chore: update implementation

This commit is contained in:
JustSong 2023-08-19 17:07:52 +08:00
parent 2b6d720d68
commit dac1c2b2b0
2 changed files with 6 additions and 10 deletions

View File

@ -520,5 +520,6 @@
"代理": "Proxy", "代理": "Proxy",
"此项可选,用于通过代理站来进行 API 调用请输入代理站地址格式为https://domain.com": "This is optional, used to make API calls through the proxy site, please enter the proxy site address, the format is: https://domain.com", "此项可选,用于通过代理站来进行 API 调用请输入代理站地址格式为https://domain.com": "This is optional, used to make API calls through the proxy site, please enter the proxy site address, the format is: https://domain.com",
"取消密码登录将导致所有未绑定其他登录方式的用户(包括管理员)无法通过密码登录,确认取消?": "Canceling password login will cause all users (including administrators) who have not bound other login methods to be unable to log in via password, confirm cancel?", "取消密码登录将导致所有未绑定其他登录方式的用户(包括管理员)无法通过密码登录,确认取消?": "Canceling password login will cause all users (including administrators) who have not bound other login methods to be unable to log in via password, confirm cancel?",
"按照如下格式输入:": "Enter in the following format:" "按照如下格式输入:": "Enter in the following format:",
"点击查看": "click to view"
} }

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Button, Form, Header, Label, Pagination, Segment, Select, Table, Icon } from 'semantic-ui-react'; import { Button, Form, Header, Label, Pagination, Segment, Select, Table } from 'semantic-ui-react';
import { API, isAdmin, showError, timestamp2string } from '../helpers'; import { API, isAdmin, showError, timestamp2string } from '../helpers';
import { ITEMS_PER_PAGE } from '../constants'; import { ITEMS_PER_PAGE } from '../constants';
@ -141,7 +141,7 @@ const LogsTable = () => {
const refresh = async () => { const refresh = async () => {
setLoading(true); setLoading(true);
setActivePage(1) setActivePage(1);
await loadLogs(0); await loadLogs(0);
}; };
@ -176,7 +176,7 @@ const LogsTable = () => {
if (logs.length === 0) return; if (logs.length === 0) return;
setLoading(true); setLoading(true);
let sortedLogs = [...logs]; let sortedLogs = [...logs];
if (typeof sortedLogs[0][key] === 'string'){ if (typeof sortedLogs[0][key] === 'string') {
sortedLogs.sort((a, b) => { sortedLogs.sort((a, b) => {
return ('' + a[key]).localeCompare(b[key]); return ('' + a[key]).localeCompare(b[key]);
}); });
@ -200,12 +200,7 @@ const LogsTable = () => {
<Header as='h3'> <Header as='h3'>
使用明细总消耗额度 使用明细总消耗额度
{showStat && renderQuota(stat.quota)} {showStat && renderQuota(stat.quota)}
<Icon {!showStat && <span onClick={handleEyeClick} style={{ cursor: 'pointer', color: 'gray' }}>点击查看</span>}
name={showStat ? "eye slash" : "eye"}
size="small"
onClick={handleEyeClick}
style={{ cursor: 'pointer', marginLeft: '5px', fontSize: '0.8em' }}
/>
</Header> </Header>
<Form> <Form>