From 97a8aee05ce9e5da1049b2dd00c2167bb5c70ace Mon Sep 17 00:00:00 2001 From: Ash Wu Date: Wed, 8 Dec 2021 10:51:23 +0800 Subject: [PATCH 1/2] Add AWS credential check button Signed-off-by: Ash Wu Co-Authored-By: Timothy Lee Co-Authored-By: Kent Huang --- src/Settings.tsx | 30 +++++++++++++++++++++++++++++- src/electron/AwsAdapter.ts | 15 +++++++++++++++ src/electron/ServerHandlers.ts | 11 +++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/Settings.tsx b/src/Settings.tsx index e63f55e..54e0798 100644 --- a/src/Settings.tsx +++ b/src/Settings.tsx @@ -100,6 +100,28 @@ export default function Settings() { }); } }; + const onAWSTest = async () => { + const accessKeyId = awsForm.getFieldValue('aws-id'); + const secretAccessKey = awsForm.getFieldValue('aws-key'); + const region = awsForm.getFieldValue('aws-region'); + const result = await send('test-aws-credentials', { + accessKeyId, + secretAccessKey, + region, + }); + if (result.error) { + console.log(result.error); + notification.error({ + message: 'AWS Credential Check Failed', + description: ``, + }); + } else { + notification.success({ + message: 'AWS Connected', + description: ``, + }); + } + }; const onDockerHubReset = async () => { await send('delete-dockerhub-credential'); notification.info({ @@ -271,7 +293,13 @@ export default function Settings() { - + + Test + + } + /> + } + />