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,8 +271,7 @@ internal fun Sub2ApiUsageCard(
|
||||
)
|
||||
}
|
||||
|
||||
// 每日明细只在按天且有数据时列出(按小时时逐小时列会过长)
|
||||
if (!isHourly) {
|
||||
// 每日/每小时明细列表
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.sub2_daily_header),
|
||||
@ -280,6 +279,18 @@ internal fun Sub2ApiUsageCard(
|
||||
color = inkMuted()
|
||||
)
|
||||
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 ->
|
||||
DailyRow(day)
|
||||
if (index != days.lastIndex) {
|
||||
@ -303,17 +314,21 @@ internal fun Sub2ApiUsageCard(
|
||||
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.5f))
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
|
||||
// tab 切换:按模型 / 按 Key(文字样式,非按钮)
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
FilterChip(
|
||||
selected = detailTab == DetailTab.MODEL,
|
||||
onClick = { detailTab = DetailTab.MODEL },
|
||||
label = { Text(stringResource(R.string.sub2_tab_by_model)) }
|
||||
// tab 切换:按模型 / 按 Key(纯文字 tab,非按钮)
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(20.dp)) {
|
||||
Text(
|
||||
text = stringResource(R.string.sub2_tab_by_model),
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
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(
|
||||
selected = detailTab == DetailTab.KEY,
|
||||
onClick = { detailTab = DetailTab.KEY },
|
||||
label = { Text(stringResource(R.string.sub2_tab_by_key)) }
|
||||
Text(
|
||||
text = stringResource(R.string.sub2_tab_by_key),
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
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))
|
||||
@ -321,14 +336,6 @@ internal fun Sub2ApiUsageCard(
|
||||
if (detailTab == DetailTab.KEY) {
|
||||
KeyUsageSection(keyStatsState)
|
||||
} 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(按当前周期内有数据的模型;「全部」时用网关全量)
|
||||
LazyRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
item {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user