移除平台配置中无效的 JSON 文件路径展示
配置已迁入数据库,不再展示历史 filePath / data/*.json 路径。
This commit is contained in:
@@ -119,7 +119,6 @@ function FulfillmentRoutingPanel() {
|
||||
const [saving, setSaving] = useState(false)
|
||||
const [previewing, setPreviewing] = useState(false)
|
||||
const [errorMessage, setErrorMessage] = useState('')
|
||||
const [filePath, setFilePath] = useState('')
|
||||
const [enabled, setEnabled] = useState(true)
|
||||
const [priority, setPriority] = useState<string[]>(['kuaishou_ct_assisted', 'kuaishou_feifei'])
|
||||
const [unmatchedExecutorKey, setUnmatchedExecutorKey] = useState('')
|
||||
@@ -202,7 +201,6 @@ function FulfillmentRoutingPanel() {
|
||||
}
|
||||
|
||||
function hydrateConfig(data: AdminFulfillmentRoutingConfig) {
|
||||
setFilePath(data.filePath || '')
|
||||
setEnabled(data.enabled !== false)
|
||||
setPriority(normalizeRoutingPriority(data.defaultExecutorPriority))
|
||||
setUnmatchedExecutorKey(data.unmatchedExecutorKey || '')
|
||||
@@ -276,7 +274,7 @@ function FulfillmentRoutingPanel() {
|
||||
{errorMessage ? <Alert type="error" showIcon message={errorMessage} /> : null}
|
||||
|
||||
<div className="metric-grid four">
|
||||
<MetricCard label="路由状态" value={enabled ? '启用' : '停用'} detail={filePath || '默认配置'} />
|
||||
<MetricCard label="路由状态" value={enabled ? '启用' : '停用'} />
|
||||
<MetricCard label="商品规则" value={String(rules.length)} detail={`启用 ${enabledRuleCount} 条`} />
|
||||
<MetricCard
|
||||
label="全局优先级"
|
||||
@@ -497,7 +495,6 @@ function KuaishouFeifeiFulfillmentPanel() {
|
||||
const [syncing, setSyncing] = useState(false)
|
||||
const [matching, setMatching] = useState(false)
|
||||
const [errorMessage, setErrorMessage] = useState('')
|
||||
const [filePath, setFilePath] = useState('')
|
||||
const [rules, setRules] = useState<AdminKuaishouFeifeiProductRule[]>([])
|
||||
const [matchInput, setMatchInput] = useState('')
|
||||
const [matchResult, setMatchResult] = useState<AdminKuaishouFeifeiMatchResult | null>(null)
|
||||
@@ -566,7 +563,6 @@ function KuaishouFeifeiFulfillmentPanel() {
|
||||
}
|
||||
|
||||
function hydrateConfig(data: AdminKuaishouFeifeiConfigResponse) {
|
||||
setFilePath(data.filePath || '')
|
||||
setRules(
|
||||
Array.isArray(data.source.productRules)
|
||||
? data.source.productRules.map((rule) => normalizeFeifeiRule(rule))
|
||||
@@ -612,14 +608,9 @@ function KuaishouFeifeiFulfillmentPanel() {
|
||||
<section className="platform-panel-stack">
|
||||
{errorMessage ? <Alert type="error" showIcon message={errorMessage} /> : null}
|
||||
|
||||
<div className="metric-grid four">
|
||||
<div className="metric-grid three">
|
||||
<MetricCard label="名字映射" value={String(mappingCount)} detail={`启用 ${enabledRuleCount} 条`} />
|
||||
<MetricCard label="匹配方式" value="同名" detail="使用 91 商品名规范化匹配" />
|
||||
<MetricCard
|
||||
label="配置文件"
|
||||
value={filePath ? 'GUI' : '默认'}
|
||||
detail={filePath || 'data/kuaishou-feifei-config.json'}
|
||||
/>
|
||||
<Card>
|
||||
<Space wrap>
|
||||
<Button icon={<ReloadOutlined />} loading={loading} onClick={loadConfig}>
|
||||
|
||||
@@ -578,7 +578,6 @@ function NotificationPanel({
|
||||
title="通知渠道"
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Typography.Text type="secondary">{notificationConfig.filePath || '默认配置'}</Typography.Text>
|
||||
<Button icon={<SendOutlined />} loading={testingNotification} onClick={testNotification}>
|
||||
发送测试
|
||||
</Button>
|
||||
@@ -682,12 +681,9 @@ function NotificationPanel({
|
||||
<Card
|
||||
title="监控任务"
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Typography.Text type="secondary">{scheduledJobs.filePath || '默认配置'}</Typography.Text>
|
||||
<Button type="primary" icon={<SaveOutlined />} loading={savingJobs} onClick={saveJobs}>
|
||||
保存任务
|
||||
</Button>
|
||||
</Space>
|
||||
<Button type="primary" icon={<SaveOutlined />} loading={savingJobs} onClick={saveJobs}>
|
||||
保存任务
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<Typography.Paragraph type="secondary" style={{ marginBottom: 12 }}>
|
||||
@@ -1426,18 +1422,15 @@ function KuaishouIndustryPanel({
|
||||
<Card
|
||||
title="应用参数"
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Typography.Text type="secondary">{config.filePath || '默认配置'}</Typography.Text>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<SaveOutlined />}
|
||||
loading={saving}
|
||||
disabled={Boolean(actionLoading)}
|
||||
onClick={saveConfig}
|
||||
>
|
||||
保存配置
|
||||
</Button>
|
||||
</Space>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<SaveOutlined />}
|
||||
loading={saving}
|
||||
disabled={Boolean(actionLoading)}
|
||||
onClick={saveConfig}
|
||||
>
|
||||
保存配置
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<div className="platform-form-grid">
|
||||
@@ -1671,11 +1664,10 @@ function KuaishouFeifeiPlatformPanel({
|
||||
|
||||
return (
|
||||
<section className="platform-panel-stack">
|
||||
<div className="metric-grid four">
|
||||
<div className="metric-grid three">
|
||||
<MetricCard label="运行状态" value={config.effective.enabled ? '已启用' : '停用'} detail={source.enabled ? '源配置启用' : '源配置停用'} />
|
||||
<MetricCard label="API 凭据" value={config.effective.hasAppKey && config.effective.hasAppSecret ? '已配置' : '待补全'} />
|
||||
<MetricCard label="启用规则" value={String(enabledRules.length)} detail={`共 ${source.productRules.length} 条`} />
|
||||
<MetricCard label="配置文件" value={config.filePath ? 'GUI' : '默认'} detail={config.filePath || '-'} />
|
||||
</div>
|
||||
|
||||
<Card
|
||||
@@ -1901,7 +1893,6 @@ function CloudtentaclesPlatformPanel({
|
||||
title="kuaishou-lewan 履约账号"
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Typography.Text type="secondary">{config.filePath || '默认配置'}</Typography.Text>
|
||||
<Switch checked={config.enabled} checkedChildren="启用" unCheckedChildren="停用" onChange={(enabled) => updateConfig({ enabled })} />
|
||||
<Button icon={<PlusOutlined />} onClick={addSource}>新增账号</Button>
|
||||
<Button type="primary" icon={<SaveOutlined />} loading={saving} onClick={saveConfig}>保存账号</Button>
|
||||
|
||||
@@ -1012,6 +1012,10 @@ select {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.metric-grid.three {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.metric-grid.four {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
@@ -1264,6 +1268,7 @@ select {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.metric-grid.three,
|
||||
.metric-grid.four,
|
||||
.metric-grid.five,
|
||||
.platform-form-grid,
|
||||
|
||||
Reference in New Issue
Block a user