diff --git a/front/src/store/account.ts b/front/src/store/account.ts index a6f9261b89..03d10b2622 100644 --- a/front/src/store/account.ts +++ b/front/src/store/account.ts @@ -134,7 +134,7 @@ export const useAccountStore = defineStore({ * @param {number} id * @return {*} */ - async accountDelete(id: number) { + async accountDelete(id: string) { return http.delete(`${BK_HCM_AJAX_URL_PREFIX}/api/v1/cloud/accounts/${id}`); }, /** @@ -142,7 +142,7 @@ export const useAccountStore = defineStore({ * @param {number} id * @return {*} */ - async accountDeleteValidate(id: number) { + async accountDeleteValidate(id: string) { return http.post(`${BK_HCM_AJAX_URL_PREFIX}/api/v1/cloud/accounts/${id}/delete/validate`); }, /** @@ -187,12 +187,10 @@ export const useAccountStore = defineStore({ }, async updateAccountList(data: any) { - console.log('data', data); this.accountList = data?.map(({ id, name }: { id: string; name: string }) => ({ id, name, })); - console.log('this.accountList', this.accountList); }, /** diff --git a/front/src/views/resource/accountmanage/account-detail.tsx b/front/src/views/resource/accountmanage/account-detail.tsx index 2b159cdb48..bc33b203c7 100644 --- a/front/src/views/resource/accountmanage/account-detail.tsx +++ b/front/src/views/resource/accountmanage/account-detail.tsx @@ -81,13 +81,8 @@ export default defineComponent({ ...initProjectModel, }); - const { - curExtension, - isValidateLoading, - handleValidate, - isValidateDiasbled, - extensionPayload, - } = useSecretExtension(projectModel, true); + const { curExtension, isValidateLoading, handleValidate, isValidateDiasbled, extensionPayload } = + useSecretExtension(projectModel, true); const secretModel = reactive({ ...initSecretModel, @@ -362,7 +357,6 @@ export default defineComponent({ }; const check = (val: any): boolean => { - console.log('check', check); return /^[a-z][a-z-z0-9_-]*$/.test(val); }; @@ -397,8 +391,6 @@ export default defineComponent({ message: t('更新成功'), theme: 'success', }); - } catch (error) { - console.log(error); } finally { isOrganizationDetail.value = true; // 改为详情展示态 getDetail(); // 请求数据 @@ -451,8 +443,6 @@ export default defineComponent({ }); projectModel.extension = extension; onClosed(); - } catch (error) { - console.log(error); } finally { buttonLoading.value = false; } @@ -684,26 +674,17 @@ export default defineComponent({ }, ]); - // const dialogForm = reactive([ - // { - // label: 'Secret ID', - // required: true, - // property: 'secretId', - // component: () => , - // }, - // { - // label: 'Secret Key', - // required: true, - // property: 'secretKey', - // component: () => , - // }, - // ]); - - // const test = () => { - // console.log('1111333'); - // }; - - // console.log('formBaseInfo', formBaseInfo); + const isSyncLoading = ref(false); + const handleSync = async () => { + isSyncLoading.value = true; + try { + await accountStore.accountSync(projectModel.id); + Message({ message: t('本次同步任务触发成功。如需再次同步,请在20分钟后重试'), theme: 'success' }); + } catch (error) { + } finally { + isSyncLoading.value = false; + } + }; return () => isLoading.value ? ( @@ -713,8 +694,23 @@ export default defineComponent({ {!route.path.includes('resource/resource/account/detail') && ( <> - 账号详情 -  - ID {projectModel.id} + {{ + default: () => ( + <> + {t('账号详情')} +  - ID {projectModel.id} + + ), + right: + projectModel.type === 'resource' ? ( + + {t('同步')} + + ) : undefined, + }}
diff --git a/front/src/views/resource/accountmanage/index.vue b/front/src/views/resource/accountmanage/index.vue index 33070ff55d..b2a60f2caa 100644 --- a/front/src/views/resource/accountmanage/index.vue +++ b/front/src/views/resource/accountmanage/index.vue @@ -1,154 +1,243 @@ + +