fix:自动补货更新

This commit is contained in:
2026-11-02 18:30:51 +08:00
parent ce8d99ad95
commit 4dbec33dbd
9 changed files with 197 additions and 20 deletions
+2
View File
@@ -596,6 +596,8 @@ export interface RockStats {
auto_delivery_enabled: boolean;
token_warning_stock: number;
auto_purchase_enabled: boolean;
auto_purchase_cooldown_seconds?: number;
next_auto_purchase_at?: string;
username: string;
last_heartbeat_at?: string;
last_purchase_error?: string;
+2
View File
@@ -367,6 +367,8 @@ export default function PlatformRock() {
form={form}
autoDelivery={autoDelivery}
autoPurchaseEnabled={autoPurchaseEnabled}
autoPurchaseCoolingSeconds={stats?.auto_purchase_cooldown_seconds ?? 0}
nextAutoPurchaseAt={stats?.next_auto_purchase_at}
togglingAutoPurchase={togglingAutoPurchase}
testingConn={testingConn}
savingConfig={savingConfig}
@@ -28,6 +28,8 @@ export interface RockStrategyCardProps {
form: FormInstance
autoDelivery: boolean
autoPurchaseEnabled: boolean
autoPurchaseCoolingSeconds?: number
nextAutoPurchaseAt?: string
togglingAutoPurchase: boolean
testingConn: boolean
savingConfig: boolean
@@ -41,6 +43,8 @@ export function RockStrategyCard({
form,
autoDelivery,
autoPurchaseEnabled,
autoPurchaseCoolingSeconds,
nextAutoPurchaseAt,
togglingAutoPurchase,
testingConn,
savingConfig,
@@ -245,6 +249,20 @@ export function RockStrategyCard({
<Text type="secondary" style={{ fontSize: 11 }}>
切换后立即保存
</Text>
{autoPurchaseEnabled && (
<Text
type={(autoPurchaseCoolingSeconds ?? 0) > 0 ? 'warning' : 'secondary'}
style={{ fontSize: 11 }}
>
{(autoPurchaseCoolingSeconds ?? 0) > 0
? `冷却中,${
nextAutoPurchaseAt
? `${nextAutoPurchaseAt.slice(11, 19)} 后`
: '稍后'
}可再次补货`
: '自动补货就绪'}
</Text>
)}
</Space>
</Form.Item>
</Col>