From 3cf92daef57499c5d8974d7814cd8bcfa9556787 Mon Sep 17 00:00:00 2001 From: MartialBE Date: Fri, 5 Apr 2024 16:16:22 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20improve:=20=20channel=20?= =?UTF-8?q?=20add=20used?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/log.go | 4 +- web/src/views/Channel/component/TableRow.js | 5 +- web/src/views/Channel/index.js | 1 + web/src/views/Log/component/TableToolBar.js | 91 ++++++++++----------- 4 files changed, 50 insertions(+), 51 deletions(-) diff --git a/model/log.go b/model/log.go index 988a2d59..83c9a647 100644 --- a/model/log.go +++ b/model/log.go @@ -263,8 +263,8 @@ func GetChannelExpensesByPeriod(startTimestamp, endTimestamp int64) (LogStatisti JOIN channels ON logs.channel_id = channels.id WHERE logs.type=2 AND logs.created_at BETWEEN ? AND ? - GROUP BY date, channels.name - ORDER BY date, channels.name + GROUP BY date, channels.id + ORDER BY date, channels.id `, startTimestamp, endTimestamp).Scan(&LogStatistics).Error return LogStatistics, err diff --git a/web/src/views/Channel/component/TableRow.js b/web/src/views/Channel/component/TableRow.js index 7e502b5b..3939a71e 100644 --- a/web/src/views/Channel/component/TableRow.js +++ b/web/src/views/Channel/component/TableRow.js @@ -37,7 +37,7 @@ import { IconDotsVertical, IconEdit, IconTrash, IconCopy, IconWorldWww } from '@ import { styled, alpha } from '@mui/material/styles'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'; -import { copy } from 'utils/common'; +import { copy, renderQuota } from 'utils/common'; const StyledMenu = styled((props) => ( + {renderQuota(item.used_quota)} - + diff --git a/web/src/views/Channel/index.js b/web/src/views/Channel/index.js index 31feac49..99200313 100644 --- a/web/src/views/Channel/index.js +++ b/web/src/views/Channel/index.js @@ -387,6 +387,7 @@ export default function ChannelPage() { { id: 'status', label: '状态', disableSort: false }, { id: 'response_time', label: '响应时间', disableSort: false }, { id: 'balance', label: '余额', disableSort: false }, + { id: 'used', label: '已使用', disableSort: false }, { id: 'priority', label: '优先级', disableSort: false, width: '80px' }, { id: 'weight', label: '权重', disableSort: false, width: '80px' }, { id: 'action', label: '操作', disableSort: true } diff --git a/web/src/views/Log/component/TableToolBar.js b/web/src/views/Log/component/TableToolBar.js index 416eb673..2498babf 100644 --- a/web/src/views/Log/component/TableToolBar.js +++ b/web/src/views/Log/component/TableToolBar.js @@ -100,53 +100,6 @@ export default function TableToolBar({ filterName, handleFilterName, userIsAdmin /> - - - - {userIsAdmin && ( - - 渠道ID - - - - } - /> - - )} - - {userIsAdmin && ( - - 用户名称 - - - - } - /> - - )} - 类型