mirror of
https://github.com/rustfs/console.git
synced 2026-09-01 15:17:45 +08:00
feat : user
This commit is contained in:
@@ -56,7 +56,7 @@ const handerGroupStatusChange = async (val: string) => {
|
||||
await getGroupData(group.value.name);
|
||||
};
|
||||
async function openDialog(row: any) {
|
||||
await getGroupData(row.name);
|
||||
await getGroupData(row.accessKey);
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,21 +11,29 @@
|
||||
action: true,
|
||||
}">
|
||||
<n-card>
|
||||
<n-form ref="formRef" :model="editForm" label-placement="left" :show-feedback="false">
|
||||
<n-form-item-grid-item :span="24" label="用户名" path="accessKey" required>
|
||||
<n-input v-model:value="editForm.accessKey" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="秘钥" path="secretKey" required>
|
||||
<n-input v-model:value="editForm.secretKey" type="password" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="分组" path="groups">
|
||||
<n-select v-model:value="editForm.groups" filterable multiple :options="groupsList" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="策略" path="policies">
|
||||
<n-select v-model:value="editForm.policies" filterable multiple :options="policiesList" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form ref="newformRef" :model="editForm" label-placement="left" label-align="right" :label-width="130">
|
||||
<n-grid :cols="24" :x-gap="18">
|
||||
<n-form-item-grid-item :span="24" label="用户名" path="accessKey" required>
|
||||
<n-input v-model:value="editForm.accessKey" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="秘钥" path="secretKey" required>
|
||||
<n-input v-model:value="editForm.secretKey" type="password" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="分组" path="groups">
|
||||
<n-select v-model:value="editForm.groups" filterable multiple :options="groupsList" />
|
||||
</n-form-item-grid-item>
|
||||
<n-form-item-grid-item :span="24" label="策略" path="policies">
|
||||
<n-select v-model:value="editForm.policies" filterable multiple :options="policiesList" />
|
||||
</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="submitForm">提交</n-button>
|
||||
</n-space>
|
||||
</template>
|
||||
</n-modal>
|
||||
</div>
|
||||
</template>
|
||||
@@ -42,15 +50,21 @@ const editForm = reactive({
|
||||
groups: [],
|
||||
policies: [],
|
||||
});
|
||||
async function openDialog() {
|
||||
getPoliciesList();
|
||||
getGroupsList();
|
||||
function openDialog() {
|
||||
// getPoliciesList();
|
||||
// getGroupsList();
|
||||
visible.value = true;
|
||||
console.log(1111);
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
function submitForm() {}
|
||||
|
||||
// 获取策略列表
|
||||
const policiesList = ref([]);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default as userTab } from './userTab.vue';
|
||||
export { default as userTab } from './user-tab.vue';
|
||||
export { default as groupTab } from './group-tab.vue';
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
:row-key="rowKey"
|
||||
@update:checked-row-keys="handleCheck" />
|
||||
<newUser @search="getDataList" ref="newItemRef"></newUser>
|
||||
<userEdit @search="getDataList" :checkedKeys="checkedKeys" ref="policiesRef"></userEdit>
|
||||
<userEdit @search="getDataList" :checkedKeys="checkedKeys" ref="editItemRef"></userEdit>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -162,7 +162,7 @@ const addToGroup = () => {};
|
||||
/** **********************************修改 */
|
||||
const editItemRef = ref();
|
||||
function openEditItem(row: any) {
|
||||
editItemRef.value.openDialog(row.accessKey);
|
||||
editItemRef.value.openDialog(row);
|
||||
}
|
||||
/** ***********************************删除 */
|
||||
async function deleteItem(row: any) {
|
||||
Reference in New Issue
Block a user