feat: add client ip for berry theme

This commit is contained in:
林水溶 2024-03-14 00:19:55 +09:00
parent 0b0a8fba28
commit 0e8103527d
5 changed files with 30 additions and 2 deletions

View File

@ -14,6 +14,7 @@ const LogTableHead = ({ userIsAdmin }) => {
<TableCell>提示</TableCell>
<TableCell>补全</TableCell>
<TableCell>额度</TableCell>
<TableCell>请求端IP</TableCell>
<TableCell>详情</TableCell>
</TableRow>
</TableHead>

View File

@ -57,6 +57,7 @@ export default function LogTableRow({ item, userIsAdmin }) {
<TableCell>{item.prompt_tokens || ''}</TableCell>
<TableCell>{item.completion_tokens || ''}</TableCell>
<TableCell>{item.quota ? renderQuota(item.quota, 6) : ''}</TableCell>
<TableCell>{item.client_ip || ''}</TableCell>
<TableCell>{item.content}</TableCell>
</TableRow>
</>

View File

@ -5,6 +5,7 @@ import {
IconKey,
IconBrandGithubCopilot,
IconSitemap,
IconMapPin
} from "@tabler/icons-react";
import {
InputAdornment,
@ -81,6 +82,30 @@ export default function TableToolBar({
/>
</FormControl>
<FormControl>
<InputLabel htmlFor="channel-client_ip-label">请求端IP</InputLabel>
<OutlinedInput
id="client_ip"
name="client_ip"
sx={{
minWidth: "100%",
}}
label="请求端IP"
value={filterName.client_ip}
onChange={handleFilterName}
placeholder="请求端IP"
startAdornment={
<InputAdornment position="start">
<IconMapPin
stroke={1.5}
size="20px"
color={grey500}
/>
</InputAdornment>
}
/>
</FormControl>
<FormControl>
<LocalizationProvider
dateAdapter={AdapterDayjs}

View File

@ -28,7 +28,8 @@ export default function Log() {
start_timestamp: 0,
end_timestamp: new Date().getTime() / 1000 + 3600,
type: 0,
channel: ''
channel: '',
client_ip: ''
};
const [logs, setLogs] = useState([]);
const [activePage, setActivePage] = useState(0);

View File

@ -425,7 +425,7 @@ const LogsTable = () => {
}}
width={1}
>
请求IP
请求IP
</Table.HeaderCell>
<Table.HeaderCell
style={{ cursor: 'pointer' }}