import { _ as __nuxt_component_0 } from './LangSelect-C_QPlcDf.mjs'; import { defineComponent, ref, reactive, computed, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderAttr, ssrInterpolate, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicModel } from 'vue/server-renderer'; import { u as useApi } from './useApi-B-E5eLsI.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import { _ as _export_sfc } from './server.mjs'; import './useLangOptions-DMhiAuTa.mjs'; import './useLoading-D4zrSa2m.mjs'; 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 'pinia'; import 'perfect-debounce'; const SCAT_MCP = 10; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "serviceconfig", __ssrInlineRender: true, setup(__props) { const REGIONS = [ { value: 1, label: "中国" }, { value: 2, label: "美国" }, { value: 3, label: "东亚" }, { value: 4, label: "东南亚" }, { value: 5, label: "南亚" }, { value: 6, label: "中东" }, { value: 7, label: "欧洲" }, { value: 8, label: "俄罗斯" }, { value: 9, label: "非洲" }, { value: 10, label: "南美" }, { value: 11, label: "北美" }, { value: 12, label: "大洋洲" }, { value: 13, label: "巴西" }, { value: 14, label: "印度" } ]; const SCAT = [ { v: 1, label: "STT 语音识别", short: "STT", color: "#0369a1", bg: "#dbeafe" }, { v: 8, label: "录音文件识别", short: "录音识别", color: "#0e7490", bg: "#cffafe" }, { v: 2, label: "TTS 语音合成", short: "TTS", color: "#7c3aed", bg: "#ede9fe" }, { v: 3, label: "MT 机器翻译", short: "MT", color: "#059669", bg: "#dcfce7" }, { v: 4, label: "AST 端到端翻译", short: "AST", color: "#c2410c", bg: "#fff7ed" }, { v: 5, label: "LLM 文本大模型", short: "文本LLM", color: "#b45309", bg: "#fef9c3" }, { v: 9, label: "多媒体大模型", short: "多媒体LLM", color: "#9333ea", bg: "#f3e8ff" }, { v: 7, label: "STS 端到端对话", short: "STS", color: "#be185d", bg: "#fce7f3" }, { v: 6, label: "存储 OSS/COS", short: "存储", color: "#475569", bg: "#f1f5f9" }, { v: 10, label: "MCP 服务", short: "MCP", color: "#0d9488", bg: "#ccfbf1" } ]; useApi(); useToast(); const scopeApp = ref(""); const scopeApps = ref([]); function scatInfo(v) { return SCAT.find((s) => s.v === v) || { short: "?", color: "#999", bg: "#eee", v: 0, label: "" }; } function isMcpType() { if (editType.value === SCAT_MCP) return true; return !!curSvc.value && parseCats(curSvc.value.categories).includes(SCAT_MCP); } function parseCats(s) { return (s || "").split(",").map((x) => parseInt(x) || 0).filter((x) => x > 0); } function encCount(s) { return (s.fields || []).filter((f) => f.encrypted).length; } const backendReady = ref(true); const allSvcs = ref([]); const curSvc = ref(null); const curRegion = ref(0); const svcModalVisible = ref(false); const detailMode = ref("default"); const editForm = reactive({ id: "", name: "", provider: "", description: "", enable: false }); const editType = ref(0); const editFields = ref([]); const selectedTemplateId = ref(""); const wizardStep = ref(1); const overrideFields = ref([]); const extraRegionFields = ref([]); const regionLoading = ref(false); const templates = ref([]); const curRegionLabel = computed(() => { const r = REGIONS.find((x) => x.value === curRegion.value); return r ? r.label : "区域" + curRegion.value; }); const groupedSvcs = computed(() => { const groups = SCAT.map((sc) => ({ ...sc, items: allSvcs.value.filter((s) => parseCats(s.categories).includes(sc.v)) })).filter((g) => g.items.length); const unclassified = allSvcs.value.filter((s) => !parseCats(s.categories).length); if (unclassified.length) { groups.push({ v: 0, label: "未分类", short: "未分类", color: "#64748b", bg: "#f1f5f9", items: unclassified }); } return groups; }); const templatesByCat = computed(() => { return SCAT.map((sc) => ({ cat: sc.v, label: sc.label, items: templates.value.filter((t) => t.category === sc.v) })).filter((g) => g.items.length); }); const templatesForType = computed(() => templates.value.filter((t) => t.category === editType.value)); const syncVisible = ref(false); ref(false); const syncDesc = ref(""); const syncScopeNote = ref(""); const syncTargets = ref([]); const syncRegionList = computed(() => REGIONS.filter((r) => r.value !== curRegion.value)); const tplModalVisible = ref(false); const tplView = ref("list"); const tplEditing = ref(false); const tplForm = reactive({ id: "", category: 2, provider: "", name: "", description: "" }); const tplFields = ref([]); return (_ctx, _push, _parent, _attrs) => { const _component_LangSelect = __nuxt_component_0; _push(``); if (!backendReady.value) { _push(`
⚠ 「第三方服务配置」后端接口暂不可用(连接失败),请检查 console 服务是否运行。
`); } else { _push(``); } _push(`

第三方服务配置

按服务类型分组管理已接入的第三方服务(火山引擎、阿里云、Azure 等)。默认展示全局默认配置,可切换到具体应用;区域默认中国,切换区域后点击卡片可为该区域覆盖字段值。

`); if (curRegion.value !== 0) { _push(`
✦ 当前处于「${ssrInterpolate(curRegionLabel.value)}」区域视图:点击服务卡片编辑该区域的字段分叉(覆盖值 / 停用字段 / 区域专属字段)。要改服务本身的默认配置,请切回「默认(全区域)」。
`); } else { _push(``); } if (groupedSvcs.value.length) { _push(`
`); ssrRenderList(groupedSvcs.value, (g) => { _push(`
${ssrInterpolate(g.short)}

${ssrInterpolate(g.label)}

${ssrInterpolate(g.items.length)} 个服务
`); ssrRenderList(g.items, (s) => { _push(`
${ssrInterpolate(s.name)}${ssrInterpolate(s.enable ? "启用" : "停用")}

${ssrInterpolate(s.id)}

${ssrInterpolate(s.description || "—")}

`); if (s.provider) { _push(`${ssrInterpolate(s.provider)}`); } else { _push(``); } _push(`${ssrInterpolate((s.fields || []).length)} 字段`); if (encCount(s)) { _push(`🔒${ssrInterpolate(encCount(s))}`); } else { _push(``); } _push(`
`); }); _push(`
+添加${ssrInterpolate(g.short)}服务
`); }); _push(`
`); } else { _push(`
⚙️

尚未配置任何第三方服务

`); } if (svcModalVisible.value) { _push(``); } else { _push(``); } _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/serviceconfig.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const serviceconfig = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4e0895d6"]]); export { serviceconfig as default }; //# sourceMappingURL=serviceconfig-BN6iazID.mjs.map