版本更新
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled

This commit is contained in:
hahwu 2025-07-31 15:37:57 +08:00
parent a42ddfc1fa
commit 3720f14ac5
7 changed files with 103 additions and 16 deletions

View File

@ -1,5 +1,5 @@
import { requestClient } from '#/api/request';
import type { UserInfo } from '#/model/admin.user';
import type { UserInfo,AdminLog } from '#/model/admin.user';
export interface UserParam {
uid: string;
@ -12,6 +12,11 @@ export async function getAdminListApi() {
return requestClient.post<UserInfo[]>('/admin/list');
}
export async function getAdminLogListApi() {
return requestClient.post<AdminLog[]>('/admin/log/list');
}
export async function addAdminApi(param: UserInfo) {
return requestClient.post<UserInfo>('/admin/add', param);
}

View File

@ -9,7 +9,8 @@
"admin": {
"title": "管理中心",
"user": "用户管理",
"setting": "系统设置"
"setting": "系统设置",
"log": "操作日志"
},
"dashboard": {
"title": "服务器管理",

View File

@ -8,3 +8,10 @@ export interface UserInfo {
group: string;
role: number;
}
export interface AdminLog{
admin: string;
action: string;
params: string;
createTime: string;
}

View File

@ -7,7 +7,7 @@ const routes: RouteRecordRaw[] = [
{
component: BasicLayout,
meta: {
icon: 'lucide:layout-dashboard',
icon: 'material-symbols:brightness-empty-outline',
order: -1,
title: $t('page.admin.title'),
authority:['super'],
@ -26,6 +26,17 @@ const routes: RouteRecordRaw[] = [
title: $t('page.admin.user'),
},
},
{
name: 'UserManagement',
path: '/user-management-log',
component: () => import('#/views/admin/log/index.vue'),
meta: {
authority: ['super', 'admin'],
affixTab: false,
icon: 'material-symbols:assignment-rounded',
title: $t('page.admin.log'),
},
},
],
},
];

View File

@ -0,0 +1,6 @@
<script lang="ts" setup>
import AnalyticsVisitsTable from './log-table.vue';
</script>
<template>
<AnalyticsVisitsTable />
</template>

View File

@ -0,0 +1,44 @@
<script setup lang="ts">
import { Page } from '@vben/common-ui';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { AdminLog } from '#/model/admin.user';
import { getAdminLogListApi } from '#/api/core/admin.user';
const gridOptions: VxeGridProps<AdminLog> = {
columns: [
{ field: 'admin', title: '用户名', },
{ field: 'action', title: '操作' },
{ field: 'params', title: '参数' },
{ field: 'ip', title: 'IP' },
{ field: 'createTime', title: '时间' },
],
height: 'auto',
pagerConfig: {},
proxyConfig: {
response: {
total: 'total',
result: 'data',
},
ajax: {
query: async () => {
return await getAdminLogListApi();
},
},
},
rowConfig: {
isHover: true,
},
};
const [Grid] = useVbenVxeGrid({ gridOptions });
</script>
<template>
<Page auto-content-height>
<Grid />
</Page>
</template>

View File

@ -102,7 +102,7 @@ const [BanForm] = useVbenForm({
},
label: '原因:',
fieldName: 'reason',
}
},
],
handleSubmit: async (values) => {
const cv = modalApi.getData<Record<string, any>>();
@ -241,7 +241,10 @@ watch(
<template>
<Modal title="玩家详情">
<div class="p-5">
<UserHeader :avatar="userStore.userInfo?.avatar || preferences.app.defaultAvatar" :ban="info.Ban">
<UserHeader
:avatar="userStore.userInfo?.avatar || preferences.app.defaultAvatar"
:ban="info.Ban"
>
<template #nick_name> nick_name: {{ info.Name || 'N/A' }} </template>
<template #user_name> user_name: {{ info.Mac }} </template>
<template #uid> uid: {{ info.Uid }} </template>
@ -250,31 +253,33 @@ watch(
<template #energy>{{ info.Energy }} </template>
<template #diamond>{{ info.Diamond }}</template>
</UserHeader>
<AccessControl :codes="['super']" type="role">
<AccessControl :codes="['super', 'admin']" type="role">
<div class="mt-5">
<Card class="card-box flex flex-col p-5 ">
<Card class="card-box flex flex-col p-5">
<BaseForm />
</Card>
</div>
</AccessControl>
<AccessControl :codes="['super']" type="role">
<AccessControl :codes="['super', 'admin']" type="role">
<div class="mt-5">
<Card class="card-box flex flex-col p-5 ">
<Card class="card-box flex flex-col p-5">
<BanForm />
</Card>
</div>
</AccessControl>
<div class="mt-5 flex flex-col lg:flex-row">
<div class="mr-4 w-full lg:w-3/5">
<WorkbenchProject :items="info.Order" title="订单" />
<!-- <WorkbenchTrends :items="trendItems" class="mt-5" title="最新动态" /> -->
</div>
<div class="w-full lg:w-2/5">
<WorkbenchDetail :items="projectItems" class="mt-5 lg:mt-0" title="玩家详情">
<WorkbenchDetail
:items="projectItems"
class="mt-5 lg:mt-0"
title="玩家详情"
>
<template #areaid> {{ info.AreaId }}</template>
<template #charge> <b>$</b>{{ info.Charge.toFixed(2) }}</template>
<template #RegisterTime> {{ info.RegisterTime }}</template>
@ -284,14 +289,22 @@ watch(
<template #Code>{{ info.Code || 0 }}</template>
<template #TodayCumulative>{{ info.TodayCumulative }}</template>
</WorkbenchDetail>
<calendar v-if="info.Heatmap.length > 0" style="margin-top: 15px" :dataList="info.Heatmap" title="热力图"
:key="`heatmap-${info.Uid}`" />
<div v-else style="
<calendar
v-if="info.Heatmap.length > 0"
style="margin-top: 15px"
:dataList="info.Heatmap"
title="热力图"
:key="`heatmap-${info.Uid}`"
/>
<div
v-else
style="
margin-top: 15px;
padding: 20px;
text-align: center;
color: #999;
">
"
>
暂无热力图数据
</div>
<!-- <WorkbenchTodo :items="todoItems" class="mt-5" title="待办事项" /> -->