diff --git a/components/access-keys/edit-item.vue b/components/access-keys/edit-item.vue index 378afb5..53c2d10 100644 --- a/components/access-keys/edit-item.vue +++ b/components/access-keys/edit-item.vue @@ -47,7 +47,8 @@ async function openDialog(row: any) { formModel.accesskey = row.accessKey const policyValue = typeof res.policy === 'string' ? res.policy : JSON.stringify(res.policy ?? {}) formModel.policy = policyValue - formModel.expiry = res.expiration ? dayjs(res.expiration).toISOString() : null + formModel.expiry = + res.expiration && res.expiration !== '9999-01-01T00:00:00Z' ? dayjs(res.expiration).toISOString() : null formModel.name = res.name ?? '' formModel.description = res.description ?? '' formModel.status = res.accountStatus ?? 'on' @@ -78,7 +79,7 @@ async function submitForm() { newStatus: formModel.status, newName: formModel.name, newDescription: formModel.description, - newExpiration: formModel.expiry ? dayjs(formModel.expiry).toISOString() : undefined, + newExpiration: formModel.expiry ? dayjs(formModel.expiry).toISOString() : '9999-01-01T00:00:00Z', }) message.success(t('Updated successfully')) closeModal() diff --git a/components/access-keys/new-item.vue b/components/access-keys/new-item.vue index d0b65bd..efc63c2 100644 --- a/components/access-keys/new-item.vue +++ b/components/access-keys/new-item.vue @@ -22,7 +22,7 @@ - {{ t('Expiry') }} + {{ t('Expiry') }}({{ t('empty is indicates permanent validity') }}) { } const validateForm = () => { - if (!formModel.expiry) { - message.error(t('Please select expiration date')) - return false - } + // if (!formModel.expiry) { + // message.error(t('Please select expiration date')) + // return false + // } if (!formModel.impliedPolicy) { try { JSON.parse(formModel.policy || '{}') diff --git a/components/user/account.vue b/components/user/account.vue index 4665606..14eb59b 100644 --- a/components/user/account.vue +++ b/components/user/account.vue @@ -212,7 +212,7 @@ watch(searchTerm, value => { }) const formatExpiration = (value?: string) => { - if (!value) return '-' + if (!value || value == '9999-01-01T00:00:00Z') return '-' const date = dayjs(value) if (!date.isValid()) return '-' return date.format('YYYY-MM-DD HH:mm') @@ -305,10 +305,10 @@ const validateForm = () => { message.error(t('Secret Key length must be between 8 and 40 characters')) return false } - if (!formModel.expiry) { - message.error(t('Please select expiration date')) - return false - } + // if (!formModel.expiry) { + // message.error(t('Please select expiration date')) + // return false + // } if (!formModel.impliedPolicy) { try { JSON.parse(formModel.policy || '{}') @@ -336,7 +336,7 @@ const submitForm = async () => { ...formModel, targetUser: props.user.accessKey, policy: formModel.impliedPolicy ? null : JSON.stringify(JSON.parse(formModel.policy || '{}')), - expiration: formModel.expiry ? new Date(formModel.expiry).toISOString() : null, + expiration: formModel.expiry ? new Date(formModel.expiry).toISOString() : '9999-01-01T00:00:00.000Z', } const res = await createServiceAccount(payload) message.success(t('Add Success')) diff --git a/i18n/locales/en-US.json b/i18n/locales/en-US.json index d90a7d3..b5b407b 100644 --- a/i18n/locales/en-US.json +++ b/i18n/locales/en-US.json @@ -866,5 +866,6 @@ "API request failed": "API request failed", "Operation failed": "Operation failed", "Create a user to get started": "Create a user to get started", - "Get Notification Config Failed": "Get Notification Config Failed" + "Get Notification Config Failed": "Get Notification Config Failed", + "empty is indicates permanent validity": "empty is indicates permanent validity" } diff --git a/i18n/locales/tr-TR.json b/i18n/locales/tr-TR.json index bdf89fa..dcde190 100644 --- a/i18n/locales/tr-TR.json +++ b/i18n/locales/tr-TR.json @@ -866,5 +866,6 @@ "API request failed": "API isteği başarısız", "Operation failed": "İşlem başarısız", "Create a user to get started": "Başlamak için bir kullanıcı oluşturun", - "Get Notification Config Failed": "Bildirim Yapılandırması Alınamadı" + "Get Notification Config Failed": "Bildirim Yapılandırması Alınamadı", + "empty is indicates permanent validity": "boş, kalıcı geçerlilik gösterir" } diff --git a/i18n/locales/zh-CN.json b/i18n/locales/zh-CN.json index 0b37474..45e2c30 100644 --- a/i18n/locales/zh-CN.json +++ b/i18n/locales/zh-CN.json @@ -866,5 +866,6 @@ "API request failed": "API 请求失败", "Operation failed": "操作失败", "Create a user to get started": "开始创建一个用户", - "Get Notification Config Failed": "获取通知配置失败" + "Get Notification Config Failed": "获取通知配置失败", + "empty is indicates permanent validity": "空表示永久有效" } diff --git a/pages/access-keys/index.vue b/pages/access-keys/index.vue index 824b722..b75fb17 100644 --- a/pages/access-keys/index.vue +++ b/pages/access-keys/index.vue @@ -93,7 +93,12 @@ const columns: ColumnDef[] = [ accessorKey: 'expiration', header: () => t('Expiration'), cell: ({ row }) => - h('span', row.original.expiration ? dayjs(row.original.expiration).format('YYYY-MM-DD HH:mm') : '-'), + h( + 'span', + row.original.expiration && row.original.expiration !== '9999-01-01T00:00:00Z' + ? dayjs(row.original.expiration).format('YYYY-MM-DD HH:mm') + : '-' + ), }, { accessorKey: 'accountStatus',