Skip to content

Commit 5ce62e9

Browse files
committed
v0.3.3
1 parent fc9b495 commit 5ce62e9

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

app/api/v1/models/route.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,6 @@ interface ModelInfo {
1313
};
1414
}
1515

16-
interface ModelWithPrice {
17-
id: string;
18-
base_model_id: string;
19-
name: string;
20-
imageUrl: string;
21-
system_prompt: string;
22-
input_price: number;
23-
output_price: number;
24-
per_msg_price: number;
25-
updated_at: Date;
26-
}
27-
2816
interface ModelResponse {
2917
data: {
3018
id: string;

app/models/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ export default function ModelsPage() {
769769
const renderPriceCell = (
770770
field: "input_price" | "output_price" | "per_msg_price",
771771
record: Model,
772-
showTooltip: boolean = true // 默认显示 tooltip
772+
showTooltip: boolean = true
773773
) => {
774774
const isEditing =
775775
editingCell?.id === record.id && editingCell?.field === field;
@@ -808,6 +808,7 @@ export default function ModelsPage() {
808808
? t("models.table.invalidNumber")
809809
: t("models.table.nonePositiveNumber"),
810810
})}
811+
isPerMsgPrice={field === "per_msg_price"}
811812
/>
812813
);
813814
};

components/editable-cell.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface EditableCellProps {
2222
errorMessage?: string;
2323
maxValue?: number;
2424
};
25+
isPerMsgPrice?: boolean;
2526
}
2627

2728
export function EditableCell({
@@ -35,6 +36,7 @@ export function EditableCell({
3536
tooltipText,
3637
placeholder,
3738
validateValue = (value) => ({ isValid: true }),
39+
isPerMsgPrice = false,
3840
}: EditableCellProps) {
3941
const numericValue = typeof value === "number" ? value : Number(value);
4042
const originalValue = numericValue >= 0 ? numericValue.toFixed(4) : "";
@@ -187,7 +189,7 @@ export function EditableCell({
187189
}
188190
`}
189191
>
190-
{numericValue < 0 ? (
192+
{isPerMsgPrice && numericValue < 0 ? (
191193
<span className="text-muted-foreground/60">
192194
{t("common.notSet")}
193195
</span>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "openwebui-usage-monitor",
4-
"version": "0.3.2",
4+
"version": "0.3.3",
55
"private": true,
66
"scripts": {
77
"dev": "next dev",

0 commit comments

Comments
 (0)