mirror of
https://github.com/rustfs/console.git
synced 2026-09-19 09:52:25 +08:00
feat : i18n
This commit is contained in:
@@ -331,13 +331,13 @@ const bucketApi = useBucket({});
|
||||
// 批量删除
|
||||
function handleBatchDelete() {
|
||||
dialog.error({
|
||||
title: '警告',
|
||||
content: '你确定要删除所有选中的对象吗?',
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
title: t('Warning'),
|
||||
content: t('Are you sure you want to delete all selected objects?'),
|
||||
positiveText: t('Confirm'),
|
||||
negativeText: t('Cancel'),
|
||||
onPositiveClick: async () => {
|
||||
if (!checkedKeys.value.length) {
|
||||
message.error('请至少选择一项');
|
||||
message.error(t('Please select at least one item'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -366,17 +366,17 @@ async function submitForm() {
|
||||
: null,
|
||||
});
|
||||
|
||||
message.success('添加成功');
|
||||
message.success(t('Add Success'));
|
||||
cancelAdd();
|
||||
emit('notice', res);
|
||||
getUserList();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
message.error('添加失败');
|
||||
message.error(t('Add Failed'));
|
||||
}
|
||||
} else {
|
||||
console.log(errors);
|
||||
message.error('请填写正确的格式');
|
||||
message.error(t('Please fill in the correct format'));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -386,11 +386,11 @@ async function submitForm() {
|
||||
policy: formModel.value.policy || '{}',
|
||||
expiry: new Date(formModel.value.expiry || 0).toISOString(),
|
||||
});
|
||||
message.success('修改成功');
|
||||
message.success(t('Edit Success'));
|
||||
cancelAdd();
|
||||
getUserList();
|
||||
} catch (error) {
|
||||
message.error('修改失败');
|
||||
message.error(t('Edit Failed'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,10 +402,10 @@ function dateDisabled(ts: number) {
|
||||
async function deleteItem(row: any) {
|
||||
try {
|
||||
const res = await deleteServiceAccount(row.accessKey);
|
||||
message.success('删除成功');
|
||||
message.success(t('Delete Success'));
|
||||
getUserList();
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
message.error(t('Delete Failed'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,13 +421,13 @@ function handleCheck(keys: DataTableRowKey[]) {
|
||||
}
|
||||
function deleteByList() {
|
||||
dialog.error({
|
||||
title: '警告',
|
||||
content: '你确定要删除所有选中的秘钥吗?',
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
title: t('Warning'),
|
||||
content: t('Are you sure you want to delete all selected keys?'),
|
||||
positiveText: t('Confirm'),
|
||||
negativeText: t('Cancel'),
|
||||
onPositiveClick: async () => {
|
||||
if (!checkedKeys.value.length) {
|
||||
message.error('请至少选择一项');
|
||||
message.error(t('Please select at least one item'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -436,9 +436,9 @@ function deleteByList() {
|
||||
// })
|
||||
checkedKeys.value = [];
|
||||
getUserList();
|
||||
message.success('删除成功');
|
||||
message.success(t('Delete Success'));
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
message.error(t('Delete Failed'));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
v-model:show="visible"
|
||||
:mask-closable="false"
|
||||
preset="card"
|
||||
title="新用户已创建"
|
||||
:title="t('New user has been created')"
|
||||
class="max-w-screen-md"
|
||||
:segmented="{
|
||||
content: true,
|
||||
action: true
|
||||
}">
|
||||
action: true,
|
||||
}"
|
||||
>
|
||||
<n-card>
|
||||
<n-form label-placement="left" label-align="right" :label-width="130">
|
||||
<n-grid :cols="24" :x-gap="18">
|
||||
@@ -18,22 +19,24 @@
|
||||
class="w-full"
|
||||
v-model="accessKey"
|
||||
:readonly="true"
|
||||
:copy-icon="true"></copy-input>
|
||||
:copy-icon="true"
|
||||
></copy-input>
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="secretkey">
|
||||
<copy-input
|
||||
class="w-full"
|
||||
v-model="secretkey"
|
||||
:readonly="true"
|
||||
:copy-icon="true"></copy-input>
|
||||
:copy-icon="true"
|
||||
></copy-input>
|
||||
</n-form-item-grid-item>
|
||||
</n-grid>
|
||||
</n-form>
|
||||
</n-card>
|
||||
<template #action>
|
||||
<n-space justify="center">
|
||||
<n-button @click="closeModal()">取消</n-button>
|
||||
<n-button type="primary" @click="exportFile">导出</n-button>
|
||||
<n-button @click="closeModal()">{{ t('Cancel') }}</n-button>
|
||||
<n-button type="primary" @click="exportFile">{{ t('Export') }}</n-button>
|
||||
</n-space>
|
||||
</template>
|
||||
</n-modal>
|
||||
@@ -41,29 +44,30 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { download } from '@/utils/export-file'
|
||||
const visible = ref(false)
|
||||
import { download } from '@/utils/export-file';
|
||||
const visible = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
const accessKey = ref('')
|
||||
const secretkey = ref('')
|
||||
const url = ref('')
|
||||
const accessKey = ref('');
|
||||
const secretkey = ref('');
|
||||
const url = ref('');
|
||||
function openDialog(data: any) {
|
||||
accessKey.value = data.credentials.accessKey
|
||||
secretkey.value = data.credentials.secretKey
|
||||
url.value = data.url
|
||||
visible.value = true
|
||||
accessKey.value = data.credentials.accessKey;
|
||||
secretkey.value = data.credentials.secretKey;
|
||||
url.value = data.url;
|
||||
visible.value = true;
|
||||
}
|
||||
const emit = defineEmits(['search'])
|
||||
const emit = defineEmits(['search']);
|
||||
function closeModal() {
|
||||
visible.value = false
|
||||
accessKey.value = ''
|
||||
secretkey.value = ''
|
||||
emit('search')
|
||||
visible.value = false;
|
||||
accessKey.value = '';
|
||||
secretkey.value = '';
|
||||
emit('search');
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openDialog
|
||||
})
|
||||
openDialog,
|
||||
});
|
||||
|
||||
function exportFile() {
|
||||
download(
|
||||
@@ -73,9 +77,9 @@ function exportFile() {
|
||||
accessKey: accessKey.value,
|
||||
secretKey: secretkey.value,
|
||||
api: 's3v4',
|
||||
path: 'auto'
|
||||
path: 'auto',
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -119,11 +119,11 @@ const changeMebers = async () => {
|
||||
userOrGroup: encodeURIComponent(props.user.accessKey),
|
||||
isGroup: false,
|
||||
});
|
||||
messge.success('修改成功');
|
||||
messge.success(t('Edit Success'));
|
||||
editStatus.value = false;
|
||||
emit('search');
|
||||
} catch {
|
||||
messge.error('修改失败');
|
||||
messge.error(t('Edit Failed'));
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -548,5 +548,7 @@
|
||||
"Description": "Description",
|
||||
"Are you sure you want to delete all selected keys?": "Are you sure you want to delete all selected keys?",
|
||||
"Please select at least one item": "Please select at least one item",
|
||||
"Get Data Failed": "Get Data Failed"
|
||||
"Get Data Failed": "Get Data Failed",
|
||||
"New user has been created": "New user has been created",
|
||||
"Export": "Export"
|
||||
}
|
||||
|
||||
@@ -410,6 +410,8 @@
|
||||
"Storage Class": "存储类型",
|
||||
"Version ID": "版本ID",
|
||||
"Submit Data": "提交数据",
|
||||
"New user has been created": "新用户已创建",
|
||||
"Export": "导出",
|
||||
"Get Version Control Status Failed": "获取版本控制状态失败",
|
||||
"The XML format you provided is incorrect, or has not been validated against our published schema. (MasterKeyID not found aws:kms).": "您提供的XML格式不正确,或者未根据我们发布的架构进行验证。(未找到MasterKeyID aws:kms)。",
|
||||
"Server-side encryption is specified, but S3 is not configured.": "指定了服务器端加密,但S3未配置。",
|
||||
|
||||
Reference in New Issue
Block a user