更新安全配置项目
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { useToast } from "@/components/ui/toast";
|
||||
import { Loader2 } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {useEffect, useState} from "react";
|
||||
import {useToast} from "@/components/ui/toast";
|
||||
import {Loader2} from "lucide-react";
|
||||
import {Button} from "@/components/ui/button";
|
||||
|
||||
interface ExportConfig {
|
||||
untranslatedColor: string;
|
||||
secondPageHeader: boolean;
|
||||
orientation: "portrait" | "landscape";
|
||||
}
|
||||
|
||||
const defaultExportConfig: ExportConfig = {
|
||||
untranslatedColor: "CC0000",
|
||||
secondPageHeader: false,
|
||||
orientation: "landscape",
|
||||
};
|
||||
|
||||
@@ -30,7 +28,6 @@ export default function ExportPage() {
|
||||
if (result.success && result.data) {
|
||||
setConfig({
|
||||
untranslatedColor: result.data.export?.untranslatedColor || defaultExportConfig.untranslatedColor,
|
||||
secondPageHeader: result.data.export?.secondPageHeader ?? defaultExportConfig.secondPageHeader,
|
||||
orientation: result.data.export?.orientation || defaultExportConfig.orientation,
|
||||
});
|
||||
}
|
||||
@@ -136,19 +133,6 @@ export default function ExportPage() {
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={config.secondPageHeader}
|
||||
onChange={(e) => setConfig({ ...config, secondPageHeader: e.target.checked })}
|
||||
className="h-4 w-4 cursor-pointer rounded border-input"
|
||||
/>
|
||||
<span className="text-sm">第二页显示表头</span>
|
||||
</label>
|
||||
<p className="text-xs text-muted-foreground">启用后,如果内容超过一页,第二页及后续页面会在顶部显示表头行</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 预览 */}
|
||||
@@ -169,10 +153,6 @@ export default function ExportPage() {
|
||||
<span className="text-sm">页面方向:</span>
|
||||
<span className="text-sm">{config.orientation === "landscape" ? "横向 (Landscape)" : "纵向 (Portrait)"}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-sm">第二页表头:</span>
|
||||
<span className="text-sm">{config.secondPageHeader ? "启用" : "禁用"}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user