feat(ssh-keys): add ssh key endpoints and ui components
This commit is contained in:
parent
9d64c6751b
commit
f9114e2de0
17 changed files with 375 additions and 7 deletions
10
resources/scripts/api/account/ssh/createSSHKey.ts
Normal file
10
resources/scripts/api/account/ssh/createSSHKey.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import http from '@/api/http';
|
||||
import { SSHKey, rawDataToSSHKey } from '@/api/account/ssh/getSSHKeys';
|
||||
|
||||
export default (name: string, publicKey: string): Promise<SSHKey> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post('/api/client/account/ssh', { name, public_key: publicKey })
|
||||
.then(({ data }) => resolve(rawDataToSSHKey(data.attributes)))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue