Skip to content

Commit

Permalink
change machine to node for headscale v0.23-alpha
Browse files Browse the repository at this point in the history
ChowDPa02k committed Dec 12, 2023
1 parent 2289762 commit 06c6fe0
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/app/api.service.ts
Original file line number Diff line number Diff line change
@@ -12,39 +12,39 @@ export class ApiService {

///Machine api start
machineList(user: string): Observable<any> {
return this.http.get(`/api/v1/machine?user=${user}`)
return this.http.get(`/api/v1/node?user=${user}`)
}

machineRegister(user: string, key: string): Observable<any> {
return this.http.post(`/api/v1/machine/register?user=${user}&key=${key}`, null);
return this.http.post(`/api/v1/node/register?user=${user}&key=${key}`, null);
}

machineDetail(machineId: string): Observable<any> {
return this.http.get(`/api/v1/machine/${machineId}`);
return this.http.get(`/api/v1/node/${machineId}`);
}

machineExpire(machineId: string): Observable<any> {
return this.http.post(`/api/v1/machine/${machineId}/expire`, null);
return this.http.post(`/api/v1/node/${machineId}/expire`, null);
}

machineDelete(machineId: string): Observable<any> {
return this.http.delete(`/api/v1/machine/${machineId}`);
return this.http.delete(`/api/v1/node/${machineId}`);
}

machineRename(machineId: string, name: string): Observable<any> {
return this.http.post(`/api/v1/machine/${machineId}/rename/${name}`, null);
return this.http.post(`/api/v1/node/${machineId}/rename/${name}`, null);
}

machineRoutes(machineId: string): Observable<any> {
return this.http.get(`/api/v1/machine/${machineId}/routes`);
return this.http.get(`/api/v1/node/${machineId}/routes`);
}

machineTag(machineId: string, tags: Array<string>): Observable<any> {
return this.http.post(`/api/v1/machine/${machineId}/tags`, {tags});
return this.http.post(`/api/v1/node/${machineId}/tags`, {tags});
}

machineChangeUser(machineId: string, user: string): Observable<any> {
return this.http.post(`/api/v1/machine/${machineId}/user?user=${user}`, null);
return this.http.post(`/api/v1/node/${machineId}/user?user=${user}`, null);
}


2 changes: 1 addition & 1 deletion src/app/views/machine-manager/machine-manager.component.ts
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ export class MachineManagerComponent implements OnInit {

getList() {
this.api.machineList(this.user).subscribe(x => {
this.machines = x.machines.sort((a: any, b: any) => parseInt(a.id) - parseInt(b.id));
this.machines = x.nodes.sort((a: any, b: any) => parseInt(a.id) - parseInt(b.id));
this.getRoutes();
if (this.tagEditMachine.id) {
this.tagEditMachine = this.machines.find(x => x.id == this.tagEditMachine.id);

0 comments on commit 06c6fe0

Please sign in to comment.