feat: EC2 UI polished + storage persisting
This commit is contained in:
@@ -77,6 +77,8 @@ export type Ec2KeyPairMaterial = {
|
||||
keyMaterial: string;
|
||||
};
|
||||
|
||||
export type Ec2KeyPairType = "rsa" | "ed25519";
|
||||
|
||||
export type Ec2Vpc = {
|
||||
vpcId: string;
|
||||
cidrBlock: string;
|
||||
@@ -344,10 +346,10 @@ export async function listEc2KeyPairs(signal?: AbortSignal): Promise<Ec2KeyPair[
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function createEc2KeyPair(name: string): Promise<Ec2KeyPairMaterial> {
|
||||
const res = await apiClient.call<Ec2KeyPairMaterial>(
|
||||
export async function createEc2KeyPair(name: string, keyType: Ec2KeyPairType = "rsa"): Promise<Ec2KeyPairMaterial> {
|
||||
const res = await apiClient.call<Ec2KeyPairMaterial, {name: string; keyType: Ec2KeyPairType}>(
|
||||
apiEndpointKeys.aws.ec2.keyPairs.create,
|
||||
{ body: JSON.stringify({ name }), headers: { "content-type": "application/json" } },
|
||||
{ body: { name, keyType } },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user