fix: resolve clippy warnings for dead field and struct prefix
- Remove unused passkey_name from RegisterStartRequest (only used in RegisterFinishRequest) - Rename AiUsageView fields from total_calls/total_tokens/total_cost to calls/tokens/cost
This commit is contained in:
parent
fbc2d66a84
commit
1377d43935
3 changed files with 9 additions and 10 deletions
|
|
@ -25,7 +25,6 @@ const SESSION_COOKIE_NAME: &str = "brewlog_session";
|
|||
pub struct RegisterStartRequest {
|
||||
pub token: String,
|
||||
pub display_name: String,
|
||||
pub passkey_name: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ use crate::application::server::AppState;
|
|||
|
||||
#[derive(Serialize)]
|
||||
pub struct AiUsageView {
|
||||
pub total_calls: i64,
|
||||
pub total_tokens: String,
|
||||
pub total_cost: String,
|
||||
pub calls: i64,
|
||||
pub tokens: String,
|
||||
pub cost: String,
|
||||
}
|
||||
|
||||
fn format_cost(cost: f64) -> String {
|
||||
|
|
@ -133,9 +133,9 @@ pub(crate) async fn account_page(
|
|||
}
|
||||
};
|
||||
let ai_usage = ai_usage.filter(|s| s.total_calls > 0).map(|s| AiUsageView {
|
||||
total_calls: s.total_calls,
|
||||
total_tokens: format_number(s.total_tokens),
|
||||
total_cost: format_cost(s.total_cost),
|
||||
calls: s.total_calls,
|
||||
tokens: format_number(s.total_tokens),
|
||||
cost: format_cost(s.total_cost),
|
||||
});
|
||||
|
||||
let template = AccountTemplate {
|
||||
|
|
|
|||
|
|
@ -224,15 +224,15 @@
|
|||
<div class="grid grid-cols-1 md:grid-cols-3 gap-3">
|
||||
<div class="rounded-lg border bg-surface p-4">
|
||||
<span class="block text-sm text-stone-500">Total Cost</span>
|
||||
<span class="mt-1 block text-lg font-semibold text-stone-800">{{ usage.total_cost }}</span>
|
||||
<span class="mt-1 block text-lg font-semibold text-stone-800">{{ usage.cost }}</span>
|
||||
</div>
|
||||
<div class="rounded-lg border bg-surface p-4">
|
||||
<span class="block text-sm text-stone-500">API Calls</span>
|
||||
<span class="mt-1 block text-lg font-semibold text-stone-800">{{ usage.total_calls }}</span>
|
||||
<span class="mt-1 block text-lg font-semibold text-stone-800">{{ usage.calls }}</span>
|
||||
</div>
|
||||
<div class="rounded-lg border bg-surface p-4">
|
||||
<span class="block text-sm text-stone-500">Total Tokens</span>
|
||||
<span class="mt-1 block text-lg font-semibold text-stone-800">{{ usage.total_tokens }}</span>
|
||||
<span class="mt-1 block text-lg font-semibold text-stone-800">{{ usage.tokens }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Reference in a new issue