mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-24 06:34:32 +08:00
【修复】表单初始化,申请节点随机时间
This commit is contained in:
@@ -33,6 +33,40 @@ export const useController = (props: FlowNodeProps = { type: 'quick', node: flow
|
||||
// 使用store获取所有需要的方法和状态
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const { startNodeSavedByUser } = useStore();
|
||||
|
||||
/**
|
||||
* 生成开始节点的随机时间
|
||||
* @param {any} childNode - 子节点配置
|
||||
* @returns {any} 处理后的子节点配置
|
||||
*/
|
||||
const generateStartNodeRandomTime = (childNode: any) => {
|
||||
// 检查是否是开始节点
|
||||
if (childNode.type === "start") {
|
||||
if (startNodeSavedByUser.value) {
|
||||
return childNode;
|
||||
}
|
||||
const config = childNode.config;
|
||||
const hasUserSetTime =
|
||||
config.hour !== undefined &&
|
||||
config.minute !== undefined &&
|
||||
!(config.hour === 1 && config.minute === 0);
|
||||
if (!hasUserSetTime) {
|
||||
const randomHour = Math.floor(Math.random() * 4) + 1;
|
||||
const randomMinute = Math.floor(Math.random() * 12) * 5;
|
||||
|
||||
return {
|
||||
...childNode,
|
||||
config: {
|
||||
...config,
|
||||
hour: randomHour,
|
||||
minute: randomMinute,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
return childNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存节点配置
|
||||
@@ -45,14 +79,16 @@ export const useController = (props: FlowNodeProps = { type: 'quick', node: flow
|
||||
if (res.valid && flowData.value.name) {
|
||||
const { active } = workflowData.value
|
||||
const { id, name, childNode } = flowData.value
|
||||
const { exec_type, ...exec_time } = childNode.config as unknown as StartNodeConfig
|
||||
const param = {
|
||||
name,
|
||||
active,
|
||||
content: JSON.stringify(childNode),
|
||||
exec_type,
|
||||
exec_time: JSON.stringify(exec_time || {}),
|
||||
}
|
||||
const processedChildNode = generateStartNodeRandomTime(childNode);
|
||||
const { exec_type, ...exec_time } =
|
||||
processedChildNode.config as unknown as StartNodeConfig;
|
||||
const param = {
|
||||
name,
|
||||
active,
|
||||
content: JSON.stringify(processedChildNode),
|
||||
exec_type,
|
||||
exec_time: JSON.stringify(exec_time || {}),
|
||||
};
|
||||
if (route.query.isEdit) {
|
||||
updateWorkflowData({ id, ...param })
|
||||
} else {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -478,6 +478,7 @@ export const useApiFormController = (
|
||||
btwaf: $t("t_0_1747271295174"),
|
||||
safeline: $t("t_0_1747300383756"),
|
||||
lecdn: "请输入正确的URL地址",
|
||||
webhook: "请输入回调地址",
|
||||
};
|
||||
return callback(
|
||||
new Error(mapTips[param.value.type as keyof typeof mapTips])
|
||||
|
||||
@@ -1,55 +1,62 @@
|
||||
import { defineComponent, onBeforeMount, onMounted, ref } from 'vue'
|
||||
import type { Component } from 'vue'
|
||||
|
||||
import FlowChart from '@components/FlowChart'
|
||||
import { useStore } from '@autoDeploy/children/workflowView/useStore'
|
||||
import { useController } from './useController'
|
||||
import FlowChart from "@components/FlowChart";
|
||||
import { useStore } from "@autoDeploy/children/workflowView/useStore";
|
||||
import { useController } from "./useController";
|
||||
import { useStore as useFlowStore } from "@components/FlowChart/useStore";
|
||||
/**
|
||||
* @description 工作流视图主组件,负责加载和渲染流程图。
|
||||
*/
|
||||
export default defineComponent({
|
||||
name: 'WorkflowView',
|
||||
setup() {
|
||||
const { init } = useController()
|
||||
const { workflowType, workDefalutNodeData, isEdit } = useStore()
|
||||
name: "WorkflowView",
|
||||
setup() {
|
||||
const { init } = useController();
|
||||
const { workflowType, workDefalutNodeData, isEdit } = useStore();
|
||||
const { resetStartNodeSavedState } = useFlowStore();
|
||||
|
||||
// 使用import.meta.glob一次性加载所有节点组件
|
||||
const modules = import.meta.glob('./node/*/index.tsx', { eager: true })
|
||||
// 使用import.meta.glob一次性加载所有节点组件
|
||||
const modules = import.meta.glob("./node/*/index.tsx", { eager: true });
|
||||
|
||||
// 创建节点组件映射
|
||||
const taskComponents = ref<Record<string, Component>>({})
|
||||
// 创建节点组件映射
|
||||
const taskComponents = ref<Record<string, Component>>({});
|
||||
|
||||
// 初始化任务组件映射
|
||||
const initTaskComponents = () => {
|
||||
const componentsMap: Record<string, Component> = {}
|
||||
// 获取文件夹名称(对应节点类型)并映射到组件
|
||||
Object.entries(modules).forEach(([path, module]) => {
|
||||
// 获取路径中的节点类型
|
||||
const match = path.match(/\/node\/([^/]+)\/index\.tsx$/)
|
||||
if (match && match[1]) {
|
||||
const nodeType = match[1]
|
||||
const componentKey = `${nodeType}Node`
|
||||
// @ts-ignore
|
||||
componentsMap[componentKey] = module.default || module
|
||||
}
|
||||
})
|
||||
taskComponents.value = componentsMap
|
||||
console.log('已加载节点组件:', Object.keys(componentsMap))
|
||||
}
|
||||
// 初始化任务组件映射
|
||||
const initTaskComponents = () => {
|
||||
const componentsMap: Record<string, Component> = {};
|
||||
// 获取文件夹名称(对应节点类型)并映射到组件
|
||||
Object.entries(modules).forEach(([path, module]) => {
|
||||
// 获取路径中的节点类型
|
||||
const match = path.match(/\/node\/([^/]+)\/index\.tsx$/);
|
||||
if (match && match[1]) {
|
||||
const nodeType = match[1];
|
||||
const componentKey = `${nodeType}Node`;
|
||||
// @ts-ignore
|
||||
componentsMap[componentKey] = module.default || module;
|
||||
}
|
||||
});
|
||||
taskComponents.value = componentsMap;
|
||||
console.log("已加载节点组件:", Object.keys(componentsMap));
|
||||
};
|
||||
|
||||
// 初始化组件
|
||||
onBeforeMount(initTaskComponents)
|
||||
// 初始化组件
|
||||
onBeforeMount(initTaskComponents);
|
||||
|
||||
// 初始化数据
|
||||
onMounted(init)
|
||||
// 初始化数据
|
||||
onMounted(init);
|
||||
|
||||
return () => (
|
||||
<FlowChart
|
||||
type={workflowType.value}
|
||||
node={workDefalutNodeData.value}
|
||||
isEdit={isEdit.value}
|
||||
taskComponents={taskComponents.value}
|
||||
/>
|
||||
)
|
||||
},
|
||||
})
|
||||
// 组件销毁时重置开始节点保存状态
|
||||
onUnmounted(() => {
|
||||
resetStartNodeSavedState();
|
||||
});
|
||||
|
||||
return () => (
|
||||
<FlowChart
|
||||
type={workflowType.value}
|
||||
node={workDefalutNodeData.value}
|
||||
isEdit={isEdit.value}
|
||||
taskComponents={taskComponents.value}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -53,467 +53,548 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const { updateNodeConfig, advancedOptions, isRefreshNode } = useStore()
|
||||
// 获取路由信息
|
||||
const route = useRoute()
|
||||
// 弹窗辅助
|
||||
const { confirm } = useModalHooks()
|
||||
// 获取表单助手函数
|
||||
const { useFormInput, useFormSelect, useFormMore, useFormHelp, useFormSwitch } = useFormHooks()
|
||||
// 表单参数
|
||||
const param = ref(deepClone(props.node.config))
|
||||
const { updateNodeConfig, advancedOptions, isRefreshNode } = useStore();
|
||||
// 获取路由信息
|
||||
const route = useRoute();
|
||||
// 弹窗辅助
|
||||
const { confirm } = useModalHooks();
|
||||
// 获取表单助手函数
|
||||
const {
|
||||
useFormInput,
|
||||
useFormSelect,
|
||||
useFormMore,
|
||||
useFormHelp,
|
||||
useFormSwitch,
|
||||
} = useFormHooks();
|
||||
// 表单参数
|
||||
const param = ref(deepClone(props.node.config));
|
||||
|
||||
// 获取路由参数
|
||||
const isEdit = computed(() => route.query.isEdit === 'true')
|
||||
const routeEmail = computed(() => (route.query.email as string) || '')
|
||||
// 获取路由参数
|
||||
const isEdit = computed(() => route.query.isEdit === "true");
|
||||
const routeEmail = computed(() => (route.query.email as string) || "");
|
||||
|
||||
// CA选项状态
|
||||
const caOptions = ref<Array<{ label: string; value: string; icon: string }>>([])
|
||||
const emailOptions = ref<string[]>([])
|
||||
const isLoadingCA = ref(false)
|
||||
const isLoadingEmails = ref(false)
|
||||
const showEmailDropdown = ref(false)
|
||||
const emailInputRef = ref<InstanceType<typeof NInput> | null>(null)
|
||||
// CA选项状态
|
||||
const caOptions = ref<
|
||||
Array<{ label: string; value: string; icon: string }>
|
||||
>([]);
|
||||
const emailOptions = ref<string[]>([]);
|
||||
const isLoadingCA = ref(false);
|
||||
const isLoadingEmails = ref(false);
|
||||
const showEmailDropdown = ref(false);
|
||||
const emailInputRef = ref<InstanceType<typeof NInput> | null>(null);
|
||||
|
||||
// 加载CA选项
|
||||
const loadCAOptions = async () => {
|
||||
isLoadingCA.value = true
|
||||
try {
|
||||
const { data } = await getEabList({ ca: '', p: 1, limit: 1000 }).fetch()
|
||||
const uniqueCATypes = new Set<string>()
|
||||
const caList: Array<{ label: string; value: string; icon: string }> = []
|
||||
// 加载CA选项
|
||||
const loadCAOptions = async () => {
|
||||
isLoadingCA.value = true;
|
||||
try {
|
||||
const { data } = await getEabList({
|
||||
ca: param.value.ca,
|
||||
p: 1,
|
||||
limit: 1000,
|
||||
}).fetch();
|
||||
const uniqueCATypes = new Set<string>();
|
||||
const caList: Array<{ label: string; value: string; icon: string }> =
|
||||
[];
|
||||
|
||||
// 优先添加重要的CA类型(确保始终显示)
|
||||
const priorityCATypes = ['letsencrypt', 'buypass', 'zerossl']
|
||||
priorityCATypes.forEach((caType) => {
|
||||
if (!uniqueCATypes.has(caType)) {
|
||||
uniqueCATypes.add(caType)
|
||||
const predefinedCA = Object.values(CACertificateAuthorization).find((ca) => ca.type === caType)
|
||||
caList.push({
|
||||
label: predefinedCA ? predefinedCA.name : caType.toUpperCase(),
|
||||
value: caType,
|
||||
icon: `cert-${caType}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优先添加重要的CA类型(确保始终显示)
|
||||
const priorityCATypes = ["letsencrypt", "buypass", "zerossl"];
|
||||
priorityCATypes.forEach((caType) => {
|
||||
if (!uniqueCATypes.has(caType)) {
|
||||
uniqueCATypes.add(caType);
|
||||
const predefinedCA = Object.values(CACertificateAuthorization).find(
|
||||
(ca) => ca.type === caType
|
||||
);
|
||||
caList.push({
|
||||
label: predefinedCA ? predefinedCA.name : caType.toUpperCase(),
|
||||
value: caType,
|
||||
icon: `cert-${caType}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 添加API返回的其他CA类型(去重)
|
||||
data?.forEach((item) => {
|
||||
if (item.ca && !uniqueCATypes.has(item.ca)) {
|
||||
uniqueCATypes.add(item.ca)
|
||||
// 添加API返回的其他CA类型(去重)
|
||||
data?.forEach((item) => {
|
||||
if (item.ca && !uniqueCATypes.has(item.ca)) {
|
||||
uniqueCATypes.add(item.ca);
|
||||
|
||||
// 查找预定义配置中对应的CA信息
|
||||
const predefinedCA = Object.values(CACertificateAuthorization).find((ca) => ca.type === item.ca)
|
||||
caList.push({
|
||||
label: predefinedCA ? predefinedCA.name : item.ca.toUpperCase(),
|
||||
value: item.ca,
|
||||
icon: predefinedCA ? `cert-${item.ca}` : 'cert-custom', // 如果不在预定义配置中,使用custom图标;否则使用对应的cert图标
|
||||
})
|
||||
}
|
||||
})
|
||||
// 查找预定义配置中对应的CA信息
|
||||
const predefinedCA = Object.values(CACertificateAuthorization).find(
|
||||
(ca) => ca.type === item.ca
|
||||
);
|
||||
caList.push({
|
||||
label: predefinedCA ? predefinedCA.name : item.ca.toUpperCase(),
|
||||
value: item.ca,
|
||||
icon: predefinedCA ? `cert-${item.ca}` : "cert-custom", // 如果不在预定义配置中,使用custom图标;否则使用对应的cert图标
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
caOptions.value = caList
|
||||
} catch (error) {
|
||||
console.error('加载CA选项失败:', error)
|
||||
} finally {
|
||||
isLoadingCA.value = false
|
||||
}
|
||||
}
|
||||
caOptions.value = caList;
|
||||
} catch (error) {
|
||||
console.error("加载CA选项失败:", error);
|
||||
} finally {
|
||||
isLoadingCA.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 加载邮件选项
|
||||
const loadEmailOptions = async (ca: string) => {
|
||||
if (!ca) return
|
||||
isLoadingEmails.value = true
|
||||
try {
|
||||
const { data } = await getEabList({ ca, p: 1, limit: 1000 }).fetch()
|
||||
emailOptions.value = data?.map((item) => item.email).filter(Boolean) || []
|
||||
// 加载邮件选项
|
||||
const loadEmailOptions = async (ca: string) => {
|
||||
if (!ca) return;
|
||||
isLoadingEmails.value = true;
|
||||
try {
|
||||
const { data } = await getEabList({ ca, p: 1, limit: 1000 }).fetch();
|
||||
emailOptions.value =
|
||||
data?.map((item) => item.email).filter(Boolean) || [];
|
||||
|
||||
// 检查是否为编辑模式且有外部传入的邮箱
|
||||
if (isEdit.value && routeEmail.value) {
|
||||
// 编辑模式:使用外部传入的邮箱地址
|
||||
param.value.email = routeEmail.value
|
||||
} else {
|
||||
// 非编辑模式:保持原有逻辑
|
||||
if (!emailOptions.value.length) {
|
||||
param.value.email = ''
|
||||
}
|
||||
// 如果邮箱数组有内容且当前邮箱为空,自动填充第一个邮箱地址
|
||||
if (emailOptions.value.length > 0 && emailOptions.value[0] && !param.value.email) {
|
||||
param.value.email = emailOptions.value[0]
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载邮件选项失败:', error)
|
||||
} finally {
|
||||
isLoadingEmails.value = false
|
||||
}
|
||||
}
|
||||
// 检查是否为编辑模式且有外部传入的邮箱
|
||||
if (isEdit.value && routeEmail.value) {
|
||||
// 编辑模式:使用外部传入的邮箱地址
|
||||
param.value.email = routeEmail.value;
|
||||
} else {
|
||||
// 非编辑模式:保持原有逻辑
|
||||
if (!emailOptions.value.length) {
|
||||
param.value.email = "";
|
||||
}
|
||||
// 如果邮箱数组有内容且当前邮箱为空,自动填充第一个邮箱地址
|
||||
if (
|
||||
emailOptions.value.length > 0 &&
|
||||
emailOptions.value[0] &&
|
||||
!param.value.email
|
||||
) {
|
||||
param.value.email = emailOptions.value[0];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("加载邮件选项失败:", error);
|
||||
} finally {
|
||||
isLoadingEmails.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 处理CA选择变化
|
||||
const handleCAChange = (value: string) => {
|
||||
param.value.ca = value
|
||||
// 移除直接调用 loadEmailOptions,让 watch 监听器统一处理
|
||||
// 这样避免了用户切换CA时的重复 API 请求
|
||||
}
|
||||
// 处理CA选择变化
|
||||
const handleCAChange = (value: string) => {
|
||||
param.value.ca = value;
|
||||
// 移除直接调用 loadEmailOptions,让 watch 监听器统一处理
|
||||
// 这样避免了用户切换CA时的重复 API 请求
|
||||
};
|
||||
|
||||
// 跳转到CA管理页面
|
||||
const goToAddCAProvider = () => {
|
||||
window.open('/auto-deploy?type=caManage', '_blank')
|
||||
}
|
||||
// 跳转到CA管理页面
|
||||
const goToAddCAProvider = () => {
|
||||
window.open("/auto-deploy?type=caManage", "_blank");
|
||||
};
|
||||
|
||||
// 渲染CA选择器标签
|
||||
const renderLabel = (option: { label: string; value: string; icon: string }) => {
|
||||
return (
|
||||
<NFlex align="center">
|
||||
<SvgIcon icon={option.icon} size="2rem" />
|
||||
<NText>{option.label}</NText>
|
||||
</NFlex>
|
||||
)
|
||||
}
|
||||
// 渲染CA选择器标签
|
||||
const renderLabel = (option: {
|
||||
label: string;
|
||||
value: string;
|
||||
icon: string;
|
||||
}) => {
|
||||
return (
|
||||
<NFlex align="center">
|
||||
<SvgIcon icon={option.icon} size="2rem" />
|
||||
<NText>{option.label}</NText>
|
||||
</NFlex>
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染CA选择器单选标签
|
||||
const renderSingleSelectTag = ({ option }: any) => {
|
||||
return (
|
||||
<NFlex align="center">
|
||||
{option.label ? renderLabel(option) : <NText class="text-[#aaa]">{$t('t_0_1747990228780')}</NText>}
|
||||
</NFlex>
|
||||
)
|
||||
}
|
||||
// 渲染CA选择器单选标签
|
||||
const renderSingleSelectTag = ({ option }: any) => {
|
||||
return (
|
||||
<NFlex align="center">
|
||||
{option.label ? (
|
||||
renderLabel(option)
|
||||
) : (
|
||||
<NText class="text-[#aaa]">{$t("t_0_1747990228780")}</NText>
|
||||
)}
|
||||
</NFlex>
|
||||
);
|
||||
};
|
||||
|
||||
// 过滤函数
|
||||
const handleFilter = (pattern: string, option: any): boolean => {
|
||||
return option.label.toLowerCase().includes(pattern.toLowerCase())
|
||||
}
|
||||
// 过滤函数
|
||||
const handleFilter = (pattern: string, option: any): boolean => {
|
||||
return option.label.toLowerCase().includes(pattern.toLowerCase());
|
||||
};
|
||||
|
||||
// 处理邮箱输入框焦点
|
||||
const handleEmailFocus = () => {
|
||||
if (emailOptions.value.length > 0) {
|
||||
showEmailDropdown.value = true
|
||||
}
|
||||
}
|
||||
// 处理邮箱输入框焦点
|
||||
const handleEmailFocus = () => {
|
||||
if (emailOptions.value.length > 0) {
|
||||
showEmailDropdown.value = true;
|
||||
}
|
||||
};
|
||||
|
||||
// 处理邮箱输入框失焦
|
||||
const handleEmailBlur = () => {
|
||||
// 延迟关闭下拉,确保点击选项有时间触发
|
||||
setTimeout(() => {
|
||||
showEmailDropdown.value = false
|
||||
}, 200)
|
||||
}
|
||||
// 处理邮箱输入框失焦
|
||||
const handleEmailBlur = () => {
|
||||
// 延迟关闭下拉,确保点击选项有时间触发
|
||||
setTimeout(() => {
|
||||
showEmailDropdown.value = false;
|
||||
}, 200);
|
||||
};
|
||||
|
||||
// 选择邮箱地址
|
||||
const handleSelectEmail = (email: string) => {
|
||||
param.value.email = email
|
||||
showEmailDropdown.value = false
|
||||
emailInputRef.value?.blur()
|
||||
}
|
||||
// 选择邮箱地址
|
||||
const handleSelectEmail = (email: string) => {
|
||||
param.value.email = email;
|
||||
showEmailDropdown.value = false;
|
||||
emailInputRef.value?.blur();
|
||||
};
|
||||
|
||||
// 创建邮箱下拉选项
|
||||
const emailDropdownOptions = computed(() => {
|
||||
return emailOptions.value.map((email) => ({
|
||||
label: email,
|
||||
key: email,
|
||||
}))
|
||||
})
|
||||
// 创建邮箱下拉选项
|
||||
const emailDropdownOptions = computed(() => {
|
||||
return emailOptions.value.map((email) => ({
|
||||
label: email,
|
||||
key: email,
|
||||
}));
|
||||
});
|
||||
|
||||
// 判断是否需要输入框(letsencrypt、buypass、zerossl)
|
||||
const shouldUseInputForEmail = computed(() => {
|
||||
return ['letsencrypt', 'buypass', 'zerossl'].includes(param.value.ca)
|
||||
})
|
||||
// 判断是否需要输入框(letsencrypt、buypass、zerossl)
|
||||
const shouldUseInputForEmail = computed(() => {
|
||||
return ["letsencrypt", "buypass", "zerossl"].includes(param.value.ca);
|
||||
});
|
||||
|
||||
// 表单渲染配置
|
||||
const config = computed(() => {
|
||||
// 基本选项
|
||||
return [
|
||||
useFormInput($t('t_17_1745227838561'), 'domains', {
|
||||
placeholder: $t('t_0_1745735774005'),
|
||||
allowInput: noSideSpace,
|
||||
onInput: (val: string) => {
|
||||
param.value.domains = val.replace(/,/g, ',').replace(/;/g, ',') // 中文逗号分隔
|
||||
},
|
||||
}),
|
||||
{
|
||||
type: 'custom' as const,
|
||||
render: () => {
|
||||
return (
|
||||
<DnsProviderSelect
|
||||
type="dns"
|
||||
path="provider_id"
|
||||
value={param.value.provider_id}
|
||||
valueType="value"
|
||||
isAddMode={true}
|
||||
{...{
|
||||
'onUpdate:value': (val: { value: string; type: string }) => {
|
||||
param.value.provider_id = val.value
|
||||
param.value.provider = val.type
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'custom' as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NSpin show={isLoadingCA.value}>
|
||||
<NGrid cols={24}>
|
||||
<NFormItemGi span={13} label={$t('t_3_1750399513606')} path="ca" showRequireMark={true}>
|
||||
<NSelect
|
||||
value={param.value.ca}
|
||||
options={caOptions.value}
|
||||
renderLabel={renderLabel}
|
||||
renderTag={renderSingleSelectTag}
|
||||
filterable
|
||||
filter={handleFilter}
|
||||
loading={isLoadingCA.value}
|
||||
placeholder={$t('t_0_1747990228780')}
|
||||
onUpdateValue={handleCAChange}
|
||||
class="flex-1 w-full"
|
||||
v-slots={{
|
||||
empty: () => {
|
||||
return <span class="text-[1.4rem]">{$t('t_2_1747990228008')}</span>
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span={11}>
|
||||
<NButton class="mx-[8px]" onClick={goToAddCAProvider}>
|
||||
{$t('t_4_1747903685371')}
|
||||
</NButton>
|
||||
<NButton onClick={loadCAOptions} loading={isLoadingCA.value}>
|
||||
{$t('t_0_1746497662220')}
|
||||
</NButton>
|
||||
</NFormItemGi>
|
||||
</NGrid>
|
||||
</NSpin>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'custom' as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem label={$t('t_68_1745289354676')} path="email">
|
||||
{shouldUseInputForEmail.value ? (
|
||||
<NDropdown
|
||||
trigger="manual"
|
||||
show={showEmailDropdown.value}
|
||||
options={emailDropdownOptions.value}
|
||||
onSelect={handleSelectEmail}
|
||||
placement="bottom-start"
|
||||
style="width: 100%"
|
||||
>
|
||||
<NInput
|
||||
ref={emailInputRef}
|
||||
v-model:value={param.value.email}
|
||||
placeholder={$t('t_2_1748052862259')}
|
||||
clearable
|
||||
loading={isLoadingEmails.value}
|
||||
onFocus={handleEmailFocus}
|
||||
onBlur={handleEmailBlur}
|
||||
class="w-full"
|
||||
/>
|
||||
</NDropdown>
|
||||
) : (
|
||||
<NSelect
|
||||
v-model:value={param.value.email}
|
||||
options={emailOptions.value.map((email) => ({ label: email, value: email }))}
|
||||
placeholder={$t('t_2_1748052862259')}
|
||||
clearable
|
||||
filterable
|
||||
loading={isLoadingEmails.value}
|
||||
class="w-full"
|
||||
/>
|
||||
)}
|
||||
</NFormItem>
|
||||
)
|
||||
},
|
||||
},
|
||||
// 表单渲染配置
|
||||
const config = computed(() => {
|
||||
// 基本选项
|
||||
return [
|
||||
useFormInput($t("t_17_1745227838561"), "domains", {
|
||||
placeholder: $t("t_0_1745735774005"),
|
||||
allowInput: noSideSpace,
|
||||
onInput: (val: string) => {
|
||||
param.value.domains = val.replace(/,/g, ",").replace(/;/g, ","); // 中文逗号分隔
|
||||
},
|
||||
}),
|
||||
{
|
||||
type: "custom" as const,
|
||||
render: () => {
|
||||
return (
|
||||
<DnsProviderSelect
|
||||
type="dns"
|
||||
path="provider_id"
|
||||
value={param.value.provider_id}
|
||||
valueType="value"
|
||||
isAddMode={true}
|
||||
{...{
|
||||
"onUpdate:value": (val: { value: string; type: string }) => {
|
||||
param.value.provider_id = val.value;
|
||||
param.value.provider = val.type;
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "custom" as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NSpin show={isLoadingCA.value}>
|
||||
<NGrid cols={24}>
|
||||
<NFormItemGi
|
||||
span={13}
|
||||
label={$t("t_3_1750399513606")}
|
||||
path="ca"
|
||||
showRequireMark={true}
|
||||
>
|
||||
<NSelect
|
||||
value={param.value.ca}
|
||||
options={caOptions.value}
|
||||
renderLabel={renderLabel}
|
||||
renderTag={renderSingleSelectTag}
|
||||
filterable
|
||||
filter={handleFilter}
|
||||
loading={isLoadingCA.value}
|
||||
placeholder={$t("t_0_1747990228780")}
|
||||
onUpdateValue={handleCAChange}
|
||||
class="flex-1 w-full"
|
||||
v-slots={{
|
||||
empty: () => {
|
||||
return (
|
||||
<span class="text-[1.4rem]">
|
||||
{$t("t_2_1747990228008")}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span={11}>
|
||||
<NButton class="mx-[8px]" onClick={goToAddCAProvider}>
|
||||
{$t("t_4_1747903685371")}
|
||||
</NButton>
|
||||
<NButton
|
||||
onClick={loadCAOptions}
|
||||
loading={isLoadingCA.value}
|
||||
>
|
||||
{$t("t_0_1746497662220")}
|
||||
</NButton>
|
||||
</NFormItemGi>
|
||||
</NGrid>
|
||||
</NSpin>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "custom" as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem label={$t("t_68_1745289354676")} path="email">
|
||||
{shouldUseInputForEmail.value ? (
|
||||
<NDropdown
|
||||
trigger="manual"
|
||||
show={showEmailDropdown.value}
|
||||
options={emailDropdownOptions.value}
|
||||
onSelect={handleSelectEmail}
|
||||
placement="bottom-start"
|
||||
style="width: 100%"
|
||||
>
|
||||
<NInput
|
||||
ref={emailInputRef}
|
||||
v-model:value={param.value.email}
|
||||
placeholder={$t("t_2_1748052862259")}
|
||||
clearable
|
||||
loading={isLoadingEmails.value}
|
||||
onFocus={handleEmailFocus}
|
||||
onBlur={handleEmailBlur}
|
||||
class="w-full"
|
||||
/>
|
||||
</NDropdown>
|
||||
) : (
|
||||
<NSelect
|
||||
v-model:value={param.value.email}
|
||||
options={emailOptions.value.map((email) => ({
|
||||
label: email,
|
||||
value: email,
|
||||
}))}
|
||||
placeholder={$t("t_2_1748052862259")}
|
||||
clearable
|
||||
filterable
|
||||
loading={isLoadingEmails.value}
|
||||
class="w-full"
|
||||
/>
|
||||
)}
|
||||
</NFormItem>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
type: 'custom' as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem label={$t('t_4_1747990227956')} path="end_day">
|
||||
<div class="flex items-center">
|
||||
<span class="text-[1.4rem] mr-[1.2rem]">{$t('t_5_1747990228592')}</span>
|
||||
<NInputNumber v-model:value={param.value.end_day} showButton={false} min={1} class="w-[120px]" />
|
||||
<span class="text-[1.4rem] ml-[1.2rem]">{$t('t_6_1747990228465')}</span>
|
||||
</div>
|
||||
</NFormItem>
|
||||
)
|
||||
},
|
||||
},
|
||||
useFormMore(advancedOptions),
|
||||
...(advancedOptions.value
|
||||
? [
|
||||
useFormSelect(
|
||||
$t('t_0_1747647014927'),
|
||||
'algorithm',
|
||||
[
|
||||
{ label: 'RSA2048', value: 'RSA2048' },
|
||||
{ label: 'RSA3072', value: 'RSA3072' },
|
||||
{ label: 'RSA4096', value: 'RSA4096' },
|
||||
{ label: 'RSA8192', value: 'RSA8192' },
|
||||
{ label: 'EC256', value: 'EC256' },
|
||||
{ label: 'EC384', value: 'EC384' },
|
||||
],
|
||||
{},
|
||||
{ showRequireMark: false },
|
||||
),
|
||||
useFormInput(
|
||||
$t('t_7_1747990227761'),
|
||||
'proxy',
|
||||
{
|
||||
placeholder: $t('t_8_1747990235316'),
|
||||
allowInput: noSideSpace,
|
||||
},
|
||||
{ showRequireMark: false },
|
||||
),
|
||||
useFormSwitch(
|
||||
$t('t_2_1749204567193'),
|
||||
'close_cname',
|
||||
{
|
||||
checkedValue: 1,
|
||||
uncheckedValue: 0,
|
||||
},
|
||||
{ showRequireMark: false },
|
||||
),
|
||||
useFormSwitch(
|
||||
$t('t_2_1747106957037'),
|
||||
'skip_check',
|
||||
{
|
||||
checkedValue: 1,
|
||||
uncheckedValue: 0,
|
||||
},
|
||||
{ showRequireMark: false },
|
||||
),
|
||||
// 只有在跳过预检查关闭时才显示DNS递归服务器、预检查超时时间和忽略预检查结果
|
||||
...(param.value.skip_check === 0
|
||||
? [
|
||||
useFormInput(
|
||||
$t('t_0_1747106957037'),
|
||||
'name_server',
|
||||
{
|
||||
placeholder: $t('t_1_1747106961747'),
|
||||
allowInput: noSideSpace,
|
||||
onInput: (val: string) => {
|
||||
param.value.name_server = val.replace(/,/g, ',').replace(/;/g, ',') // 中文逗号分隔
|
||||
},
|
||||
},
|
||||
{ showRequireMark: false },
|
||||
),
|
||||
{
|
||||
type: 'custom' as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem label={$t('t_0_1749263105073')} path="max_wait">
|
||||
<NInputNumber
|
||||
v-model:value={(param.value as ApplyNodeConfig & { max_wait?: number }).max_wait}
|
||||
showButton={false}
|
||||
min={1}
|
||||
class="w-full"
|
||||
placeholder={$t('t_1_1749263104936')}
|
||||
/>
|
||||
</NFormItem>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'custom' as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem label={$t('t_2_1749263103765')} path="ignore_check">
|
||||
<div class="flex items-center">
|
||||
<span class="text-[1.4rem] mr-[1.2rem]">{$t('t_3_1749263104237')}</span>
|
||||
<NSwitch
|
||||
v-model:value={param.value.ignore_check}
|
||||
checkedValue={1}
|
||||
uncheckedValue={0}
|
||||
class="mx-[.5rem]"
|
||||
v-slots={{
|
||||
checked: () => $t('t_4_1749263101853'),
|
||||
unchecked: () => $t('t_5_1749263101934'),
|
||||
}}
|
||||
/>
|
||||
<span class="text-[1.4rem] ml-[1.2rem]">{$t('t_6_1749263103891')}</span>
|
||||
</div>
|
||||
</NFormItem>
|
||||
)
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
]
|
||||
: []),
|
||||
useFormHelp([
|
||||
{
|
||||
content: $t('t_0_1747040228657'),
|
||||
},
|
||||
{
|
||||
content: $t('t_1_1747040226143'),
|
||||
},
|
||||
]),
|
||||
]
|
||||
})
|
||||
{
|
||||
type: "custom" as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem label={$t("t_4_1747990227956")} path="end_day">
|
||||
<div class="flex items-center">
|
||||
<span class="text-[1.4rem] mr-[1.2rem]">
|
||||
{$t("t_5_1747990228592")}
|
||||
</span>
|
||||
<NInputNumber
|
||||
v-model:value={param.value.end_day}
|
||||
showButton={false}
|
||||
min={1}
|
||||
class="w-[120px]"
|
||||
/>
|
||||
<span class="text-[1.4rem] ml-[1.2rem]">
|
||||
{$t("t_6_1747990228465")}
|
||||
</span>
|
||||
</div>
|
||||
</NFormItem>
|
||||
);
|
||||
},
|
||||
},
|
||||
useFormMore(advancedOptions),
|
||||
...(advancedOptions.value
|
||||
? [
|
||||
useFormSelect(
|
||||
$t("t_0_1747647014927"),
|
||||
"algorithm",
|
||||
[
|
||||
{ label: "RSA2048", value: "RSA2048" },
|
||||
{ label: "RSA3072", value: "RSA3072" },
|
||||
{ label: "RSA4096", value: "RSA4096" },
|
||||
{ label: "RSA8192", value: "RSA8192" },
|
||||
{ label: "EC256", value: "EC256" },
|
||||
{ label: "EC384", value: "EC384" },
|
||||
],
|
||||
{},
|
||||
{ showRequireMark: false }
|
||||
),
|
||||
useFormInput(
|
||||
$t("t_7_1747990227761"),
|
||||
"proxy",
|
||||
{
|
||||
placeholder: $t("t_8_1747990235316"),
|
||||
allowInput: noSideSpace,
|
||||
},
|
||||
{ showRequireMark: false }
|
||||
),
|
||||
useFormSwitch(
|
||||
$t("t_2_1749204567193"),
|
||||
"close_cname",
|
||||
{
|
||||
checkedValue: 1,
|
||||
uncheckedValue: 0,
|
||||
},
|
||||
{ showRequireMark: false }
|
||||
),
|
||||
useFormSwitch(
|
||||
$t("t_2_1747106957037"),
|
||||
"skip_check",
|
||||
{
|
||||
checkedValue: 1,
|
||||
uncheckedValue: 0,
|
||||
},
|
||||
{ showRequireMark: false }
|
||||
),
|
||||
// 只有在跳过预检查关闭时才显示DNS递归服务器、预检查超时时间和忽略预检查结果
|
||||
...(param.value.skip_check === 0
|
||||
? [
|
||||
useFormInput(
|
||||
$t("t_0_1747106957037"),
|
||||
"name_server",
|
||||
{
|
||||
placeholder: $t("t_1_1747106961747"),
|
||||
allowInput: noSideSpace,
|
||||
onInput: (val: string) => {
|
||||
param.value.name_server = val
|
||||
.replace(/,/g, ",")
|
||||
.replace(/;/g, ","); // 中文逗号分隔
|
||||
},
|
||||
},
|
||||
{ showRequireMark: false }
|
||||
),
|
||||
{
|
||||
type: "custom" as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem
|
||||
label={$t("t_0_1749263105073")}
|
||||
path="max_wait"
|
||||
>
|
||||
<NInputNumber
|
||||
v-model:value={
|
||||
(
|
||||
param.value as ApplyNodeConfig & {
|
||||
max_wait?: number;
|
||||
}
|
||||
).max_wait
|
||||
}
|
||||
showButton={false}
|
||||
min={1}
|
||||
class="w-full"
|
||||
placeholder={$t("t_1_1749263104936")}
|
||||
/>
|
||||
</NFormItem>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "custom" as const,
|
||||
render: () => {
|
||||
return (
|
||||
<NFormItem
|
||||
label={$t("t_2_1749263103765")}
|
||||
path="ignore_check"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<span class="text-[1.4rem] mr-[1.2rem]">
|
||||
{$t("t_3_1749263104237")}
|
||||
</span>
|
||||
<NSwitch
|
||||
v-model:value={param.value.ignore_check}
|
||||
checkedValue={1}
|
||||
uncheckedValue={0}
|
||||
class="mx-[.5rem]"
|
||||
v-slots={{
|
||||
checked: () => $t("t_4_1749263101853"),
|
||||
unchecked: () => $t("t_5_1749263101934"),
|
||||
}}
|
||||
/>
|
||||
<span class="text-[1.4rem] ml-[1.2rem]">
|
||||
{$t("t_6_1749263103891")}
|
||||
</span>
|
||||
</div>
|
||||
</NFormItem>
|
||||
);
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
]
|
||||
: []),
|
||||
useFormHelp([
|
||||
{
|
||||
content: $t("t_0_1747040228657"),
|
||||
},
|
||||
{
|
||||
content: $t("t_1_1747040226143"),
|
||||
},
|
||||
]),
|
||||
];
|
||||
});
|
||||
|
||||
// 创建表单实例
|
||||
const { component: Form, data, example } = useForm<ApplyNodeConfig>({ defaultValue: param, config, rules })
|
||||
// 创建表单实例
|
||||
const {
|
||||
component: Form,
|
||||
data,
|
||||
example,
|
||||
} = useForm<ApplyNodeConfig>({ defaultValue: param, config, rules });
|
||||
|
||||
// 监听CA值变化,自动加载邮箱选项
|
||||
watch(
|
||||
() => param.value.ca,
|
||||
async (newCA) => {
|
||||
if (newCA) {
|
||||
await loadEmailOptions(newCA)
|
||||
} else {
|
||||
emailOptions.value = []
|
||||
param.value.email = ''
|
||||
showEmailDropdown.value = false
|
||||
}
|
||||
},
|
||||
)
|
||||
// 监听CA值变化,自动加载邮箱选项
|
||||
watch(
|
||||
() => param.value.ca,
|
||||
async (newCA) => {
|
||||
if (newCA) {
|
||||
await loadEmailOptions(newCA);
|
||||
} else {
|
||||
emailOptions.value = [];
|
||||
param.value.email = "";
|
||||
showEmailDropdown.value = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听邮箱选项变化,如果当前下拉显示且没有选项了就关闭下拉
|
||||
watch(
|
||||
() => emailOptions.value,
|
||||
(newOptions) => {
|
||||
if (showEmailDropdown.value && newOptions.length === 0) {
|
||||
showEmailDropdown.value = false
|
||||
}
|
||||
},
|
||||
)
|
||||
// 监听邮箱选项变化,如果当前下拉显示且没有选项了就关闭下拉
|
||||
watch(
|
||||
() => emailOptions.value,
|
||||
(newOptions) => {
|
||||
if (showEmailDropdown.value && newOptions.length === 0) {
|
||||
showEmailDropdown.value = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
advancedOptions.value = false
|
||||
await loadCAOptions()
|
||||
onMounted(async () => {
|
||||
advancedOptions.value = false;
|
||||
await loadCAOptions();
|
||||
|
||||
// 如果是编辑模式且有外部传入的邮箱,直接设置邮箱值
|
||||
if (isEdit.value && routeEmail.value) {
|
||||
param.value.email = routeEmail.value
|
||||
}
|
||||
// 如果当前已经有CA值,主动加载对应的邮件选项
|
||||
if (param.value.ca) {
|
||||
await loadEmailOptions(param.value.ca);
|
||||
}
|
||||
|
||||
// 移除重复调用,让 watch 监听器处理 CA 值变化
|
||||
// 这样避免了 onMounted 和 watch 同时调用 loadEmailOptions 导致的重复请求
|
||||
})
|
||||
// 如果是编辑模式且有外部传入的邮箱,直接设置邮箱值
|
||||
if (isEdit.value && routeEmail.value) {
|
||||
param.value.email = routeEmail.value;
|
||||
}
|
||||
|
||||
// 确认事件触发
|
||||
confirm(async (close) => {
|
||||
try {
|
||||
await example.value?.validate()
|
||||
// 移除重复调用,让 watch 监听器处理 CA 值变化
|
||||
// 这样避免了 onMounted 和 watch 同时调用 loadEmailOptions 导致的重复请求
|
||||
});
|
||||
|
||||
updateNodeConfig(props.node.id, data.value) // 更新节点配置
|
||||
isRefreshNode.value = props.node.id // 刷新节点
|
||||
close()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
})
|
||||
// 确认事件触发
|
||||
confirm(async (close) => {
|
||||
try {
|
||||
await example.value?.validate();
|
||||
|
||||
return () => (
|
||||
<div class="apply-node-drawer">
|
||||
<Form labelPlacement="top" />
|
||||
</div>
|
||||
)
|
||||
},
|
||||
updateNodeConfig(props.node.id, data.value); // 更新节点配置
|
||||
isRefreshNode.value = props.node.id; // 刷新节点
|
||||
close();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
|
||||
return () => (
|
||||
<div class="apply-node-drawer">
|
||||
<Form labelPlacement="top" />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
})
|
||||
|
||||
@@ -28,208 +28,235 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const { updateNodeConfig, isRefreshNode, flowData } = useStore()
|
||||
// 弹窗辅助
|
||||
const { confirm } = useModalHooks()
|
||||
// 错误处理
|
||||
const { handleError } = useError()
|
||||
// 获取表单助手函数
|
||||
const { useFormRadio, useFormCustom } = useFormHooks()
|
||||
// 表单参数
|
||||
const param = ref(deepClone(props.node.config))
|
||||
|
||||
// 周期类型选项
|
||||
const cycleTypeOptions = [
|
||||
{ label: $t('t_2_1744875938555'), value: 'day' },
|
||||
{ label: $t('t_0_1744942117992'), value: 'week' },
|
||||
{ label: $t('t_3_1744875938310'), value: 'month' },
|
||||
]
|
||||
|
||||
// 星期选项
|
||||
const weekOptions = [
|
||||
{ label: $t('t_1_1744942116527'), value: 1 },
|
||||
{ label: $t('t_2_1744942117890'), value: 2 },
|
||||
{ label: $t('t_3_1744942117885'), value: 3 },
|
||||
{ label: $t('t_4_1744942117738'), value: 4 },
|
||||
{ label: $t('t_5_1744942117167'), value: 5 },
|
||||
{ label: $t('t_6_1744942117815'), value: 6 },
|
||||
{ label: $t('t_7_1744942117862'), value: 0 },
|
||||
]
|
||||
|
||||
// 定义默认值常量,避免重复
|
||||
const DEFAULT_AUTO_SETTINGS: Record<string, StartNodeConfig> = {
|
||||
day: { exec_type: 'auto', type: 'day', hour: 1, minute: 0 },
|
||||
week: { exec_type: 'auto', type: 'week', hour: 1, minute: 0, week: 1 },
|
||||
month: { exec_type: 'auto', type: 'month', hour: 1, minute: 0, month: 1 },
|
||||
}
|
||||
|
||||
// 创建时间输入input
|
||||
const createTimeInput = (value: number, updateFn: (val: number) => void, max: number, label: string): VNode => (
|
||||
<NInputGroup>
|
||||
<NInputNumber
|
||||
value={value}
|
||||
onUpdateValue={(val: number | null) => {
|
||||
if (val !== null) {
|
||||
updateFn(val)
|
||||
}
|
||||
}}
|
||||
max={max}
|
||||
min={0}
|
||||
showButton={false}
|
||||
class="w-full"
|
||||
/>
|
||||
<NInputGroupLabel>{label}</NInputGroupLabel>
|
||||
</NInputGroup>
|
||||
)
|
||||
|
||||
// 表单渲染
|
||||
const formRender = computed(() => {
|
||||
const formItems: FormConfig = []
|
||||
if (param.value.exec_type === 'auto') {
|
||||
formItems.push(
|
||||
useFormCustom<StartNodeConfig>(() => {
|
||||
return (
|
||||
<NGrid cols={24} xGap={24}>
|
||||
<NFormItemGi label={$t('t_2_1744879616413')} span={8} showRequireMark path="type">
|
||||
<NSelect
|
||||
class="w-full"
|
||||
options={cycleTypeOptions}
|
||||
v-model:value={param.value.type}
|
||||
onUpdateValue={(val: 'day' | 'week' | 'month') => {
|
||||
if (val) {
|
||||
param.value.type = val
|
||||
updateParamValueByType(val)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</NFormItemGi>
|
||||
|
||||
{param.value.type !== 'day' && (
|
||||
<NFormItemGi span={5} path={param.value.type === 'week' ? 'week' : 'month'}>
|
||||
{param.value.type === 'week' ? (
|
||||
<NSelect
|
||||
value={param.value.week}
|
||||
onUpdateValue={(val: number) => {
|
||||
param.value.week = val
|
||||
}}
|
||||
options={weekOptions}
|
||||
/>
|
||||
) : (
|
||||
createTimeInput(
|
||||
param.value.month || 0,
|
||||
(val: number) => (param.value.month = val),
|
||||
31,
|
||||
$t('t_29_1744958838904'),
|
||||
)
|
||||
)}
|
||||
</NFormItemGi>
|
||||
)}
|
||||
|
||||
<NFormItemGi span={param.value.type === 'day' ? 7 : 5} path="hour">
|
||||
{createTimeInput(
|
||||
param.value.hour || 0,
|
||||
(val: number) => (param.value.hour = val),
|
||||
23,
|
||||
$t('t_5_1744879615277'),
|
||||
)}
|
||||
</NFormItemGi>
|
||||
|
||||
<NFormItemGi span={param.value.type === 'day' ? 7 : 5} path="minute">
|
||||
{createTimeInput(
|
||||
param.value.minute || 0,
|
||||
(val: number) => (param.value.minute = val),
|
||||
59,
|
||||
$t('t_3_1744879615723'),
|
||||
)}
|
||||
</NFormItemGi>
|
||||
</NGrid>
|
||||
)
|
||||
}),
|
||||
)
|
||||
}
|
||||
return [
|
||||
// 运行模式选择
|
||||
useFormRadio($t('t_30_1745735764748'), 'exec_type', [
|
||||
{ label: $t('t_4_1744875940750'), value: 'auto' },
|
||||
{ label: $t('t_5_1744875940010'), value: 'manual' },
|
||||
]),
|
||||
...formItems,
|
||||
]
|
||||
})
|
||||
|
||||
// 创建表单实例
|
||||
const {
|
||||
component: Form,
|
||||
data,
|
||||
example,
|
||||
} = useForm<StartNodeConfig>({
|
||||
defaultValue: param,
|
||||
config: formRender,
|
||||
rules,
|
||||
})
|
||||
updateNodeConfig,
|
||||
isRefreshNode,
|
||||
flowData,
|
||||
setStartNodeSavedByUser,
|
||||
startNodeSavedByUser,
|
||||
} = useStore();
|
||||
// 弹窗辅助
|
||||
const { confirm } = useModalHooks();
|
||||
// 错误处理
|
||||
const { handleError } = useError();
|
||||
// 获取表单助手函数
|
||||
const { useFormRadio, useFormCustom } = useFormHooks();
|
||||
// 表单参数
|
||||
const param = ref(deepClone(props.node.config));
|
||||
|
||||
// 更新参数的函数
|
||||
const updateParamValue = (updates: StartNodeConfig) => {
|
||||
console.log(updates)
|
||||
let newParams = { ...updates }
|
||||
// if (newParams.exec_type === 'manual') {
|
||||
// 小时随机 1-6
|
||||
const randomHour = Math.floor(Math.random() * 4) + 1
|
||||
// 分钟每5分钟随机,0-55
|
||||
const randomMinute = Math.floor(Math.random() * 12) * 5
|
||||
newParams = {
|
||||
...newParams,
|
||||
hour: randomHour,
|
||||
minute: randomMinute,
|
||||
}
|
||||
param.value = newParams
|
||||
// }
|
||||
}
|
||||
// 周期类型选项
|
||||
const cycleTypeOptions = [
|
||||
{ label: $t("t_2_1744875938555"), value: "day" },
|
||||
{ label: $t("t_0_1744942117992"), value: "week" },
|
||||
{ label: $t("t_3_1744875938310"), value: "month" },
|
||||
];
|
||||
|
||||
const updateParamValueByType = (type: 'day' | 'week' | 'month') => {
|
||||
updateParamValue(DEFAULT_AUTO_SETTINGS[type] as StartNodeConfig)
|
||||
}
|
||||
// 星期选项
|
||||
const weekOptions = [
|
||||
{ label: $t("t_1_1744942116527"), value: 1 },
|
||||
{ label: $t("t_2_1744942117890"), value: 2 },
|
||||
{ label: $t("t_3_1744942117885"), value: 3 },
|
||||
{ label: $t("t_4_1744942117738"), value: 4 },
|
||||
{ label: $t("t_5_1744942117167"), value: 5 },
|
||||
{ label: $t("t_6_1744942117815"), value: 6 },
|
||||
{ label: $t("t_7_1744942117862"), value: 0 },
|
||||
];
|
||||
|
||||
// 监听执行类型变化
|
||||
watch(
|
||||
() => param.value.exec_type,
|
||||
(newVal) => {
|
||||
if (newVal === 'auto') {
|
||||
updateParamValue(DEFAULT_AUTO_SETTINGS.day as StartNodeConfig)
|
||||
} else if (newVal === 'manual') {
|
||||
updateParamValue({ exec_type: 'manual' })
|
||||
}
|
||||
},
|
||||
)
|
||||
// 定义默认值常量,避免重复
|
||||
const DEFAULT_AUTO_SETTINGS: Record<string, StartNodeConfig> = {
|
||||
day: { exec_type: "auto", type: "day", hour: 1, minute: 0 },
|
||||
week: { exec_type: "auto", type: "week", hour: 1, minute: 0, week: 1 },
|
||||
month: { exec_type: "auto", type: "month", hour: 1, minute: 0, month: 1 },
|
||||
};
|
||||
|
||||
// 监听类型变化
|
||||
watch(
|
||||
() => param.value.type,
|
||||
(newVal) => {
|
||||
if (newVal && param.value.exec_type === 'auto') {
|
||||
updateParamValue(DEFAULT_AUTO_SETTINGS[newVal] as StartNodeConfig)
|
||||
}
|
||||
},
|
||||
)
|
||||
// 创建时间输入input
|
||||
const createTimeInput = (
|
||||
value: number,
|
||||
updateFn: (val: number) => void,
|
||||
max: number,
|
||||
label: string
|
||||
): VNode => (
|
||||
<NInputGroup>
|
||||
<NInputNumber
|
||||
value={value}
|
||||
onUpdateValue={(val: number | null) => {
|
||||
if (val !== null) {
|
||||
updateFn(val);
|
||||
}
|
||||
}}
|
||||
max={max}
|
||||
min={0}
|
||||
showButton={false}
|
||||
class="w-full"
|
||||
/>
|
||||
<NInputGroupLabel>{label}</NInputGroupLabel>
|
||||
</NInputGroup>
|
||||
);
|
||||
|
||||
// 确认事件触发
|
||||
confirm(async (close) => {
|
||||
try {
|
||||
await example.value?.validate()
|
||||
updateNodeConfig(props.node.id, data.value) // 更新节点配置
|
||||
isRefreshNode.value = props.node.id // 刷新节点
|
||||
close()
|
||||
} catch (error) {
|
||||
handleError(error)
|
||||
}
|
||||
})
|
||||
// 表单渲染
|
||||
const formRender = computed(() => {
|
||||
const formItems: FormConfig = [];
|
||||
if (param.value.exec_type === "auto") {
|
||||
formItems.push(
|
||||
useFormCustom<StartNodeConfig>(() => {
|
||||
return (
|
||||
<NGrid cols={24} xGap={24}>
|
||||
<NFormItemGi
|
||||
label={$t("t_2_1744879616413")}
|
||||
span={8}
|
||||
showRequireMark
|
||||
path="type"
|
||||
>
|
||||
<NSelect
|
||||
class="w-full"
|
||||
options={cycleTypeOptions}
|
||||
v-model:value={param.value.type}
|
||||
onUpdateValue={(val: "day" | "week" | "month") => {
|
||||
if (val) {
|
||||
param.value.type = val;
|
||||
updateParamValueByType(val);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</NFormItemGi>
|
||||
|
||||
onMounted(() => {
|
||||
if (isUndefined(flowData.value.id)) {
|
||||
updateParamValueByType('day')
|
||||
updateNodeConfig(props.node.id, param.value) // 更新节点配置
|
||||
}
|
||||
})
|
||||
{param.value.type !== "day" && (
|
||||
<NFormItemGi
|
||||
span={5}
|
||||
path={param.value.type === "week" ? "week" : "month"}
|
||||
>
|
||||
{param.value.type === "week" ? (
|
||||
<NSelect
|
||||
value={param.value.week}
|
||||
onUpdateValue={(val: number) => {
|
||||
param.value.week = val;
|
||||
}}
|
||||
options={weekOptions}
|
||||
/>
|
||||
) : (
|
||||
createTimeInput(
|
||||
param.value.month || 0,
|
||||
(val: number) => (param.value.month = val),
|
||||
31,
|
||||
$t("t_29_1744958838904")
|
||||
)
|
||||
)}
|
||||
</NFormItemGi>
|
||||
)}
|
||||
|
||||
<NFormItemGi
|
||||
span={param.value.type === "day" ? 7 : 5}
|
||||
path="hour"
|
||||
>
|
||||
{createTimeInput(
|
||||
param.value.hour || 0,
|
||||
(val: number) => (param.value.hour = val),
|
||||
23,
|
||||
$t("t_5_1744879615277")
|
||||
)}
|
||||
</NFormItemGi>
|
||||
|
||||
<NFormItemGi
|
||||
span={param.value.type === "day" ? 7 : 5}
|
||||
path="minute"
|
||||
>
|
||||
{createTimeInput(
|
||||
param.value.minute || 0,
|
||||
(val: number) => (param.value.minute = val),
|
||||
59,
|
||||
$t("t_3_1744879615723")
|
||||
)}
|
||||
</NFormItemGi>
|
||||
</NGrid>
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
return [
|
||||
// 运行模式选择
|
||||
useFormRadio($t("t_30_1745735764748"), "exec_type", [
|
||||
{ label: $t("t_4_1744875940750"), value: "auto" },
|
||||
{ label: $t("t_5_1744875940010"), value: "manual" },
|
||||
]),
|
||||
...formItems,
|
||||
];
|
||||
});
|
||||
|
||||
// 创建表单实例
|
||||
const {
|
||||
component: Form,
|
||||
data,
|
||||
example,
|
||||
} = useForm<StartNodeConfig>({
|
||||
defaultValue: param,
|
||||
config: formRender,
|
||||
rules,
|
||||
});
|
||||
|
||||
// 更新参数的函数
|
||||
const updateParamValue = (updates: StartNodeConfig) => {
|
||||
console.log(updates);
|
||||
let newParams = { ...updates };
|
||||
// if (newParams.exec_type === 'manual') {
|
||||
// 小时随机 1-6
|
||||
const randomHour = Math.floor(Math.random() * 4) + 1;
|
||||
// 分钟每5分钟随机,0-55
|
||||
const randomMinute = Math.floor(Math.random() * 12) * 5;
|
||||
newParams = {
|
||||
...newParams,
|
||||
hour: randomHour,
|
||||
minute: randomMinute,
|
||||
};
|
||||
param.value = newParams;
|
||||
// }
|
||||
};
|
||||
|
||||
const updateParamValueByType = (type: "day" | "week" | "month") => {
|
||||
updateParamValue(DEFAULT_AUTO_SETTINGS[type] as StartNodeConfig);
|
||||
};
|
||||
|
||||
// 监听执行类型变化
|
||||
watch(
|
||||
() => param.value.exec_type,
|
||||
(newVal) => {
|
||||
if (newVal === "auto") {
|
||||
updateParamValue(DEFAULT_AUTO_SETTINGS.day as StartNodeConfig);
|
||||
} else if (newVal === "manual") {
|
||||
updateParamValue({ exec_type: "manual" });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听类型变化
|
||||
watch(
|
||||
() => param.value.type,
|
||||
(newVal) => {
|
||||
if (newVal && param.value.exec_type === "auto") {
|
||||
updateParamValue(DEFAULT_AUTO_SETTINGS[newVal] as StartNodeConfig);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 确认事件触发
|
||||
confirm(async (close) => {
|
||||
try {
|
||||
await example.value?.validate();
|
||||
updateNodeConfig(props.node.id, data.value); // 更新节点配置
|
||||
isRefreshNode.value = props.node.id; // 刷新节点
|
||||
setStartNodeSavedByUser(true);
|
||||
close();
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
console.log("开始节点初始化");
|
||||
if (isUndefined(flowData.value.id) && !startNodeSavedByUser.value) {
|
||||
updateParamValueByType("day");
|
||||
updateNodeConfig(props.node.id, param.value); // 更新节点配置
|
||||
}
|
||||
});
|
||||
|
||||
return () => (
|
||||
<div class="apply-node-drawer">
|
||||
|
||||
@@ -91,6 +91,57 @@ export const useController = () => {
|
||||
// 判断是否为子路由
|
||||
const hasChildRoutes = computed(() => route.path !== "/auto-deploy");
|
||||
|
||||
/**
|
||||
* @description 格式化执行周期显示
|
||||
* @param {string} execTime - 执行时间配置JSON字符串
|
||||
* @param {string} execType - 执行类型
|
||||
* @returns {string} 格式化后的执行周期文本
|
||||
*/
|
||||
const formatExecTime = (execTime: string, execType: string): string => {
|
||||
// 如果是手动执行,显示 --
|
||||
if (execType !== "auto") {
|
||||
return "--";
|
||||
}
|
||||
|
||||
// 如果没有执行时间配置,默认为每日
|
||||
if (!execTime) {
|
||||
return "每日";
|
||||
}
|
||||
|
||||
try {
|
||||
const timeConfig = JSON.parse(execTime);
|
||||
const { type = "day", hour, minute, week, month } = timeConfig;
|
||||
|
||||
// 格式化时间
|
||||
const timeStr = `${hour.toString().padStart(2, "0")}:${minute
|
||||
.toString()
|
||||
.padStart(2, "0")}`;
|
||||
|
||||
switch (type) {
|
||||
case "day":
|
||||
return `每日 ${timeStr}`;
|
||||
case "week":
|
||||
const weekDays = [
|
||||
"周日",
|
||||
"周一",
|
||||
"周二",
|
||||
"周三",
|
||||
"周四",
|
||||
"周五",
|
||||
"周六",
|
||||
];
|
||||
return `每周${weekDays[week] || "周" + week} ${timeStr}`;
|
||||
case "month":
|
||||
return `每月${month}日 ${timeStr}`;
|
||||
default:
|
||||
return `每日 ${timeStr}`;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("解析执行时间配置失败:", error);
|
||||
return "每日";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 创建表格列配置
|
||||
* @returns {DataTableColumn<WorkflowItem>[]} 返回表格列配置数组
|
||||
@@ -140,6 +191,14 @@ export const useController = () => {
|
||||
render: (row: WorkflowItem) => row.last_run_time || "-",
|
||||
},
|
||||
statusCol<WorkflowItem>("last_run_status", $t("t_2_1750129253921")),
|
||||
{
|
||||
title: "执行周期",
|
||||
key: "exec_time",
|
||||
width: 150,
|
||||
render: (row: WorkflowItem) => (
|
||||
<span>{formatExecTime(row.exec_time, row.exec_type)}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: $t("t_8_1745215914610"),
|
||||
key: "actions",
|
||||
@@ -342,12 +401,17 @@ export const useController = () => {
|
||||
* @description 复制工作流
|
||||
* @param {WorkflowItem} workflow - 工作流对象
|
||||
*/
|
||||
const handleCopyWorkflow = async (workflow: WorkflowItem) => {
|
||||
console.log(workflow, 'workflow123123123123');
|
||||
const { name, content, exec_type, active, exec_time } = workflow;
|
||||
const params = { name: `${name} - 副本`, content, exec_type, active, exec_time };
|
||||
await copyExistingWorkflow(params as WorkflowItem);
|
||||
await fetch();
|
||||
const handleCopyWorkflow = async (workflow: WorkflowItem) => {
|
||||
const { name, content, exec_type, active, exec_time } = workflow;
|
||||
const params = {
|
||||
name: `${name} - 副本`,
|
||||
content,
|
||||
exec_type,
|
||||
active,
|
||||
exec_time,
|
||||
};
|
||||
await copyExistingWorkflow(params as WorkflowItem);
|
||||
await fetch();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,18 +45,21 @@ export default defineComponent({
|
||||
<NSelect
|
||||
options={[
|
||||
{ label: "全部", value: "" },
|
||||
...intermediateCaList.value.map((item) => ({
|
||||
...(intermediateCaList.value || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
})),
|
||||
]}
|
||||
placeholder="请选择中间证书"
|
||||
size="large"
|
||||
style={{ width: "180px" }}
|
||||
defaultValue={""}
|
||||
style={{ width: "180px" }}
|
||||
defaultValue={""}
|
||||
onUpdateValue={handleCaIdChange}
|
||||
/>
|
||||
<SearchComponent placeholder="请输入名称搜索" style={{ width: "240px" }} />
|
||||
<SearchComponent
|
||||
placeholder="请输入名称搜索"
|
||||
style={{ width: "240px" }}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
content: () => (
|
||||
|
||||
@@ -38,19 +38,24 @@ export const useStore = () => {
|
||||
|
||||
const getIntermediateCaList = async () => {
|
||||
try {
|
||||
const { fetch, data } = getCaList({
|
||||
const { fetch, data } = getCaList({
|
||||
p: "-1",
|
||||
limit: "-1",
|
||||
level: "intermediate",
|
||||
});
|
||||
await fetch();
|
||||
if (data.value?.status === true) {
|
||||
intermediateCaList.value = data.value.data;
|
||||
return data.value.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取中间证书列表失败:', error);
|
||||
}
|
||||
});
|
||||
await fetch();
|
||||
if (data.value?.status === true) {
|
||||
intermediateCaList.value = data.value.data || [];
|
||||
return data.value.data || [];
|
||||
} else {
|
||||
intermediateCaList.value = [];
|
||||
return [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取中间证书列表失败:", error);
|
||||
intermediateCaList.value = [];
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,174 +1,177 @@
|
||||
import { defineComponent, ref, computed, watch } from 'vue';
|
||||
import { NForm, NFormItem, NInput, NSelect, NSpace, NButton, FormRules, useMessage } from 'naive-ui';
|
||||
import { useStore } from '../useStore';
|
||||
import { useAddCaController } from '../useController';
|
||||
import { useModalClose } from '@baota/naive-ui/hooks';
|
||||
import {
|
||||
NForm,
|
||||
NFormItem,
|
||||
NInput,
|
||||
NSelect,
|
||||
NSpace,
|
||||
NButton,
|
||||
FormRules,
|
||||
useMessage,
|
||||
NDivider,
|
||||
NIcon,
|
||||
} from "naive-ui";
|
||||
import { useStore } from "../useStore";
|
||||
import { useAddCaController } from "../useController";
|
||||
import { useModalClose } from "@baota/naive-ui/hooks";
|
||||
import { ChevronDown } from "@vicons/ionicons5";
|
||||
|
||||
/**
|
||||
* 添加CA模态框组件
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['success'],
|
||||
setup(props, { emit }) {
|
||||
const { addForm, resetAddForm, createType, rootCaList } = useStore();
|
||||
const message = useMessage();
|
||||
const closeModal = useModalClose();
|
||||
emits: ["success"],
|
||||
setup(props, { emit }) {
|
||||
const { addForm, resetAddForm, createType, rootCaList } = useStore();
|
||||
const message = useMessage();
|
||||
const closeModal = useModalClose();
|
||||
|
||||
// 表单引用
|
||||
const formRef = ref();
|
||||
// 表单引用
|
||||
const formRef = ref();
|
||||
|
||||
// 有效期单位选择
|
||||
const validityUnit = ref<'day' | 'year'>('day');
|
||||
// 有效期单位选择
|
||||
const validityUnit = ref<"day" | "year">("day");
|
||||
|
||||
// 使用表单控制器
|
||||
const { handleSubmit } = useAddCaController();
|
||||
// 展开收起状态
|
||||
const showAdvancedConfig = ref(false);
|
||||
|
||||
// 表单验证规则
|
||||
const rules = computed((): FormRules => {
|
||||
const baseRules: any = {
|
||||
name: [
|
||||
{ required: true, message: '请输入CA名称', trigger: 'blur' }
|
||||
],
|
||||
cn: [
|
||||
{ required: true, message: '请输入通用名称', trigger: 'blur' }
|
||||
],
|
||||
o: [
|
||||
{ required: true, message: '请输入组织名称', trigger: 'blur' }
|
||||
],
|
||||
c: [
|
||||
{ required: true, message: '请选择国家', trigger: 'change' }
|
||||
],
|
||||
ou: [
|
||||
{ required: true, message: '请输入组织单位', trigger: 'blur' }
|
||||
],
|
||||
province: [
|
||||
{ required: true, message: '请输入省份', trigger: 'blur' }
|
||||
],
|
||||
locality: [
|
||||
{ required: true, message: '请输入城市', trigger: 'blur' }
|
||||
],
|
||||
key_length: [
|
||||
{ required: true, message: '请选择密钥长度', trigger: 'change' }
|
||||
],
|
||||
valid_days: [
|
||||
{ required: true, message: '请选择有效期', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
// 使用表单控制器
|
||||
const { handleSubmit } = useAddCaController();
|
||||
|
||||
if (createType.value === 'root') {
|
||||
baseRules.algorithm = [
|
||||
{ required: true, message: '请选择加密算法', trigger: 'change' }
|
||||
];
|
||||
}
|
||||
// 表单验证规则
|
||||
const rules = computed((): FormRules => {
|
||||
const baseRules: any = {
|
||||
name: [{ required: true, message: "请输入CA名称", trigger: "blur" }],
|
||||
cn: [{ required: true, message: "请输入通用名称", trigger: "blur" }],
|
||||
c: [{ required: true, message: "请选择国家", trigger: "change" }],
|
||||
key_length: [
|
||||
{ required: true, message: "请选择密钥长度", trigger: "change" },
|
||||
],
|
||||
valid_days: [
|
||||
{ required: true, message: "请选择有效期", trigger: "change" },
|
||||
],
|
||||
};
|
||||
|
||||
if (createType.value === 'intermediate') {
|
||||
baseRules.root_id = [
|
||||
{ required: true, message: '请选择父级CA', trigger: 'change' }
|
||||
];
|
||||
}
|
||||
if (createType.value === "root") {
|
||||
baseRules.algorithm = [
|
||||
{ required: true, message: "请选择加密算法", trigger: "change" },
|
||||
];
|
||||
}
|
||||
|
||||
return baseRules;
|
||||
});
|
||||
if (createType.value === "intermediate") {
|
||||
baseRules.root_id = [
|
||||
{ required: true, message: "请选择父级CA", trigger: "change" },
|
||||
];
|
||||
}
|
||||
|
||||
// 算法选项
|
||||
const algorithmOptions = [
|
||||
{ label: "ECDSA", value: "ecdsa" },
|
||||
{ label: "RSA", value: "rsa" },
|
||||
{ label: "SM2", value: "sm2" },
|
||||
];
|
||||
return baseRules;
|
||||
});
|
||||
|
||||
const keyLengthOptions = computed(() => {
|
||||
switch (addForm.value.algorithm) {
|
||||
case 'ecdsa':
|
||||
return [
|
||||
{ label: "P-256 (256 bit)", value: "256" },
|
||||
{ label: "P-384 (384 bit)", value: "384" },
|
||||
{ label: "P-521 (521 bit)", value: "521" },
|
||||
];
|
||||
case 'rsa':
|
||||
return [
|
||||
{ label: "2048 bit", value: "2048" },
|
||||
{ label: "3072 bit", value: "3072" },
|
||||
{ label: "4096 bit", value: "4096" },
|
||||
];
|
||||
case 'sm2':
|
||||
return [
|
||||
{ label: "SM2 (256 bit)", value: "256" },
|
||||
];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
});
|
||||
// 算法选项
|
||||
const algorithmOptions = [
|
||||
{ label: "ECDSA", value: "ecdsa" },
|
||||
{ label: "RSA", value: "rsa" },
|
||||
{ label: "SM2", value: "sm2" },
|
||||
];
|
||||
|
||||
// 国家选项
|
||||
const countryOptions = [
|
||||
{ label: "中国", value: "CN" },
|
||||
{ label: "美国", value: "US" },
|
||||
{ label: "日本", value: "JP" },
|
||||
{ label: "德国", value: "DE" },
|
||||
{ label: "英国", value: "GB" },
|
||||
];
|
||||
const keyLengthOptions = computed(() => {
|
||||
switch (addForm.value.algorithm) {
|
||||
case "ecdsa":
|
||||
return [
|
||||
{ label: "P-256 (256 bit)", value: "256" },
|
||||
{ label: "P-384 (384 bit)", value: "384" },
|
||||
{ label: "P-521 (521 bit)", value: "521" },
|
||||
];
|
||||
case "rsa":
|
||||
return [
|
||||
{ label: "2048 bit", value: "2048" },
|
||||
{ label: "3072 bit", value: "3072" },
|
||||
{ label: "4096 bit", value: "4096" },
|
||||
];
|
||||
case "sm2":
|
||||
return [{ label: "SM2 (256 bit)", value: "256" }];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
// 监听算法变化,重置密钥长度选择
|
||||
watch(() => addForm.value.algorithm, (newAlgorithm) => {
|
||||
addForm.value.key_length = '';
|
||||
if (newAlgorithm === 'ecdsa') {
|
||||
addForm.value.key_length = '256';
|
||||
} else if (newAlgorithm === 'sm2') {
|
||||
addForm.value.key_length = '256';
|
||||
} else if (newAlgorithm === 'rsa') {
|
||||
addForm.value.key_length = '2048';
|
||||
}
|
||||
});
|
||||
// 国家选项
|
||||
const countryOptions = [
|
||||
{ label: "中国", value: "CN" },
|
||||
{ label: "美国", value: "US" },
|
||||
{ label: "日本", value: "JP" },
|
||||
{ label: "德国", value: "DE" },
|
||||
{ label: "英国", value: "GB" },
|
||||
];
|
||||
|
||||
// 监听父级CA选择,自动填充算法值
|
||||
watch(() => addForm.value.root_id, (newRootId) => {
|
||||
if (createType.value === 'intermediate' && newRootId) {
|
||||
const selectedRootCa = rootCaList.value.find(ca => ca.id.toString() === newRootId);
|
||||
if (selectedRootCa) {
|
||||
addForm.value.algorithm = selectedRootCa.algorithm;
|
||||
if (selectedRootCa.algorithm === 'ecdsa') {
|
||||
addForm.value.key_length = '256';
|
||||
} else if (selectedRootCa.algorithm === 'sm2') {
|
||||
addForm.value.key_length = '256';
|
||||
} else if (selectedRootCa.algorithm === 'rsa') {
|
||||
addForm.value.key_length = '2048';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 监听算法变化,重置密钥长度选择
|
||||
watch(
|
||||
() => addForm.value.algorithm,
|
||||
(newAlgorithm) => {
|
||||
addForm.value.key_length = "";
|
||||
if (newAlgorithm === "ecdsa") {
|
||||
addForm.value.key_length = "256";
|
||||
} else if (newAlgorithm === "sm2") {
|
||||
addForm.value.key_length = "256";
|
||||
} else if (newAlgorithm === "rsa") {
|
||||
addForm.value.key_length = "2048";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 处理表单提交
|
||||
const handleFormSubmit = async () => {
|
||||
try {
|
||||
// 先验证表单
|
||||
await formRef.value?.validate();
|
||||
const formData = { ...addForm.value };
|
||||
if (validityUnit.value === 'year' && formData.valid_days) {
|
||||
const years = parseInt(formData.valid_days);
|
||||
if (!isNaN(years)) {
|
||||
formData.valid_days = (years * 365).toString();
|
||||
}
|
||||
}
|
||||
const success = await handleSubmit(formData);
|
||||
if (success) {
|
||||
resetAddForm();
|
||||
closeModal();
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('表单验证失败:', error);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
// 监听父级CA选择,自动填充算法值
|
||||
watch(
|
||||
() => addForm.value.root_id,
|
||||
(newRootId) => {
|
||||
if (createType.value === "intermediate" && newRootId) {
|
||||
const selectedRootCa = rootCaList.value.find(
|
||||
(ca) => ca.id.toString() === newRootId
|
||||
);
|
||||
if (selectedRootCa) {
|
||||
addForm.value.algorithm = selectedRootCa.algorithm;
|
||||
if (selectedRootCa.algorithm === "ecdsa") {
|
||||
addForm.value.key_length = "256";
|
||||
} else if (selectedRootCa.algorithm === "sm2") {
|
||||
addForm.value.key_length = "256";
|
||||
} else if (selectedRootCa.algorithm === "rsa") {
|
||||
addForm.value.key_length = "2048";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 处理取消操作
|
||||
const handleCancel = () => {
|
||||
resetAddForm();
|
||||
closeModal();
|
||||
};
|
||||
// 处理表单提交
|
||||
const handleFormSubmit = async () => {
|
||||
try {
|
||||
// 先验证表单
|
||||
await formRef.value?.validate();
|
||||
const formData = { ...addForm.value };
|
||||
if (validityUnit.value === "year" && formData.valid_days) {
|
||||
const years = parseInt(formData.valid_days);
|
||||
if (!isNaN(years)) {
|
||||
formData.valid_days = (years * 365).toString();
|
||||
}
|
||||
}
|
||||
const success = await handleSubmit(formData);
|
||||
if (success) {
|
||||
resetAddForm();
|
||||
closeModal();
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("表单验证失败:", error);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
return () => (
|
||||
// 处理取消操作
|
||||
const handleCancel = () => {
|
||||
resetAddForm();
|
||||
closeModal();
|
||||
};
|
||||
|
||||
return () => (
|
||||
<NForm
|
||||
ref={formRef}
|
||||
model={addForm.value}
|
||||
@@ -191,42 +194,6 @@ export default defineComponent({
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="组织(O)" path="o" required>
|
||||
<NInput
|
||||
v-model:value={addForm.value.o}
|
||||
placeholder="请输入组织名称"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="国家(C)" path="c" required>
|
||||
<NSelect
|
||||
v-model:value={addForm.value.c}
|
||||
options={countryOptions}
|
||||
placeholder="请选择国家"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="组织单位(OU)" path="ou" required>
|
||||
<NInput
|
||||
v-model:value={addForm.value.ou}
|
||||
placeholder="请输入组织单位"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="省份" path="province" required>
|
||||
<NInput
|
||||
v-model:value={addForm.value.province}
|
||||
placeholder="请输入省份"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="城市" path="locality" required>
|
||||
<NInput
|
||||
v-model:value={addForm.value.locality}
|
||||
placeholder="请输入城市"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
{createType.value === "intermediate" && (
|
||||
<NFormItem label="父级CA" path="root_id" required>
|
||||
<NSelect
|
||||
@@ -270,14 +237,78 @@ export default defineComponent({
|
||||
<NSelect
|
||||
v-model:value={validityUnit.value}
|
||||
options={[
|
||||
{ label: '天', value: 'day' },
|
||||
{ label: '年', value: 'year' }
|
||||
{ label: "天", value: "day" },
|
||||
{ label: "年", value: "year" },
|
||||
]}
|
||||
style={{ width: '80px' }}
|
||||
style={{ width: "80px" }}
|
||||
/>
|
||||
</NSpace>
|
||||
</NFormItem>
|
||||
<div class="mt-4 mb-4">
|
||||
<div
|
||||
class="flex items-center justify-center cursor-pointer py-2"
|
||||
onClick={() =>
|
||||
(showAdvancedConfig.value = !showAdvancedConfig.value)
|
||||
}
|
||||
>
|
||||
<NDivider>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-[#18a058] font-medium">更多配置</span>
|
||||
<NIcon
|
||||
size="16"
|
||||
color="#18a058"
|
||||
class="transition-transform duration-200"
|
||||
style={{
|
||||
transform: showAdvancedConfig.value
|
||||
? "rotate(180deg)"
|
||||
: "rotate(0deg)",
|
||||
}}
|
||||
>
|
||||
<ChevronDown />
|
||||
</NIcon>
|
||||
</div>
|
||||
</NDivider>
|
||||
</div>
|
||||
{showAdvancedConfig.value && (
|
||||
<div class="space-y-4 mt-4">
|
||||
<NFormItem label="组织(O)">
|
||||
<NInput
|
||||
v-model:value={addForm.value.o}
|
||||
placeholder="请输入组织名称"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="国家(C)" path="c" required>
|
||||
<NSelect
|
||||
v-model:value={addForm.value.c}
|
||||
options={countryOptions}
|
||||
placeholder="请选择国家"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="组织单位(OU)">
|
||||
<NInput
|
||||
v-model:value={addForm.value.ou}
|
||||
placeholder="请输入组织单位"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="省份">
|
||||
<NInput
|
||||
v-model:value={addForm.value.province}
|
||||
placeholder="请输入省份"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="城市">
|
||||
<NInput
|
||||
v-model:value={addForm.value.locality}
|
||||
placeholder="请输入城市"
|
||||
/>
|
||||
</NFormItem>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div class="flex justify-end gap-3 mt-6">
|
||||
<NButton onClick={handleCancel}>取消</NButton>
|
||||
<NButton type="primary" onClick={handleFormSubmit}>
|
||||
@@ -286,5 +317,5 @@ export default defineComponent({
|
||||
</div>
|
||||
</NForm>
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -428,11 +428,7 @@ export const useAddCaController = () => {
|
||||
const baseRules: any = {
|
||||
name: [{ required: true, message: '请输入CA名称', trigger: 'blur' }],
|
||||
cn: [{ required: true, message: '请输入通用名称', trigger: 'blur' }],
|
||||
o: [{ required: true, message: '请输入组织名称', trigger: 'blur' }],
|
||||
c: [{ required: true, message: '请选择国家', trigger: 'change' }],
|
||||
ou: [{ required: true, message: '请输入组织单位', trigger: 'blur' }],
|
||||
province: [{ required: true, message: '请输入省份', trigger: 'blur' }],
|
||||
locality: [{ required: true, message: '请输入城市', trigger: 'blur' }],
|
||||
key_length: [{ required: true, message: '请选择密钥长度', trigger: 'change' }],
|
||||
valid_days: [{ required: true, message: '请选择有效期', trigger: 'change' }],
|
||||
};
|
||||
@@ -468,7 +464,7 @@ export const useAddCaController = () => {
|
||||
try {
|
||||
openLoad();
|
||||
// 验证必填字段
|
||||
let requiredFields: string[] = ['name', 'cn', 'o', 'c', 'ou', 'province', 'locality', 'key_length', 'valid_days'];
|
||||
let requiredFields: string[] = ['name', 'cn', 'c', 'key_length', 'valid_days'];
|
||||
if (createType.value === 'root') {
|
||||
requiredFields.push('algorithm');
|
||||
}
|
||||
|
||||
@@ -10,21 +10,21 @@
|
||||
<body>
|
||||
<div class="font-sans bg-white text-secondary">
|
||||
<!-- 首屏Banner -->
|
||||
<section class="pt-28 pb-20 md:pt-36 md:pb-28 bg-gradient-to-b">
|
||||
<section class="pt-28 pb-20 md:pt-24 md:pb-28 bg-gradient-to-b">
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="max-w-4xl mx-auto text-center">
|
||||
<div class=" mx-auto text-center">
|
||||
<h1 class="text-[clamp(2rem,5vw,3.5rem)] font-bold leading-tight text-dark mb-6 animate-fade-in">
|
||||
堡塔<span class="text-primary">域名注册</span>重磅上线!<br />一站式搞定建站访问
|
||||
</h1>
|
||||
<p class="text-[clamp(1rem,2vw,1.25rem)] text-secondary-80 mb-10 max-w-2xl mx-auto">
|
||||
.com低至54元,.cn低至20元!部分后缀新人9.9元注册
|
||||
.com低至53.9元,.cn低至19.9元!部分后缀新人9.9元注册
|
||||
</p>
|
||||
<!-- 搜索框和按钮 -->
|
||||
<div id="search-section" class="flex flex-col sm:flex-row max-w-3xl mx-auto mb-8 gap-4">
|
||||
<div id="search-section" class="flex flex-col sm:flex-row max-w-3xl mx-auto gap-4 pb-20">
|
||||
<div class="input-container">
|
||||
<input type="text" placeholder="输入您想注册的域名(如:yourbrand)" class="search-input" id="domain-query-input" />
|
||||
<i class="fa fa-times-circle clear-input-button" id="clear-input-button" title="清空输入"></i>
|
||||
<div class="mt-2 text-left"><a class="text-primary hover:text-primary" style="text-decoration: none;" href="/domain/domain/transfer">域名转入 .cn地址31元</a></div>
|
||||
<div class="mt-2 text-left"><a class="text-primary hover:text-primary" style="text-decoration: none;" href="/domain/domain/transfer">域名转入 .cn地址29.9元</a></div>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<a id="domain-query-button"
|
||||
@@ -37,53 +37,160 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 价格表格 -->
|
||||
<div class="mt-24 md:mt-36 mx-auto max-w-[900px]">
|
||||
<div class="text-center mb-8">
|
||||
<h2 class="text-clamp font-bold text-dark mb-4" style="margin-top: 60px">域名价格一览表</h2>
|
||||
<div class="text-secondary-80 max-w-2xl mx-auto px-4">
|
||||
透明的价格体系,无隐藏费用,让您明明白白消费,更多服务<span
|
||||
class="contact-service-trigger border-b border-dashed border-primary cursor-pointer relative">请联系客服咨询
|
||||
<!-- 二维码悬浮层 -->
|
||||
<div
|
||||
class="qr-code-popup absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 opacity-0 invisible transition-all duration-300 z-50">
|
||||
<div class="bg-white rounded-lg shadow-xl p-4 border border-gray-200">
|
||||
<div class="text-center mb-2">
|
||||
<p class="text-sm font-medium text-gray-700">扫码联系客服</p>
|
||||
<!-- 0.01秒杀活动区域 -->
|
||||
<div class="seckill-activity-section py-20" id="seckill-activity" style="display: none;">
|
||||
<div class="container">
|
||||
<!-- 活动标题与规则说明 -->
|
||||
<div class="activity-header text-center mb-6">
|
||||
<h2 class="activity-title text-2xl md:text-3xl font-bold text-primary mb-3">
|
||||
开学季专属福利 · 0.01元限量秒杀
|
||||
</h2>
|
||||
<div class="activity-rules flex flex-col sm:flex-row items-center justify-center gap-4 text-sm text-secondary-70">
|
||||
<div class="rule-item flex items-center gap-2">
|
||||
<i class="fa fa-star text-primary"></i>
|
||||
<span>每日限量100个名额</span>
|
||||
</div>
|
||||
<div class="rule-item flex items-center gap-2">
|
||||
<i class="fa fa-ban text-primary"></i>
|
||||
<span>每个账号仅限参与1次</span>
|
||||
</div>
|
||||
<div class="rule-item flex items-center gap-2">
|
||||
<i class="fa fa-ticket text-primary"></i>
|
||||
<span>领取资格后即可使用</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 扁平化商品卡片 -->
|
||||
<div class="seckill-flat-card">
|
||||
<div class="flat-card-container">
|
||||
<!-- 左侧:产品信息区 -->
|
||||
<div class="product-info-section">
|
||||
<div class="product-badge">
|
||||
<i class="fa fa-fire"></i>
|
||||
<span>10:00准时开抢</span>
|
||||
</div>
|
||||
<!-- 二维码SVG -->
|
||||
<img src="https://www.bt.cn/Public/new/images/wechat-qrcode.png" alt="二维码"
|
||||
class="w-24 h-24 mx-auto" />
|
||||
<div class="text-center mt-2">
|
||||
<p class="text-xs text-gray-500">微信客服</p>
|
||||
<div class="product-content">
|
||||
<h3 class="product-name">域名注册 0.01元秒杀</h3>
|
||||
<p class="product-desc">.top/.icu/.xyz/.cyou后缀每日限量100个名额,每日上午10:00准时开枪</p>
|
||||
</div>
|
||||
<!-- 小箭头 -->
|
||||
<div
|
||||
class="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-white">
|
||||
</div>
|
||||
|
||||
<!-- 右侧:购买信息区(水平4列) -->
|
||||
<div class="purchase-info-section">
|
||||
<!-- 第1列:购买时长 -->
|
||||
<div class="info-column">
|
||||
<div class="column-label">购买时长</div>
|
||||
<div class="column-value">1年</div>
|
||||
</div>
|
||||
|
||||
<!-- 第2列:购买数量 -->
|
||||
<div class="info-column">
|
||||
<div class="column-label">购买数量</div>
|
||||
<div class="column-value">1</div>
|
||||
</div>
|
||||
|
||||
<!-- 第3列:价格信息 -->
|
||||
<div class="info-column price-column">
|
||||
<div class="current-price-info">
|
||||
<span class="price-symbol">¥</span>
|
||||
<span class="price-number">0.01</span>
|
||||
<span class="price-unit">元/1年</span>
|
||||
</div>
|
||||
<div class="original-price-info">
|
||||
<span>官网价格:</span>
|
||||
<span class="strikethrough">¥97.9元/1年</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第4列:倒计时与操作 -->
|
||||
<div class="info-column action-column">
|
||||
<!-- 进度信息(活动开始后显示,替代倒计时) -->
|
||||
<div class="progress-info" id="progress-info-section" style="display: none;">
|
||||
<span class="progress-text" id="progress-text-flat">已售0%</span>
|
||||
<div class="progress-bar-mini">
|
||||
<div class="progress-fill-mini" id="progress-fill-flat" style="width: 0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 倒计时区域(活动开始前显示) -->
|
||||
<div class="countdown-section" id="countdown-section">
|
||||
<div class="countdown-label-mini">距离下次开抢</div>
|
||||
<div class="countdown-display-mini">
|
||||
<span class="time-digit-mini" id="countdown-hours-flat">00</span>
|
||||
<span class="time-sep">:</span>
|
||||
<span class="time-digit-mini" id="countdown-minutes-flat">00</span>
|
||||
<span class="time-sep">:</span>
|
||||
<span class="time-digit-mini" id="countdown-seconds-flat">00</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="seckill-btn-flat" id="seckill-action-btn-flat">
|
||||
<span class="btn-text">即将开始</span>
|
||||
<div class="btn-loading" style="display: none;">
|
||||
<i class="fa fa-spinner fa-spin"></i>
|
||||
</div>
|
||||
</button>
|
||||
<div class="action-tips-mini" id="action-tips-flat">
|
||||
活动即将开始,请耐心等待
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-tips-mini action-tips-footer-info">
|
||||
* 活动截止时间是2025年9月15日,抢到秒杀资格后请尽快使用
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto px-4 md:px-0">
|
||||
<!-- 现代化价格表格 -->
|
||||
<div class="modern-price-table bg-white overflow-hidden shadow-lg">
|
||||
<!-- 表头 -->
|
||||
<div class="price-table-header bg-gradient-to-r from-primary to-green-600 text-white py-4 px-4">
|
||||
<div class="grid grid-cols-4 gap-4 text-center">
|
||||
<div class="text-sm md:text-base font-semibold">域名后缀</div>
|
||||
<div class="text-sm md:text-base font-semibold">首年价格</div>
|
||||
<div class="text-sm md:text-base font-semibold">续费价格</div>
|
||||
<div class="text-sm md:text-base font-semibold">转入续费</div>
|
||||
</div>
|
||||
<!-- 价格表格 -->
|
||||
<div class="mx-auto max-w-[900px]">
|
||||
<div class="text-center mb-8">
|
||||
<h2 class="text-clamp font-bold text-dark mb-4" style="margin-top: 80px">域名价格一览表</h2>
|
||||
<div class="text-secondary-80 max-w-4xl mx-auto px-4">
|
||||
透明的价格体系,无隐藏费用,让您明明白白消费,更多服务请<a class="border-b border-dashed border-primary text-secondary-80" href="https://qm.qq.com/q/fxbto4wZkk" target="_blank" rel="noopener" style="text-decoration: none;">加入QQ群</a>或者<span
|
||||
class="contact-service-trigger cursor-pointer border-b border-dashed border-primary relative">请联系客服咨询
|
||||
<!-- 二维码悬浮层 -->
|
||||
<div
|
||||
class="qr-code-popup absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 opacity-0 invisible transition-all duration-300 z-50">
|
||||
<div class="bg-white rounded-lg shadow-xl p-4 border border-gray-200">
|
||||
<div class="text-center mb-2">
|
||||
<p class="text-sm font-medium text-gray-700">扫码联系客服</p>
|
||||
</div>
|
||||
<!-- 二维码SVG -->
|
||||
<img src="https://www.bt.cn/Public/new/images/wechat-qrcode.png" alt="二维码"
|
||||
class="w-24 h-24 mx-auto" />
|
||||
<div class="text-center mt-2">
|
||||
<p class="text-xs text-gray-500">微信客服</p>
|
||||
</div>
|
||||
<!-- 小箭头 -->
|
||||
<div
|
||||
class="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-white">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<!-- 表格内容 -->
|
||||
<div class="price-table-body" id="price-table-body">
|
||||
<!-- 动态生成的价格表格内容 -->
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto px-4 md:px-0">
|
||||
<!-- 现代化价格表格 -->
|
||||
<div class="modern-price-table bg-white overflow-hidden shadow-lg">
|
||||
<!-- 表头 -->
|
||||
<div class="price-table-header bg-gradient-to-r from-primary to-green-600 text-white py-4 px-4">
|
||||
<div class="grid grid-cols-4 gap-4 text-center">
|
||||
<div class="text-sm md:text-base font-semibold">域名后缀</div>
|
||||
<div class="text-sm md:text-base font-semibold">首年价格</div>
|
||||
<div class="text-sm md:text-base font-semibold">续费价格</div>
|
||||
<div class="text-sm md:text-base font-semibold">转入续费</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表格内容 -->
|
||||
<div class="price-table-body" id="price-table-body">
|
||||
<!-- 动态生成的价格表格内容 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,6 +41,9 @@ import type {
|
||||
OrderDetailRequest,
|
||||
OrderDetailResponseData,
|
||||
} from "../types/api-types/order-detail";
|
||||
import type {
|
||||
SeckillActivityInfoResponseData,
|
||||
} from "../types/api-types/flashsale";
|
||||
|
||||
// 落地页-域名查询
|
||||
export function domainQueryCheck(
|
||||
@@ -154,6 +157,15 @@ export function getOrderDetail(
|
||||
return api.post<OrderDetailResponseData>("/v1/order/detail", data, headers);
|
||||
}
|
||||
|
||||
// 获取今日秒杀活动信息
|
||||
export function getSeckillActivityInfo(): Promise<ApiResponse<SeckillActivityInfoResponseData>> {
|
||||
return api.post<SeckillActivityInfoResponseData>("v1/user/flashsale/get_today_info",{});
|
||||
}
|
||||
// 领取秒杀
|
||||
export function grabSeckill(): Promise<ApiResponse> {
|
||||
return api.post("v1/user/flashsale/grab_coupon", {});
|
||||
}
|
||||
|
||||
/**
|
||||
* WHOIS查询API
|
||||
* @param domain 域名
|
||||
|
||||
@@ -4,66 +4,615 @@ import { renderTemplateList } from "@utils/core";
|
||||
import type { DomainPrice } from "@types";
|
||||
import { NotificationManager } from "@utils";
|
||||
import { bindContactServicePopupClick } from "@utils";
|
||||
import { getSeckillActivityInfo, grabSeckill } from "../api/landing";
|
||||
|
||||
window.isLoggedIn = localStorage.getItem("isLogin") === "true";
|
||||
// window.isLoggedIn = localStorage.getItem("isLogin") === "true";
|
||||
window.isLoggedIn = true;
|
||||
const isDev = (): boolean => process.env.NODE_ENV === "development";
|
||||
|
||||
/**
|
||||
* 秒杀活动状态枚举
|
||||
*/
|
||||
enum SeckillStatus {
|
||||
NOT_STARTED = 'not_started', // 未开始
|
||||
CAN_QUALIFY = 'can_qualify', // 可领资格
|
||||
CAN_SECKILL = 'can_seckill', // 可秒杀
|
||||
PARTICIPATED = 'participated', // 已参与
|
||||
SOLD_OUT = 'sold_out' // 已抢完
|
||||
}
|
||||
/**
|
||||
* 秒杀活动数据接口
|
||||
*/
|
||||
interface SeckillActivityData {
|
||||
startTime: string; // 开始时间 (HH:mm 格式)
|
||||
totalQuota: number; // 总配额
|
||||
grabbedCount: number; // 已抢数量
|
||||
userStatus: SeckillStatus; // 用户状态
|
||||
isActive: boolean; // 活动是否激活
|
||||
}
|
||||
|
||||
/**
|
||||
* 秒杀活动数据适配器
|
||||
*/
|
||||
class SeckillDataAdapter {
|
||||
/**
|
||||
* 映射API状态到前端状态
|
||||
*/
|
||||
static mapGrabStatusToSeckillStatus(grabStatus: number, isLoggedIn: boolean): SeckillStatus {
|
||||
switch(grabStatus) {
|
||||
case 0: // 可抢
|
||||
return isLoggedIn ? SeckillStatus.CAN_SECKILL : SeckillStatus.CAN_QUALIFY;
|
||||
case 1: // 已抢到未使用
|
||||
case 2: // 已使用
|
||||
return SeckillStatus.PARTICIPATED;
|
||||
case 3: // 活动未开始
|
||||
return SeckillStatus.NOT_STARTED;
|
||||
case 4: // 活动已结束
|
||||
case 5: // 已抢完
|
||||
return SeckillStatus.SOLD_OUT;
|
||||
default:
|
||||
return SeckillStatus.NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 倒计时管理器
|
||||
*/
|
||||
class SeckillTimer {
|
||||
private targetTime: Date;
|
||||
private timer: number | null = null;
|
||||
private onUpdate: ((timeLeft: { hours: number; minutes: number; seconds: number }) => void) | null = null;
|
||||
private onComplete: (() => void) | null = null;
|
||||
|
||||
constructor(targetHour: number = 10, targetMinute: number = 0) {
|
||||
this.targetTime = this.calculateNextTarget(targetHour, targetMinute);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算下一个目标时间
|
||||
*/
|
||||
private calculateNextTarget(hour: number, minute: number): Date {
|
||||
const now = new Date();
|
||||
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), hour, minute, 0);
|
||||
|
||||
// 如果今天的时间已过,计算明天的时间
|
||||
if (today <= now) {
|
||||
today.setDate(today.getDate() + 1);
|
||||
}
|
||||
|
||||
return today;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始倒计时
|
||||
*/
|
||||
start(onUpdate?: (timeLeft: { hours: number; minutes: number; seconds: number }) => void, onComplete?: () => void): void {
|
||||
this.onUpdate = onUpdate || null;
|
||||
this.onComplete = onComplete || null;
|
||||
this.tick();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止倒计时
|
||||
*/
|
||||
stop(): void {
|
||||
if (this.timer) {
|
||||
window.clearTimeout(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 倒计时逻辑
|
||||
*/
|
||||
private tick(): void {
|
||||
const now = new Date();
|
||||
const timeLeft = this.targetTime.getTime() - now.getTime();
|
||||
|
||||
if (timeLeft <= 0) {
|
||||
// 倒计时结束
|
||||
if (this.onComplete) {
|
||||
this.onComplete();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const hours = Math.floor(timeLeft / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
|
||||
const seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
|
||||
|
||||
if (this.onUpdate) {
|
||||
this.onUpdate({ hours, minutes, seconds });
|
||||
}
|
||||
|
||||
this.timer = window.setTimeout(() => this.tick(), 1000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 秒杀活动状态管理器
|
||||
*/
|
||||
class SeckillStateManager {
|
||||
private currentStatus: SeckillStatus = SeckillStatus.NOT_STARTED;
|
||||
private activityData!: SeckillActivityData;
|
||||
private clickDebounceTimer: number | null = null;
|
||||
|
||||
constructor() {
|
||||
// 初始化默认状态,等待API数据
|
||||
this.setupDefaultData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步初始化API数据
|
||||
*/
|
||||
async initialize(): Promise<void> {
|
||||
await this.initWithApiData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过API初始化活动数据
|
||||
*/
|
||||
async initWithApiData(): Promise<void> {
|
||||
try {
|
||||
const response = await getSeckillActivityInfo();
|
||||
if (response.status === true && response.data) {
|
||||
const { grab_status, remaining_coupons, total_coupons } = response.data;
|
||||
|
||||
// 设置初始状态
|
||||
const isLoggedIn = (window as any).isLoggedIn;
|
||||
this.currentStatus = SeckillDataAdapter.mapGrabStatusToSeckillStatus(
|
||||
grab_status,
|
||||
isLoggedIn,
|
||||
);
|
||||
|
||||
// 设置活动数据(保持现有结构)
|
||||
this.activityData = {
|
||||
startTime: "10:00", // 保持现有逻辑
|
||||
totalQuota: total_coupons,
|
||||
grabbedCount: total_coupons - remaining_coupons,
|
||||
userStatus: this.currentStatus,
|
||||
isActive: true // 保持现有逻辑
|
||||
};
|
||||
} else {
|
||||
// API调用失败,使用默认数据
|
||||
this.setupDefaultData();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取活动数据失败:', error);
|
||||
// 错误时使用默认数据
|
||||
this.setupDefaultData();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认数据
|
||||
*/
|
||||
private setupDefaultData(): void {
|
||||
// 使用默认数据,保持现有逻辑
|
||||
const randomGrabbedCount = Math.floor(Math.random() * 30) + 5;
|
||||
this.activityData = {
|
||||
startTime: "10:00",
|
||||
totalQuota: 100,
|
||||
grabbedCount: randomGrabbedCount,
|
||||
userStatus: SeckillStatus.NOT_STARTED,
|
||||
isActive: true
|
||||
};
|
||||
this.currentStatus = SeckillStatus.NOT_STARTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
updateStatus(newStatus: SeckillStatus): void {
|
||||
this.currentStatus = newStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前状态
|
||||
*/
|
||||
getCurrentStatus(): SeckillStatus {
|
||||
return this.currentStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动数据
|
||||
*/
|
||||
getActivityData(): SeckillActivityData {
|
||||
return { ...this.activityData };
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新进度
|
||||
*/
|
||||
updateProgress(grabbedCount: number): void {
|
||||
this.activityData.grabbedCount = Math.min(grabbedCount, this.activityData.totalQuota);
|
||||
}
|
||||
|
||||
/**
|
||||
* 防重复点击
|
||||
*/
|
||||
debounceClick(callback: () => void, delay: number = 3000): void {
|
||||
if (this.clickDebounceTimer) {
|
||||
return;
|
||||
}
|
||||
|
||||
callback();
|
||||
this.clickDebounceTimer = window.setTimeout(() => {
|
||||
this.clickDebounceTimer = null;
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 秒杀活动主类
|
||||
*/
|
||||
class SeckillActivity {
|
||||
private timer: SeckillTimer;
|
||||
private stateManager: SeckillStateManager;
|
||||
private $container: any;
|
||||
private $btn: any;
|
||||
private $btnText: any;
|
||||
private $btnLoading: any;
|
||||
private $tips: any;
|
||||
private $progressBar: any;
|
||||
private $progressText: any;
|
||||
private $countdownSection: any;
|
||||
private $progressSection: any;
|
||||
|
||||
constructor() {
|
||||
// 倒计时时间,10:00
|
||||
this.timer = new SeckillTimer(10, 0);
|
||||
|
||||
this.stateManager = new SeckillStateManager();
|
||||
this.$container = $("#seckill-activity");
|
||||
this.$btn = $("#seckill-action-btn-flat");
|
||||
this.$btnText = this.$btn.find(".btn-text");
|
||||
this.$btnLoading = this.$btn.find(".btn-loading");
|
||||
this.$tips = $("#action-tips-flat");
|
||||
this.$progressBar = $("#progress-fill-flat");
|
||||
this.$progressText = $("#progress-text-flat");
|
||||
this.$countdownSection = $("#countdown-section");
|
||||
this.$progressSection = $("#progress-info-section");
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化活动
|
||||
*/
|
||||
async init(): Promise<void> {
|
||||
// 等待状态管理器数据加载完成
|
||||
await this.stateManager.initialize();
|
||||
|
||||
this.renderInitialState();
|
||||
this.bindEvents();
|
||||
this.startTimer();
|
||||
this.checkActivityVisibility();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新活动状态和数据(用于API数据更新后重新渲染)
|
||||
*/
|
||||
refreshState(): void {
|
||||
this.renderInitialState();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查活动显示状态
|
||||
*/
|
||||
private checkActivityVisibility(): void {
|
||||
// 模拟检查活动是否应该显示的逻辑
|
||||
const shouldShow = true; // 可以根据实际需求调整逻辑
|
||||
|
||||
if (shouldShow) {
|
||||
this.$container.show().addClass('animate-fade-in');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染初始状态
|
||||
*/
|
||||
private renderInitialState(): void {
|
||||
const status = this.stateManager.getCurrentStatus();
|
||||
const data = this.stateManager.getActivityData();
|
||||
|
||||
this.updateButtonState(status);
|
||||
|
||||
// 根据状态决定显示倒计时还是进度条
|
||||
if (status === SeckillStatus.NOT_STARTED) {
|
||||
// 活动未开始,显示倒计时,隐藏进度条
|
||||
this.$countdownSection.show();
|
||||
this.$progressSection.hide();
|
||||
} else {
|
||||
// 活动已开始,隐藏倒计时,显示进度条
|
||||
this.$countdownSection.hide();
|
||||
this.$progressSection.show();
|
||||
this.updateProgress(data.grabbedCount, data.totalQuota);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定事件
|
||||
*/
|
||||
private bindEvents(): void {
|
||||
this.$btn.on('click', () => {
|
||||
this.stateManager.debounceClick(() => {
|
||||
this.handleButtonClick();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始倒计时
|
||||
*/
|
||||
private startTimer(): void {
|
||||
this.timer.start(
|
||||
(timeLeft) => this.updateCountdown(timeLeft),
|
||||
() => this.onTimerComplete()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新倒计时显示 - 适配扁平化布局
|
||||
*/
|
||||
private updateCountdown(timeLeft: { hours: number; minutes: number; seconds: number }): void {
|
||||
const $hours = $("#countdown-hours-flat");
|
||||
const $minutes = $("#countdown-minutes-flat");
|
||||
const $seconds = $("#countdown-seconds-flat");
|
||||
|
||||
// 更新数字(无动画效果)
|
||||
const updateDigit = ($element: any, value: number) => {
|
||||
const newValue = value.toString().padStart(2, '0');
|
||||
$element.text(newValue);
|
||||
};
|
||||
|
||||
updateDigit($hours, timeLeft.hours);
|
||||
updateDigit($minutes, timeLeft.minutes);
|
||||
updateDigit($seconds, timeLeft.seconds);
|
||||
|
||||
// 时间紧迫时的特殊样式
|
||||
const totalMinutes = timeLeft.hours * 60 + timeLeft.minutes;
|
||||
if (totalMinutes < 10) {
|
||||
$(".time-digit-mini").addClass('urgent');
|
||||
} else {
|
||||
$(".time-digit-mini").removeClass('urgent');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 倒计时完成处理
|
||||
*/
|
||||
private onTimerComplete(): void {
|
||||
const isLoggedIn = (window as any).isLoggedIn;
|
||||
const newStatus = isLoggedIn ? SeckillStatus.CAN_SECKILL : SeckillStatus.CAN_QUALIFY;
|
||||
|
||||
this.stateManager.updateStatus(newStatus);
|
||||
this.updateButtonState(newStatus);
|
||||
|
||||
// 隐藏倒计时,显示进度条
|
||||
this.$countdownSection.hide();
|
||||
this.$progressSection.show();
|
||||
|
||||
// 更新进度条显示
|
||||
const data = this.stateManager.getActivityData();
|
||||
this.updateProgress(data.grabbedCount, data.totalQuota);
|
||||
|
||||
// 按钮闪烁提示
|
||||
this.$btn.addClass('blink');
|
||||
setTimeout(() => this.$btn.removeClass('blink'), 1500);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新按钮状态
|
||||
*/
|
||||
private updateButtonState(status: SeckillStatus): void {
|
||||
// 清除所有状态类
|
||||
this.$btn.removeClass('not-started can-qualify can-seckill participated sold-out loading');
|
||||
|
||||
const config = this.getButtonConfig(status);
|
||||
this.$btn.addClass(config.className);
|
||||
this.$btnText.text(config.text);
|
||||
this.$tips.html(config.tips);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取按钮配置
|
||||
*/
|
||||
private getButtonConfig(status: SeckillStatus): { className: string; text: string; tips: string } {
|
||||
const configs = {
|
||||
[SeckillStatus.NOT_STARTED]: {
|
||||
className: "not-started",
|
||||
text: "即将开始",
|
||||
tips: "活动即将开始,请耐心等待",
|
||||
},
|
||||
[SeckillStatus.CAN_QUALIFY]: {
|
||||
className: "can-qualify",
|
||||
text: "领取资格",
|
||||
tips: "点击领取秒杀资格",
|
||||
},
|
||||
[SeckillStatus.CAN_SECKILL]: {
|
||||
className: "can-seckill",
|
||||
text: "立即领取",
|
||||
tips: "限时秒杀进行中,立即抢购",
|
||||
},
|
||||
[SeckillStatus.PARTICIPATED]: {
|
||||
className: "participated",
|
||||
text: "已领取",
|
||||
tips: "您已成功领取秒杀名额</br>快去<a href='/new/domain-query-register.html' class='text-primary hover:text-primary' target='_blank' rel='noopener'>注册域名</a>吧",
|
||||
},
|
||||
[SeckillStatus.SOLD_OUT]: {
|
||||
className: "sold-out",
|
||||
text: "已抢完",
|
||||
tips: "今日名额已抢完,明日再来",
|
||||
},
|
||||
};
|
||||
|
||||
return configs[status];
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理按钮点击
|
||||
*/
|
||||
private handleButtonClick(): void {
|
||||
const status = this.stateManager.getCurrentStatus();
|
||||
|
||||
this.$btn.addClass('btn-click');
|
||||
setTimeout(() => this.$btn.removeClass('btn-click'), 200);
|
||||
|
||||
switch (status) {
|
||||
case SeckillStatus.CAN_QUALIFY:
|
||||
this.handleQualifyAction();
|
||||
break;
|
||||
case SeckillStatus.CAN_SECKILL:
|
||||
this.handleSeckillAction();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理资格领取
|
||||
*/
|
||||
private handleQualifyAction(): void {
|
||||
NotificationManager.show({
|
||||
type: "warning",
|
||||
message: "请先登录后再领取资格",
|
||||
});
|
||||
setTimeout(() => {
|
||||
location.href = `/login.html?ReturnUrl=${location.href}`;
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理秒杀操作
|
||||
*/
|
||||
private async handleSeckillAction(): Promise<void> {
|
||||
try {
|
||||
this.setButtonLoading(true);
|
||||
// 这里请求领取接口
|
||||
const response = await grabSeckill() as any;
|
||||
|
||||
if (response.status === true) {
|
||||
// 成功后更新状态
|
||||
this.stateManager.updateStatus(SeckillStatus.PARTICIPATED);
|
||||
|
||||
// 更新进度(模拟增加一个已抢数量)
|
||||
const data = this.stateManager.getActivityData();
|
||||
const newGrabbedCount = data.grabbedCount + 1;
|
||||
this.stateManager.updateProgress(newGrabbedCount);
|
||||
this.updateProgress(newGrabbedCount, data.totalQuota);
|
||||
|
||||
// 显示成功消息
|
||||
NotificationManager.show({
|
||||
type: "success",
|
||||
message: response.msg || "恭喜您!成功领取秒杀名额",
|
||||
});
|
||||
} else {
|
||||
// 失败时显示错误消息
|
||||
NotificationManager.show({
|
||||
type: "error",
|
||||
message: response.msg || "领取失败,请稍后重试",
|
||||
});
|
||||
}
|
||||
} catch (error: any) {
|
||||
NotificationManager.show({
|
||||
type: "error",
|
||||
message: error.message || "网络错误,请稍后重试",
|
||||
});
|
||||
} finally {
|
||||
this.setButtonLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置按钮加载状态
|
||||
*/
|
||||
private setButtonLoading(loading: boolean): void {
|
||||
if (loading) {
|
||||
this.$btn.addClass('loading');
|
||||
this.$btnLoading.show();
|
||||
} else {
|
||||
this.$btn.removeClass('loading');
|
||||
this.$btnLoading.hide();
|
||||
const status = this.stateManager.getCurrentStatus();
|
||||
this.updateButtonState(status);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新进度条 - 支持百分比显示
|
||||
*/
|
||||
private updateProgress(current: number, total: number): void {
|
||||
const percentage = Math.min((current / total) * 100, 100);
|
||||
this.$progressBar.css('width', `${percentage}%`);
|
||||
|
||||
// 显示百分比
|
||||
if (percentage >= 100) {
|
||||
this.$progressText.text('已抢100%');
|
||||
} else {
|
||||
this.$progressText.text(`已抢${Math.floor(percentage)}%`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 域名价格数据 - 纯数据对象f
|
||||
*/
|
||||
const domainPriceData: DomainPrice[] = [
|
||||
{
|
||||
suffix: ".com",
|
||||
originalPrice: 89,
|
||||
firstYearPrice: 54,
|
||||
renewPrice: 79,
|
||||
transferPrice: 79,
|
||||
},
|
||||
{
|
||||
suffix: ".net",
|
||||
originalPrice: 99,
|
||||
firstYearPrice: 86,
|
||||
renewPrice: 89,
|
||||
transferPrice: 89,
|
||||
},
|
||||
{
|
||||
suffix: ".cn",
|
||||
originalPrice: 39,
|
||||
firstYearPrice: 20,
|
||||
renewPrice: 34,
|
||||
transferPrice: 31,
|
||||
firstYearPrice: 19.9,
|
||||
renewPrice: 33.9,
|
||||
transferPrice: 29.9,
|
||||
},
|
||||
{
|
||||
suffix: ".com",
|
||||
originalPrice: 89,
|
||||
firstYearPrice: 53.9,
|
||||
renewPrice: 79,
|
||||
transferPrice: 79,
|
||||
},
|
||||
{
|
||||
suffix: ".top",
|
||||
originalPrice: 49,
|
||||
firstYearPrice: 9.9,
|
||||
renewPrice: 31,
|
||||
transferPrice: 31,
|
||||
// isWan: true,
|
||||
},
|
||||
{
|
||||
suffix: ".cyou",
|
||||
originalPrice: 109,
|
||||
firstYearPrice: 9.9,
|
||||
renewPrice: 98,
|
||||
transferPrice: 98,
|
||||
// isWan: true,
|
||||
},
|
||||
{
|
||||
suffix: ".icu",
|
||||
originalPrice: 109,
|
||||
firstYearPrice: 9.9,
|
||||
renewPrice: 98,
|
||||
transferPrice: 98,
|
||||
renewPrice: 29.9,
|
||||
transferPrice: 29.9,
|
||||
// isWan: true,
|
||||
},
|
||||
{
|
||||
suffix: ".xyz",
|
||||
originalPrice: 109,
|
||||
firstYearPrice: 9.9,
|
||||
renewPrice: 92,
|
||||
transferPrice: 92,
|
||||
renewPrice: 91.9,
|
||||
transferPrice: 91.9,
|
||||
// isWan: true,
|
||||
},
|
||||
{
|
||||
suffix: ".cyou",
|
||||
originalPrice: 109,
|
||||
firstYearPrice: 9.9,
|
||||
renewPrice: 97.9,
|
||||
transferPrice: 97.9,
|
||||
// isWan: true,
|
||||
},
|
||||
{
|
||||
suffix: ".icu",
|
||||
originalPrice: 109,
|
||||
firstYearPrice: 9.9,
|
||||
renewPrice: 97.9,
|
||||
transferPrice: 97.9,
|
||||
// isWan: true,
|
||||
},
|
||||
{
|
||||
suffix: ".net",
|
||||
originalPrice: 99,
|
||||
firstYearPrice: 85.9,
|
||||
renewPrice: 85.9,
|
||||
transferPrice: 85.9,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -178,8 +727,8 @@ const handleDomainQuery = (): void => {
|
||||
}
|
||||
|
||||
if (query) {
|
||||
window.location.href = `/new/domain-query-register.html?search=${encodeURIComponent(
|
||||
query
|
||||
window.location.href = `${isDev() ? "" : "/new"}/domain-query-register.html?search=${encodeURIComponent(
|
||||
query,
|
||||
)}`; // 跳转到注册页并携带查询词
|
||||
} else {
|
||||
$input.focus().addClass("shake"); // 空值时聚焦并触发轻微抖动提示
|
||||
@@ -453,10 +1002,18 @@ const initCartButton = (): void => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化秒杀活动
|
||||
*/
|
||||
const initSeckillActivity = async (): Promise<void> => {
|
||||
const seckillActivity = new SeckillActivity();
|
||||
await seckillActivity.init();
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化所有 UI 事件与页面效果
|
||||
*/
|
||||
const initUIEvents = (): void => {
|
||||
const initUIEvents = async (): Promise<void> => {
|
||||
initFaqToggles();
|
||||
initPageLoadAnimations();
|
||||
initDomainQueryEvents();
|
||||
@@ -466,17 +1023,19 @@ const initUIEvents = (): void => {
|
||||
initScrollToSearchButton();
|
||||
initServiceQRCode();
|
||||
initCartButton();
|
||||
// 异步初始化秒杀活动,等待API数据加载
|
||||
await initSeckillActivity();
|
||||
};
|
||||
|
||||
/**
|
||||
* 应用初始化(等待 jQuery 可用后初始化 UI)
|
||||
*/
|
||||
const initApp = (): void => {
|
||||
const initApp = async (): Promise<void> => {
|
||||
if (typeof (window as any).jQuery === "undefined") {
|
||||
window.setTimeout(initApp, 100); // 依赖 jQuery,未加载则轮询等待
|
||||
return;
|
||||
}
|
||||
initUIEvents();
|
||||
await initUIEvents();
|
||||
(window as any).scrollToSearchBox = scrollToSearchBox; // 暴露给内联事件或其他脚本调用
|
||||
};
|
||||
|
||||
|
||||
@@ -742,6 +742,8 @@ button{
|
||||
color: #374151;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@@ -1404,6 +1406,9 @@ th.text-center {
|
||||
border-radius: 4px 4px 0 0;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
@@ -2223,12 +2228,12 @@ th.text-center {
|
||||
line-height: 1.4;
|
||||
margin: 0;
|
||||
}
|
||||
/* 隐藏“注册域名”说明文案 */
|
||||
/* 隐藏"注册域名"说明文案 */
|
||||
.cart-payment-modal .domain-suffix { display: none; }
|
||||
|
||||
/* 下层左:年限选择 */
|
||||
.cart-payment-modal .cart-item-options { grid-area: year; }
|
||||
/* 隐藏“购买年限”说明文案 */
|
||||
/* 隐藏"购买年限"说明文案 */
|
||||
.cart-payment-modal .option-label { display: none; }
|
||||
/* 年限选择器尺寸与行高优化 */
|
||||
.cart-payment-modal .year-selector .select-display {
|
||||
@@ -2336,7 +2341,7 @@ th.text-center {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
/* 把原“价格+按钮”的父容器扁平化,不占位 */
|
||||
/* 把原"价格+按钮"的父容器扁平化,不占位 */
|
||||
.cart-payment-modal .payment-section > .price-pos {
|
||||
display: contents;
|
||||
}
|
||||
@@ -2363,5 +2368,559 @@ th.text-center {
|
||||
}
|
||||
}
|
||||
|
||||
/* =========================== */
|
||||
/* 0.01秒杀活动样式 */
|
||||
/* =========================== */
|
||||
|
||||
|
||||
/* 活动标题 */
|
||||
.activity-title {
|
||||
background: linear-gradient(135deg, var(--primary) 0%, #16a34a 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
/* 活动规则说明 */
|
||||
.activity-rules .rule-item {
|
||||
background: rgba(32, 165, 58, 0.05);
|
||||
padding: 8px 12px;
|
||||
border-radius: 20px;
|
||||
border: 1px solid rgba(32, 165, 58, 0.15);
|
||||
}
|
||||
|
||||
/* 扁平化商品卡片 */
|
||||
.seckill-flat-card {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
|
||||
overflow: hidden;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.flat-card-container {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 3fr;
|
||||
height: 180px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 左侧产品信息区 */
|
||||
.product-info-section {
|
||||
background: linear-gradient(135deg, var(--primary) 0%, #16a34a 100%);
|
||||
color: white;
|
||||
padding: 24px 28px;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.product-badge {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 16px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
backdrop-filter: blur(8px);
|
||||
padding: 6px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.product-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 14px;
|
||||
opacity: 0.9;
|
||||
line-height: 1.4;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 右侧购买信息区(4列网格) */
|
||||
.purchase-info-section {
|
||||
padding: 20px 24px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1.5fr 1.2fr;
|
||||
gap: 20px;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.info-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.column-label {
|
||||
font-size: 14px;
|
||||
color: var(--secondary-70);
|
||||
margin-bottom: 6px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.column-value {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--dark);
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
/* 价格列样式 */
|
||||
.price-column {
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.current-price-info {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 2px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.price-symbol {
|
||||
font-size: 16px;
|
||||
color: #f97316;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.price-number {
|
||||
font-size: 24px;
|
||||
color: #f97316;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.price-unit {
|
||||
font-size: 12px;
|
||||
color: #f97316;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.original-price-info {
|
||||
font-size: 12px;
|
||||
color: var(--secondary-70);
|
||||
margin-bottom: 50px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.progress-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
font-size: 12px;
|
||||
color: var(--primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.progress-bar-mini {
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
background: #e5e7eb;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-fill-mini {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--primary) 0%, #16a34a 100%);
|
||||
border-radius: 2px;
|
||||
transition: width 0.5s ease;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-fill-mini::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
|
||||
animation: progress-shine 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes progress-shine {
|
||||
0% { left: -100%; }
|
||||
100% { left: 100%; }
|
||||
}
|
||||
|
||||
/* 操作列样式 */
|
||||
.action-column {
|
||||
text-align: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* 倒计时区域 */
|
||||
.countdown-section {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.countdown-label-mini {
|
||||
font-size: 12px;
|
||||
color: var(--secondary-70);
|
||||
margin-bottom: 4px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.countdown-display-mini {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
margin-bottom: 4px;
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
||||
}
|
||||
|
||||
/* 进度信息区域(替代倒计时位置) */
|
||||
#progress-info-section {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.time-digit-mini {
|
||||
background: var(--primary);
|
||||
color: white;
|
||||
padding: 6px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
min-width: 32px;
|
||||
text-align: center;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.time-digit-mini.urgent {
|
||||
background: #e53e3e;
|
||||
animation: urgent-pulse 1s infinite;
|
||||
}
|
||||
|
||||
.time-digit-mini.animate {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
@keyframes urgent-pulse {
|
||||
0%, 100% { transform: scale(1); }
|
||||
50% { transform: scale(1.02); }
|
||||
}
|
||||
|
||||
.time-sep {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.seckill-btn-flat {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(135deg, var(--primary) 0%, #16a34a 100%);
|
||||
color: white;
|
||||
box-shadow: 0 2px 8px rgba(32, 165, 58, 0.3);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.seckill-btn-flat:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(32, 165, 58, 0.4);
|
||||
}
|
||||
|
||||
.seckill-btn-flat.not-started {
|
||||
background: #9ca3af;
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.seckill-btn-flat.not-started:hover {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.seckill-btn-flat.can-seckill {
|
||||
animation: seckill-pulse 1.5s infinite;
|
||||
}
|
||||
|
||||
@keyframes seckill-pulse {
|
||||
0% { box-shadow: 0 2px 8px rgba(32, 165, 58, 0.3); }
|
||||
50% { box-shadow: 0 2px 12px rgba(32, 165, 58, 0.5), 0 0 0 2px rgba(32, 165, 58, 0.2); }
|
||||
100% { box-shadow: 0 2px 8px rgba(32, 165, 58, 0.3); }
|
||||
}
|
||||
.seckill-btn-flat.sold-out,
|
||||
.seckill-btn-flat.participated {
|
||||
background: none;
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
border: 1px solid #999999;
|
||||
color:#999999
|
||||
}
|
||||
|
||||
.seckill-btn-flat.participated:hover {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.seckill-btn-flat.sold-out:hover {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.seckill-btn-flat.loading .btn-text {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.seckill-btn-flat .btn-loading {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: white;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.action-tips-mini {
|
||||
font-size: 12px;
|
||||
color: var(--secondary-70);
|
||||
line-height: 1.3;
|
||||
}
|
||||
.action-tips-footer-info{
|
||||
position: absolute;
|
||||
bottom: 38px;
|
||||
left:60px;
|
||||
}
|
||||
|
||||
/* 按钮点击动画 */
|
||||
.seckill-btn.btn-click {
|
||||
animation: btn-click 0.2s ease;
|
||||
}
|
||||
|
||||
@keyframes btn-click {
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(0.95); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
/* 按钮闪烁提示 */
|
||||
.seckill-btn.blink {
|
||||
animation: btn-blink 0.5s ease 3;
|
||||
}
|
||||
|
||||
@keyframes btn-blink {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
}
|
||||
|
||||
/* 响应式适配 */
|
||||
@media (max-width: 920px) {
|
||||
.seckill-activity-section {
|
||||
margin: 1rem 0;
|
||||
padding: 1.5rem 0;
|
||||
}
|
||||
|
||||
.seckill-flat-card {
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
.flat-card-container {
|
||||
grid-template-columns: 1fr;
|
||||
height: auto;
|
||||
min-height: 160px;
|
||||
}
|
||||
|
||||
.product-info-section {
|
||||
padding: 16px 20px;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 20px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.purchase-info-section {
|
||||
padding: 16px 20px;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.action-column {
|
||||
grid-column: 1 / -1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.countdown-section,
|
||||
#progress-info-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.countdown-display-mini {
|
||||
justify-self: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.seckill-btn-flat {
|
||||
height: 36px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.action-tips-mini {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.activity-rules {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.activity-rules .rule-item {
|
||||
padding: 6px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.action-tips-footer-info{
|
||||
position: static;
|
||||
margin-top: 20px;
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
.original-price-info,
|
||||
.column-value{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 740px) {
|
||||
.activity-rules{
|
||||
flex-direction:row;
|
||||
}
|
||||
.activity-rules .rule-item{
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 小屏设备优化 */
|
||||
@media (max-width: 480px) {
|
||||
.activity-title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.seckill-flat-card {
|
||||
margin: 0 0.5rem;
|
||||
}
|
||||
|
||||
.flat-card-container {
|
||||
height: auto;
|
||||
min-height: 140px;
|
||||
}
|
||||
|
||||
.product-info-section {
|
||||
padding: 14px 16px;
|
||||
min-height: 70px;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 12px;
|
||||
}
|
||||
.product-badge{
|
||||
top: 10px;
|
||||
right: 8px;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.purchase-info-section {
|
||||
padding: 14px 16px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.column-label {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.column-value {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.price-number {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.time-digit-mini {
|
||||
font-size: 14px;
|
||||
padding: 4px 6px;
|
||||
min-width: 26px;
|
||||
}
|
||||
|
||||
.seckill-btn-flat {
|
||||
height: 32px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.action-tips-mini {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.countdown-section,
|
||||
#progress-info-section {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.activity-rules .rule-item{
|
||||
padding: 2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.activity-rules .rule-item .fa{
|
||||
display: none;
|
||||
}
|
||||
.original-price-info, .column-value{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
29
frontend/apps/domain-official/src/types/api-types/flashsale.d.ts
vendored
Normal file
29
frontend/apps/domain-official/src/types/api-types/flashsale.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
export type SeckillActivityInfoResponseData = {
|
||||
// 是否可以抢券,false表示不可抢
|
||||
can_grab: boolean;
|
||||
// 优惠券价格,单位:元
|
||||
coupon_price: string;
|
||||
// 当前系统时间
|
||||
current_time: string;
|
||||
// 活动描述
|
||||
description: string;
|
||||
// 活动结束时间
|
||||
end_time: string;
|
||||
// 抢券状态:0=可抢,1=已抢到未使用,2=已使用,3=活动未开始,4=活动已结束,5=已抢完
|
||||
grab_status: number;
|
||||
// 是否有活动,true表示有活动
|
||||
has_activity: boolean;
|
||||
// 剩余优惠券数量
|
||||
remaining_coupons: number;
|
||||
// 活动开始时间
|
||||
start_time: string;
|
||||
// 状态文本描述
|
||||
status_text: string;
|
||||
// 总优惠券数量
|
||||
total_coupons: number;
|
||||
// 用户优惠券状态
|
||||
user_coupon: {
|
||||
// 0: 未领取,1: 已领取,2: 已使用
|
||||
status: number;
|
||||
};
|
||||
};
|
||||
@@ -5,8 +5,8 @@
|
||||
<link rel="icon" href="./favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>AllinSSL</title>
|
||||
<script type="module" crossorigin src="./static/js/main-CVVsEoi-.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./static/css/style-B0WIL3Dv.css">
|
||||
<script type="module" crossorigin src="./static/js/main-BVxorWyM.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./static/css/style-Cb9FPhWh.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
static/build/static/css/style-Cb9FPhWh.css
Normal file
1
static/build/static/css/style-Cb9FPhWh.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
static/build/static/js/CAManageForm-Bt1zZwNW.js
Normal file
1
static/build/static/js/CAManageForm-Bt1zZwNW.js
Normal file
@@ -0,0 +1 @@
|
||||
import{u as t}from"./index-PcCxPxDa.js";import{d as s,c as o}from"./main-BVxorWyM.js";import"./useStore-CPojdwSJ.js";import"./index-yTfFo-nL.js";import"./access-tNugO07J.js";import"./index-BhUxUanl.js";import"./index-D7kMPrCO.js";import"./throttle-C61W3BCh.js";import"./DownloadOutline-B1jf4tcR.js";import"./data-BmphZhVh.js";import"./index-D_D2Mlc-.js";import"./business-DFqzW9Fz.js";import"./index-leYjYcVi.js";import"./text-D7JJPoiP.js";import"./Flex-B1kHIVtt.js";const e=s({name:"CAManageForm",props:{isEdit:{type:Boolean,default:!1},editId:{type:String,default:""}},setup(s){const{CAForm:e}=t(s);return()=>o(e,{labelPlacement:"top"},null)}});export{e as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{u as t}from"./index-fjy6_cH2.js";import{d as s,c as o}from"./main-CVVsEoi-.js";import"./useStore-D2I9NOuy.js";import"./index-LlhX5Hs2.js";import"./access-Du4iSKC0.js";import"./index-DaXJddrY.js";import"./index-B9SDvh40.js";import"./throttle-DQKa2dtP.js";import"./DownloadOutline-BuSEpw-L.js";import"./data-CbrE0j8M.js";import"./index-B6kauwOV.js";import"./business-DixaSQa5.js";import"./index-DOjdH0KK.js";import"./text-DHYNx3gK.js";import"./Flex-C3vnRpt4.js";const e=s({name:"CAManageForm",props:{isEdit:{type:Boolean,default:!1},editId:{type:String,default:""}},setup(s){const{CAForm:e}=t(s);return()=>o(e,{labelPlacement:"top"},null)}});export{e as default};
|
||||
1
static/build/static/js/CreateLeafCertForm-Be3oB_7T.js
Normal file
1
static/build/static/js/CreateLeafCertForm-Be3oB_7T.js
Normal file
@@ -0,0 +1 @@
|
||||
import{u as e}from"./index-yolAsWR-.js";import{d as t,c as r}from"./main-BVxorWyM.js";import"./index-BhUxUanl.js";import"./index-yTfFo-nL.js";import"./ca-BQ6_tJiJ.js";import"./Flex-B1kHIVtt.js";import"./index-D7kMPrCO.js";const s=t({name:"CreateLeafCertForm",props:{list:{type:Array,default:()=>[]}},setup(t){const{CreateLeafCertForm:s}=e(t.list);return()=>r(s,{labelPlacement:"top"},null)}});export{s as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{u as e}from"./index-ediA7WBp.js";import{d as t,c as r}from"./main-CVVsEoi-.js";import"./index-DaXJddrY.js";import"./index-LlhX5Hs2.js";import"./ca-Btr8pAtm.js";import"./Flex-C3vnRpt4.js";import"./index-B9SDvh40.js";const s=t({name:"CreateLeafCertForm",props:{list:{type:Array,default:()=>[]}},setup(t){const{CreateLeafCertForm:s}=e(t.list);return()=>r(s,{labelPlacement:"top"},null)}});export{s as default};
|
||||
@@ -1 +1 @@
|
||||
import{d as n,Y as o,Z as r,_ as e}from"./main-CVVsEoi-.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},l=n({name:"DownloadOutline",render:function(n,l){return r(),o("svg",t,l[0]||(l[0]=[e("path",{d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 272l80 80l80-80"},null,-1),e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 48v288"},null,-1)]))}});export{l as D};
|
||||
import{d as n,Y as o,Z as r,_ as e}from"./main-BVxorWyM.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},l=n({name:"DownloadOutline",render:function(n,l){return r(),o("svg",t,l[0]||(l[0]=[e("path",{d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 272l80 80l80-80"},null,-1),e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 48v288"},null,-1)]))}});export{l as D};
|
||||
@@ -1 +1 @@
|
||||
import{d as e,aV as r,aX as a,H as l,I as t,K as n,b_ as s,a_ as i,k as o,aZ as f,b$ as p,c0 as c}from"./main-CVVsEoi-.js";const u=e({name:"Flex",props:Object.assign(Object.assign({},n.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrap:{type:Boolean,default:!0}}),setup(e){const{mergedClsPrefixRef:r,mergedRtlRef:a}=t(e),l=n("Flex","-flex",void 0,s,e,r);return{rtlEnabled:i("Flex",a,r),mergedClsPrefix:r,margin:o(()=>{const{size:r}=e;if(Array.isArray(r))return{horizontal:r[0],vertical:r[1]};if("number"==typeof r)return{horizontal:r,vertical:r};const{self:{[f("gap",r)]:a}}=l.value,{row:t,col:n}=p(a);return{horizontal:c(n),vertical:c(t)}})}},render(){const{vertical:e,reverse:t,align:n,inline:s,justify:i,margin:o,wrap:f,mergedClsPrefix:p,rtlEnabled:c}=this,u=r(a(this),!1);return u.length?l("div",{role:"none",class:[`${p}-flex`,c&&`${p}-flex--rtl`],style:{display:s?"inline-flex":"flex",flexDirection:e&&!t?"column":e&&t?"column-reverse":!e&&t?"row-reverse":"row",justifyContent:i,flexWrap:!f||e?"nowrap":"wrap",alignItems:n,gap:`${o.vertical}px ${o.horizontal}px`}},u):null}});export{u as N};
|
||||
import{d as e,aV as r,aX as a,H as l,I as t,K as n,b_ as s,a_ as i,k as o,aZ as f,b$ as p,c0 as c}from"./main-BVxorWyM.js";const u=e({name:"Flex",props:Object.assign(Object.assign({},n.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrap:{type:Boolean,default:!0}}),setup(e){const{mergedClsPrefixRef:r,mergedRtlRef:a}=t(e),l=n("Flex","-flex",void 0,s,e,r);return{rtlEnabled:i("Flex",a,r),mergedClsPrefix:r,margin:o(()=>{const{size:r}=e;if(Array.isArray(r))return{horizontal:r[0],vertical:r[1]};if("number"==typeof r)return{horizontal:r,vertical:r};const{self:{[f("gap",r)]:a}}=l.value,{row:t,col:n}=p(a);return{horizontal:c(n),vertical:c(t)}})}},render(){const{vertical:e,reverse:t,align:n,inline:s,justify:i,margin:o,wrap:f,mergedClsPrefix:p,rtlEnabled:c}=this,u=r(a(this),!1);return u.length?l("div",{role:"none",class:[`${p}-flex`,c&&`${p}-flex--rtl`],style:{display:s?"inline-flex":"flex",flexDirection:e&&!t?"column":e&&t?"column-reverse":!e&&t?"row-reverse":"row",justifyContent:i,flexWrap:!f||e?"nowrap":"wrap",alignItems:n,gap:`${o.vertical}px ${o.horizontal}px`}},u):null}});export{u as N};
|
||||
@@ -1 +1 @@
|
||||
import{d as a,Y as l,Z as n,_ as r}from"./main-CVVsEoi-.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 20 20"},o=a({name:"Certificate20Regular",render:function(a,o){return n(),l("svg",t,o[0]||(o[0]=[r("g",{fill:"none"},[r("path",{d:"M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3.146a4.508 4.508 0 0 0-1-.678V5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h7.258c.076.113.157.223.242.329V15H4a2 2 0 0 1-2-2V5zm16.5 6.5c0 .954-.381 1.818-1 2.45V18a.5.5 0 0 1-.8.4l-1.4-1.05a.5.5 0 0 0-.6 0l-1.4 1.05a.5.5 0 0 1-.8-.4v-4.05a3.5 3.5 0 1 1 6-2.45zM15 15c-.537 0-1.045-.12-1.5-.337v2.087l1.243-.746a.5.5 0 0 1 .514 0l1.243.746v-2.087A3.486 3.486 0 0 1 15 15zm0-1a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5zM5 6.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm.5 4.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4z",fill:"currentColor"})],-1)]))}}),h={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},w=a({name:"CloudMonitoring",render:function(a,t){return n(),l("svg",h,t[0]||(t[0]=[r("path",{d:"M28 16v6H4V6h7V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-6zM18 28h-4v-4h4z",fill:"currentColor"},null,-1),r("path",{d:"M18 18h-.01a1 1 0 0 1-.951-.725L15.246 11H11V9h5a1 1 0 0 1 .962.725l1.074 3.76l3.009-9.78A1.014 1.014 0 0 1 22 3a.98.98 0 0 1 .949.684L24.72 9H30v2h-6a1 1 0 0 1-.949-.684l-1.013-3.04l-3.082 10.018A1 1 0 0 1 18 18z",fill:"currentColor"},null,-1)]))}}),v={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},e=a({name:"Flow",render:function(a,t){return n(),l("svg",v,t[0]||(t[0]=[r("path",{d:"M27 22.14V17a2 2 0 0 0-2-2h-8V9.86a4 4 0 1 0-2 0V15H7a2 2 0 0 0-2 2v5.14a4 4 0 1 0 2 0V17h18v5.14a4 4 0 1 0 2 0zM8 26a2 2 0 1 1-2-2a2 2 0 0 1 2 2zm6-20a2 2 0 1 1 2 2a2 2 0 0 1-2-2zm12 22a2 2 0 1 1 2-2a2 2 0 0 1-2 2z",fill:"currentColor"},null,-1)]))}});export{o as C,e as F,w as a};
|
||||
import{d as a,Y as l,Z as n,_ as r}from"./main-BVxorWyM.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 20 20"},o=a({name:"Certificate20Regular",render:function(a,o){return n(),l("svg",t,o[0]||(o[0]=[r("g",{fill:"none"},[r("path",{d:"M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3.146a4.508 4.508 0 0 0-1-.678V5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h7.258c.076.113.157.223.242.329V15H4a2 2 0 0 1-2-2V5zm16.5 6.5c0 .954-.381 1.818-1 2.45V18a.5.5 0 0 1-.8.4l-1.4-1.05a.5.5 0 0 0-.6 0l-1.4 1.05a.5.5 0 0 1-.8-.4v-4.05a3.5 3.5 0 1 1 6-2.45zM15 15c-.537 0-1.045-.12-1.5-.337v2.087l1.243-.746a.5.5 0 0 1 .514 0l1.243.746v-2.087A3.486 3.486 0 0 1 15 15zm0-1a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5zM5 6.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm.5 4.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4z",fill:"currentColor"})],-1)]))}}),h={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},w=a({name:"CloudMonitoring",render:function(a,t){return n(),l("svg",h,t[0]||(t[0]=[r("path",{d:"M28 16v6H4V6h7V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-6zM18 28h-4v-4h4z",fill:"currentColor"},null,-1),r("path",{d:"M18 18h-.01a1 1 0 0 1-.951-.725L15.246 11H11V9h5a1 1 0 0 1 .962.725l1.074 3.76l3.009-9.78A1.014 1.014 0 0 1 22 3a.98.98 0 0 1 .949.684L24.72 9H30v2h-6a1 1 0 0 1-.949-.684l-1.013-3.04l-3.082 10.018A1 1 0 0 1 18 18z",fill:"currentColor"},null,-1)]))}}),v={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},e=a({name:"Flow",render:function(a,t){return n(),l("svg",v,t[0]||(t[0]=[r("path",{d:"M27 22.14V17a2 2 0 0 0-2-2h-8V9.86a4 4 0 1 0-2 0V15H7a2 2 0 0 0-2 2v5.14a4 4 0 1 0 2 0V17h18v5.14a4 4 0 1 0 2 0zM8 26a2 2 0 1 1-2-2a2 2 0 0 1 2 2zm6-20a2 2 0 1 1 2 2a2 2 0 0 1-2-2zm12 22a2 2 0 1 1 2-2a2 2 0 0 1-2 2z",fill:"currentColor"},null,-1)]))}});export{o as C,e as F,w as a};
|
||||
@@ -1 +1 @@
|
||||
import{d as c,Y as n,Z as r,_ as t}from"./main-CVVsEoi-.js";const o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},s=c({name:"LockOutlined",render:function(c,s){return r(),n("svg",o,s[0]||(s[0]=[t("path",{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 1 0-56 0z",fill:"currentColor"},null,-1)]))}});export{s as L};
|
||||
import{d as c,Y as n,Z as r,_ as t}from"./main-BVxorWyM.js";const o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},s=c({name:"LockOutlined",render:function(c,s){return r(),n("svg",o,s[0]||(s[0]=[t("path",{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 1 0-56 0z",fill:"currentColor"},null,-1)]))}});export{s as L};
|
||||
@@ -1 +1 @@
|
||||
import{d as c,Y as a,Z as n,_ as o}from"./main-CVVsEoi-.js";const r={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},t=c({name:"LogoGithub",render:function(c,t){return n(),a("svg",r,t[0]||(t[0]=[o("path",{d:"M256 32C132.3 32 32 134.9 32 261.7c0 101.5 64.2 187.5 153.2 217.9a17.56 17.56 0 0 0 3.8.4c8.3 0 11.5-6.1 11.5-11.4c0-5.5-.2-19.9-.3-39.1a102.4 102.4 0 0 1-22.6 2.7c-43.1 0-52.9-33.5-52.9-33.5c-10.2-26.5-24.9-33.6-24.9-33.6c-19.5-13.7-.1-14.1 1.4-14.1h.1c22.5 2 34.3 23.8 34.3 23.8c11.2 19.6 26.2 25.1 39.6 25.1a63 63 0 0 0 25.6-6c2-14.8 7.8-24.9 14.2-30.7c-49.7-5.8-102-25.5-102-113.5c0-25.1 8.7-45.6 23-61.6c-2.3-5.8-10-29.2 2.2-60.8a18.64 18.64 0 0 1 5-.5c8.1 0 26.4 3.1 56.6 24.1a208.21 208.21 0 0 1 112.2 0c30.2-21 48.5-24.1 56.6-24.1a18.64 18.64 0 0 1 5 .5c12.2 31.6 4.5 55 2.2 60.8c14.3 16.1 23 36.6 23 61.6c0 88.2-52.4 107.6-102.3 113.3c8 7.1 15.2 21.1 15.2 42.5c0 30.7-.3 55.5-.3 63c0 5.4 3.1 11.5 11.4 11.5a19.35 19.35 0 0 0 4-.4C415.9 449.2 480 363.1 480 261.7C480 134.9 379.7 32 256 32z",fill:"currentColor"},null,-1)]))}});export{t as L};
|
||||
import{d as c,Y as a,Z as n,_ as o}from"./main-BVxorWyM.js";const r={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},t=c({name:"LogoGithub",render:function(c,t){return n(),a("svg",r,t[0]||(t[0]=[o("path",{d:"M256 32C132.3 32 32 134.9 32 261.7c0 101.5 64.2 187.5 153.2 217.9a17.56 17.56 0 0 0 3.8.4c8.3 0 11.5-6.1 11.5-11.4c0-5.5-.2-19.9-.3-39.1a102.4 102.4 0 0 1-22.6 2.7c-43.1 0-52.9-33.5-52.9-33.5c-10.2-26.5-24.9-33.6-24.9-33.6c-19.5-13.7-.1-14.1 1.4-14.1h.1c22.5 2 34.3 23.8 34.3 23.8c11.2 19.6 26.2 25.1 39.6 25.1a63 63 0 0 0 25.6-6c2-14.8 7.8-24.9 14.2-30.7c-49.7-5.8-102-25.5-102-113.5c0-25.1 8.7-45.6 23-61.6c-2.3-5.8-10-29.2 2.2-60.8a18.64 18.64 0 0 1 5-.5c8.1 0 26.4 3.1 56.6 24.1a208.21 208.21 0 0 1 112.2 0c30.2-21 48.5-24.1 56.6-24.1a18.64 18.64 0 0 1 5 .5c12.2 31.6 4.5 55 2.2 60.8c14.3 16.1 23 36.6 23 61.6c0 88.2-52.4 107.6-102.3 113.3c8 7.1 15.2 21.1 15.2 42.5c0 30.7-.3 55.5-.3 63c0 5.4 3.1 11.5 11.4 11.5a19.35 19.35 0 0 0 4-.4C415.9 449.2 480 363.1 480 261.7C480 134.9 379.7 32 256 32z",fill:"currentColor"},null,-1)]))}});export{t as L};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{c as s}from"./index-LlhX5Hs2.js";const c=c=>s("/v1/access/get_list",c),a=c=>s("/v1/access/add_access",c),e=c=>s("/v1/access/upd_access",c),t=c=>s("/v1/access/del_access",c),_=c=>s("/v1/access/get_all",c),v=c=>s("/v1/acme_account/get_list",c),o=c=>s("/v1/acme_account/add_account",c),u=c=>s("/v1/acme_account/upd_account",c),d=c=>s("/v1/acme_account/del_account",c),n=c=>s("/v1/access/test_access",c),g=c=>s("/v1/access/get_sites",c),i=()=>s("/v1/access/get_plugins");export{a,i as b,v as c,t as d,o as e,u as f,c as g,d as h,g as i,_ as j,n as t,e as u};
|
||||
import{c as s}from"./index-yTfFo-nL.js";const c=c=>s("/v1/access/get_list",c),a=c=>s("/v1/access/add_access",c),e=c=>s("/v1/access/upd_access",c),t=c=>s("/v1/access/del_access",c),_=c=>s("/v1/access/get_all",c),v=c=>s("/v1/acme_account/get_list",c),o=c=>s("/v1/acme_account/add_account",c),u=c=>s("/v1/acme_account/upd_account",c),d=c=>s("/v1/acme_account/del_account",c),n=c=>s("/v1/access/test_access",c),g=c=>s("/v1/access/get_sites",c),i=()=>s("/v1/access/get_plugins");export{a,i as b,v as c,t as d,o as e,u as f,c as g,d as h,g as i,_ as j,n as t,e as u};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{c as a}from"./index-LlhX5Hs2.js";const e=e=>a("/v1/private_ca/create_root_ca",e),t=e=>a("/v1/private_ca/create_intermediate_ca",e),_=e=>a("/v1/private_ca/get_ca_list",e),c=e=>a("/v1/private_ca/del_ca",e),r=e=>a("/v1/private_ca/create_leaf_cert",e),v=e=>a("/v1/private_ca/get_leaf_cert_list",e),i=e=>a("/v1/private_ca/del_leaf_cert",e);export{v as a,c as b,r as c,i as d,e,t as f,_ as g};
|
||||
import{c as a}from"./index-yTfFo-nL.js";const e=e=>a("/v1/private_ca/create_root_ca",e),t=e=>a("/v1/private_ca/create_intermediate_ca",e),_=e=>a("/v1/private_ca/get_ca_list",e),c=e=>a("/v1/private_ca/del_ca",e),r=e=>a("/v1/private_ca/create_leaf_cert",e),v=e=>a("/v1/private_ca/get_leaf_cert_list",e),i=e=>a("/v1/private_ca/del_leaf_cert",e);export{v as a,c as b,r as c,i as d,e,t as f,_ as g};
|
||||
@@ -1 +1 @@
|
||||
import{$ as e}from"./main-CVVsEoi-.js";const t={mail:{name:e("t_68_1745289354676"),type:"mail"},workwx:{name:e("t_33_1746773350932"),type:"workwx"},dingtalk:{name:e("t_32_1746773348993"),type:"dingtalk"},feishu:{name:e("t_34_1746773350153"),type:"feishu"},webhook:{name:"WebHook",type:"webhook"}},n={zerossl:{name:"ZeroSSL",type:"zerossl"},google:{name:"Google",type:"google"},sslcom:{name:"SSL.COM",type:"sslcom"},buypass:{name:"Buypass",type:"buypass"},letsencrypt:{name:"Let's Encrypt",type:"letsencrypt"},custom:{name:"自定义",type:"custom"}},o={localhost:{name:e("t_4_1744958838951"),icon:"ssh",type:["host"],notApi:!1,hostRelated:{default:{name:e("t_4_1744958838951")}},sort:1},ssh:{name:"SSH",icon:"ssh",type:["host"],hostRelated:{default:{name:"SSH"}},sort:2},btpanel:{name:e("t_10_1745735765165"),icon:"btpanel",hostRelated:{default:{name:e("t_10_1745735765165")},site:{name:e("t_1_1747886307276")},dockersite:{name:e("t_0_1747994891459")},singlesite:{name:e("t_1_1747886307276")+"\r\n(Win/Linux 9.4前)"}},type:["host"],sort:3},btwaf:{name:e("t_3_1747886302848"),icon:"btwaf",hostRelated:{site:{name:e("t_4_1747886303229")}},type:["host"],sort:4},"1panel":{name:"1Panel",icon:"1panel",hostRelated:{default:{name:"1Panel"},site:{name:e("t_2_1747886302053")}},type:["host"],sort:5},aliyun:{name:e("t_2_1747019616224"),icon:"aliyun",type:["host","dns"],hostRelated:{cdn:{name:e("t_16_1745735766712")},dcdn:{name:e("t_0_1752230148946")},oss:{name:e("t_2_1746697487164")},waf:{name:e("t_10_1744958860078")},esa:{name:e("t_1_1752230146379")}},sort:6},tencentcloud:{name:e("t_3_1747019616129"),icon:"tencentcloud",type:["host","dns"],hostRelated:{cdn:{name:e("t_14_1745735766121")},cos:{name:e("t_15_1745735768976")},waf:{name:e("t_9_1744958840634")},teo:{name:e("t_5_1747886301427")}},sort:7},huaweicloud:{name:e("t_9_1747886301128"),icon:"huaweicloud",type:["host","dns"],hostRelated:{cdn:{name:e("t_9_1747886301128")+"CDN"}},sort:10},baidu:{name:e("t_10_1747886300958"),icon:"baidu",type:["host","dns"],hostRelated:{cdn:{name:"百度云CDN"}},sort:11},volcengine:{name:e("t_13_1747886301689"),icon:"volcengine",type:["host","dns"],hostRelated:{cdn:{name:e("t_13_1747886301689")+"CDN"},dcdn:{name:e("t_13_1747886301689")+"DCDN"}},sort:13},safeline:{name:e("t_11_1747886301986"),icon:"safeline",type:["host"],hostRelated:{panel:{name:e("t_1_1747298114192")},site:{name:e("t_12_1747886302725")}},sort:8},qiniu:{name:e("t_6_1747886301844"),icon:"qiniu",type:["host"],hostRelated:{cdn:{name:e("t_7_1747886302395")},oss:{name:e("t_8_1747886304014")}},sort:9},cloudflare:{name:"Cloudflare",icon:"cloudflare",type:["dns"],sort:12},westcn:{name:e("t_14_1747886301884"),icon:"westcn",type:["dns"],sort:14},godaddy:{name:"GoDaddy",icon:"godaddy",type:["dns"],sort:15},namecheap:{name:"Namecheap",icon:"namecheap",type:["dns"],sort:16},ns1:{name:"NS1",icon:"ns1",type:["dns"],sort:17},cloudns:{name:"ClouDNS",icon:"cloudns",type:["dns"],sort:18},aws:{name:"AWS",icon:"aws",type:["dns"],sort:19},azure:{name:"Azure",icon:"azure",type:["dns"],sort:20},namesilo:{name:"Namesilo",icon:"namesilo",type:["dns"],sort:21},namedotcom:{name:"Name.com",icon:"namedotcom",type:["dns"],sort:22},bunny:{name:"Bunny",icon:"bunny",type:["dns"],sort:23},gcore:{name:"Gcore",icon:"gcore",type:["dns"],sort:24},jdcloud:{name:"京东云",icon:"jdcloud",type:["dns"],sort:25},lecdn:{name:"LeCDN",icon:"lecdn",type:["dns","host"],hostRelated:{default:{name:"LeCDN"}},sort:26},constellix:{name:"Constellix",icon:"constellix",type:["dns"],sort:27},doge:{name:e("t_0_1750129254226"),icon:"doge",type:["host"],hostRelated:{cdn:{name:e("t_0_1750129254226")+"CDN"}},sort:28},webhook:{name:"Webhook",icon:"webhook",type:["host","dns"],hostRelated:{default:{name:"Webhook"}},sort:31},spaceship:{name:"Spaceship",icon:"spaceship",type:["dns"],hostRelated:{default:{name:"Spaceship"}},sort:32},plugin:{name:"插件",icon:"plugin",type:["host"],hostRelated:{default:{name:"插件"}},sort:29}};export{o as A,n as C,t as M};
|
||||
import{$ as e}from"./main-BVxorWyM.js";const t={mail:{name:e("t_68_1745289354676"),type:"mail"},workwx:{name:e("t_33_1746773350932"),type:"workwx"},dingtalk:{name:e("t_32_1746773348993"),type:"dingtalk"},feishu:{name:e("t_34_1746773350153"),type:"feishu"},webhook:{name:"WebHook",type:"webhook"}},n={zerossl:{name:"ZeroSSL",type:"zerossl"},google:{name:"Google",type:"google"},sslcom:{name:"SSL.COM",type:"sslcom"},buypass:{name:"Buypass",type:"buypass"},letsencrypt:{name:"Let's Encrypt",type:"letsencrypt"},custom:{name:"自定义",type:"custom"}},o={localhost:{name:e("t_4_1744958838951"),icon:"ssh",type:["host"],notApi:!1,hostRelated:{default:{name:e("t_4_1744958838951")}},sort:1},ssh:{name:"SSH",icon:"ssh",type:["host"],hostRelated:{default:{name:"SSH"}},sort:2},btpanel:{name:e("t_10_1745735765165"),icon:"btpanel",hostRelated:{default:{name:e("t_10_1745735765165")},site:{name:e("t_1_1747886307276")},dockersite:{name:e("t_0_1747994891459")},singlesite:{name:e("t_1_1747886307276")+"\r\n(Win/Linux 9.4前)"}},type:["host"],sort:3},btwaf:{name:e("t_3_1747886302848"),icon:"btwaf",hostRelated:{site:{name:e("t_4_1747886303229")}},type:["host"],sort:4},"1panel":{name:"1Panel",icon:"1panel",hostRelated:{default:{name:"1Panel"},site:{name:e("t_2_1747886302053")}},type:["host"],sort:5},aliyun:{name:e("t_2_1747019616224"),icon:"aliyun",type:["host","dns"],hostRelated:{cdn:{name:e("t_16_1745735766712")},dcdn:{name:e("t_0_1752230148946")},oss:{name:e("t_2_1746697487164")},waf:{name:e("t_10_1744958860078")},esa:{name:e("t_1_1752230146379")}},sort:6},tencentcloud:{name:e("t_3_1747019616129"),icon:"tencentcloud",type:["host","dns"],hostRelated:{cdn:{name:e("t_14_1745735766121")},cos:{name:e("t_15_1745735768976")},waf:{name:e("t_9_1744958840634")},teo:{name:e("t_5_1747886301427")}},sort:7},huaweicloud:{name:e("t_9_1747886301128"),icon:"huaweicloud",type:["host","dns"],hostRelated:{cdn:{name:e("t_9_1747886301128")+"CDN"}},sort:10},baidu:{name:e("t_10_1747886300958"),icon:"baidu",type:["host","dns"],hostRelated:{cdn:{name:"百度云CDN"}},sort:11},volcengine:{name:e("t_13_1747886301689"),icon:"volcengine",type:["host","dns"],hostRelated:{cdn:{name:e("t_13_1747886301689")+"CDN"},dcdn:{name:e("t_13_1747886301689")+"DCDN"}},sort:13},safeline:{name:e("t_11_1747886301986"),icon:"safeline",type:["host"],hostRelated:{panel:{name:e("t_1_1747298114192")},site:{name:e("t_12_1747886302725")}},sort:8},qiniu:{name:e("t_6_1747886301844"),icon:"qiniu",type:["host"],hostRelated:{cdn:{name:e("t_7_1747886302395")},oss:{name:e("t_8_1747886304014")}},sort:9},cloudflare:{name:"Cloudflare",icon:"cloudflare",type:["dns"],sort:12},westcn:{name:e("t_14_1747886301884"),icon:"westcn",type:["dns"],sort:14},godaddy:{name:"GoDaddy",icon:"godaddy",type:["dns"],sort:15},namecheap:{name:"Namecheap",icon:"namecheap",type:["dns"],sort:16},ns1:{name:"NS1",icon:"ns1",type:["dns"],sort:17},cloudns:{name:"ClouDNS",icon:"cloudns",type:["dns"],sort:18},aws:{name:"AWS",icon:"aws",type:["dns"],sort:19},azure:{name:"Azure",icon:"azure",type:["dns"],sort:20},namesilo:{name:"Namesilo",icon:"namesilo",type:["dns"],sort:21},namedotcom:{name:"Name.com",icon:"namedotcom",type:["dns"],sort:22},bunny:{name:"Bunny",icon:"bunny",type:["dns"],sort:23},gcore:{name:"Gcore",icon:"gcore",type:["dns"],sort:24},jdcloud:{name:"京东云",icon:"jdcloud",type:["dns"],sort:25},lecdn:{name:"LeCDN",icon:"lecdn",type:["dns","host"],hostRelated:{default:{name:"LeCDN"}},sort:26},constellix:{name:"Constellix",icon:"constellix",type:["dns"],sort:27},doge:{name:e("t_0_1750129254226"),icon:"doge",type:["host"],hostRelated:{cdn:{name:e("t_0_1750129254226")+"CDN"}},sort:28},webhook:{name:"Webhook",icon:"webhook",type:["host","dns"],hostRelated:{default:{name:"Webhook"}},sort:31},spaceship:{name:"Spaceship",icon:"spaceship",type:["dns"],hostRelated:{default:{name:"Spaceship"}},sort:32},plugin:{name:"插件",icon:"plugin",type:["host"],hostRelated:{default:{name:"插件"}},sort:29}};export{o as A,n as C,t as M};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,c as t}from"./index-LlhX5Hs2.js";import{bq as r,bv as n,bL as a,bD as u,bM as s}from"./main-CVVsEoi-.js";function o(e,t,r){for(var n=0,a=r.length;n<a;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}var c=r(function(e,t){return n(e.length,function(){return e.apply(t,arguments)})});function i(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function d(e,t,r,n){return e["@@transducer/result"](r[n](c(e["@@transducer/step"],e),t))}var g=a(o,d,i),f=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();function l(e){return new f(e)}var p=e(function(e,t,r){return g("function"==typeof e?l(e):e,t,r)}),m=r(function(e,t){for(var r=0,n=Math.min(e.length,t.length),a={};r<n;)a[e[r]]=t[r],r+=1;return a});const y=e=>t("/v1/cert/get_list",e),D=e=>t("/v1/cert/upload_cert",e),w=e=>t("/v1/cert/del_cert",e),h=(e,t="yyyy-MM-dd HH:mm:ss")=>{if(!e)return"--";const r=Number(e)&&10===e.toString().length?new Date(1e3*Number(e)):new Date(e),n=m(["yyyy","MM","dd","HH","mm","ss"],[r.getFullYear(),r.getMonth()+1,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()]);return p((e,t)=>{const r=n[t],a="yyyy"!==t&&r<10?`0${r}`:`${r}`;return e.replace(new RegExp(t,"g"),a)},t,s(n))},v=(e,t)=>{const r=new Date(e),n=new Date(t),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),u=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime()-a.getTime();return Math.floor(u/864e5)};u(v);u((e,t,r)=>{const n=new Date(e).getTime(),a=new Date(t).getTime(),u=new Date(r).getTime();return n>=a&&n<=u});u((e,t)=>{const r=new Date(t);return r.setDate(r.getDate()+e),r});export{g as _,l as a,v as c,w as d,y as g,h as i,p as r,D as u};
|
||||
import{_ as e,c as t}from"./index-yTfFo-nL.js";import{bq as r,bv as n,bL as a,bD as u,bM as s}from"./main-BVxorWyM.js";function o(e,t,r){for(var n=0,a=r.length;n<a;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}var c=r(function(e,t){return n(e.length,function(){return e.apply(t,arguments)})});function i(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function d(e,t,r,n){return e["@@transducer/result"](r[n](c(e["@@transducer/step"],e),t))}var g=a(o,d,i),f=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();function l(e){return new f(e)}var p=e(function(e,t,r){return g("function"==typeof e?l(e):e,t,r)}),m=r(function(e,t){for(var r=0,n=Math.min(e.length,t.length),a={};r<n;)a[e[r]]=t[r],r+=1;return a});const y=e=>t("/v1/cert/get_list",e),D=e=>t("/v1/cert/upload_cert",e),w=e=>t("/v1/cert/del_cert",e),h=(e,t="yyyy-MM-dd HH:mm:ss")=>{if(!e)return"--";const r=Number(e)&&10===e.toString().length?new Date(1e3*Number(e)):new Date(e),n=m(["yyyy","MM","dd","HH","mm","ss"],[r.getFullYear(),r.getMonth()+1,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()]);return p((e,t)=>{const r=n[t],a="yyyy"!==t&&r<10?`0${r}`:`${r}`;return e.replace(new RegExp(t,"g"),a)},t,s(n))},v=(e,t)=>{const r=new Date(e),n=new Date(t),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),u=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime()-a.getTime();return Math.floor(u/864e5)};u(v);u((e,t,r)=>{const n=new Date(e).getTime(),a=new Date(t).getTime(),u=new Date(r).getTime();return n>=a&&n<=u});u((e,t)=>{const r=new Date(t);return r.setDate(r.getDate()+e),r});export{g as _,l as a,v as c,w as d,y as g,h as i,p as r,D as u};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
static/build/static/js/index-B4a0r2ZJ.js
Normal file
1
static/build/static/js/index-B4a0r2ZJ.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{p as e,i as t,b as n,t as a,w as r,c as o,d as l,e as s,f as i}from"./index-DOjdH0KK.js";import{bS as u,av as f,bT as c,k as d,bU as v,o as g,bV as p,bW as w,r as m,x as y,V as h}from"./main-CVVsEoi-.js";const b=n?window:void 0;function S(...e){const t=[],n=()=>{t.forEach(e=>e()),t.length=0},s=d(()=>{const t=a(c(e[0])).filter(e=>null!=e);return t.every(e=>"string"!=typeof e)?t:void 0}),i=r(()=>{var t,n;return[null!=(n=null==(t=s.value)?void 0:t.map(e=>function(e){var t;const n=c(e);return null!=(t=null==n?void 0:n.$el)?t:n}(e)))?n:[b].filter(e=>null!=e),a(c(s.value?e[1]:e[0])),a(w(s.value?e[2]:e[1])),c(s.value?e[3]:e[2])]},([e,a,r,o])=>{if(n(),!(null==e?void 0:e.length)||!(null==a?void 0:a.length)||!(null==r?void 0:r.length))return;const s=l(o)?{...o}:o;t.push(...e.flatMap(e=>a.flatMap(t=>r.map(n=>((e,t,n,a)=>(e.addEventListener(t,n,a),()=>e.removeEventListener(t,n,a)))(e,t,n,s)))))},{flush:"post"});return o(n),()=>{i(),n()}}function N(e){const t=function(){const e=u(!1),t=p();return t&&g(()=>{e.value=!0},t),e}();return d(()=>(t.value,Boolean(e())))}const M=Symbol("vueuse-ssr-width");function O(){const e=v()?t(M,null):null;return"number"==typeof e?e:void 0}function E(t,n={}){const{window:a=b,ssrWidth:r=O()}=n,o=N(()=>a&&"matchMedia"in a&&"function"==typeof a.matchMedia),l=u("number"==typeof r),s=u(),i=u(!1);return f(()=>{if(l.value){l.value=!o.value;const n=c(t).split(",");return void(i.value=n.some(t=>{const n=t.includes("not all"),a=t.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),o=t.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let l=Boolean(a||o);return a&&l&&(l=r>=e(a[1])),o&&l&&(l=r<=e(o[1])),n?!l:l}))}o.value&&(s.value=a.matchMedia(c(t)),i.value=s.value.matches)}),S(s,"change",e=>{i.value=e.matches},{passive:!0}),d(()=>i.value)}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A="__vueuse_ssr_handlers__",I=J();function J(){return A in j||(j[A]=j[A]||{}),j[A]}const V={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},_="vueuse-storage";function D(e,t,n,a={}){var r;const{flush:o="pre",deep:l=!0,listenToStorageChanges:f=!0,writeDefaults:v=!0,mergeDefaults:g=!1,shallow:p,window:w=b,eventFilter:N,onError:M=e=>{},initOnMounted:O}=a,E=(p?u:m)("function"==typeof t?t():t),j=d(()=>c(e));if(!n)try{n=function(e,t){return I[e]||t}("getDefaultStorage",()=>{var e;return null==(e=b)?void 0:e.localStorage})()}catch(B){M(B)}if(!n)return E;const A=c(t),J=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(A),D=null!=(r=a.serializer)?r:V[J],{pause:k,resume:x}=s(E,()=>function(e){try{const t=n.getItem(j.value);if(null==e)T(t,null),n.removeItem(j.value);else{const a=D.write(e);t!==a&&(n.setItem(j.value,a),T(t,a))}}catch(B){M(B)}}(E.value),{flush:o,deep:l,eventFilter:N});function T(e,t){if(w){const a={key:j.value,oldValue:e,newValue:t,storageArea:n};w.dispatchEvent(n instanceof Storage?new StorageEvent("storage",a):new CustomEvent(_,{detail:a}))}}function z(e){if(!e||e.storageArea===n)if(e&&null==e.key)E.value=A;else if(!e||e.key===j.value){k();try{(null==e?void 0:e.newValue)!==D.write(E.value)&&(E.value=function(e){const t=e?e.newValue:n.getItem(j.value);if(null==t)return v&&null!=A&&n.setItem(j.value,D.write(A)),A;if(!e&&g){const e=D.read(t);return"function"==typeof g?g(e,A):"object"!==J||Array.isArray(e)?e:{...A,...e}}return"string"!=typeof t?t:D.read(t)}(e))}catch(B){M(B)}finally{e?h(x):x()}}}function F(e){z(e.detail)}return y(j,()=>z(),{flush:o}),w&&f&&i(()=>{n instanceof Storage?S(w,"storage",z,{passive:!0}):S(w,_,F),O&&z()}),O||z(),E}function k(e,t,n={}){const{window:a=b}=n;return D(e,t,null==a?void 0:a.localStorage,n)}function x(e,t,n={}){const{window:a=b}=n;return D(e,t,null==a?void 0:a.sessionStorage,n)}export{k as a,x as b,E as u};
|
||||
import{p as e,i as t,b as n,t as a,w as r,c as o,d as l,e as s,f as i}from"./index-leYjYcVi.js";import{bS as u,av as f,bT as c,k as d,bU as v,o as g,bV as p,bW as w,r as m,x as y,V as h}from"./main-BVxorWyM.js";const b=n?window:void 0;function S(...e){const t=[],n=()=>{t.forEach(e=>e()),t.length=0},s=d(()=>{const t=a(c(e[0])).filter(e=>null!=e);return t.every(e=>"string"!=typeof e)?t:void 0}),i=r(()=>{var t,n;return[null!=(n=null==(t=s.value)?void 0:t.map(e=>function(e){var t;const n=c(e);return null!=(t=null==n?void 0:n.$el)?t:n}(e)))?n:[b].filter(e=>null!=e),a(c(s.value?e[1]:e[0])),a(w(s.value?e[2]:e[1])),c(s.value?e[3]:e[2])]},([e,a,r,o])=>{if(n(),!(null==e?void 0:e.length)||!(null==a?void 0:a.length)||!(null==r?void 0:r.length))return;const s=l(o)?{...o}:o;t.push(...e.flatMap(e=>a.flatMap(t=>r.map(n=>((e,t,n,a)=>(e.addEventListener(t,n,a),()=>e.removeEventListener(t,n,a)))(e,t,n,s)))))},{flush:"post"});return o(n),()=>{i(),n()}}function N(e){const t=function(){const e=u(!1),t=p();return t&&g(()=>{e.value=!0},t),e}();return d(()=>(t.value,Boolean(e())))}const M=Symbol("vueuse-ssr-width");function O(){const e=v()?t(M,null):null;return"number"==typeof e?e:void 0}function E(t,n={}){const{window:a=b,ssrWidth:r=O()}=n,o=N(()=>a&&"matchMedia"in a&&"function"==typeof a.matchMedia),l=u("number"==typeof r),s=u(),i=u(!1);return f(()=>{if(l.value){l.value=!o.value;const n=c(t).split(",");return void(i.value=n.some(t=>{const n=t.includes("not all"),a=t.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),o=t.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let l=Boolean(a||o);return a&&l&&(l=r>=e(a[1])),o&&l&&(l=r<=e(o[1])),n?!l:l}))}o.value&&(s.value=a.matchMedia(c(t)),i.value=s.value.matches)}),S(s,"change",e=>{i.value=e.matches},{passive:!0}),d(()=>i.value)}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A="__vueuse_ssr_handlers__",I=J();function J(){return A in j||(j[A]=j[A]||{}),j[A]}const V={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},_="vueuse-storage";function D(e,t,n,a={}){var r;const{flush:o="pre",deep:l=!0,listenToStorageChanges:f=!0,writeDefaults:v=!0,mergeDefaults:g=!1,shallow:p,window:w=b,eventFilter:N,onError:M=e=>{},initOnMounted:O}=a,E=(p?u:m)("function"==typeof t?t():t),j=d(()=>c(e));if(!n)try{n=function(e,t){return I[e]||t}("getDefaultStorage",()=>{var e;return null==(e=b)?void 0:e.localStorage})()}catch(B){M(B)}if(!n)return E;const A=c(t),J=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(A),D=null!=(r=a.serializer)?r:V[J],{pause:k,resume:x}=s(E,()=>function(e){try{const t=n.getItem(j.value);if(null==e)T(t,null),n.removeItem(j.value);else{const a=D.write(e);t!==a&&(n.setItem(j.value,a),T(t,a))}}catch(B){M(B)}}(E.value),{flush:o,deep:l,eventFilter:N});function T(e,t){if(w){const a={key:j.value,oldValue:e,newValue:t,storageArea:n};w.dispatchEvent(n instanceof Storage?new StorageEvent("storage",a):new CustomEvent(_,{detail:a}))}}function z(e){if(!e||e.storageArea===n)if(e&&null==e.key)E.value=A;else if(!e||e.key===j.value){k();try{(null==e?void 0:e.newValue)!==D.write(E.value)&&(E.value=function(e){const t=e?e.newValue:n.getItem(j.value);if(null==t)return v&&null!=A&&n.setItem(j.value,D.write(A)),A;if(!e&&g){const e=D.read(t);return"function"==typeof g?g(e,A):"object"!==J||Array.isArray(e)?e:{...A,...e}}return"string"!=typeof t?t:D.read(t)}(e))}catch(B){M(B)}finally{e?h(x):x()}}}function F(e){z(e.detail)}return y(j,()=>z(),{flush:o}),w&&f&&i(()=>{n instanceof Storage?S(w,"storage",z,{passive:!0}):S(w,_,F),O&&z()}),O||z(),E}function k(e,t,n={}){const{window:a=b}=n;return D(e,t,null==a?void 0:a.localStorage,n)}function x(e,t,n={}){const{window:a=b}=n;return D(e,t,null==a?void 0:a.sessionStorage,n)}export{k as a,x as b,E as u};
|
||||
@@ -1 +1 @@
|
||||
import{d as e,Y as a,Z as l,_ as t,aQ as s,r,k as n,x as i,aR as o,aS as c,c as u,a3 as d,q as m,aa as p,$ as h,b as v,B as x}from"./main-CVVsEoi-.js";const f={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},y=e({name:"Search",render:function(e,s){return l(),a("svg",f,s[0]||(s[0]=[t("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8a124.95 124.95 0 0 1-124.8-124.8z",fill:"currentColor"},null,-1)]))}});function b(e={}){const{onSearch:a,value:l="",placeholder:t="请输入搜索内容",clearDelay:p=100,size:h="large",clearable:v=!0,className:x="min-w-[300px]",disabled:f=!1,trim:b=!0,immediate:g=!1,debounceDelay:w=300}=e,k=s(l)?l:r(l),S=n(()=>(b?k.value.trim():k.value).length>0),_=(e=!1)=>{if(a){const l=b?k.value.trim():k.value;a(l,e)}},C=o(()=>{_()},w);g&&a&&i(k,()=>{C()});const z=e=>{"Enter"===e.key&&_()},B=()=>{k.value="",c(()=>{_(!0)},p)},q=()=>{_(!0)};return{value:k,hasSearchValue:S,handleKeydown:z,handleClear:B,handleSearchClick:q,search:_,debouncedSearch:C,clear:()=>{k.value=""},setValue:e=>{k.value=e},SearchComponent:(e={})=>{const a={value:k.value,"onUpdate:value":e=>{k.value=e},onKeydown:z,onClear:B,placeholder:t,clearable:v,size:h,disabled:f,class:x,...e};return u(m,a,{suffix:()=>u("div",{class:"flex items-center cursor-pointer",onClick:q},[u(d,{component:y,class:"text-[var(--text-color-3)] w-[1.6rem] font-bold"},null)])})}}}const g=e({name:"TableEmptyState",props:{addButtonText:{type:String,required:!0},onAddClick:{type:Function,required:!0}},setup:e=>()=>u("div",{class:"flex justify-center items-center h-full"},[u(p,{class:"px-[4rem]"},{default:()=>[h("t_1_1747754231838"),u(x,{text:!0,type:"primary",size:"small",onClick:e.onAddClick},{default:()=>[e.addButtonText]}),v(","),h("t_2_1747754234999"),u(x,{text:!0,tag:"a",target:"_blank",type:"primary",href:"https://github.com/allinssl/allinssl/issues"},{default:()=>[v("Issues")]}),v(","),h("t_3_1747754232000"),u(x,{text:!0,tag:"a",target:"_blank",type:"primary",href:"https://github.com/allinssl/allinssl"},{default:()=>[v("Star")]}),v(","),h("t_4_1747754235407")]})])});export{g as E,b as u};
|
||||
import{d as e,Y as a,Z as l,_ as t,aQ as s,r,k as n,x as i,aR as o,aS as c,c as u,a3 as d,q as m,aa as p,$ as h,b as v,B as x}from"./main-BVxorWyM.js";const f={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},y=e({name:"Search",render:function(e,s){return l(),a("svg",f,s[0]||(s[0]=[t("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8a124.95 124.95 0 0 1-124.8-124.8z",fill:"currentColor"},null,-1)]))}});function b(e={}){const{onSearch:a,value:l="",placeholder:t="请输入搜索内容",clearDelay:p=100,size:h="large",clearable:v=!0,className:x="min-w-[300px]",disabled:f=!1,trim:b=!0,immediate:g=!1,debounceDelay:w=300}=e,k=s(l)?l:r(l),S=n(()=>(b?k.value.trim():k.value).length>0),_=(e=!1)=>{if(a){const l=b?k.value.trim():k.value;a(l,e)}},C=o(()=>{_()},w);g&&a&&i(k,()=>{C()});const z=e=>{"Enter"===e.key&&_()},B=()=>{k.value="",c(()=>{_(!0)},p)},q=()=>{_(!0)};return{value:k,hasSearchValue:S,handleKeydown:z,handleClear:B,handleSearchClick:q,search:_,debouncedSearch:C,clear:()=>{k.value=""},setValue:e=>{k.value=e},SearchComponent:(e={})=>{const a={value:k.value,"onUpdate:value":e=>{k.value=e},onKeydown:z,onClear:B,placeholder:t,clearable:v,size:h,disabled:f,class:x,...e};return u(m,a,{suffix:()=>u("div",{class:"flex items-center cursor-pointer",onClick:q},[u(d,{component:y,class:"text-[var(--text-color-3)] w-[1.6rem] font-bold"},null)])})}}}const g=e({name:"TableEmptyState",props:{addButtonText:{type:String,required:!0},onAddClick:{type:Function,required:!0}},setup:e=>()=>u("div",{class:"flex justify-center items-center h-full"},[u(p,{class:"px-[4rem]"},{default:()=>[h("t_1_1747754231838"),u(x,{text:!0,type:"primary",size:"small",onClick:e.onAddClick},{default:()=>[e.addButtonText]}),v(","),h("t_2_1747754234999"),u(x,{text:!0,tag:"a",target:"_blank",type:"primary",href:"https://github.com/allinssl/allinssl/issues"},{default:()=>[v("Issues")]}),v(","),h("t_3_1747754232000"),u(x,{text:!0,tag:"a",target:"_blank",type:"primary",href:"https://github.com/allinssl/allinssl"},{default:()=>[v("Star")]}),v(","),h("t_4_1747754235407")]})])});export{g as E,b as u};
|
||||
@@ -1 +1 @@
|
||||
import{d as e,u as t,a as o,c as r,b as s,$ as l,B as a,i as c}from"./main-CVVsEoi-.js";const m=(e=16,t)=>r("svg",{width:e,height:e,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:t},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6zM7.9 7.5L10.3 5l.7.7-2.4 2.5 2.4 2.5-.7.7-2.4-2.5-2.4 2.5-.7-.7 2.4-2.5-2.4-2.5.7-.7 2.4 2.5z"},null)]),n=e({setup(){const e=t(),n=o(["baseColor","textColorBase","textColorSecondary","textColorDisabled"]);return()=>{let t;return r("div",{class:"flex flex-col items-center justify-center min-h-screen p-4",style:n.value},[r("div",{class:"text-center px-4 sm:px-8 max-w-[60rem] mx-auto"},[r("div",{class:"text-[4.5rem] sm:text-[6rem] md:text-[8rem] font-bold leading-none mb-2 sm:mb-4",style:{color:"var(--n-text-color-base)",textShadow:"2px 2px 8px rgba(0,0,0,0.25)"}},[s("404")]),r("div",{class:"flex items-center justify-center mb-4 sm:mb-8"},[m(60,"var(--n-text-color-base)")]),r("div",{class:"text-[1.2rem] sm:text-[1.5rem] md:text-[1.8rem] mb-4 sm:mb-8",style:{color:"var(--n-text-color-secondary)"}},[l("t_0_1744098811152")]),r(a,{style:{backgroundColor:"var(--n-text-color-base)",color:"var(--n-base-color)",border:"none"},onClick:()=>e.push("/")},(o=t=l("t_1_1744098801860"),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!c(o)?t:{default:()=>[t]})),r("div",{class:"mt-4 sm:mt-8 text-[1rem] sm:text-[1.1rem] md:text-[1.3rem]",style:{color:"var(--n-text-color-disabled)"}},[l("t_2_1744098804908")])])]);var o}}});export{n as default};
|
||||
import{d as e,u as t,a as o,c as r,b as s,$ as l,B as a,i as c}from"./main-BVxorWyM.js";const m=(e=16,t)=>r("svg",{width:e,height:e,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:t},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6zM7.9 7.5L10.3 5l.7.7-2.4 2.5 2.4 2.5-.7.7-2.4-2.5-2.4 2.5-.7-.7 2.4-2.5-2.4-2.5.7-.7 2.4 2.5z"},null)]),n=e({setup(){const e=t(),n=o(["baseColor","textColorBase","textColorSecondary","textColorDisabled"]);return()=>{let t;return r("div",{class:"flex flex-col items-center justify-center min-h-screen p-4",style:n.value},[r("div",{class:"text-center px-4 sm:px-8 max-w-[60rem] mx-auto"},[r("div",{class:"text-[4.5rem] sm:text-[6rem] md:text-[8rem] font-bold leading-none mb-2 sm:mb-4",style:{color:"var(--n-text-color-base)",textShadow:"2px 2px 8px rgba(0,0,0,0.25)"}},[s("404")]),r("div",{class:"flex items-center justify-center mb-4 sm:mb-8"},[m(60,"var(--n-text-color-base)")]),r("div",{class:"text-[1.2rem] sm:text-[1.5rem] md:text-[1.8rem] mb-4 sm:mb-8",style:{color:"var(--n-text-color-secondary)"}},[l("t_0_1744098811152")]),r(a,{style:{backgroundColor:"var(--n-text-color-base)",color:"var(--n-base-color)",border:"none"},onClick:()=>e.push("/")},(o=t=l("t_1_1744098801860"),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!c(o)?t:{default:()=>[t]})),r("div",{class:"mt-4 sm:mt-8 text-[1rem] sm:text-[1.1rem] md:text-[1.3rem]",style:{color:"var(--n-text-color-disabled)"}},[l("t_2_1744098804908")])])]);var o}}});export{n as default};
|
||||
1
static/build/static/js/index-BvWeZ1eD.js
Normal file
1
static/build/static/js/index-BvWeZ1eD.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{d as e,c as s}from"./main-CVVsEoi-.js";const l=e({name:"BaseComponent",setup(e,{slots:l}){const t=l["header-left"]||l.headerLeft,f=l["header-right"]||l.headerRight,r=l.header,o=l["footer-left"]||l.footerLeft,a=l["footer-right"]||l.footerRight,i=l.footer;return()=>s("div",{class:"flex flex-col"},[r?s("div",{class:"flex justify-between flex-wrap w-full"},[r()]):(t||f)&&s("div",{class:"flex justify-between flex-wrap",style:{rowGap:"0.8rem"}},[s("div",{class:"flex flex-shrink-0"},[t&&t()]),s("div",{class:"flex flex-shrink-0"},[f&&f()])]),s("div",{class:`w-full content ${r||t||f?"mt-[1.2rem]":""} ${i||o||a?"mb-[1.2rem]":""}`},[l.content&&l.content()]),i?s("div",{class:"flex justify-between w-full"},[i()]):(o||a)&&s("div",{class:"flex justify-between"},[s("div",{class:"flex flex-shrink-0"},[o&&o()]),s("div",{class:"flex flex-shrink-0"},[a&&a()])]),l.popup&&l.popup()])}});export{l as B};
|
||||
import{d as e,c as s}from"./main-BVxorWyM.js";const l=e({name:"BaseComponent",setup(e,{slots:l}){const t=l["header-left"]||l.headerLeft,f=l["header-right"]||l.headerRight,r=l.header,o=l["footer-left"]||l.footerLeft,a=l["footer-right"]||l.footerRight,i=l.footer;return()=>s("div",{class:"flex flex-col"},[r?s("div",{class:"flex justify-between flex-wrap w-full"},[r()]):(t||f)&&s("div",{class:"flex justify-between flex-wrap",style:{rowGap:"0.8rem"}},[s("div",{class:"flex flex-shrink-0"},[t&&t()]),s("div",{class:"flex flex-shrink-0"},[f&&f()])]),s("div",{class:`w-full content ${r||t||f?"mt-[1.2rem]":""} ${i||o||a?"mb-[1.2rem]":""}`},[l.content&&l.content()]),i?s("div",{class:"flex justify-between w-full"},[i()]):(o||a)&&s("div",{class:"flex justify-between"},[s("div",{class:"flex flex-shrink-0"},[o&&o()]),s("div",{class:"flex flex-shrink-0"},[a&&a()])]),l.popup&&l.popup()])}});export{l as B};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{d as e,k as i,c as r}from"./main-CVVsEoi-.js";const t=e({name:"SvgIcon",props:{icon:{type:String,required:!0},color:{type:String,default:""},size:{type:String,default:"1.8rem"}},setup(e){const t=i(()=>`#icon-${e.icon}`);return()=>r("svg",{class:"relative inline-block align-[-0.2rem]",style:{width:e.size,height:e.size},"aria-hidden":"true"},[r("use",{"xlink:href":t.value,fill:e.color},null)])}});export{t as S};
|
||||
import{d as e,k as i,c as r}from"./main-BVxorWyM.js";const t=e({name:"SvgIcon",props:{icon:{type:String,required:!0},color:{type:String,default:""},size:{type:String,default:"1.8rem"}},setup(e){const t=i(()=>`#icon-${e.icon}`);return()=>r("svg",{class:"relative inline-block align-[-0.2rem]",style:{width:e.size,height:e.size},"aria-hidden":"true"},[r("use",{"xlink:href":t.value,fill:e.color},null)])}});export{t as S};
|
||||
@@ -1 +1 @@
|
||||
var t;import{S as e}from"./index-B6kauwOV.js";import{A as a,M as o}from"./data-CbrE0j8M.js";import{k as r,d as n,c as s,N as i,i as l}from"./main-CVVsEoi-.js";import{N as c}from"./Flex-C3vnRpt4.js";const p={},m={},y=new Set;for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const e=a[f];if(p[f]=e.name,m[f]=e.icon,null==e?void 0:e.hostRelated)for(const a in e.hostRelated)if(Object.prototype.hasOwnProperty.call(e.hostRelated,a)){const o=e.hostRelated[a],r=`${f}-${a}`;r&&(p[r]=(null==(t=null==o?void 0:o.name)?void 0:t.toString())??"",m[r]=e.icon)}}for(const f in o)if(Object.prototype.hasOwnProperty.call(o,f)){const t=o[f];p[f]=t.name,m[f]=t.type,y.add(f)}a.btwaf&&(m.btwaf="btpanel");const u=n({name:"AuthApiTypeIcon",props:{icon:{type:[String,Array],required:!0},type:{type:String,default:"default"},text:{type:Boolean,default:!0}},setup(t){const{iconPath:a,typeName:o,iconItems:n}=function(t){return{iconPath:r(()=>{const e=Array.isArray(t.icon)?t.icon[0]:t.icon;return e?(y.has(e)?"notify-":"resources-")+(m[e]||"default"):"resources-default"}),typeName:r(()=>Array.isArray(t.icon)?t.icon.filter(Boolean).map(t=>p[t]||t).join(", "):p[t.icon]||t.icon),iconItems:r(()=>(Array.isArray(t.icon)?t.icon:[t.icon]).filter(Boolean).map(t=>({iconPath:(y.has(t)?"notify-":"resources-")+(m[t]||"default"),typeName:p[t]||t,key:t})))}}(t);return()=>{if(Array.isArray(t.icon)&&t.icon.length>1){let a;return s(c,{size:"small",wrap:!0,style:"gap: 4px; flex-wrap: wrap;"},"function"==typeof(r=a=n.value.map((a,o)=>s(i,{key:a.key,type:t.type,size:"small",class:"w-auto text-ellipsis overflow-hidden whitespace-normal p-[.6rem] h-auto mb-1",style:"margin-right: 4px; max-width: 100%;"},{default:()=>[s(e,{icon:a.iconPath,size:"1.2rem",class:"mr-[0.4rem] flex-shrink-0"},null),t.text&&s("span",{class:"text-[12px] truncate"},[a.typeName])]})))||"[object Object]"===Object.prototype.toString.call(r)&&!l(r)?a:{default:()=>[a]})}var r;return s(i,{type:t.type,size:"small",class:"w-auto text-ellipsis overflow-hidden whitespace-normal p-[.6rem] h-auto",style:"max-width: 100%;"},{default:()=>[s(e,{icon:a.value,size:"1.2rem",class:"mr-[0.4rem] flex-shrink-0"},null),t.text&&s("span",{class:"text-[12px] truncate"},[o.value])]})}}});export{u as T};
|
||||
var t;import{S as e}from"./index-D_D2Mlc-.js";import{A as a,M as o}from"./data-BmphZhVh.js";import{k as r,d as n,c as s,N as i,i as l}from"./main-BVxorWyM.js";import{N as c}from"./Flex-B1kHIVtt.js";const p={},m={},y=new Set;for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const e=a[f];if(p[f]=e.name,m[f]=e.icon,null==e?void 0:e.hostRelated)for(const a in e.hostRelated)if(Object.prototype.hasOwnProperty.call(e.hostRelated,a)){const o=e.hostRelated[a],r=`${f}-${a}`;r&&(p[r]=(null==(t=null==o?void 0:o.name)?void 0:t.toString())??"",m[r]=e.icon)}}for(const f in o)if(Object.prototype.hasOwnProperty.call(o,f)){const t=o[f];p[f]=t.name,m[f]=t.type,y.add(f)}a.btwaf&&(m.btwaf="btpanel");const u=n({name:"AuthApiTypeIcon",props:{icon:{type:[String,Array],required:!0},type:{type:String,default:"default"},text:{type:Boolean,default:!0}},setup(t){const{iconPath:a,typeName:o,iconItems:n}=function(t){return{iconPath:r(()=>{const e=Array.isArray(t.icon)?t.icon[0]:t.icon;return e?(y.has(e)?"notify-":"resources-")+(m[e]||"default"):"resources-default"}),typeName:r(()=>Array.isArray(t.icon)?t.icon.filter(Boolean).map(t=>p[t]||t).join(", "):p[t.icon]||t.icon),iconItems:r(()=>(Array.isArray(t.icon)?t.icon:[t.icon]).filter(Boolean).map(t=>({iconPath:(y.has(t)?"notify-":"resources-")+(m[t]||"default"),typeName:p[t]||t,key:t})))}}(t);return()=>{if(Array.isArray(t.icon)&&t.icon.length>1){let a;return s(c,{size:"small",wrap:!0,style:"gap: 4px; flex-wrap: wrap;"},"function"==typeof(r=a=n.value.map((a,o)=>s(i,{key:a.key,type:t.type,size:"small",class:"w-auto text-ellipsis overflow-hidden whitespace-normal p-[.6rem] h-auto mb-1",style:"margin-right: 4px; max-width: 100%;"},{default:()=>[s(e,{icon:a.iconPath,size:"1.2rem",class:"mr-[0.4rem] flex-shrink-0"},null),t.text&&s("span",{class:"text-[12px] truncate"},[a.typeName])]})))||"[object Object]"===Object.prototype.toString.call(r)&&!l(r)?a:{default:()=>[a]})}var r;return s(i,{type:t.type,size:"small",class:"w-auto text-ellipsis overflow-hidden whitespace-normal p-[.6rem] h-auto",style:"max-width: 100%;"},{default:()=>[s(e,{icon:a.value,size:"1.2rem",class:"mr-[0.4rem] flex-shrink-0"},null),t.text&&s("span",{class:"text-[12px] truncate"},[o.value])]})}}});export{u as T};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{u as e}from"./useStore-CEORux-G.js";import{u as a,N as l}from"./index-LlhX5Hs2.js";import{r as t,x as u,o as v,aD as s,$ as d,d as r,c as o,w as n,t as i,m as p,B as y,i as c}from"./main-CVVsEoi-.js";import{S as f}from"./index-B6kauwOV.js";import{N as m}from"./text-DHYNx3gK.js";import{N as _}from"./Flex-C3vnRpt4.js";const b=r({name:"DnsProviderSelect",props:{type:{type:String,required:!0},path:{type:String,required:!0},value:{type:String,required:!0},valueType:{type:String,default:"value"},isAddMode:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},emits:["update:value"],setup(r,{emit:b}){const g=function(l,r){const{handleError:o}=a(),{fetchDnsProvider:n,resetDnsProvider:i,dnsProvider:p}=e(),y=t({label:"",value:"",type:"",data:{}}),c=t([]),f=t(!1),m=t(""),_=()=>{var e,a,t,u,v;const s=p.value.find(e=>("value"===l.valueType?e.value:e.type)===y.value.value);s?(y.value={label:s.label,value:"value"===l.valueType?s.value:s.type,type:"value"===l.valueType?s.type:s.value,data:s},r("update:value",{...y.value})):""===y.value.value&&p.value.length>0&&(y.value={label:(null==(e=p.value[0])?void 0:e.label)||"",value:"value"===l.valueType?(null==(a=p.value[0])?void 0:a.value)||"":(null==(t=p.value[0])?void 0:t.type)||"",type:"value"===l.valueType?(null==(u=p.value[0])?void 0:u.type)||"":(null==(v=p.value[0])?void 0:v.value)||"",data:p.value[0]||{}},r("update:value",{...y.value}))},b=e=>{y.value.value=e,_()},g=async(e=l.type)=>{f.value=!0,m.value="";try{await n(e),l.value?(y.value.value=l.value,_()):_()}catch(a){m.value="string"==typeof a?a:d("t_0_1746760933542"),o(a)}finally{f.value=!1}};return u(()=>p.value,e=>{var a;c.value=e.map(e=>({label:e.label,value:"value"===l.valueType?e.value:e.type,type:"value"===l.valueType?e.type:e.value,data:e}))||[],c.value.some(e=>e.value===y.value.value)?_():l.value&&c.value.some(e=>e.value===l.value)?(y.value.value=l.value,_()):""===y.value.value&&c.value.length>0&&(y.value.value=(null==(a=c.value[0])?void 0:a.value)||"",_())},{deep:!0}),u(()=>l.value,e=>{e!==y.value.value&&b(e)},{immediate:!0}),u(()=>l.type,e=>{g(e)}),v(async()=>{await g(l.type)}),s(()=>{i()}),{param:y,dnsProviderRef:c,isLoading:f,errorMessage:m,goToAddDnsProvider:()=>{window.open("/auth-api-manage","_blank")},handleUpdateValue:b,loadDnsProviders:g,handleFilter:(e,a)=>a.label.toLowerCase().includes(e.toLowerCase())}}(r,b),h=e=>o(_,{align:"center"},{default:()=>[o(f,{icon:`resources-${e.type}`,size:"2rem"},null),o(m,null,{default:()=>[e.label]})]});return()=>{let e;return o(l,{show:g.isLoading.value},{default:()=>[o(n,{cols:24,class:r.customClass},{default:()=>[o(i,{span:r.isAddMode?13:24,label:"dns"===r.type?d("t_3_1745735765112"):d("t_0_1746754500246"),path:r.path},{default:()=>[o(p,{class:"flex-1 w-full",filterable:!0,options:g.dnsProviderRef.value,renderLabel:h,renderTag:({option:e})=>(({option:e})=>o(_,{align:"center"},{default:()=>[e.label?h(e):o(m,{class:"text-[#aaa]"},{default:()=>["dns"===r.type?d("t_0_1747019621052"):d("t_0_1746858920894")]})]}))({option:e}),filter:(e,a)=>g.handleFilter(e,a),placeholder:"dns"===r.type?d("t_3_1745490735059"):d("t_0_1746858920894"),value:g.param.value.value,onUpdateValue:g.handleUpdateValue,disabled:r.disabled},{empty:()=>o("span",{class:"text-[1.4rem]"},[g.errorMessage.value||("dns"===r.type?d("t_1_1746858922914"):d("t_2_1746858923964"))])})]}),r.isAddMode&&o(i,{span:11},{default:()=>{return[o(y,{class:"mx-[8px]",onClick:g.goToAddDnsProvider,disabled:r.disabled},{default:()=>["dns"===r.type?d("t_1_1746004861166"):d("t_3_1746858920060")]}),o(y,{onClick:()=>g.loadDnsProviders(r.type),loading:g.isLoading.value,disabled:r.disabled},(a=e=d("t_0_1746497662220"),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!c(a)?e:{default:()=>[e]}))];var a}})]})]})}}});export{b as D};
|
||||
import{u as e}from"./useStore-DsgAV0BS.js";import{u as a,N as l}from"./index-yTfFo-nL.js";import{r as t,x as u,o as v,aD as s,$ as d,d as r,c as o,w as n,t as i,m as p,B as y,i as c}from"./main-BVxorWyM.js";import{S as f}from"./index-D_D2Mlc-.js";import{N as m}from"./text-D7JJPoiP.js";import{N as _}from"./Flex-B1kHIVtt.js";const b=r({name:"DnsProviderSelect",props:{type:{type:String,required:!0},path:{type:String,required:!0},value:{type:String,required:!0},valueType:{type:String,default:"value"},isAddMode:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},emits:["update:value"],setup(r,{emit:b}){const g=function(l,r){const{handleError:o}=a(),{fetchDnsProvider:n,resetDnsProvider:i,dnsProvider:p}=e(),y=t({label:"",value:"",type:"",data:{}}),c=t([]),f=t(!1),m=t(""),_=()=>{var e,a,t,u,v;const s=p.value.find(e=>("value"===l.valueType?e.value:e.type)===y.value.value);s?(y.value={label:s.label,value:"value"===l.valueType?s.value:s.type,type:"value"===l.valueType?s.type:s.value,data:s},r("update:value",{...y.value})):""===y.value.value&&p.value.length>0&&(y.value={label:(null==(e=p.value[0])?void 0:e.label)||"",value:"value"===l.valueType?(null==(a=p.value[0])?void 0:a.value)||"":(null==(t=p.value[0])?void 0:t.type)||"",type:"value"===l.valueType?(null==(u=p.value[0])?void 0:u.type)||"":(null==(v=p.value[0])?void 0:v.value)||"",data:p.value[0]||{}},r("update:value",{...y.value}))},b=e=>{y.value.value=e,_()},g=async(e=l.type)=>{f.value=!0,m.value="";try{await n(e),l.value?(y.value.value=l.value,_()):_()}catch(a){m.value="string"==typeof a?a:d("t_0_1746760933542"),o(a)}finally{f.value=!1}};return u(()=>p.value,e=>{var a;c.value=e.map(e=>({label:e.label,value:"value"===l.valueType?e.value:e.type,type:"value"===l.valueType?e.type:e.value,data:e}))||[],c.value.some(e=>e.value===y.value.value)?_():l.value&&c.value.some(e=>e.value===l.value)?(y.value.value=l.value,_()):""===y.value.value&&c.value.length>0&&(y.value.value=(null==(a=c.value[0])?void 0:a.value)||"",_())},{deep:!0}),u(()=>l.value,e=>{e!==y.value.value&&b(e)},{immediate:!0}),u(()=>l.type,e=>{g(e)}),v(async()=>{await g(l.type)}),s(()=>{i()}),{param:y,dnsProviderRef:c,isLoading:f,errorMessage:m,goToAddDnsProvider:()=>{window.open("/auth-api-manage","_blank")},handleUpdateValue:b,loadDnsProviders:g,handleFilter:(e,a)=>a.label.toLowerCase().includes(e.toLowerCase())}}(r,b),h=e=>o(_,{align:"center"},{default:()=>[o(f,{icon:`resources-${e.type}`,size:"2rem"},null),o(m,null,{default:()=>[e.label]})]});return()=>{let e;return o(l,{show:g.isLoading.value},{default:()=>[o(n,{cols:24,class:r.customClass},{default:()=>[o(i,{span:r.isAddMode?13:24,label:"dns"===r.type?d("t_3_1745735765112"):d("t_0_1746754500246"),path:r.path},{default:()=>[o(p,{class:"flex-1 w-full",filterable:!0,options:g.dnsProviderRef.value,renderLabel:h,renderTag:({option:e})=>(({option:e})=>o(_,{align:"center"},{default:()=>[e.label?h(e):o(m,{class:"text-[#aaa]"},{default:()=>["dns"===r.type?d("t_0_1747019621052"):d("t_0_1746858920894")]})]}))({option:e}),filter:(e,a)=>g.handleFilter(e,a),placeholder:"dns"===r.type?d("t_3_1745490735059"):d("t_0_1746858920894"),value:g.param.value.value,onUpdateValue:g.handleUpdateValue,disabled:r.disabled},{empty:()=>o("span",{class:"text-[1.4rem]"},[g.errorMessage.value||("dns"===r.type?d("t_1_1746858922914"):d("t_2_1746858923964"))])})]}),r.isAddMode&&o(i,{span:11},{default:()=>{return[o(y,{class:"mx-[8px]",onClick:g.goToAddDnsProvider,disabled:r.disabled},{default:()=>["dns"===r.type?d("t_1_1746004861166"):d("t_3_1746858920060")]}),o(y,{onClick:()=>g.loadDnsProviders(r.type),loading:g.isLoading.value,disabled:r.disabled},(a=e=d("t_0_1746497662220"),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!c(a)?e:{default:()=>[e]}))];var a}})]})]})}}});export{b as D};
|
||||
File diff suppressed because one or more lines are too long
1
static/build/static/js/index-jFN9tlnn.js
Normal file
1
static/build/static/js/index-jFN9tlnn.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{bS as e,bX as t,aQ as n,bV as a,bU as i,A as o,x as r,bY as s,aF as u,bT as c,o as l,V as f,J as m,r as p,bZ as v}from"./main-CVVsEoi-.js";function b(e){return!!s()&&(u(e),!0)}const d=new WeakMap,w=(...e)=>{var t;const n=e[0],r=null==(t=a())?void 0:t.proxy;if(null==r&&!i())throw new Error("injectLocal must be called in setup");return r&&d.has(r)&&n in d.get(r)?d.get(r)[n]:o(...e)},g="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const h=Object.prototype.toString,y=e=>"[object Object]"===h.call(e),F=()=>{};function j(e,t){return function(...n){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(a).catch(i)})}}const A=e=>e();function S(e=A,n={}){const{initialState:a="active"}=n,i=function(...e){if(1!==e.length)return m(...e);const n=e[0];return"function"==typeof n?t(v(()=>({get:n,set:F}))):p(n)}("active"===a);return{isActive:t(i),pause:function(){i.value=!1},resume:function(){i.value=!0},eventFilter:(...t)=>{i.value&&e(...t)}}}function T(e){return e.endsWith("rem")?16*Number.parseFloat(e):Number.parseFloat(e)}function k(e){return Array.isArray(e)?e:[e]}function x(e,t=200,a=!1,i=!0,o=!1){return j(function(...e){let t,a,i,o,r,s,u=0,l=!0,f=F;n(e[0])||"object"!=typeof e[0]?[i,o=!0,r=!0,s=!1]=e:({delay:i,trailing:o=!0,leading:r=!0,rejectOnCancel:s=!1}=e[0]);const m=()=>{t&&(clearTimeout(t),t=void 0,f(),f=F)};return e=>{const n=c(i),p=Date.now()-u,v=()=>a=e();return m(),n<=0?(u=Date.now(),v()):(p>n&&(r||!l)?(u=Date.now(),v()):o&&(a=new Promise((e,a)=>{f=s?a:e,t=setTimeout(()=>{u=Date.now(),l=!0,e(v()),m()},Math.max(0,n-p))})),r||t||(t=setTimeout(()=>l=!0,n)),l=!1,a)}}(t,a,i,o),e)}function D(e,t,n={}){const{eventFilter:a,initialState:i="active",...o}=n,{eventFilter:s,pause:u,resume:c,isActive:l}=S(a,{initialState:i}),f=function(e,t,n={}){const{eventFilter:a=A,...i}=n;return r(e,j(a,t),i)}(e,t,{...o,eventFilter:s});return{stop:f,pause:u,resume:c,isActive:l}}function P(e,t=!0,n){a()?l(e,n):t?e():f(e)}function W(n,a,i={}){const{immediate:o=!0,immediateCallback:r=!1}=i,s=e(!1);let u=null;function l(){u&&(clearTimeout(u),u=null)}function f(){s.value=!1,l()}function m(...e){r&&n(),l(),s.value=!0,u=setTimeout(()=>{s.value=!1,u=null,n(...e)},c(a))}return o&&(s.value=!0,g&&m()),b(f),{isPending:t(s),start:m,stop:f}}function O(e,t,n){return r(e,t,{...n,immediate:!0})}export{W as a,g as b,b as c,y as d,D as e,P as f,w as i,T as p,k as t,x as u,O as w};
|
||||
import{bS as e,bX as t,aQ as n,bV as a,bU as i,A as o,x as r,bY as s,aF as u,bT as c,o as l,V as f,J as m,r as p,bZ as v}from"./main-BVxorWyM.js";function b(e){return!!s()&&(u(e),!0)}const d=new WeakMap,w=(...e)=>{var t;const n=e[0],r=null==(t=a())?void 0:t.proxy;if(null==r&&!i())throw new Error("injectLocal must be called in setup");return r&&d.has(r)&&n in d.get(r)?d.get(r)[n]:o(...e)},g="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const h=Object.prototype.toString,y=e=>"[object Object]"===h.call(e),F=()=>{};function j(e,t){return function(...n){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(a).catch(i)})}}const A=e=>e();function S(e=A,n={}){const{initialState:a="active"}=n,i=function(...e){if(1!==e.length)return m(...e);const n=e[0];return"function"==typeof n?t(v(()=>({get:n,set:F}))):p(n)}("active"===a);return{isActive:t(i),pause:function(){i.value=!1},resume:function(){i.value=!0},eventFilter:(...t)=>{i.value&&e(...t)}}}function T(e){return e.endsWith("rem")?16*Number.parseFloat(e):Number.parseFloat(e)}function k(e){return Array.isArray(e)?e:[e]}function x(e,t=200,a=!1,i=!0,o=!1){return j(function(...e){let t,a,i,o,r,s,u=0,l=!0,f=F;n(e[0])||"object"!=typeof e[0]?[i,o=!0,r=!0,s=!1]=e:({delay:i,trailing:o=!0,leading:r=!0,rejectOnCancel:s=!1}=e[0]);const m=()=>{t&&(clearTimeout(t),t=void 0,f(),f=F)};return e=>{const n=c(i),p=Date.now()-u,v=()=>a=e();return m(),n<=0?(u=Date.now(),v()):(p>n&&(r||!l)?(u=Date.now(),v()):o&&(a=new Promise((e,a)=>{f=s?a:e,t=setTimeout(()=>{u=Date.now(),l=!0,e(v()),m()},Math.max(0,n-p))})),r||t||(t=setTimeout(()=>l=!0,n)),l=!1,a)}}(t,a,i,o),e)}function D(e,t,n={}){const{eventFilter:a,initialState:i="active",...o}=n,{eventFilter:s,pause:u,resume:c,isActive:l}=S(a,{initialState:i}),f=function(e,t,n={}){const{eventFilter:a=A,...i}=n;return r(e,j(a,t),i)}(e,t,{...o,eventFilter:s});return{stop:f,pause:u,resume:c,isActive:l}}function P(e,t=!0,n){a()?l(e,n):t?e():f(e)}function W(n,a,i={}){const{immediate:o=!0,immediateCallback:r=!1}=i,s=e(!1);let u=null;function l(){u&&(clearTimeout(u),u=null)}function f(){s.value=!1,l()}function m(...e){r&&n(),l(),s.value=!0,u=setTimeout(()=>{s.value=!1,u=null,n(...e)},c(a))}return o&&(s.value=!0,g&&m()),b(f),{isPending:t(s),start:m,stop:f}}function O(e,t,n){return r(e,t,{...n,immediate:!0})}export{W as a,g as b,b as c,y as d,D as e,P as f,w as i,T as p,k as t,x as u,O as w};
|
||||
File diff suppressed because one or more lines are too long
1
static/build/static/js/index-yolAsWR-.js
Normal file
1
static/build/static/js/index-yolAsWR-.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{c as o}from"./index-LlhX5Hs2.js";const t=t=>o("/v1/monitor/get_list",t),r=t=>o("/v1/monitor/add_monitor",t),i=t=>o("/v1/monitor/upd_monitor",t),n=t=>o("/v1/monitor/del_monitor",t),m=t=>o("/v1/monitor/set_monitor",t),s=t=>o("/v1/monitor/get_monitor_info",t),a=t=>o("/v1/monitor/get_err_record",t);export{r as a,s as b,a as c,n as d,t as g,m as s,i as u};
|
||||
import{c as o}from"./index-yTfFo-nL.js";const t=t=>o("/v1/monitor/get_list",t),r=t=>o("/v1/monitor/add_monitor",t),i=t=>o("/v1/monitor/upd_monitor",t),n=t=>o("/v1/monitor/del_monitor",t),m=t=>o("/v1/monitor/set_monitor",t),s=t=>o("/v1/monitor/get_monitor_info",t),a=t=>o("/v1/monitor/get_err_record",t);export{r as a,s as b,a as c,n as d,t as g,m as s,i as u};
|
||||
@@ -1 +1 @@
|
||||
import{c as s,d as o}from"./index-LlhX5Hs2.js";const e=o=>s("/v1/login/sign",o),g=()=>o.get("/v1/login/get_code"),i=()=>s("/v1/login/sign-out",{}),v=o=>s("/v1/overview/get_overviews",o);export{g as a,v as g,e as l,i as s};
|
||||
import{c as s,d as o}from"./index-yTfFo-nL.js";const e=o=>s("/v1/login/sign",o),g=()=>o.get("/v1/login/get_code"),i=()=>s("/v1/login/sign-out",{}),v=o=>s("/v1/overview/get_overviews",o);export{g as a,v as g,e as l,i as s};
|
||||
@@ -1 +1 @@
|
||||
import{c as t}from"./index-LlhX5Hs2.js";const e=e=>t("/v1/setting/get_setting",e),s=e=>t("/v1/setting/save_setting",e),r=e=>t("/v1/report/add_report",e),o=e=>t("/v1/report/upd_report",e),a=e=>t("/v1/report/del_report",e),p=e=>t("/v1/report/notify_test",e),i=e=>t("/v1/report/get_list",e),v=e=>t("/v1/setting/get_version",e);export{e as a,i as b,r as c,a as d,v as g,s,p as t,o as u};
|
||||
import{c as t}from"./index-yTfFo-nL.js";const e=e=>t("/v1/setting/get_setting",e),s=e=>t("/v1/setting/save_setting",e),r=e=>t("/v1/report/add_report",e),o=e=>t("/v1/report/upd_report",e),a=e=>t("/v1/report/del_report",e),p=e=>t("/v1/report/notify_test",e),i=e=>t("/v1/report/get_list",e),v=e=>t("/v1/setting/get_version",e);export{e as a,i as b,r as c,a as d,v as g,s,p as t,o as u};
|
||||
@@ -1 +1 @@
|
||||
import{E as e,F as o,d as t,H as n,I as r,K as s,ce as i,k as l,aZ as a,M as d,aw as c}from"./main-CVVsEoi-.js";const h=e("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[o("strong","\n font-weight: var(--n-font-weight-strong);\n "),o("italic",{fontStyle:"italic"}),o("underline",{textDecoration:"underline"}),o("code","\n line-height: 1.4;\n display: inline-block;\n font-family: var(--n-font-famliy-mono);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n box-sizing: border-box;\n padding: .05em .35em 0 .35em;\n border-radius: var(--n-code-border-radius);\n font-size: .9em;\n color: var(--n-code-text-color);\n background-color: var(--n-code-color);\n border: var(--n-code-border);\n ")]),g=t({name:"Text",props:Object.assign(Object.assign({},s.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=r(e),n=s("Typography","-text",h,i,e,o),g=l(()=>{const{depth:o,type:t}=e,r="default"===t?void 0===o?"textColor":`textColor${o}Depth`:a("textColor",t),{common:{fontWeightStrong:s,fontFamilyMono:i,cubicBezierEaseInOut:l},self:{codeTextColor:d,codeBorderRadius:c,codeColor:h,codeBorder:g,[r]:u}}=n.value;return{"--n-bezier":l,"--n-text-color":u,"--n-font-weight-strong":s,"--n-font-famliy-mono":i,"--n-code-border-radius":c,"--n-code-text-color":d,"--n-code-color":h,"--n-code-border":g}}),u=t?d("text",l(()=>`${e.type[0]}${e.depth||""}`),g,e):void 0;return{mergedClsPrefix:o,compitableTag:c(e,["as","tag"]),cssVars:t?void 0:g,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender}},render(){var e,o,t;const{mergedClsPrefix:r}=this;null===(e=this.onRender)||void 0===e||e.call(this);const s=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],i=null===(t=(o=this.$slots).default)||void 0===t?void 0:t.call(o);return this.code?n("code",{class:s,style:this.cssVars},this.delete?n("del",null,i):i):this.delete?n("del",{class:s,style:this.cssVars},i):n(this.compitableTag||"span",{class:s,style:this.cssVars},i)}});export{g as N};
|
||||
import{E as e,F as o,d as t,H as n,I as r,K as s,ce as i,k as l,aZ as a,M as d,aw as c}from"./main-BVxorWyM.js";const h=e("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[o("strong","\n font-weight: var(--n-font-weight-strong);\n "),o("italic",{fontStyle:"italic"}),o("underline",{textDecoration:"underline"}),o("code","\n line-height: 1.4;\n display: inline-block;\n font-family: var(--n-font-famliy-mono);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n box-sizing: border-box;\n padding: .05em .35em 0 .35em;\n border-radius: var(--n-code-border-radius);\n font-size: .9em;\n color: var(--n-code-text-color);\n background-color: var(--n-code-color);\n border: var(--n-code-border);\n ")]),g=t({name:"Text",props:Object.assign(Object.assign({},s.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=r(e),n=s("Typography","-text",h,i,e,o),g=l(()=>{const{depth:o,type:t}=e,r="default"===t?void 0===o?"textColor":`textColor${o}Depth`:a("textColor",t),{common:{fontWeightStrong:s,fontFamilyMono:i,cubicBezierEaseInOut:l},self:{codeTextColor:d,codeBorderRadius:c,codeColor:h,codeBorder:g,[r]:u}}=n.value;return{"--n-bezier":l,"--n-text-color":u,"--n-font-weight-strong":s,"--n-font-famliy-mono":i,"--n-code-border-radius":c,"--n-code-text-color":d,"--n-code-color":h,"--n-code-border":g}}),u=t?d("text",l(()=>`${e.type[0]}${e.depth||""}`),g,e):void 0;return{mergedClsPrefix:o,compitableTag:c(e,["as","tag"]),cssVars:t?void 0:g,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender}},render(){var e,o,t;const{mergedClsPrefix:r}=this;null===(e=this.onRender)||void 0===e||e.call(this);const s=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],i=null===(t=(o=this.$slots).default)||void 0===t?void 0:t.call(o);return this.code?n("code",{class:s,style:this.cssVars},this.delete?n("del",null,i):i):this.delete?n("del",{class:s,style:this.cssVars},i):n(this.compitableTag||"span",{class:s,style:this.cssVars},i)}});export{g as N};
|
||||
@@ -1 +1 @@
|
||||
import{cb as t,cc as n,cd as i}from"./main-CVVsEoi-.js";var r=/\s/;var e=/^\s+/;function a(t){return t?t.slice(0,function(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}(t)+1).replace(e,""):t}var o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,c=parseInt;function v(i){if("number"==typeof i)return i;if(t(i))return NaN;if(n(i)){var r="function"==typeof i.valueOf?i.valueOf():i;i=n(r)?r+"":r}if("string"!=typeof i)return 0===i?i:+i;i=a(i);var e=u.test(i);return e||f.test(i)?c(i.slice(2),e?2:8):o.test(i)?NaN:+i}var s=function(){return i.Date.now()},l=Math.max,d=Math.min;function m(t,i,r){var e,a,o,u,f,c,m=0,p=!1,g=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function x(n){var i=e,r=a;return e=a=void 0,m=n,u=t.apply(r,i)}function y(t){var n=t-c;return void 0===c||n>=i||n<0||g&&t-m>=o}function T(){var t=s();if(y(t))return w(t);f=setTimeout(T,function(t){var n=i-(t-c);return g?d(n,o-(t-m)):n}(t))}function w(t){return f=void 0,h&&e?x(t):(e=a=void 0,u)}function E(){var t=s(),n=y(t);if(e=arguments,a=this,c=t,n){if(void 0===f)return function(t){return m=t,f=setTimeout(T,i),p?x(t):u}(c);if(g)return clearTimeout(f),f=setTimeout(T,i),x(c)}return void 0===f&&(f=setTimeout(T,i)),u}return i=v(i)||0,n(r)&&(p=!!r.leading,o=(g="maxWait"in r)?l(v(r.maxWait)||0,i):o,h="trailing"in r?!!r.trailing:h),E.cancel=function(){void 0!==f&&clearTimeout(f),m=0,e=c=a=f=void 0},E.flush=function(){return void 0===f?u:w(s())},E}function p(t,i,r){var e=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return n(r)&&(e="leading"in r?!!r.leading:e,a="trailing"in r?!!r.trailing:a),m(t,i,{leading:e,maxWait:i,trailing:a})}export{p as t};
|
||||
import{cb as t,cc as n,cd as i}from"./main-BVxorWyM.js";var r=/\s/;var e=/^\s+/;function a(t){return t?t.slice(0,function(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}(t)+1).replace(e,""):t}var o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,c=parseInt;function v(i){if("number"==typeof i)return i;if(t(i))return NaN;if(n(i)){var r="function"==typeof i.valueOf?i.valueOf():i;i=n(r)?r+"":r}if("string"!=typeof i)return 0===i?i:+i;i=a(i);var e=u.test(i);return e||f.test(i)?c(i.slice(2),e?2:8):o.test(i)?NaN:+i}var s=function(){return i.Date.now()},l=Math.max,d=Math.min;function m(t,i,r){var e,a,o,u,f,c,m=0,p=!1,g=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function x(n){var i=e,r=a;return e=a=void 0,m=n,u=t.apply(r,i)}function y(t){var n=t-c;return void 0===c||n>=i||n<0||g&&t-m>=o}function T(){var t=s();if(y(t))return w(t);f=setTimeout(T,function(t){var n=i-(t-c);return g?d(n,o-(t-m)):n}(t))}function w(t){return f=void 0,h&&e?x(t):(e=a=void 0,u)}function E(){var t=s(),n=y(t);if(e=arguments,a=this,c=t,n){if(void 0===f)return function(t){return m=t,f=setTimeout(T,i),p?x(t):u}(c);if(g)return clearTimeout(f),f=setTimeout(T,i),x(c)}return void 0===f&&(f=setTimeout(T,i)),u}return i=v(i)||0,n(r)&&(p=!!r.leading,o=(g="maxWait"in r)?l(v(r.maxWait)||0,i):o,h="trailing"in r?!!r.trailing:h),E.cancel=function(){void 0!==f&&clearTimeout(f),m=0,e=c=a=f=void 0},E.flush=function(){return void 0===f?u:w(s())},E}function p(t,i,r){var e=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return n(r)&&(e="leading"in r?!!r.leading:e,a="trailing"in r?!!r.trailing:a),m(t,i,{leading:e,maxWait:i,trailing:a})}export{p as t};
|
||||
@@ -1 +1 @@
|
||||
import{c as e,u as a}from"./index-LlhX5Hs2.js";import{e as o,s as t,r as l,$ as r}from"./main-CVVsEoi-.js";const s=a=>e("/v1/workflow/get_list",a),w=a=>e("/v1/workflow/add_workflow",a),c=a=>e("/v1/workflow/del_workflow",a),f=a=>e("/v1/workflow/get_workflow_history",a),n=a=>e("/v1/workflow/get_exec_log",a),d=a=>e("/v1/workflow/execute_workflow",a),i=a=>e("/v1/workflow/exec_type",a),k=a=>e("/v1/workflow/active",a),u=a=>e("/v1/workflow/stop",a),v=o("work-edit-view-store",()=>{const{handleError:o}=a(),t=l(!1),s=l(!1),c=l({id:"",name:"",content:"",active:"1",exec_type:"manual"}),f=l("quick"),n=l({id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}});return{isEdit:t,detectionRefresh:s,workflowData:c,workflowType:f,workDefalutNodeData:n,resetWorkflowData:()=>{c.value={id:"",name:"",content:"",active:"1",exec_type:"manual"},n.value={id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}},f.value="quick",t.value=!1},addNewWorkflow:async e=>{try{const{message:a,fetch:o}=w(e);a.value=!0,await o()}catch(a){o(a).default(r("t_10_1745457486451"))}},updateWorkflowData:async a=>{try{const{message:o,fetch:t}=e("/v1/workflow/upd_workflow",a);o.value=!0,await t()}catch(t){o(t).default(r("t_11_1745457488256"))}}}}),_=()=>{const e=v();return{...e,...t(e)}};export{f as a,d as b,w as c,c as d,k as e,n as f,s as g,_ as h,u as s,i as u};
|
||||
import{c as e,u as a}from"./index-yTfFo-nL.js";import{e as o,s as t,r as l,$ as r}from"./main-BVxorWyM.js";const s=a=>e("/v1/workflow/get_list",a),w=a=>e("/v1/workflow/add_workflow",a),c=a=>e("/v1/workflow/del_workflow",a),f=a=>e("/v1/workflow/get_workflow_history",a),n=a=>e("/v1/workflow/get_exec_log",a),d=a=>e("/v1/workflow/execute_workflow",a),i=a=>e("/v1/workflow/exec_type",a),k=a=>e("/v1/workflow/active",a),u=a=>e("/v1/workflow/stop",a),v=o("work-edit-view-store",()=>{const{handleError:o}=a(),t=l(!1),s=l(!1),c=l({id:"",name:"",content:"",active:"1",exec_type:"manual"}),f=l("quick"),n=l({id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}});return{isEdit:t,detectionRefresh:s,workflowData:c,workflowType:f,workDefalutNodeData:n,resetWorkflowData:()=>{c.value={id:"",name:"",content:"",active:"1",exec_type:"manual"},n.value={id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}},f.value="quick",t.value=!1},addNewWorkflow:async e=>{try{const{message:a,fetch:o}=w(e);a.value=!0,await o()}catch(a){o(a).default(r("t_10_1745457486451"))}},updateWorkflowData:async a=>{try{const{message:o,fetch:t}=e("/v1/workflow/upd_workflow",a);o.value=!0,await t()}catch(t){o(t).default(r("t_11_1745457488256"))}}}}),_=()=>{const e=v();return{...e,...t(e)}};export{f as a,d as b,w as c,c as d,k as e,n as f,s as g,_ as h,u as s,i as u};
|
||||
@@ -1 +1 @@
|
||||
import{e,s as a,r as t,k as o,$ as s}from"./main-CVVsEoi-.js";import{a as l,b as n}from"./index-DTrXdYNR.js";import{u as r}from"./index-LlhX5Hs2.js";import{b as i}from"./setting-Bm6X4TfA.js";import{j as u}from"./access-Du4iSKC0.js";const m=e("layout-store",()=>{const{handleError:e}=r(),a=l("layout-collapsed",!1),m=t([]),c=t([]),v=n("menu-active","home"),d=o(()=>"home"!==v.value?"var(--n-content-padding)":"0"),p=l("locales-active","zhCN"),h=t({mail:{name:s("t_68_1745289354676")},dingtalk:{name:s("t_32_1746773348993")},wecom:{name:s("t_33_1746773350932")},feishu:{name:s("t_34_1746773350153")},webhook:{name:"WebHook"}});return{isCollapsed:a,notifyProvider:m,dnsProvider:c,menuActive:v,layoutPadding:d,locales:p,pushSourceType:h,toggleCollapse:()=>{a.value=!a.value},handleCollapse:()=>{a.value=!0},handleExpand:()=>{a.value=!1},updateMenuActive:e=>{"logout"!==e&&(v.value=e)},resetDataInfo:()=>{v.value="home",sessionStorage.removeItem("menu-active")},fetchNotifyProvider:async()=>{try{m.value=[];const{data:e}=await i({p:1,search:"",limit:1e3}).fetch();m.value=(null==e?void 0:e.map(e=>({label:e.name,value:e.id.toString(),type:e.type})))||[]}catch(a){e(a)}},fetchDnsProvider:async(a="")=>{try{c.value=[];const{data:e}=await u({type:a}).fetch();c.value=(null==e?void 0:e.map(e=>({label:e.name,value:e.id.toString(),type:e.type,data:e})))||[]}catch(t){c.value=[],e(t)}},resetDnsProvider:()=>{c.value=[]}}}),c=()=>{const e=m();return{...e,...a(e)}};export{c as u};
|
||||
import{e,s as a,r as t,k as o,$ as s}from"./main-BVxorWyM.js";import{a as l,b as n}from"./index-BZGO7Gi4.js";import{u as r}from"./index-yTfFo-nL.js";import{b as i}from"./setting-DkG4j-Qh.js";import{j as u}from"./access-tNugO07J.js";const m=e("layout-store",()=>{const{handleError:e}=r(),a=l("layout-collapsed",!1),m=t([]),c=t([]),v=n("menu-active","home"),d=o(()=>"home"!==v.value?"var(--n-content-padding)":"0"),p=l("locales-active","zhCN"),h=t({mail:{name:s("t_68_1745289354676")},dingtalk:{name:s("t_32_1746773348993")},wecom:{name:s("t_33_1746773350932")},feishu:{name:s("t_34_1746773350153")},webhook:{name:"WebHook"}});return{isCollapsed:a,notifyProvider:m,dnsProvider:c,menuActive:v,layoutPadding:d,locales:p,pushSourceType:h,toggleCollapse:()=>{a.value=!a.value},handleCollapse:()=>{a.value=!0},handleExpand:()=>{a.value=!1},updateMenuActive:e=>{"logout"!==e&&(v.value=e)},resetDataInfo:()=>{v.value="home",sessionStorage.removeItem("menu-active")},fetchNotifyProvider:async()=>{try{m.value=[];const{data:e}=await i({p:1,search:"",limit:1e3}).fetch();m.value=(null==e?void 0:e.map(e=>({label:e.name,value:e.id.toString(),type:e.type})))||[]}catch(a){e(a)}},fetchDnsProvider:async(a="")=>{try{c.value=[];const{data:e}=await u({type:a}).fetch();c.value=(null==e?void 0:e.map(e=>({label:e.name,value:e.id.toString(),type:e.type,data:e})))||[]}catch(t){c.value=[],e(t)}},resetDnsProvider:()=>{c.value=[]}}}),c=()=>{const e=m();return{...e,...a(e)}};export{c as u};
|
||||
Reference in New Issue
Block a user