Merge branch 'main' of https://gitlab.guxuan.icu/Leo_Ding/GPU_Web
This commit is contained in:
commit
a70ac366e1
4
src/apis/modules/log.ts
Normal file
4
src/apis/modules/log.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import request from '@/utils/index'
|
||||
|
||||
// 获取登录日志
|
||||
export const fetchLoginLog = (params:any) => request.get('/v1/auth/login_log', { params })
|
||||
@ -5,7 +5,7 @@
|
||||
<nav class="nav-left">
|
||||
<a href="/" class="nav-item">首页</a>
|
||||
<a href="/layout/market" class="nav-item">算力中心</a>
|
||||
<a href="/cloud-server" class="nav-item">云主机</a>
|
||||
<!-- <a href="/cloud-server" class="nav-item">云主机</a> -->
|
||||
</nav>
|
||||
|
||||
<!-- 右侧导航 -->
|
||||
|
||||
@ -59,7 +59,7 @@ interface MenuItem {
|
||||
const menuItems: MenuItem[] = [
|
||||
{ path: '/controlPanel/overview', name: '总览', icon: HomeOutlined },
|
||||
{ path: '/controlPanel/container', name: '容器实例', icon: ConsoleSqlOutlined },
|
||||
{ path: '/controlPanel/fileStore', name: '文件存储', icon: FolderOpenOutlined },
|
||||
// { path: '/controlPanel/fileStore', name: '文件存储', icon: FolderOpenOutlined },
|
||||
{ path: '/controlPanel/image', name: '镜像', icon: GlobalOutlined },
|
||||
{ path: '/controlPanel/publicData', name: '公开数据', icon: LaptopOutlined },
|
||||
{
|
||||
@ -78,7 +78,7 @@ const menuItems: MenuItem[] = [
|
||||
children: [
|
||||
{ path: '/accountSecurity', name: '账号安全' },
|
||||
{ path: '/accountHistory', name: '访问记录' },
|
||||
{ path: '/controlPanel/account/security', name: '安全设置' }
|
||||
// { path: '/controlPanel/account/security', name: '安全设置' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -121,11 +121,11 @@ const routes: RouteRecordRaw[] = [
|
||||
name: "InstanceCreate",
|
||||
component: () => import("@/views/admin/instanceCreate/index.vue"),
|
||||
},
|
||||
{
|
||||
path: "fileStore",
|
||||
name: "FileStore",
|
||||
component: () => import("@/views/admin/fileStore/index.vue"),
|
||||
},
|
||||
// {
|
||||
// path: "fileStore",
|
||||
// name: "FileStore",
|
||||
// component: () => import("@/views/admin/fileStore/index.vue"),
|
||||
// },
|
||||
{
|
||||
path: "history",
|
||||
name: "History",
|
||||
|
||||
@ -6,20 +6,17 @@
|
||||
<span class="desc">以下显示内容为账号及其子账号近3个月的登录记录</span>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="loginRecords"
|
||||
:pagination="false"
|
||||
size="middle"
|
||||
:bordered="true"
|
||||
class="login-table"
|
||||
/>
|
||||
<a-table :columns="columns" :data-source="loginRecords" :pagination="paginationState" size="middle" :bordered="true"
|
||||
@change="onTableChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { ref, onBeforeMount } from 'vue';
|
||||
import apis from '@/apis';
|
||||
import { usePagination } from '@/hooks'
|
||||
import { get } from 'http';
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
||||
// 定义类型
|
||||
interface LoginRecord {
|
||||
id: number;
|
||||
@ -54,8 +51,8 @@ const loginRecords = ref<LoginRecord[]>([
|
||||
const columns = [
|
||||
{
|
||||
title: '访问时间',
|
||||
dataIndex: 'time',
|
||||
key: 'time',
|
||||
dataIndex: 'created_at',
|
||||
key: 'created_at',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
@ -66,29 +63,43 @@ const columns = [
|
||||
},
|
||||
{
|
||||
title: '访问城市',
|
||||
dataIndex: 'city',
|
||||
key: 'city',
|
||||
dataIndex: 'location',
|
||||
key: 'location',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '登录类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
dataIndex: 'login_type',
|
||||
key: 'login_type',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '操作人',
|
||||
dataIndex: 'operator',
|
||||
key: 'operator',
|
||||
width: 180,
|
||||
},
|
||||
|
||||
];
|
||||
onBeforeMount(async () => {
|
||||
getPageList();
|
||||
});
|
||||
const getPageList = async () => {
|
||||
try {
|
||||
const response = await apis.log.fetchLoginLog({ page_num:paginationState.current,page_size:paginationState.pageSize }); // 根据实际API参数调整
|
||||
// 假设返回的数据格式为 { data: LoginRecord[] }
|
||||
console.log(response);
|
||||
loginRecords.value = response.list;
|
||||
paginationState.total = response.total;
|
||||
} catch (error) {
|
||||
console.error('获取登录记录失败:', error);
|
||||
}
|
||||
}
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.access-log {
|
||||
padding: 20px;
|
||||
background-color: #f9f9f9;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.title-wrapper {
|
||||
|
||||
@ -94,9 +94,8 @@
|
||||
</a-card>
|
||||
|
||||
<!-- 数据卡片 -->
|
||||
<a-card title="数据" :bordered="false" class="card margin-top">
|
||||
<!-- <a-card title="数据" :bordered="false" class="card margin-top">
|
||||
<a-row type="flex" align="middle" style="height: 100%;">
|
||||
<!-- 第一栏:容器实例数据盘 -->
|
||||
<a-col :span="8">
|
||||
<div class="data-column">
|
||||
<div class="data-label">容器实例数据盘</div>
|
||||
@ -104,8 +103,6 @@
|
||||
<div class="data-unit">0 <span class="data-gb">GB</span></div>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<!-- 第二栏:镜像 -->
|
||||
<a-col :span="8">
|
||||
<div class="data-column">
|
||||
<div class="vertical-divider"></div>
|
||||
@ -114,8 +111,6 @@
|
||||
<div class="data-unit">0 <span class="data-gb">GB</span></div>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<!-- 第三栏:文件存储 -->
|
||||
<a-col :span="8">
|
||||
<div class="data-column">
|
||||
<div class="vertical-divider"></div>
|
||||
@ -125,7 +120,7 @@
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-card> -->
|
||||
|
||||
<!-- 常见问题卡片 -->
|
||||
<a-card title="常见问题" :bordered="false" class="card margin-top">
|
||||
|
||||
@ -6,11 +6,11 @@
|
||||
<span class="title">我的镜像</span>
|
||||
<span class="warning-text">
|
||||
连续3个月未登录或欠费50元以上,平台保留删除数据的权利,具体规则请参考
|
||||
<a href="#" class="link">文档</a>
|
||||
<!-- <a href="#" class="link">文档</a> -->
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- 存储容量信息 -->
|
||||
<!--
|
||||
<div class="storage-info">
|
||||
<div class="storage-desc">
|
||||
存储容量大小:<strong>{{ storageUsed }}</strong>
|
||||
@ -19,16 +19,14 @@
|
||||
<a href="#" class="view-rule">查看计费规则</a>
|
||||
</div>
|
||||
|
||||
<!-- 存储进度条 -->
|
||||
<div class="progress-container">
|
||||
<a-progress :percent="storagePercent" :show-info="true" />
|
||||
</div>
|
||||
|
||||
<!-- 免费/付费容量 -->
|
||||
<div class="capacity-info">
|
||||
<span><span class="dot free"></span>免费:{{ freeStorage }}</span>
|
||||
<span><span class="dot paid"></span>付费:{{ paidStorage }}</span>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 表格 -->
|
||||
<div class="table-container">
|
||||
|
||||
@ -46,9 +46,9 @@ interface MenuItem {
|
||||
const menuItems: MenuItem[] = [
|
||||
{ path: '/layout/admin/home', name: '总览', icon: HomeOutlined },
|
||||
{ path: '/layout/admin/instance', name: '容器实例', icon: ConsoleSqlOutlined },
|
||||
{ path: '/layout/admin/fileStore', name: '文件存储', icon: FolderOpenOutlined },
|
||||
// { path: '/layout/admin/fileStore', name: '文件存储', icon: FolderOpenOutlined },
|
||||
{ path: '/layout/admin/image', name: '镜像', icon: GlobalOutlined },
|
||||
{ path: '/layout/publicData', name: '公开数据', icon: LaptopOutlined },
|
||||
// { path: '/layout/publicData', name: '公开数据', icon: LaptopOutlined },
|
||||
{
|
||||
path: '',
|
||||
name: '费用',
|
||||
@ -70,7 +70,7 @@ const menuItems: MenuItem[] = [
|
||||
children: [
|
||||
{ path: '/layout/admin/security', name: '账号安全' },
|
||||
{ path: '/layout/admin/history', name: '访问记录' },
|
||||
{ path: '/controlPanel/security', name: '安全设置' },
|
||||
// { path: '/controlPanel/security', name: '安全设置' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user