fix(sub2api): tab改纯文字样式;去掉多余「按模型」标题;今天明细按小时
1. 「按模型 / 按 Key」tab 从 FilterChip 按钮改为纯 Text + clickable, 去掉按钮背景和圆角,更像文字标签而非按钮。 2. MODEL tab 下方原来有一行「按模型」小标题(sub2_models_header), 和 tab 本身重复,去掉。 3. 「今天」窗口的每日用量明细从隐藏改为按小时倒序列出, 每行显示 HH:00 + 请求/tokens/费用。
This commit is contained in:
parent
78f93588f8
commit
3b4cd103d0
@ -271,15 +271,26 @@ internal fun Sub2ApiUsageCard(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 每日明细只在按天且有数据时列出(按小时时逐小时列会过长)
|
// 每日/每小时明细列表
|
||||||
if (!isHourly) {
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
Spacer(modifier = Modifier.height(12.dp))
|
Text(
|
||||||
Text(
|
text = stringResource(R.string.sub2_daily_header),
|
||||||
text = stringResource(R.string.sub2_daily_header),
|
style = MaterialTheme.typography.labelLarge,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
color = inkMuted()
|
||||||
color = inkMuted()
|
)
|
||||||
)
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
Spacer(modifier = Modifier.height(6.dp))
|
if (isHourly) {
|
||||||
|
// 「今天」按小时:倒序展示每小时明细
|
||||||
|
chartSeries.reversed().forEachIndexed { index, hour ->
|
||||||
|
DailyRow(hour)
|
||||||
|
if (index != chartSeries.lastIndex) {
|
||||||
|
HorizontalDivider(
|
||||||
|
modifier = Modifier.padding(vertical = 2.dp),
|
||||||
|
color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.4f)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
days.reversed().forEachIndexed { index, day ->
|
days.reversed().forEachIndexed { index, day ->
|
||||||
DailyRow(day)
|
DailyRow(day)
|
||||||
if (index != days.lastIndex) {
|
if (index != days.lastIndex) {
|
||||||
@ -303,17 +314,21 @@ internal fun Sub2ApiUsageCard(
|
|||||||
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.5f))
|
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.5f))
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
|
|
||||||
// tab 切换:按模型 / 按 Key(文字样式,非按钮)
|
// tab 切换:按模型 / 按 Key(纯文字 tab,非按钮)
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
Row(horizontalArrangement = Arrangement.spacedBy(20.dp)) {
|
||||||
FilterChip(
|
Text(
|
||||||
selected = detailTab == DetailTab.MODEL,
|
text = stringResource(R.string.sub2_tab_by_model),
|
||||||
onClick = { detailTab = DetailTab.MODEL },
|
style = MaterialTheme.typography.labelLarge,
|
||||||
label = { Text(stringResource(R.string.sub2_tab_by_model)) }
|
fontWeight = if (detailTab == DetailTab.MODEL) FontWeight.SemiBold else FontWeight.Normal,
|
||||||
|
color = if (detailTab == DetailTab.MODEL) MaterialTheme.colorScheme.primary else inkMuted(),
|
||||||
|
modifier = Modifier.clickable { detailTab = DetailTab.MODEL }
|
||||||
)
|
)
|
||||||
FilterChip(
|
Text(
|
||||||
selected = detailTab == DetailTab.KEY,
|
text = stringResource(R.string.sub2_tab_by_key),
|
||||||
onClick = { detailTab = DetailTab.KEY },
|
style = MaterialTheme.typography.labelLarge,
|
||||||
label = { Text(stringResource(R.string.sub2_tab_by_key)) }
|
fontWeight = if (detailTab == DetailTab.KEY) FontWeight.SemiBold else FontWeight.Normal,
|
||||||
|
color = if (detailTab == DetailTab.KEY) MaterialTheme.colorScheme.primary else inkMuted(),
|
||||||
|
modifier = Modifier.clickable { detailTab = DetailTab.KEY }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(12.dp))
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
@ -321,14 +336,6 @@ internal fun Sub2ApiUsageCard(
|
|||||||
if (detailTab == DetailTab.KEY) {
|
if (detailTab == DetailTab.KEY) {
|
||||||
KeyUsageSection(keyStatsState)
|
KeyUsageSection(keyStatsState)
|
||||||
} else {
|
} else {
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.sub2_models_header) +
|
|
||||||
if (windowStatsAllTime) stringResource(R.string.sub2_models_alltime_suffix) else "",
|
|
||||||
style = MaterialTheme.typography.labelLarge,
|
|
||||||
color = inkMuted()
|
|
||||||
)
|
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
|
||||||
|
|
||||||
// 模型筛选 chips(按当前周期内有数据的模型;「全部」时用网关全量)
|
// 模型筛选 chips(按当前周期内有数据的模型;「全部」时用网关全量)
|
||||||
LazyRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
LazyRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
item {
|
item {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user