-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor server setting route/function names to be more expressive/na…
…tural-sounding
- Loading branch information
1 parent
854dbca
commit 948c659
Showing
10 changed files
with
67 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import http from '@/api/http' | ||
|
||
export interface AuthSettings { | ||
sshKeys: string | ||
} | ||
|
||
const rawDataToAuthSettings = (data: any): AuthSettings => ({ | ||
sshKeys: data.ssh_keys, | ||
}) | ||
|
||
const getAuthSettings = async (uuid: string): Promise<AuthSettings> => { | ||
const { | ||
data: { data }, | ||
} = await http.get(`/api/client/servers/${uuid}/settings/auth`) | ||
|
||
return rawDataToAuthSettings(data) | ||
} | ||
|
||
export default getAuthSettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...ipts/api/server/settings/updateNetwork.ts → .../server/settings/updateNetworkSettings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import http from '@/api/http' | ||
|
||
export default (uuid: string, nameservers: string[]) => { | ||
const updateNetworkSettings = (uuid: string, nameservers: string[]) => { | ||
return http.put(`/api/client/servers/${uuid}/settings/network`, { | ||
nameservers, | ||
}) | ||
} | ||
} | ||
|
||
export default updateNetworkSettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters