mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-04 19:45:34 +08:00
fix(ui): restore card borders in usage statistics panels
Restore proper card styling for ModelTestConfigPanel and PricingConfigPanel by adding back border and rounded-lg classes. The transparent background styling was causing visual inconsistency. Changes: - Replace border-none bg-transparent shadow-none with border rounded-lg - Apply to both loading and error states for consistency - Format TypeScript code for better readability - Break long function signatures across multiple lines This ensures the usage statistics panels have consistent visual appearance with proper borders and rounded corners.
This commit is contained in:
@@ -56,7 +56,9 @@ export function ModelTestConfigPanel() {
|
|||||||
await saveModelTestConfig(config);
|
await saveModelTestConfig(config);
|
||||||
toast.success(t("modelTest.configSaved", "模型测试配置已保存"));
|
toast.success(t("modelTest.configSaved", "模型测试配置已保存"));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast.error(t("modelTest.configSaveFailed", "保存失败") + ": " + String(e));
|
toast.error(
|
||||||
|
t("modelTest.configSaveFailed", "保存失败") + ": " + String(e),
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
setIsSaving(false);
|
setIsSaving(false);
|
||||||
}
|
}
|
||||||
@@ -64,7 +66,7 @@ export function ModelTestConfigPanel() {
|
|||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Card className="border-none bg-transparent p-0 shadow-none">
|
<Card className="border rounded-lg">
|
||||||
<CardHeader
|
<CardHeader
|
||||||
className="cursor-pointer"
|
className="cursor-pointer"
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(!isExpanded)}
|
||||||
@@ -81,7 +83,7 @@ export function ModelTestConfigPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="border-none bg-transparent shadow-none">
|
<Card className="border rounded-lg">
|
||||||
<CardHeader
|
<CardHeader
|
||||||
className="cursor-pointer select-none"
|
className="cursor-pointer select-none"
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(!isExpanded)}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export function PricingConfigPanel() {
|
|||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Card className="border-none bg-transparent p-0 shadow-none">
|
<Card className="border rounded-lg">
|
||||||
<CardHeader
|
<CardHeader
|
||||||
className="cursor-pointer"
|
className="cursor-pointer"
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(!isExpanded)}
|
||||||
@@ -79,7 +79,7 @@ export function PricingConfigPanel() {
|
|||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
<Card className="border-none bg-transparent p-0 shadow-none">
|
<Card className="border rounded-lg">
|
||||||
<CardHeader
|
<CardHeader
|
||||||
className="cursor-pointer"
|
className="cursor-pointer"
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(!isExpanded)}
|
||||||
@@ -110,7 +110,7 @@ export function PricingConfigPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="border-none bg-transparent shadow-none">
|
<Card className="border rounded-lg">
|
||||||
<CardHeader
|
<CardHeader
|
||||||
className="cursor-pointer select-none"
|
className="cursor-pointer select-none"
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(!isExpanded)}
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ export function useModelTest(appId: AppId) {
|
|||||||
const [testingIds, setTestingIds] = useState<Set<string>>(new Set());
|
const [testingIds, setTestingIds] = useState<Set<string>>(new Set());
|
||||||
|
|
||||||
const testProvider = useCallback(
|
const testProvider = useCallback(
|
||||||
async (providerId: string, providerName: string): Promise<ModelTestResult | null> => {
|
async (
|
||||||
|
providerId: string,
|
||||||
|
providerName: string,
|
||||||
|
): Promise<ModelTestResult | null> => {
|
||||||
setTestingIds((prev) => new Set(prev).add(providerId));
|
setTestingIds((prev) => new Set(prev).add(providerId));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ export async function getModelTestLogs(
|
|||||||
/**
|
/**
|
||||||
* 清理旧的测试日志
|
* 清理旧的测试日志
|
||||||
*/
|
*/
|
||||||
export async function cleanupModelTestLogs(keepCount?: number): Promise<number> {
|
export async function cleanupModelTestLogs(
|
||||||
|
keepCount?: number,
|
||||||
|
): Promise<number> {
|
||||||
return invoke("cleanup_model_test_logs", { keepCount });
|
return invoke("cleanup_model_test_logs", { keepCount });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user