|
|
@@ -0,0 +1,862 @@
|
|
|
+// src/components/admin/node-configurations/NodeConfigCreateWizardModal.tsx
|
|
|
+
|
|
|
+'use client';
|
|
|
+
|
|
|
+import React, { useState, useEffect } from 'react';
|
|
|
+import { toast } from 'react-hot-toast';
|
|
|
+import {
|
|
|
+ NodeConfigEntryType,
|
|
|
+ ProviderItem,
|
|
|
+ AppointmentTypeItem,
|
|
|
+ PluginConfig,
|
|
|
+ NodeConfigurationItem,
|
|
|
+} from '@/types';
|
|
|
+import { providerService } from '@/lib/services/providerService';
|
|
|
+import { nodeConfigService } from '@/lib/services/nodeConfigService';
|
|
|
+import AppointmentTypeEditor from './AppointmentTypeEditor';
|
|
|
+
|
|
|
+interface NodeConfigCreateWizardModalProps {
|
|
|
+ isOpen: boolean;
|
|
|
+ onClose: () => void;
|
|
|
+ entryType: NodeConfigEntryType;
|
|
|
+ onSuccess: () => void;
|
|
|
+}
|
|
|
+
|
|
|
+export default function NodeConfigCreateWizardModal({
|
|
|
+ isOpen,
|
|
|
+ onClose,
|
|
|
+ entryType,
|
|
|
+ onSuccess,
|
|
|
+}: NodeConfigCreateWizardModalProps) {
|
|
|
+ const [step, setStep] = useState<1 | 2 | 3>(1);
|
|
|
+ const [providers, setProviders] = useState<ProviderItem[]>([]);
|
|
|
+ const [selectedProviderName, setSelectedProviderName] = useState<string>('');
|
|
|
+ const [loadingProviders, setLoadingProviders] = useState(false);
|
|
|
+ const [submitting, setSubmitting] = useState(false);
|
|
|
+
|
|
|
+ // Step 1: Base & Identity
|
|
|
+ const [nodeId, setNodeId] = useState('node01');
|
|
|
+ const [identifier, setIdentifier] = useState('');
|
|
|
+ const [website, setWebsite] = useState('');
|
|
|
+ const [needAccount, setNeedAccount] = useState(1);
|
|
|
+ const [needProxy, setNeedProxy] = useState(1);
|
|
|
+ const [proxyPoolStr, setProxyPoolStr] = useState('proxy-cheap');
|
|
|
+ const [proxyCd, setProxyCd] = useState(300);
|
|
|
+ const [sessionMaxLife, setSessionMaxLife] = useState(1800);
|
|
|
+ const [activeTimeStart, setActiveTimeStart] = useState('00:00');
|
|
|
+ const [activeTimeEnd, setActiveTimeEnd] = useState('23:59');
|
|
|
+
|
|
|
+ // Standalone specifics
|
|
|
+ const [orderId, setOrderId] = useState('');
|
|
|
+ const [accountUsername, setAccountUsername] = useState('');
|
|
|
+ const [accountPassword, setAccountPassword] = useState('');
|
|
|
+ const [supportPta, setSupportPta] = useState(false);
|
|
|
+ const [expectedStartDate, setExpectedStartDate] = useState('');
|
|
|
+ const [expectedEndDate, setExpectedEndDate] = useState('');
|
|
|
+ const [loginInterval, setLoginInterval] = useState(1800);
|
|
|
+
|
|
|
+ // Booker specifics
|
|
|
+ const [bookerAccountSource, setBookerAccountSource] = useState('built-in');
|
|
|
+ const [bookerAccountPoolId, setBookerAccountPoolId] = useState('');
|
|
|
+ const [bookerTargetInstances, setBookerTargetInstances] = useState(1);
|
|
|
+ const [bookerAccountCd, setBookerAccountCd] = useState(10800);
|
|
|
+ const [bookerCooldown, setBookerCooldown] = useState(300);
|
|
|
+ const [bookerMaxBookings, setBookerMaxBookings] = useState(8);
|
|
|
+
|
|
|
+ // Sentinel specifics
|
|
|
+ const [sentinelAccountSource, setSentinelAccountSource] = useState('built-in');
|
|
|
+ const [sentinelAccountPoolId, setSentinelAccountPoolId] = useState('');
|
|
|
+ const [sentinelTargetInstances, setSentinelTargetInstances] = useState(1);
|
|
|
+ const [sentinelSignalTtl, setSentinelSignalTtl] = useState(30);
|
|
|
+
|
|
|
+ // Query Wait
|
|
|
+ const [queryWaitMode, setQueryWaitMode] = useState<'Random' | 'Fixed'>('Random');
|
|
|
+ const [fixedWait, setFixedWait] = useState(10);
|
|
|
+ const [randomMin, setRandomMin] = useState(60);
|
|
|
+ const [randomMax, setRandomMax] = useState(300);
|
|
|
+
|
|
|
+ // Plugin config
|
|
|
+ const [pluginConfig, setPluginConfig] = useState<PluginConfig>({
|
|
|
+ lib_path: 'plugins',
|
|
|
+ plugin_name: '',
|
|
|
+ plugin_bin: '',
|
|
|
+ plugin_proto: 'IVSPlg',
|
|
|
+ });
|
|
|
+
|
|
|
+ // Appointment types & free config
|
|
|
+ const [appointmentTypes, setAppointmentTypes] = useState<AppointmentTypeItem[]>([]);
|
|
|
+ const [freeConfigStr, setFreeConfigStr] = useState('{}');
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ if (isOpen) {
|
|
|
+ setStep(1);
|
|
|
+ fetchEnabledProviders();
|
|
|
+ resetForm();
|
|
|
+ }
|
|
|
+ }, [isOpen, entryType]);
|
|
|
+
|
|
|
+ const fetchEnabledProviders = async () => {
|
|
|
+ setLoadingProviders(true);
|
|
|
+ try {
|
|
|
+ const res = await providerService.getList({ enabled_only: true });
|
|
|
+ if (res.code === 0 && res.data) {
|
|
|
+ setProviders(res.data);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('Failed to fetch providers:', e);
|
|
|
+ } finally {
|
|
|
+ setLoadingProviders(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const resetForm = () => {
|
|
|
+ setSelectedProviderName('');
|
|
|
+ setNodeId('node01');
|
|
|
+ setIdentifier('');
|
|
|
+ setWebsite('');
|
|
|
+ setNeedAccount(1);
|
|
|
+ setNeedProxy(1);
|
|
|
+ setProxyPoolStr('proxy-cheap');
|
|
|
+ setProxyCd(300);
|
|
|
+ setSessionMaxLife(1800);
|
|
|
+ setActiveTimeStart('00:00');
|
|
|
+ setActiveTimeEnd('23:59');
|
|
|
+
|
|
|
+ setOrderId('');
|
|
|
+ setAccountUsername('');
|
|
|
+ setAccountPassword('');
|
|
|
+ setSupportPta(false);
|
|
|
+ setExpectedStartDate('');
|
|
|
+ setExpectedEndDate('');
|
|
|
+ setLoginInterval(1800);
|
|
|
+
|
|
|
+ setBookerAccountSource('built-in');
|
|
|
+ setBookerAccountPoolId('');
|
|
|
+ setBookerTargetInstances(1);
|
|
|
+ setBookerAccountCd(10800);
|
|
|
+ setBookerCooldown(300);
|
|
|
+ setBookerMaxBookings(8);
|
|
|
+
|
|
|
+ setSentinelAccountSource('built-in');
|
|
|
+ setSentinelAccountPoolId('');
|
|
|
+ setSentinelTargetInstances(1);
|
|
|
+ setSentinelSignalTtl(30);
|
|
|
+
|
|
|
+ setQueryWaitMode('Random');
|
|
|
+ setFixedWait(10);
|
|
|
+ setRandomMin(60);
|
|
|
+ setRandomMax(300);
|
|
|
+
|
|
|
+ setPluginConfig({
|
|
|
+ lib_path: 'plugins',
|
|
|
+ plugin_name: '',
|
|
|
+ plugin_bin: '',
|
|
|
+ plugin_proto: 'IVSPlg',
|
|
|
+ });
|
|
|
+
|
|
|
+ setAppointmentTypes([]);
|
|
|
+ setFreeConfigStr('{}');
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleProviderSelect = (providerName: string) => {
|
|
|
+ setSelectedProviderName(providerName);
|
|
|
+ const p = providers.find((item) => item.name === providerName);
|
|
|
+ if (!p) return;
|
|
|
+
|
|
|
+ if (p.plugin_config) {
|
|
|
+ setPluginConfig({
|
|
|
+ lib_path: p.plugin_config.lib_path || 'plugins',
|
|
|
+ plugin_name: p.plugin_config.plugin_name || '',
|
|
|
+ plugin_bin: p.plugin_config.plugin_bin || '',
|
|
|
+ plugin_proto: p.plugin_config.plugin_proto || 'IVSPlg',
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ const roleTpl = p.role_templates?.[entryType];
|
|
|
+ if (roleTpl) {
|
|
|
+ if (roleTpl.proxy_cd !== undefined) setProxyCd(Number(roleTpl.proxy_cd));
|
|
|
+ if (roleTpl.session_max_life !== undefined) setSessionMaxLife(Number(roleTpl.session_max_life));
|
|
|
+ if (roleTpl.login_interval !== undefined) setLoginInterval(Number(roleTpl.login_interval));
|
|
|
+
|
|
|
+ if (entryType === 'booker') {
|
|
|
+ if (roleTpl['booker.account_source'] !== undefined) setBookerAccountSource(roleTpl['booker.account_source']);
|
|
|
+ if (roleTpl['booker.account_pool_id'] !== undefined) setBookerAccountPoolId(roleTpl['booker.account_pool_id']);
|
|
|
+ if (roleTpl['booker.account_cd'] !== undefined) setBookerAccountCd(Number(roleTpl['booker.account_cd']));
|
|
|
+ if (roleTpl['booker.target_instances'] !== undefined) setBookerTargetInstances(Number(roleTpl['booker.target_instances']));
|
|
|
+ if (roleTpl['booker.booking_cooldown'] !== undefined) setBookerCooldown(Number(roleTpl['booker.booking_cooldown']));
|
|
|
+ if (roleTpl['booker.max_bookings_per_account'] !== undefined) setBookerMaxBookings(Number(roleTpl['booker.max_bookings_per_account']));
|
|
|
+ } else if (entryType === 'sentinel') {
|
|
|
+ if (roleTpl['sentinel.account_source'] !== undefined) setSentinelAccountSource(roleTpl['sentinel.account_source']);
|
|
|
+ if (roleTpl['sentinel.account_pool_id'] !== undefined) setSentinelAccountPoolId(roleTpl['sentinel.account_pool_id']);
|
|
|
+ if (roleTpl['sentinel.target_instances'] !== undefined) setSentinelTargetInstances(Number(roleTpl['sentinel.target_instances']));
|
|
|
+ if (roleTpl['sentinel.signal_ttl'] !== undefined) setSentinelSignalTtl(Number(roleTpl['sentinel.signal_ttl']));
|
|
|
+ if (roleTpl['sentinel.query_wait.mode'] !== undefined) setQueryWaitMode(roleTpl['sentinel.query_wait.mode']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ toast.success(`已从服务商模板 [${providerName}] 继承参数`);
|
|
|
+ };
|
|
|
+
|
|
|
+ const buildPayload = (): Partial<NodeConfigurationItem> => {
|
|
|
+ const proxyList = proxyPoolStr
|
|
|
+ .split(',')
|
|
|
+ .map((s) => s.trim())
|
|
|
+ .filter(Boolean);
|
|
|
+
|
|
|
+ let parsedFreeConfig = {};
|
|
|
+ try {
|
|
|
+ if (freeConfigStr.trim()) parsedFreeConfig = JSON.parse(freeConfigStr);
|
|
|
+ } catch {}
|
|
|
+
|
|
|
+ const base: any = {
|
|
|
+ node_id: nodeId.trim(),
|
|
|
+ identifier: identifier.trim(),
|
|
|
+ website: website.trim(),
|
|
|
+ plugin_config: pluginConfig,
|
|
|
+ appointment_types: appointmentTypes,
|
|
|
+ free_config: parsedFreeConfig,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (entryType === 'booker') {
|
|
|
+ base.need_account = needAccount;
|
|
|
+ base.need_proxy = needProxy;
|
|
|
+ base.proxy_pool = proxyList;
|
|
|
+ base.proxy_cd = proxyCd;
|
|
|
+ base.session_max_life = sessionMaxLife;
|
|
|
+ base.active_time_start = activeTimeStart;
|
|
|
+ base.active_time_end = activeTimeEnd;
|
|
|
+ base.booker = {
|
|
|
+ account_source: bookerAccountSource,
|
|
|
+ account_pool_id: bookerAccountPoolId.trim(),
|
|
|
+ target_instances: Number(bookerTargetInstances),
|
|
|
+ account_cd: Number(bookerAccountCd),
|
|
|
+ booking_cooldown: Number(bookerCooldown),
|
|
|
+ max_bookings_per_account: Number(bookerMaxBookings),
|
|
|
+ };
|
|
|
+ } else if (entryType === 'sentinel') {
|
|
|
+ base.sentinel = {
|
|
|
+ account_source: sentinelAccountSource,
|
|
|
+ account_pool_id: sentinelAccountPoolId.trim(),
|
|
|
+ target_instances: Number(sentinelTargetInstances),
|
|
|
+ signal_ttl: Number(sentinelSignalTtl),
|
|
|
+ query_wait: {
|
|
|
+ mode: queryWaitMode,
|
|
|
+ ...(queryWaitMode === 'Fixed'
|
|
|
+ ? { fixed_wait: Number(fixedWait) }
|
|
|
+ : { random_min: Number(randomMin), random_max: Number(randomMax) }),
|
|
|
+ },
|
|
|
+ };
|
|
|
+ } else if (entryType === 'standalone') {
|
|
|
+ base.order_id = orderId.trim();
|
|
|
+ base.account = {
|
|
|
+ username: accountUsername.trim(),
|
|
|
+ password: accountPassword,
|
|
|
+ };
|
|
|
+ base.proxy_pool = proxyList;
|
|
|
+ base.login_interval = Number(loginInterval);
|
|
|
+ base.session_max_life = Number(sessionMaxLife);
|
|
|
+ base.query_wait = {
|
|
|
+ mode: queryWaitMode,
|
|
|
+ ...(queryWaitMode === 'Fixed'
|
|
|
+ ? { fixed_wait: Number(fixedWait) }
|
|
|
+ : { random_min: Number(randomMin), random_max: Number(randomMax) }),
|
|
|
+ };
|
|
|
+ base.user_preferences = {
|
|
|
+ support_pta: supportPta,
|
|
|
+ expected_start_date: expectedStartDate,
|
|
|
+ expected_end_date: expectedEndDate,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ return base;
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleNext = () => {
|
|
|
+ if (step === 1) {
|
|
|
+ if (!nodeId.trim()) {
|
|
|
+ toast.error('节点 ID (node_id) 不能为空');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!identifier.trim()) {
|
|
|
+ toast.error('任务标识 (identifier) 不能为空');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setStep(2);
|
|
|
+ } else if (step === 2) {
|
|
|
+ try {
|
|
|
+ if (freeConfigStr.trim()) JSON.parse(freeConfigStr);
|
|
|
+ } catch {
|
|
|
+ toast.error('自定义 Free Config JSON 格式错误');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setStep(3);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleSubmit = async () => {
|
|
|
+ const payload = buildPayload();
|
|
|
+ setSubmitting(true);
|
|
|
+ try {
|
|
|
+ const res = await nodeConfigService.create(entryType, payload);
|
|
|
+ if (res.code === 0) {
|
|
|
+ toast.success(`[${entryType.toUpperCase()}] 节点任务配置创建成功 (默认已停用)`);
|
|
|
+ onSuccess();
|
|
|
+ onClose();
|
|
|
+ } else {
|
|
|
+ toast.error(res.message || '创建失败');
|
|
|
+ }
|
|
|
+ } catch (err: any) {
|
|
|
+ console.error('Create node config error:', err);
|
|
|
+ const msg = err?.response?.data?.message || err.message || '创建异常';
|
|
|
+ toast.error(msg);
|
|
|
+ } finally {
|
|
|
+ setSubmitting(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ if (!isOpen) return null;
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-grayscale p-4 font-mono">
|
|
|
+ <div className="bg-neutral-50 border-2 border-black shadow-[8px_8px_0px_#000] w-full max-w-4xl max-h-[92vh] flex flex-col overflow-hidden animate-in zoom-in-95 duration-150">
|
|
|
+ {/* Header */}
|
|
|
+ <div className="px-5 py-3.5 border-b-2 border-black flex justify-between items-center bg-neutral-200 text-black select-none shrink-0">
|
|
|
+ <div className="flex items-center gap-2">
|
|
|
+ <span className="w-2.5 h-2.5 bg-amber-300 border border-black inline-block" />
|
|
|
+ <h3 className="font-black text-black text-xs md:text-sm uppercase tracking-wider">
|
|
|
+ [ CREATE {entryType.toUpperCase()} WIZARD // 新建{entryType.toUpperCase()}任务向导 ]
|
|
|
+ </h3>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Stepper Tabs */}
|
|
|
+ <div className="flex items-center gap-1">
|
|
|
+ {[
|
|
|
+ { num: 1, label: '01. 模板与标识' },
|
|
|
+ { num: 2, label: '02. 策略与参数' },
|
|
|
+ { num: 3, label: '03. 核对与提交' },
|
|
|
+ ].map((s) => (
|
|
|
+ <span
|
|
|
+ key={s.num}
|
|
|
+ className={`px-2 py-0.5 border border-black text-[11px] font-black uppercase ${
|
|
|
+ step === s.num
|
|
|
+ ? 'bg-amber-300 text-black shadow-[1px_1px_0px_#000]'
|
|
|
+ : step > s.num
|
|
|
+ ? 'bg-emerald-300 text-black'
|
|
|
+ : 'bg-white text-neutral-500'
|
|
|
+ }`}
|
|
|
+ >
|
|
|
+ {s.label}
|
|
|
+ </span>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={onClose}
|
|
|
+ className="w-6 h-6 bg-white hover:bg-amber-300 border border-black flex items-center justify-center font-black text-xs transition shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5"
|
|
|
+ >
|
|
|
+ ✕
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Wizard Body */}
|
|
|
+ <div className="flex-1 overflow-y-auto p-5 space-y-5 bg-white text-xs">
|
|
|
+ {/* STEP 1 */}
|
|
|
+ {step === 1 && (
|
|
|
+ <div className="space-y-5">
|
|
|
+ {/* Provider Selection */}
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center justify-between border-b-2 border-black pb-1.5">
|
|
|
+ <div className="flex items-center gap-2">
|
|
|
+ <span className="w-2 h-2 bg-amber-300 border border-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ PROVIDER TEMPLATE // 选择预设服务商模板 ]</span>
|
|
|
+ </div>
|
|
|
+ <span className="text-[11px] text-neutral-500">选择后将自动继承默认配置</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-3 items-center">
|
|
|
+ <select
|
|
|
+ value={selectedProviderName}
|
|
|
+ onChange={(e) => handleProviderSelect(e.target.value)}
|
|
|
+ disabled={loadingProviders}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-white text-xs font-bold text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ >
|
|
|
+ <option value="">-- 手动配置 (不继承模板) --</option>
|
|
|
+ {providers.map((p) => (
|
|
|
+ <option key={p.id || p.name} value={p.name}>
|
|
|
+ {p.name.toUpperCase()} (插件: {p.plugin_config?.plugin_name || '内置'})
|
|
|
+ </option>
|
|
|
+ ))}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ {selectedProviderName && (
|
|
|
+ <div className="text-[11px] font-black text-black bg-amber-300 border border-black px-2 py-1 shadow-[1px_1px_0px_#000] inline-block">
|
|
|
+ ✓ 已继承 [{selectedProviderName.toUpperCase()}] 模板参数
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Node Identity */}
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center gap-2 border-b-2 border-black pb-1.5">
|
|
|
+ <span className="w-2 h-2 bg-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ IDENTITY // 任务与节点标识 ]</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">
|
|
|
+ 目标节点唯一标识 (node_id) <span className="text-red-500">*</span>
|
|
|
+ </label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="node01"
|
|
|
+ value={nodeId}
|
|
|
+ onChange={(e) => setNodeId(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000] placeholder:text-neutral-400"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">
|
|
|
+ 任务唯一标识符 (identifier) <span className="text-red-500">*</span>
|
|
|
+ </label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="vfs.ie.nl"
|
|
|
+ value={identifier}
|
|
|
+ onChange={(e) => setIdentifier(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000] placeholder:text-neutral-400"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="md:col-span-2">
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">使馆/登录网址 (website)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="https://visa.vfsglobal.com/..."
|
|
|
+ value={website}
|
|
|
+ onChange={(e) => setWebsite(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000] placeholder:text-neutral-400"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Standalone special */}
|
|
|
+ {entryType === 'standalone' && (
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center gap-2 border-b-2 border-black pb-1.5">
|
|
|
+ <span className="w-2 h-2 bg-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ STANDALONE CREDENTIALS // 订单与账号凭证 ]</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">关联订单号 (order_id)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="ORD-20260823-001"
|
|
|
+ value={orderId}
|
|
|
+ onChange={(e) => setOrderId(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">抢签账号 (username)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="user@example.com"
|
|
|
+ value={accountUsername}
|
|
|
+ onChange={(e) => setAccountUsername(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">抢签密码 (password)</label>
|
|
|
+ <input
|
|
|
+ type="password"
|
|
|
+ placeholder="••••••••"
|
|
|
+ value={accountPassword}
|
|
|
+ onChange={(e) => setAccountPassword(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* STEP 2 */}
|
|
|
+ {step === 2 && (
|
|
|
+ <div className="space-y-5">
|
|
|
+ {/* Booker fields */}
|
|
|
+ {entryType === 'booker' && (
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center gap-2 border-b-2 border-black pb-1.5">
|
|
|
+ <span className="w-2 h-2 bg-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ BOOKER PARAMS // 占位调度与池参数 ]</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">使馆账号池 ID (account_pool_id)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ value={bookerAccountPoolId}
|
|
|
+ onChange={(e) => setBookerAccountPoolId(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">目标并发实例 (target_instances)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ min={1}
|
|
|
+ value={bookerTargetInstances}
|
|
|
+ onChange={(e) => setBookerTargetInstances(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">账号冷却 (account_cd / 秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={bookerAccountCd}
|
|
|
+ onChange={(e) => setBookerAccountCd(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">下单间隔冷却 (booking_cooldown / 秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={bookerCooldown}
|
|
|
+ onChange={(e) => setBookerCooldown(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">单号最大占位次数</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={bookerMaxBookings}
|
|
|
+ onChange={(e) => setBookerMaxBookings(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">代理冷却时间 (proxy_cd / 秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={proxyCd}
|
|
|
+ onChange={(e) => setProxyCd(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className="md:col-span-2">
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">网络代理池标签列表 (proxy_pool, 逗号分隔)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ value={proxyPoolStr}
|
|
|
+ onChange={(e) => setProxyPoolStr(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">Session 最长存活 (秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={sessionMaxLife}
|
|
|
+ onChange={(e) => setSessionMaxLife(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Sentinel fields */}
|
|
|
+ {entryType === 'sentinel' && (
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center gap-2 border-b-2 border-black pb-1.5">
|
|
|
+ <span className="w-2 h-2 bg-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ SENTINEL PARAMS // 监控与等待策略 ]</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">使馆账号池 ID (account_pool_id)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ value={sentinelAccountPoolId}
|
|
|
+ onChange={(e) => setSentinelAccountPoolId(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">监控并发实例数</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ min={1}
|
|
|
+ value={sentinelTargetInstances}
|
|
|
+ onChange={(e) => setSentinelTargetInstances(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">放位信号 TTL 持续 (秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={sentinelSignalTtl}
|
|
|
+ onChange={(e) => setSentinelSignalTtl(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">扫位轮询模式 (query_wait.mode)</label>
|
|
|
+ <select
|
|
|
+ value={queryWaitMode}
|
|
|
+ onChange={(e) => setQueryWaitMode(e.target.value as any)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 text-xs font-bold text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ >
|
|
|
+ <option value="Random">Random (随机等待)</option>
|
|
|
+ <option value="Fixed">Fixed (固定等待)</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {queryWaitMode === 'Fixed' ? (
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">固定等待 (秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={fixedWait}
|
|
|
+ onChange={(e) => setFixedWait(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ <>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">随机最小等待 (秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={randomMin}
|
|
|
+ onChange={(e) => setRandomMin(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">随机最大等待 (秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={randomMax}
|
|
|
+ onChange={(e) => setRandomMax(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Standalone fields */}
|
|
|
+ {entryType === 'standalone' && (
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center gap-2 border-b-2 border-black pb-1.5">
|
|
|
+ <span className="w-2 h-2 bg-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ STANDALONE PARAMS // 偏好与轮询策略 ]</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">登录重试间隔 (秒)</label>
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ value={loginInterval}
|
|
|
+ onChange={(e) => setLoginInterval(Number(e.target.value))}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">期望最早日期 (start_date)</label>
|
|
|
+ <input
|
|
|
+ type="date"
|
|
|
+ value={expectedStartDate}
|
|
|
+ onChange={(e) => setExpectedStartDate(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">期望最晚日期 (end_date)</label>
|
|
|
+ <input
|
|
|
+ type="date"
|
|
|
+ value={expectedEndDate}
|
|
|
+ onChange={(e) => setExpectedEndDate(e.target.value)}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Appointment Types */}
|
|
|
+ <AppointmentTypeEditor
|
|
|
+ items={appointmentTypes}
|
|
|
+ onChange={setAppointmentTypes}
|
|
|
+ />
|
|
|
+
|
|
|
+ {/* Plugin & Free Config */}
|
|
|
+ <div className="border-2 border-black bg-neutral-100 p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
+ <div className="flex items-center gap-2 border-b-2 border-black pb-1.5">
|
|
|
+ <span className="w-2 h-2 bg-black inline-block" />
|
|
|
+ <span className="font-black text-black uppercase">[ EXTENSION // 插件与自由键值配置 ]</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">插件名称 (plugin_name)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ value={pluginConfig.plugin_name || ''}
|
|
|
+ onChange={(e) => setPluginConfig({ ...pluginConfig, plugin_name: e.target.value })}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">二进制脚本 (plugin_bin)</label>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ value={pluginConfig.plugin_bin || ''}
|
|
|
+ onChange={(e) => setPluginConfig({ ...pluginConfig, plugin_bin: e.target.value })}
|
|
|
+ className="w-full px-3 py-2 border-2 border-black bg-neutral-50 focus:bg-white text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <label className="block text-[11px] font-bold text-black mb-1">
|
|
|
+ 自定义扩展 JSON (free_config)
|
|
|
+ </label>
|
|
|
+ <textarea
|
|
|
+ rows={3}
|
|
|
+ value={freeConfigStr}
|
|
|
+ onChange={(e) => setFreeConfigStr(e.target.value)}
|
|
|
+ className="w-full p-2.5 font-mono text-xs leading-relaxed outline-none bg-neutral-900 text-neutral-100 border-2 border-black shadow-[2px_2px_0px_#000]"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* STEP 3 */}
|
|
|
+ {step === 3 && (
|
|
|
+ <div className="space-y-5">
|
|
|
+ {/* Notice Stamp */}
|
|
|
+ <div className="p-3 bg-amber-100 border-2 border-black shadow-[2px_2px_0px_#000] text-black font-bold text-xs leading-relaxed">
|
|
|
+ ⚠️ [ 落库安全提示 ]:新建的节点任务配置将一律以 <span className="bg-rose-200 border border-black px-1 py-0.2 font-black">[ 已停用 (enable: 0) ]</span> 状态落库。创建成功后可在列表中核实并随时开启。
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Summary Cards */}
|
|
|
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
+ <div className="p-4 bg-neutral-100 border-2 border-black shadow-[2px_2px_0px_#000] space-y-2 text-xs">
|
|
|
+ <div className="font-black text-black border-b-2 border-black pb-1 uppercase">[ 基础信息核对 ]</div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">目标节点:</span>
|
|
|
+ <span className="font-bold text-black">{nodeId}</span>
|
|
|
+ </div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">任务标识:</span>
|
|
|
+ <span className="font-black text-black">{identifier}</span>
|
|
|
+ </div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">角色类型:</span>
|
|
|
+ <span className="font-bold text-black uppercase">{entryType}</span>
|
|
|
+ </div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">规则数量:</span>
|
|
|
+ <span className="font-bold text-black">{appointmentTypes.length} 条</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="p-4 bg-neutral-100 border-2 border-black shadow-[2px_2px_0px_#000] space-y-2 text-xs">
|
|
|
+ <div className="font-black text-black border-b-2 border-black pb-1 uppercase">[ 插件与继承模板 ]</div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">继承模板:</span>
|
|
|
+ <span className="font-bold text-black">{selectedProviderName || '无'}</span>
|
|
|
+ </div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">插件名:</span>
|
|
|
+ <span className="font-bold text-black">{pluginConfig.plugin_name || '默认'}</span>
|
|
|
+ </div>
|
|
|
+ <div className="flex justify-between">
|
|
|
+ <span className="text-neutral-600">脚本文件:</span>
|
|
|
+ <span className="font-bold text-black">{pluginConfig.plugin_bin || '-'}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* JSON Terminal Preview */}
|
|
|
+ <div className="space-y-1">
|
|
|
+ <div className="text-[11px] font-black text-black uppercase">[ JSON TERMINAL // 最终提交负载 ]</div>
|
|
|
+ <div className="border-2 border-black shadow-[4px_4px_0px_#000]">
|
|
|
+ <pre className="p-4 bg-neutral-900 text-amber-300 font-mono text-xs overflow-x-auto max-h-60 leading-relaxed">
|
|
|
+ {JSON.stringify(buildPayload(), null, 2)}
|
|
|
+ </pre>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Footer */}
|
|
|
+ <div className="px-5 py-3 bg-neutral-200 border-t-2 border-black flex justify-between items-center shrink-0">
|
|
|
+ <div>
|
|
|
+ {step > 1 && (
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => setStep((prev) => (prev - 1) as any)}
|
|
|
+ className="px-4 py-1.5 bg-white hover:bg-neutral-100 text-black border-2 border-black text-xs font-bold uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition"
|
|
|
+ >
|
|
|
+ [ ← 上一步 ]
|
|
|
+ </button>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="flex items-center gap-2">
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={onClose}
|
|
|
+ className="px-4 py-1.5 bg-white hover:bg-neutral-100 text-black border-2 border-black text-xs font-bold uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition"
|
|
|
+ >
|
|
|
+ [ 取消 ]
|
|
|
+ </button>
|
|
|
+
|
|
|
+ {step < 3 ? (
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={handleNext}
|
|
|
+ className="px-5 py-1.5 bg-amber-300 hover:bg-amber-400 text-black border-2 border-black text-xs font-black uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition"
|
|
|
+ >
|
|
|
+ [ 下一步 → ]
|
|
|
+ </button>
|
|
|
+ ) : (
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={handleSubmit}
|
|
|
+ disabled={submitting}
|
|
|
+ className="px-5 py-1.5 bg-emerald-300 hover:bg-emerald-400 text-black border-2 border-black text-xs font-black uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition disabled:opacity-50"
|
|
|
+ >
|
|
|
+ {submitting ? '[ 提交中... ]' : '[ 确认提交落库 ]'}
|
|
|
+ </button>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+}
|