import { defineComponent, ref, reactive, computed, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrRenderAttr, ssrInterpolate, ssrIncludeBooleanAttr, ssrLooseContain, ssrRenderDynamicModel, ssrLooseEqual } from 'vue/server-renderer'; import { u as useToast } from './useToast-CS21XT61.mjs'; import { u as useApi } from './useApi-DMQewX5_.mjs'; import { _ as _export_sfc } from './server.mjs'; import './useLoading-D4zrSa2m.mjs'; import './auth-QFkCoU1C.mjs'; import 'pinia'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'perfect-debounce'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "systemconfig", __ssrInlineRender: true, setup(__props) { useToast(); useApi(); const categories = [ { id: "storage", label: "对象存储", desc: "固件 / 头像 / 文件", color: "#6366f1", icon: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8" }, { id: "mail", label: "邮件服务", desc: "生产通知 / 厂家发信", color: "#f59e0b", icon: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }, { id: "translate", label: "翻译服务", desc: "后台文案多语言同步", color: "#14b8a6", icon: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" } ]; const curCat = ref("storage"); const mail = reactive({ enable: true, host: "smtp.exmail.qq.com", port: "465", secure: "SSL", user: "noreply@yunyan.com", pass: "", _showPass: false, fromName: "云岩科技", cc: "ops@yunyan.com", testTo: "" }); const secureOptions = ["SSL", "STARTTLS", "不加密"]; function svcEnabled(id) { if (id === "storage") return true; if (id === "mail") return mail.enable; if (id === "translate") return tActiveProvider.value?.enable ?? false; return false; } const tProviders = reactive([ { id: "volc", name: "火山引擎翻译", short: "火山", tag: "Volcengine MT", color: "#1664ff", enable: true, fields: [ { key: "region", label: "Region", value: "cn-beijing", mono: true, required: true }, { key: "accessKey", label: "AccessKey", value: "AKLTZjJmODdk****", mono: true, encrypted: true, required: true }, { key: "secretKey", label: "SecretKey", value: "", mono: true, encrypted: true, required: true, hint: "留空保留原密文" } ] }, { id: "aliyun", name: "阿里云翻译", short: "阿里", tag: "Aliyun MT", color: "#ff6a00", enable: true, fields: [ { key: "region", label: "Region", value: "cn-hangzhou", mono: true, required: true }, { key: "accessKeyId", label: "AccessKey ID", value: "LTAI5txxxxxxxx", mono: true, encrypted: true, required: true }, { key: "accessKeySecret", label: "AccessKey Secret", value: "", mono: true, encrypted: true, required: true, hint: "留空保留原密文" }, { key: "scene", label: "翻译场景", value: "general", mono: true, hint: "general / social / ecommerce / tech" } ] }, { id: "google", name: "Google 翻译", short: "G", tag: "Cloud Translation", color: "#ea4335", enable: false, fields: [ { key: "project", label: "Project ID", value: "", mono: true, required: true }, { key: "apiKey", label: "API Key", value: "", mono: true, encrypted: true, required: true } ] }, { id: "deepl", name: "DeepL", short: "DL", tag: "DeepL API", color: "#0f2b46", enable: false, fields: [ { key: "authKey", label: "Auth Key", value: "", mono: true, encrypted: true, required: true }, { key: "plan", label: "套餐", value: "free", mono: true, hint: "free / pro" } ] } ]); const tActiveId = ref("volc"); const tCurProvider = ref("volc"); const tEditProvider = computed(() => tProviders.find((p) => p.id === tCurProvider.value)); const tActiveProvider = computed(() => tProviders.find((p) => p.id === tActiveId.value)); const providers = reactive([ { id: "aliyun", name: "阿里云 OSS", short: "OSS", tag: "Aliyun", color: "#ff6a00", enable: false, fields: [ { key: "endpoint", label: "Endpoint", value: "", placeholder: "oss-cn-shanghai.aliyuncs.com", mono: true, required: true }, { key: "bucket", label: "Bucket", value: "", placeholder: "yunyan-firmware", mono: true, required: true }, { key: "access_key_id", label: "AccessKey ID", value: "", mono: true, encrypted: true, required: true }, { key: "access_key_secret", label: "AccessKey Secret", value: "", mono: true, encrypted: true, required: true, hint: "留空保留原密文" }, { key: "domain", label: "自定义域名 (CDN)", value: "", placeholder: "cdn.yunyan.com", wide: true, hint: "可选,配置后文件下载 URL 走该域名" } ] }, { id: "tencent", name: "腾讯云 COS", short: "COS", tag: "Tencent", color: "#00a4ff", enable: true, fields: [ { key: "region", label: "Region", value: "ap-guangzhou", mono: true, required: true }, { key: "appid", label: "AppId", value: "1253517901", mono: true, required: true }, { key: "bucket", label: "Bucket", value: "yunyan-1253517901", mono: true, required: true }, { key: "secretId", label: "SecretId", value: "AKIDxxxxxxxx", mono: true, encrypted: true, required: true }, { key: "secretKey", label: "SecretKey", value: "", mono: true, encrypted: true, required: true, hint: "留空保留原密文" }, { key: "domain", label: "自定义域名 (CDN)", value: "", wide: true, hint: "可选" } ] }, { id: "qiniu", name: "七牛云 Kodo", short: "KODO", tag: "Qiniu", color: "#00aaff", enable: false, fields: [ { key: "zone", label: "存储区域", value: "", mono: true, required: true }, { key: "bucket", label: "Bucket", value: "", mono: true, required: true }, { key: "accessKey", label: "AccessKey", value: "", mono: true, encrypted: true, required: true }, { key: "secretKey", label: "SecretKey", value: "", mono: true, encrypted: true, required: true }, { key: "domain", label: "加速域名", value: "", wide: true } ] }, { id: "minio", name: "MinIO", short: "S3", tag: "S3 兼容", color: "#c72e49", enable: false, fields: [ { key: "endpoint", label: "Endpoint", value: "", mono: true, required: true, placeholder: "minio.内网:9000" }, { key: "bucket", label: "Bucket", value: "", mono: true, required: true }, { key: "accessKey", label: "AccessKey", value: "", mono: true, encrypted: true, required: true }, { key: "secretKey", label: "SecretKey", value: "", mono: true, encrypted: true, required: true }, { key: "useSSL", label: "使用 HTTPS", value: "false", mono: true } ] } ]); const activeId = ref("aliyun"); const curProvider = ref("aliyun"); const editProvider = computed(() => providers.find((p) => p.id === curProvider.value)); const activeProvider = computed(() => providers.find((p) => p.id === activeId.value)); const STORAGE_SVC = { aliyun: { svcId: "storage_aliyun_oss", provider: "aliyun_oss" }, tencent: { svcId: "storage_tencent_cos", provider: "tencent_cos" }, qiniu: { svcId: "storage_qiniu_kodo", provider: "qiniu_kodo" }, minio: { svcId: "storage_minio", provider: "minio" } }; const svcProviderToCard = {}; for (const [card, m] of Object.entries(STORAGE_SVC)) { svcProviderToCard[m.provider] = card; m.svcId; } ref(/* @__PURE__ */ new Set()); return (_ctx, _push, _parent, _attrs) => { _push(`
平台级服务配置:① 对象存储(固件 / 头像等文件,默认阿里云 OSS);② 邮件服务(生产环节给厂家发通知邮件);③ 翻译服务(后台配置多语言同步)。
${ssrInterpolate(editProvider.value.tag)} · 对象存储
SMTP 发信
${ssrInterpolate(tEditProvider.value.tag)} · 机器翻译