mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 07:13:45 +02:00
feat(ssh-keys): add ssh key endpoints and ui components
This commit is contained in:
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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user