mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 15:26:36 +08:00
[优化] 接口优化, 心跳请求返回规则摘要
This commit is contained in:
@@ -68,8 +68,7 @@ const defaultSystemFields = {
|
||||
};
|
||||
|
||||
const defaultOperationFields = {
|
||||
AgentHeartbeatInterval: '30000',
|
||||
AgentSyncInterval: '30000',
|
||||
AgentHeartbeatInterval: '10000',
|
||||
NodeOfflineThreshold: '120000',
|
||||
AgentUpdateRepo: 'Rain-kl/ATSFlare',
|
||||
OpenRestyWorkerProcesses: 'auto',
|
||||
@@ -335,8 +334,7 @@ export function SettingsPage() {
|
||||
});
|
||||
|
||||
setOperationFields({
|
||||
AgentHeartbeatInterval: optionMap.AgentHeartbeatInterval ?? '30000',
|
||||
AgentSyncInterval: optionMap.AgentSyncInterval ?? '30000',
|
||||
AgentHeartbeatInterval: optionMap.AgentHeartbeatInterval ?? '10000',
|
||||
NodeOfflineThreshold: optionMap.NodeOfflineThreshold ?? '120000',
|
||||
AgentUpdateRepo: optionMap.AgentUpdateRepo ?? 'Rain-kl/ATSFlare',
|
||||
OpenRestyWorkerProcesses: optionMap.OpenRestyWorkerProcesses ?? 'auto',
|
||||
@@ -942,10 +940,6 @@ export function SettingsPage() {
|
||||
operationFields.AgentHeartbeatInterval,
|
||||
10,
|
||||
);
|
||||
const sync = Number.parseInt(
|
||||
operationFields.AgentSyncInterval,
|
||||
10,
|
||||
);
|
||||
const offline = Number.parseInt(
|
||||
operationFields.NodeOfflineThreshold,
|
||||
10,
|
||||
@@ -954,9 +948,6 @@ export function SettingsPage() {
|
||||
if (Number.isNaN(heartbeat) || heartbeat < 5000) {
|
||||
throw new Error('心跳间隔不能小于 5000 毫秒。');
|
||||
}
|
||||
if (Number.isNaN(sync) || sync < 5000) {
|
||||
throw new Error('同步间隔不能小于 5000 毫秒。');
|
||||
}
|
||||
if (Number.isNaN(offline) || offline < 10000) {
|
||||
throw new Error('离线阈值不能小于 10000 毫秒。');
|
||||
}
|
||||
@@ -964,7 +955,6 @@ export function SettingsPage() {
|
||||
await saveOptionEntries(
|
||||
[
|
||||
['AgentHeartbeatInterval', String(heartbeat)],
|
||||
['AgentSyncInterval', String(sync)],
|
||||
['NodeOfflineThreshold', String(offline)],
|
||||
],
|
||||
'Agent 运行参数已保存。',
|
||||
@@ -980,7 +970,7 @@ export function SettingsPage() {
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="grid gap-5 md:grid-cols-3">
|
||||
<div className="grid gap-5 md:grid-cols-2">
|
||||
<ResourceField
|
||||
label={`心跳间隔 (${formatDurationLabel(operationFields.AgentHeartbeatInterval)})`}
|
||||
>
|
||||
@@ -995,20 +985,6 @@ export function SettingsPage() {
|
||||
}
|
||||
/>
|
||||
</ResourceField>
|
||||
<ResourceField
|
||||
label={`同步间隔 (${formatDurationLabel(operationFields.AgentSyncInterval)})`}
|
||||
>
|
||||
<ResourceInput
|
||||
type="number"
|
||||
value={operationFields.AgentSyncInterval}
|
||||
onChange={(event) =>
|
||||
setOperationFields((previous) => ({
|
||||
...previous,
|
||||
AgentSyncInterval: event.target.value,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</ResourceField>
|
||||
<ResourceField
|
||||
label={`离线阈值 (${formatDurationLabel(operationFields.NodeOfflineThreshold)})`}
|
||||
>
|
||||
|
||||
@@ -422,7 +422,7 @@ export function WebsitesPage() {
|
||||
<div className="space-y-6">
|
||||
<PageHeader
|
||||
title="网站"
|
||||
description="在同一页完成网站录入、默认证书绑定、证书导入和资产巡检,减少域名页与证书页之间的来回切换。"
|
||||
description="管理域名和TLS证书。"
|
||||
/>
|
||||
|
||||
{feedback ? (
|
||||
@@ -432,7 +432,6 @@ export function WebsitesPage() {
|
||||
<div className="grid gap-6 xl:grid-cols-[1.2fr_0.8fr]">
|
||||
<AppCard
|
||||
title={editingDomainId ? '编辑网站' : '快速添加网站'}
|
||||
description="录入域名后即可直接绑定默认证书。若证书尚未导入,可在右侧先导入再回到这里选择。"
|
||||
action={
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{editingDomainId ? (
|
||||
@@ -517,8 +516,7 @@ export function WebsitesPage() {
|
||||
</AppCard>
|
||||
|
||||
<AppCard
|
||||
title="证书快捷入口"
|
||||
description="先导入证书,再回到左侧立即绑定到网站。无需跳转到单独页面。"
|
||||
title="证书"
|
||||
action={
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<SecondaryButton
|
||||
|
||||
Reference in New Issue
Block a user