949 lines
27 KiB
Vue
949 lines
27 KiB
Vue
<script setup lang="ts">
|
||
import { ref } from 'vue'
|
||
import { useSettings, type RetryStage } from '@/composables/useSettings'
|
||
import { useToast } from '@/composables/useToast'
|
||
import { TestProxy, FetchProxy } from '@wails/go/app/App'
|
||
|
||
const { settings, loadSettings, saveSettings } = useSettings()
|
||
const { showToast } = useToast()
|
||
|
||
const visible = ref(false)
|
||
const formData = ref({
|
||
timeApiUrl: '',
|
||
activity: '',
|
||
traceEnabled: false,
|
||
traceMaxBody: 0,
|
||
logLevel: 'info',
|
||
concurrency: 150,
|
||
attempts: 2,
|
||
retryStages: [] as RetryStage[],
|
||
seckillMode: 1,
|
||
xiaodianPageSize: 200,
|
||
proxyEnabled: false,
|
||
proxyUrl: '',
|
||
proxyApi: '',
|
||
autoFetchProxyOnSchedule: false,
|
||
accountsPerProxy: 5,
|
||
proxyAutoWhitelist: false,
|
||
proxyWhitelistReplace: true,
|
||
proxyWhitelistPassword: '',
|
||
proxyWhitelistSignKey: ''
|
||
})
|
||
|
||
const testingProxy = ref(false)
|
||
const testProxyResult = ref<{ success?: boolean; text?: string; error?: string } | null>(null)
|
||
const fetchingProxy = ref(false)
|
||
|
||
const handleTestProxy = async () => {
|
||
const target = formData.value.proxyUrl.trim()
|
||
if (!target) {
|
||
testProxyResult.value = { success: false, error: '请先输入代理地址' }
|
||
return
|
||
}
|
||
testingProxy.value = true
|
||
testProxyResult.value = null
|
||
try {
|
||
const res = await TestProxy(target)
|
||
if (res.success) {
|
||
testProxyResult.value = {
|
||
success: true,
|
||
text: `连通正常 | 出口 IP: ${res.ip}${res.region ? ' (' + res.region + ')' : ''} | 往返延迟: ${res.latency}ms`
|
||
}
|
||
} else {
|
||
testProxyResult.value = {
|
||
success: false,
|
||
error: res.error || '测试连接失败'
|
||
}
|
||
}
|
||
} catch (e: any) {
|
||
testProxyResult.value = {
|
||
success: false,
|
||
error: e.message || String(e)
|
||
}
|
||
} finally {
|
||
testingProxy.value = false
|
||
}
|
||
}
|
||
|
||
const handleFetchProxy = async () => {
|
||
const api = formData.value.proxyApi.trim()
|
||
if (!api) {
|
||
showToast('提取失败', '请先填写代理提取 API 链接', 'error')
|
||
return
|
||
}
|
||
fetchingProxy.value = true
|
||
testProxyResult.value = null
|
||
try {
|
||
const res = await FetchProxy(api)
|
||
if (res.success && res.proxyUrl) {
|
||
formData.value.proxyUrl = res.proxyUrl
|
||
formData.value.proxyEnabled = true
|
||
const expires = res.expiresAt
|
||
? new Date(res.expiresAt).toLocaleString()
|
||
: '未知'
|
||
showToast(
|
||
'提取成功',
|
||
`已获取代理: ${res.proxyUrl}${res.provider ? ' [' + res.provider + ']' : ''} (${res.region || ''},过期 ${expires})`,
|
||
'success'
|
||
)
|
||
// 自动触发一次连通性测速
|
||
handleTestProxy()
|
||
} else {
|
||
showToast('提取失败', res.error || '未能提取到有效代理', 'error')
|
||
}
|
||
} catch (e: any) {
|
||
showToast('提取失败', e.message || String(e), 'error')
|
||
} finally {
|
||
fetchingProxy.value = false
|
||
}
|
||
}
|
||
|
||
const open = async () => {
|
||
await loadSettings()
|
||
formData.value = {
|
||
...settings.value,
|
||
retryStages: settings.value.retryStages.map(s => ({ ...s }))
|
||
}
|
||
testProxyResult.value = null
|
||
visible.value = true
|
||
}
|
||
|
||
const close = () => {
|
||
visible.value = false
|
||
}
|
||
|
||
const handleSave = async () => {
|
||
const success = await saveSettings(formData.value)
|
||
if (success) {
|
||
close()
|
||
}
|
||
}
|
||
|
||
const addStage = () => {
|
||
const lastStage = formData.value.retryStages[formData.value.retryStages.length - 1]
|
||
const newMaxElapsed = lastStage ? lastStage.maxElapsed + 10 : 30
|
||
formData.value.retryStages.push({
|
||
maxElapsed: newMaxElapsed,
|
||
interval: 500
|
||
})
|
||
}
|
||
|
||
const removeStage = (index: number) => {
|
||
formData.value.retryStages.splice(index, 1)
|
||
}
|
||
|
||
// 暴露给父组件
|
||
defineExpose({ open, close })
|
||
</script>
|
||
|
||
<template>
|
||
<Teleport to="body">
|
||
<Transition name="modal">
|
||
<div v-if="visible" class="modal-overlay" @click.self="close">
|
||
<div class="modal">
|
||
<div class="modal-header">
|
||
<h3>⚙ 设置</h3>
|
||
<button class="modal-close" @click="close">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 时间 API -->
|
||
<div class="form-group">
|
||
<label class="form-label">时间 API 地址</label>
|
||
<input
|
||
v-model="formData.timeApiUrl"
|
||
class="form-input"
|
||
type="text"
|
||
placeholder="留空使用默认地址"
|
||
>
|
||
<div class="form-hint">用于获取斗鱼服务端时间,一般不需要修改</div>
|
||
</div>
|
||
|
||
<!-- 实例独立代理设置 (防多开 IP 限流/风控) -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">🌐 实例独立代理设置 (防多开 IP 限流)</div>
|
||
|
||
<div class="form-group">
|
||
<div class="toggle-row">
|
||
<div>
|
||
<span class="toggle-label">启用代理</span>
|
||
<div class="form-hint">开启后本实例所有请求(校准、预热、锁单、支付)均走该代理出口</div>
|
||
</div>
|
||
<label class="toggle">
|
||
<input v-model="formData.proxyEnabled" type="checkbox">
|
||
<span class="toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div v-if="formData.proxyEnabled" class="proxy-config-area">
|
||
<div class="form-group">
|
||
<label class="form-label">每个代理账号数</label>
|
||
<input
|
||
v-model.number="formData.accountsPerProxy"
|
||
class="form-input"
|
||
type="number"
|
||
min="1"
|
||
max="100"
|
||
step="1"
|
||
>
|
||
<div class="form-hint">
|
||
例如填 5:30 个账号会稳定分成 6 组,每组使用独立代理连接池;定时抢购会按组分别提取并校验代理。
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 静态/当前代理 -->
|
||
<div class="form-group">
|
||
<label class="form-label">当前代理地址 (IP:端口 或 隧道)</label>
|
||
<div class="input-with-button">
|
||
<input
|
||
v-model="formData.proxyUrl"
|
||
class="form-input"
|
||
type="text"
|
||
placeholder="例: http://115.230.134.174:40014 或 socks5://127.0.0.1:1080"
|
||
>
|
||
<button
|
||
type="button"
|
||
class="btn-action"
|
||
:disabled="testingProxy || !formData.proxyUrl"
|
||
@click="handleTestProxy"
|
||
>
|
||
<span v-if="testingProxy">测试中...</span>
|
||
<span v-else>⚡ 测试代理</span>
|
||
</button>
|
||
</div>
|
||
<div class="form-hint">支持 http、https、socks5(可带账号密码,格式: http://user:pass@ip:port)</div>
|
||
<!-- 测试结果展示 -->
|
||
<div v-if="testProxyResult" class="test-result-box" :class="testProxyResult.success ? 'success' : 'error'">
|
||
<span v-if="testProxyResult.success">✅ {{ testProxyResult.text }}</span>
|
||
<span v-else>❌ {{ testProxyResult.error }}</span>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 代理提取 API -->
|
||
<div class="form-group">
|
||
<label class="form-label">代理 API 提取链接 (品赞 / 通用动态 IP)</label>
|
||
<div class="input-with-button">
|
||
<input
|
||
v-model="formData.proxyApi"
|
||
class="form-input"
|
||
type="text"
|
||
placeholder="粘贴品赞 core-extract 或其它代理平台提取 URL"
|
||
>
|
||
<button
|
||
type="button"
|
||
class="btn-action primary"
|
||
:disabled="fetchingProxy || !formData.proxyApi"
|
||
@click="handleFetchProxy"
|
||
>
|
||
<span v-if="fetchingProxy">提取中...</span>
|
||
<span v-else>🔄 提取并填入</span>
|
||
</button>
|
||
</div>
|
||
<div class="form-hint">
|
||
品赞会自动识别并请求当前分组所需数量;账号密码模式请生成带 mode=auth 的 API,账号密码会写入代理 URL。注意:账号密码授权仍需先将执行提取的本机 IP 加入品赞白名单,白名单只用于提取 API。
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 定时抢购前自动拉取最新代理 -->
|
||
<div class="form-group">
|
||
<label class="checkbox-row">
|
||
<input v-model="formData.autoFetchProxyOnSchedule" type="checkbox">
|
||
<span class="checkbox-text">定时任务触发前 30 秒自动提取并校验分组 IP</span>
|
||
</label>
|
||
<div class="form-hint">
|
||
按“每组账号数”提取对应数量的代理,先测斗鱼时间接口再启用;建议使用 10 分钟以上时长,覆盖抢购与最长 180 秒支付。
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="checkbox-row">
|
||
<input v-model="formData.proxyAutoWhitelist" type="checkbox">
|
||
<span class="checkbox-text">提取前自动添加本机公网 IP 白名单</span>
|
||
</label>
|
||
<div class="form-hint">
|
||
先探测一次提取,从品赞返回中读取它实际看到的来源 IP,再自动校验/添加白名单;需要填写品赞登录密码和账号安全页的签名密钥。
|
||
</div>
|
||
</div>
|
||
|
||
<template v-if="formData.proxyAutoWhitelist">
|
||
<div class="form-group">
|
||
<label class="form-label">品赞登录密码</label>
|
||
<input
|
||
v-model="formData.proxyWhitelistPassword"
|
||
class="form-input"
|
||
type="password"
|
||
autocomplete="off"
|
||
placeholder="仅用于本地生成白名单签名"
|
||
>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="form-label">白名单 AES 签名密钥</label>
|
||
<input
|
||
v-model="formData.proxyWhitelistSignKey"
|
||
class="form-input"
|
||
type="password"
|
||
autocomplete="off"
|
||
placeholder="品赞账号安全页显示的签名密钥"
|
||
>
|
||
<div class="form-hint">密钥保存在本实例配置中,不会写入日志。</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="checkbox-row">
|
||
<input v-model="formData.proxyWhitelistReplace" type="checkbox">
|
||
<span class="checkbox-text">白名单已满时替换最早添加的 IP</span>
|
||
</label>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 和平小店参数 -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">和平小店商品列表</div>
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label class="form-label">每页商品数</label>
|
||
<input v-model.number="formData.xiaodianPageSize" class="form-input" type="number" min="1" max="200" step="1">
|
||
<div class="form-hint">角色信息从账号 Cookie 自动获取,接口上限 200</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 日志设置 -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">日志设置</div>
|
||
|
||
<div class="form-group">
|
||
<div class="toggle-row">
|
||
<div>
|
||
<span class="toggle-label">Trace 日志</span>
|
||
<div class="form-hint">开启后会在 logs/ 目录生成 douyu_trace_*.log</div>
|
||
</div>
|
||
<label class="toggle">
|
||
<input v-model="formData.traceEnabled" type="checkbox">
|
||
<span class="toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label class="form-label">Trace 正文上限</label>
|
||
<div class="input-with-unit">
|
||
<input
|
||
v-model.number="formData.traceMaxBody"
|
||
class="form-input"
|
||
type="number"
|
||
min="0"
|
||
step="1024"
|
||
placeholder="0"
|
||
>
|
||
<span class="input-unit">字节</span>
|
||
</div>
|
||
<div class="form-hint">0 表示不限制</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="form-label">日志显示等级</label>
|
||
<select v-model="formData.logLevel" class="form-select">
|
||
<option value="debug">Debug</option>
|
||
<option value="info">Info</option>
|
||
<option value="warn">Warn</option>
|
||
<option value="error">Error</option>
|
||
</select>
|
||
<div class="form-hint">
|
||
Info 起只显示关键日志;需要看每个请求的耗时与错误码时切到 Debug
|
||
(抢购任务结束时仍会输出各类接口的<strong>聚合统计</strong>)
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 抢购设置 -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">抢购设置</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label class="form-label">并发数</label>
|
||
<input
|
||
v-model.number="formData.concurrency"
|
||
class="form-input"
|
||
type="number"
|
||
min="1"
|
||
max="500"
|
||
step="10"
|
||
>
|
||
<div class="form-hint">同时发起的请求数量,建议 50-200</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="form-label">小店抢购次数</label>
|
||
<input
|
||
v-model.number="formData.attempts"
|
||
class="form-input"
|
||
type="number"
|
||
min="1"
|
||
max="10"
|
||
step="1"
|
||
>
|
||
<div class="form-hint">
|
||
仅用于和平小店(作为次数缺省值)。精英/电竞手册按抢购窗口自动重试,不受此项影响
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 抢购模式 -->
|
||
<div class="form-group">
|
||
<label class="form-label">抢购模式</label>
|
||
<select v-model.number="formData.seckillMode" class="form-select">
|
||
<option :value="0">标准模式(电竞手册每次重新取鉴权)</option>
|
||
<option :value="1">激进模式(电竞手册复用鉴权)</option>
|
||
</select>
|
||
<div class="form-hint">
|
||
<template v-if="formData.seckillMode === 0">
|
||
精英手册固定为锁单后再支付,不查商品状态。电竞手册每次重新取鉴权后直接兑换。
|
||
</template>
|
||
<template v-else>
|
||
精英手册与标准模式相同。电竞手册复用已有鉴权直接兑换,失效后再取一次。
|
||
</template>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 重试间隔配置 -->
|
||
<div class="form-group">
|
||
<label class="form-label">重试间隔策略</label>
|
||
<div class="retry-stages">
|
||
<div
|
||
v-for="(stage, index) in formData.retryStages"
|
||
:key="index"
|
||
class="retry-stage-row"
|
||
>
|
||
<span class="stage-label">阶段{{ index + 1 }}:</span>
|
||
<div class="stage-inputs">
|
||
<div class="stage-input-group">
|
||
<input
|
||
v-model.number="stage.maxElapsed"
|
||
class="form-input stage-input"
|
||
type="number"
|
||
min="1"
|
||
max="75"
|
||
step="1"
|
||
>
|
||
<span class="input-unit">秒内</span>
|
||
</div>
|
||
<span class="stage-separator">→</span>
|
||
<div class="stage-input-group">
|
||
<input
|
||
v-model.number="stage.interval"
|
||
class="form-input stage-input"
|
||
type="number"
|
||
min="50"
|
||
max="5000"
|
||
step="10"
|
||
>
|
||
<span class="input-unit">ms</span>
|
||
</div>
|
||
</div>
|
||
<button
|
||
class="btn-icon btn-remove"
|
||
title="删除阶段"
|
||
@click="removeStage(index)"
|
||
>
|
||
×
|
||
</button>
|
||
</div>
|
||
<button class="btn btn-ghost btn-sm btn-add-stage" @click="addStage">
|
||
+ 添加阶段
|
||
</button>
|
||
</div>
|
||
<div class="form-hint">
|
||
按经过秒数从小到大排列,控制精英/电竞手册的<strong>锁单</strong>重试节奏;
|
||
同一账号连续失败会在此基础上成倍放大,但<strong>任何一次等待都不超过约 2 秒</strong>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="info-card">
|
||
<div class="info-title">💡 抢购策略说明</div>
|
||
<ul class="info-list">
|
||
<li>抢购窗口:<strong>75 秒</strong>;窗口内每个账号各自独立重试,互不阻塞</li>
|
||
<li>默认:阶段 2 为 200ms,阶段 3 为 500ms,其余阶段 1000ms</li>
|
||
<li><strong>锁单优先</strong>:锁到即占住库存;支付晚几秒无损失,所以支付重试刻意放缓</li>
|
||
<li>已锁单的订单即使窗口结束也会把<strong>支付</strong>重试完(最长 180 秒)</li>
|
||
<li>首发请求:第一个账号立即发出,其余按几毫秒步长错开,整批不超过 0.3 秒</li>
|
||
<li>抢购成功后自动核对积分余额:与<strong>导入账号时记录的基线</strong>比对,扣了多少分即确认兑换真的发生</li>
|
||
<li>"活动火爆/网络繁忙"是请求级限流(同一秒别的账号仍能锁单),会继续重试</li>
|
||
<li>"库存已耗完"也不提前停止:别人锁单未支付时库存会回流,会降频探测到窗口结束</li>
|
||
</ul>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-ghost" @click="close">取消</button>
|
||
<button class="btn btn-primary" @click="handleSave">保存</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</Transition>
|
||
</Teleport>
|
||
</template>
|
||
|
||
<style scoped>
|
||
.modal-overlay {
|
||
position: fixed;
|
||
inset: 0;
|
||
background: rgba(0, 0, 0, .5);
|
||
z-index: 9000;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
backdrop-filter: blur(4px);
|
||
}
|
||
|
||
.modal {
|
||
background: var(--surface);
|
||
border: 1px solid var(--line);
|
||
border-radius: var(--radius);
|
||
width: 520px;
|
||
max-width: 92vw;
|
||
max-height: 85vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
box-shadow: var(--shadow);
|
||
}
|
||
|
||
.modal-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 16px 20px;
|
||
border-bottom: 1px solid var(--line);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.modal-header h3 {
|
||
font-size: 16px;
|
||
font-weight: 600;
|
||
color: var(--text-strong);
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.modal-close {
|
||
width: 32px;
|
||
height: 32px;
|
||
border: 0;
|
||
border-radius: var(--radius-sm);
|
||
background: transparent;
|
||
color: var(--muted);
|
||
cursor: pointer;
|
||
font-size: 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: .15s;
|
||
}
|
||
|
||
.modal-close:hover {
|
||
background: var(--surface-2);
|
||
color: var(--text-strong);
|
||
}
|
||
|
||
.modal-body {
|
||
padding: 20px;
|
||
overflow-y: auto;
|
||
min-height: 0;
|
||
}
|
||
|
||
.form-section {
|
||
margin-top: 20px;
|
||
padding-top: 16px;
|
||
border-top: 1px solid var(--line);
|
||
}
|
||
|
||
.form-section-title {
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--text-strong);
|
||
margin-bottom: 14px;
|
||
}
|
||
|
||
.form-group {
|
||
margin-bottom: 16px;
|
||
}
|
||
|
||
.form-group:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.form-label {
|
||
display: block;
|
||
font-size: 12.5px;
|
||
font-weight: 500;
|
||
color: var(--text);
|
||
margin-bottom: 6px;
|
||
}
|
||
|
||
.form-hint {
|
||
font-size: 11px;
|
||
color: var(--muted);
|
||
margin-top: 4px;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.form-row {
|
||
display: flex;
|
||
gap: 16px;
|
||
}
|
||
|
||
.form-row .form-group {
|
||
flex: 1;
|
||
}
|
||
|
||
.form-input, .form-select {
|
||
width: 100%;
|
||
height: 36px;
|
||
padding: 0 12px;
|
||
background: var(--field);
|
||
color: var(--text-strong);
|
||
border: 1px solid var(--line);
|
||
border-radius: var(--radius-sm);
|
||
font-size: 13px;
|
||
transition: .15s;
|
||
}
|
||
|
||
.form-input:focus, .form-select:focus {
|
||
outline: 0;
|
||
border-color: var(--accent);
|
||
box-shadow: var(--focus);
|
||
}
|
||
|
||
.input-with-unit {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.input-with-unit .form-input {
|
||
flex: 1;
|
||
}
|
||
|
||
.input-unit {
|
||
font-size: 12px;
|
||
color: var(--muted);
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.toggle-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
}
|
||
|
||
.toggle-label {
|
||
font-size: 13px;
|
||
color: var(--text-strong);
|
||
font-weight: 500;
|
||
}
|
||
|
||
.toggle {
|
||
position: relative;
|
||
width: 44px;
|
||
height: 24px;
|
||
cursor: pointer;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.toggle input {
|
||
opacity: 0;
|
||
width: 0;
|
||
height: 0;
|
||
}
|
||
|
||
.toggle-slider {
|
||
position: absolute;
|
||
inset: 0;
|
||
background: var(--line-strong);
|
||
border-radius: 999px;
|
||
transition: .2s;
|
||
}
|
||
|
||
.toggle-slider::before {
|
||
content: "";
|
||
position: absolute;
|
||
left: 2px;
|
||
top: 2px;
|
||
width: 20px;
|
||
height: 20px;
|
||
background: #fff;
|
||
border-radius: 50%;
|
||
transition: .2s;
|
||
}
|
||
|
||
.toggle input:checked + .toggle-slider {
|
||
background: var(--accent);
|
||
}
|
||
|
||
.toggle input:checked + .toggle-slider::before {
|
||
transform: translateX(20px);
|
||
}
|
||
|
||
.modal-footer {
|
||
padding: 16px 20px;
|
||
border-top: 1px solid var(--line);
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 10px;
|
||
background: var(--surface);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.info-card {
|
||
margin-top: 16px;
|
||
padding: 14px;
|
||
background: var(--accent-soft);
|
||
border: 1px solid var(--accent-border);
|
||
border-radius: var(--radius-sm);
|
||
}
|
||
|
||
.info-card-warn {
|
||
background: var(--warning-soft);
|
||
border-color: var(--warning);
|
||
}
|
||
|
||
.info-card-warn .info-title {
|
||
color: var(--warning);
|
||
}
|
||
|
||
.info-title {
|
||
font-size: 12.5px;
|
||
font-weight: 600;
|
||
color: var(--accent);
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.info-list {
|
||
margin: 0;
|
||
padding-left: 18px;
|
||
font-size: 12px;
|
||
color: var(--text);
|
||
line-height: 1.8;
|
||
}
|
||
|
||
.info-list li {
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.info-list li:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.info-list strong {
|
||
color: var(--text-strong);
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 重试阶段配置 */
|
||
.retry-stages {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
margin-top: 8px;
|
||
}
|
||
|
||
.retry-stage-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 10px 12px;
|
||
background: var(--field);
|
||
border: 1px solid var(--line);
|
||
border-radius: var(--radius-sm);
|
||
}
|
||
|
||
.stage-label {
|
||
font-size: 12px;
|
||
color: var(--muted);
|
||
white-space: nowrap;
|
||
min-width: 42px;
|
||
}
|
||
|
||
.stage-inputs {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
flex: 1;
|
||
}
|
||
|
||
.stage-input-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.stage-input {
|
||
width: 70px !important;
|
||
text-align: center;
|
||
}
|
||
|
||
.stage-separator {
|
||
color: var(--muted);
|
||
font-size: 14px;
|
||
}
|
||
|
||
.btn-icon {
|
||
width: 28px;
|
||
height: 28px;
|
||
border: none;
|
||
border-radius: var(--radius-sm);
|
||
background: transparent;
|
||
color: var(--muted);
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 18px;
|
||
transition: .15s;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.btn-remove:hover {
|
||
background: var(--danger-soft, #fef2f2);
|
||
color: var(--danger, #ef4444);
|
||
}
|
||
|
||
.btn-add-stage {
|
||
align-self: flex-start;
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.btn-sm {
|
||
height: 32px;
|
||
padding: 0 12px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.input-with-button {
|
||
display: flex;
|
||
gap: 8px;
|
||
align-items: center;
|
||
}
|
||
|
||
.input-with-button .form-input {
|
||
flex: 1;
|
||
}
|
||
|
||
.btn-action {
|
||
height: 36px;
|
||
padding: 0 14px;
|
||
background: var(--surface-2);
|
||
border: 1px solid var(--line);
|
||
border-radius: var(--radius-sm);
|
||
color: var(--text-strong);
|
||
font-size: 12.5px;
|
||
cursor: pointer;
|
||
white-space: nowrap;
|
||
transition: .15s;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.btn-action:hover:not(:disabled) {
|
||
background: var(--surface-3, rgba(255, 255, 255, 0.08));
|
||
border-color: var(--accent);
|
||
}
|
||
|
||
.btn-action.primary {
|
||
background: var(--accent);
|
||
color: #fff;
|
||
border-color: transparent;
|
||
}
|
||
|
||
.btn-action.primary:hover:not(:disabled) {
|
||
opacity: 0.9;
|
||
}
|
||
|
||
.btn-action:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
|
||
.test-result-box {
|
||
margin-top: 8px;
|
||
padding: 8px 12px;
|
||
border-radius: var(--radius-sm);
|
||
font-size: 12px;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.test-result-box.success {
|
||
background: rgba(34, 197, 94, 0.12);
|
||
color: #4ade80;
|
||
border: 1px solid rgba(34, 197, 94, 0.3);
|
||
}
|
||
|
||
.test-result-box.error {
|
||
background: rgba(239, 68, 68, 0.12);
|
||
color: #f87171;
|
||
border: 1px solid rgba(239, 68, 68, 0.3);
|
||
}
|
||
|
||
.checkbox-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.checkbox-row input[type="checkbox"] {
|
||
width: 16px;
|
||
height: 16px;
|
||
accent-color: var(--accent);
|
||
cursor: pointer;
|
||
}
|
||
|
||
.checkbox-text {
|
||
font-size: 13px;
|
||
color: var(--text-strong);
|
||
font-weight: 500;
|
||
}
|
||
|
||
.proxy-config-area {
|
||
margin-top: 14px;
|
||
padding: 14px;
|
||
background: rgba(255, 255, 255, 0.03);
|
||
border: 1px solid var(--line);
|
||
border-radius: var(--radius-sm);
|
||
}
|
||
|
||
/* 动画 */
|
||
.modal-enter-active {
|
||
transition: all .2s ease;
|
||
}
|
||
|
||
.modal-leave-active {
|
||
transition: all .2s ease;
|
||
}
|
||
|
||
.modal-enter-from {
|
||
opacity: 0;
|
||
}
|
||
|
||
.modal-leave-to {
|
||
opacity: 0;
|
||
}
|
||
|
||
.modal-enter-from .modal {
|
||
transform: scale(.95);
|
||
opacity: 0;
|
||
}
|
||
|
||
.modal-leave-to .modal {
|
||
transform: scale(.95);
|
||
opacity: 0;
|
||
}
|
||
</style>
|