feat: ak sk

This commit is contained in:
cxymds
2025-02-24 21:02:37 +08:00
parent 81610e7681
commit 8f80ff2c8c
4 changed files with 44 additions and 29 deletions
+9 -7
View File
@@ -16,12 +16,12 @@
label-align="center"
:label-width="130">
<n-grid :cols="24" :x-gap="18">
<n-form-item-grid-item :span="24" label="Access Key" path="accesskey">
<n-input v-model:value="formModel.accesskey" />
<n-form-item-grid-item :span="24" label="Access Key" path="accessKey">
<n-input v-model:value="formModel.accessKey" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="24" label="Secret Key" path="secretkey">
<n-form-item-grid-item :span="24" label="Secret Key" path="secretKey">
<n-input
v-model:value="formModel.secretkey"
v-model:value="formModel.secretKey"
show-password-on="mousedown"
type="password" />
</n-form-item-grid-item>
@@ -92,8 +92,8 @@ const { credentials } = useAuth()
const emit = defineEmits<Emits>()
const defaultFormModal = {
accesskey: makeRandomString(20),
secretkey: makeRandomString(40),
accessKey: makeRandomString(20),
secretKey: makeRandomString(40),
name: '',
description: '',
comment: '',
@@ -131,7 +131,9 @@ async function submitForm() {
...formModel.value,
status: 'enabled',
policy: formModel.value.policy.join(','),
expiration: new Date(formModel.value.expiry || '').toISOString()
expiration: formModel.value.expiry
? new Date(formModel.value.expiry).toISOString()
: null
})
message.success('添加成功')
emit('notice', res)
+3 -1
View File
@@ -38,7 +38,9 @@
:on-update:value="handerUserStatusChange"></n-switch>
</template>
</n-tabs>
<users-user-notice ref="noticeRef"></users-user-notice>
<users-user-notice
ref="noticeRef"
@search="getUserData"></users-user-notice>
</n-card>
</n-modal>
</div>
+29 -20
View File
@@ -8,16 +8,24 @@
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">
<n-form-item-grid-item :span="24" label="Access Key">
<copy-input class="w-full" v-model="accessKey" :readonly="true" :copy-icon="true"></copy-input>
<copy-input
class="w-full"
v-model="accessKey"
:readonly="true"
: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-input
class="w-full"
v-model="secretkey"
:readonly="true"
:copy-icon="true"></copy-input>
</n-form-item-grid-item>
</n-grid>
</n-form>
@@ -33,28 +41,29 @@
</template>
<script setup lang="ts">
import { download } from '@/utils/exportFile';
const visible = ref(false);
import { download } from '@/utils/exportFile'
const visible = ref(false)
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.accessKey;
secretkey.value = data.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'])
function closeModal() {
visible.value = false;
accessKey.value = '';
secretkey.value = '';
visible.value = false
accessKey.value = ''
secretkey.value = ''
emit('search')
}
defineExpose({
openDialog,
});
openDialog
})
function exportFile() {
download(
@@ -64,9 +73,9 @@ function exportFile() {
accessKey: accessKey.value,
secretKey: secretkey.value,
api: 's3v4',
path: 'auto',
path: 'auto'
})
);
)
}
</script>