1
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-BpU4LxvO.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-875Agalq.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Button, Card, Space, Table, Tag, Typography, message, Modal, Form, Input, Select, InputNumber,
|
||||
Button, Card, Space, Table, Tag, Tooltip, Typography, message, Modal, Form, Input, Select, InputNumber,
|
||||
} from 'antd';
|
||||
import {
|
||||
MenuOutlined, ReloadOutlined, PlusOutlined, EyeOutlined, EditOutlined, DeleteOutlined,
|
||||
@@ -143,8 +143,16 @@ const AdminOauthAppList: React.FC = () => {
|
||||
{ title: '应用ID', dataIndex: 'app_id',
|
||||
render: (v: string) => <Typography.Text>{v}</Typography.Text>,
|
||||
},
|
||||
{ title: '应用密钥', dataIndex: 'secret',
|
||||
render: (v: string) => <Typography.Text>{v}</Typography.Text>,
|
||||
{ title: '应用密钥', dataIndex: 'secret', width: 180,
|
||||
render: (v: string) => {
|
||||
if (!v) return '-';
|
||||
const short = v.length > 12 ? `${v.slice(0, 6)}...${v.slice(-4)}` : v;
|
||||
return (
|
||||
<Tooltip title={v} placement="topLeft">
|
||||
<Typography.Text style={{ fontSize: 12 }}>{short}</Typography.Text>
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
{ title: '开户方式', dataIndex: 'open_type',
|
||||
render: (v: number) => {
|
||||
@@ -164,8 +172,15 @@ const AdminOauthAppList: React.FC = () => {
|
||||
{ title: '状态', dataIndex: 'status',
|
||||
render: (v: number) => <Tag color={v === 1 ? 'green' : 'red'}>{v === 1 ? '正常' : '禁用'}</Tag>,
|
||||
},
|
||||
{ title: '授权URL', dataIndex: 'auth_url',
|
||||
render: (v: string) => <Typography.Text>{v}</Typography.Text>,
|
||||
{ title: '授权URL', dataIndex: 'auth_url', width: 220,
|
||||
render: (v: string) => {
|
||||
if (!v) return '-';
|
||||
return (
|
||||
<Tooltip title={v} placement="topLeft">
|
||||
<Typography.Text style={{ fontSize: 12 }} ellipsis>{v.length > 30 ? `${v.slice(0, 27)}...` : v}</Typography.Text>
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
{ title: '创建人', dataIndex: 'create_by',
|
||||
render: (v: string) => <Typography.Text>{v}</Typography.Text>,
|
||||
@@ -225,7 +240,7 @@ const AdminOauthAppList: React.FC = () => {
|
||||
showTotal: (t) => `共 ${t} 条记录`,
|
||||
onChange: (p) => { setPage(p); load(p); },
|
||||
}}
|
||||
scroll={{ x: 800 }}
|
||||
scroll={{ x: 1400 }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -28,7 +28,16 @@ async def list_user_oauth_apps(
|
||||
if app_id is not None:
|
||||
query = query.where(UserOAuthApp.app_id.like(f"%{app_id}%"))
|
||||
|
||||
total_result = await db.execute(select(func.count(UserOAuthApp.id)).where(UserOAuthApp.deleted_at.is_(None)))
|
||||
count_query = select(func.count(UserOAuthApp.id)).where(UserOAuthApp.deleted_at.is_(None))
|
||||
if open_type is not None:
|
||||
count_query = count_query.where(UserOAuthApp.open_type == open_type)
|
||||
if status is not None:
|
||||
count_query = count_query.where(UserOAuthApp.status == status)
|
||||
if create_by is not None:
|
||||
count_query = count_query.where(UserOAuthApp.create_by == create_by)
|
||||
if app_id is not None:
|
||||
count_query = count_query.where(UserOAuthApp.app_id.like(f"%{app_id}%"))
|
||||
total_result = await db.execute(count_query)
|
||||
total = total_result.scalar() or 0
|
||||
|
||||
result = await db.execute(query.offset((page - 1) * page_size).limit(page_size))
|
||||
|
||||
Reference in New Issue
Block a user