import { defineComponent, computed, reactive, ref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrInterpolate, ssrIncludeBooleanAttr, ssrRenderAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderClass, ssrRenderDynamicModel } from 'vue/server-renderer'; import { u as useApi } from './useApi-DMQewX5_.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import { _ as _export_sfc, a as useRoute$1, b as useRouter } from './server.mjs'; import './auth-QFkCoU1C.mjs'; import 'pinia'; 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 'perfect-debounce'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "appconfig", __ssrInlineRender: true, setup(__props) { useApi(); useToast(); const route = useRoute$1(); useRouter(); const appId = computed(() => Number(route.query.id) || 0); const appName = computed(() => route.query.name || "未指定应用"); const appInitial = computed(() => (dep.app_name || appName.value || "A").charAt(0).toUpperCase()); const dep = reactive({ id: 0, app_name: "", status: "", name: "", region: "", env_id: 0, base_url: "", service_dsn: "" }); const envs = ref([]); const envId = ref(0); const envSaving = ref(false); const catalog = ref([]); const curModule = ref(""); const values = reactive({}); const dataModules = reactive(/* @__PURE__ */ new Set()); const show = reactive({}); const loading = ref(false); const saving = ref(false); const dbError = ref(""); const curDef = computed(() => catalog.value.find((m) => m.module === curModule.value) || null); const cur = computed(() => values[curModule.value] || {}); const groups = computed(() => { const order = []; const map = /* @__PURE__ */ new Map(); for (const m of catalog.value) { if (!map.has(m.group)) { map.set(m.group, []); order.push(m.group); } map.get(m.group).push(m); } return order.map((name) => ({ name, modules: map.get(name) })); }); function dbName(dsn) { const m = (dsn || "").match(/\/([^/?]+)\?/); return m ? m[1] : dsn ? "(自定义)" : "—"; } return (_ctx, _push, _parent, _attrs) => { _push(`
/

应用服务配置

${ssrInterpolate(appInitial.value)}
${ssrInterpolate(dep.name || appName.value)}#${ssrInterpolate(appId.value)}`); if (dep.app_name) { _push(`应用:${ssrInterpolate(dep.app_name)}`); } else { _push(``); } if (dep.region) { _push(`${ssrInterpolate(dep.region)}`); } else { _push(``); } if (dep.status === "pending") { _push(`待部署`); } else { _push(`已接入`); } _push(`
`); if (dep.base_url) { _push(`地址:${ssrInterpolate(dep.base_url)}`); } else { _push(``); } _push(`业务库:${ssrInterpolate(dbName(dep.service_dsn))}
部署环境`); if (envSaving.value) { _push(``); } else { _push(``); } _push(`切换后即时保存。

业务功能配置

登录 / 短信 / 邮件 / 支付等应用独立配置,保存在该部署的业务库(不进公共库)。密钥字段加密落库,显示时脱敏。

`); if (dbError.value) { _push(`
无法连接应用业务库:${ssrInterpolate(dbError.value)}
待部署的应用先完成部署、或检查业务库 DSN 连通后再配置。
`); } else { _push(``); } if (loading.value) { _push(`
`); } else { _push(`
`); if (curDef.value) { _push(`
${ssrInterpolate(curDef.value.name)}
`); if (curDef.value.desc) { _push(`
${ssrInterpolate(curDef.value.desc)}
`); } else { _push(``); } _push(`
`); if (dataModules.has(curModule.value)) { _push(``); } else { _push(``); } _push(`
`); ssrRenderList(curDef.value.fields, (f) => { _push(`
`); if (f.type === "bool") { _push(``); } else if (f.type === "select") { _push(``); } else if (f.type === "textarea") { _push(``); } else if (f.type === "password") { _push(`
`); } else { _push(``); } if (f.desc) { _push(`${ssrInterpolate(f.desc)}`); } else { _push(``); } _push(`
`); }); _push(`
`); } else { _push(`
暂无可配置的业务模块。
`); } _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/appconfig.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const appconfig = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a2d8388e"]]); export { appconfig as default }; //# sourceMappingURL=appconfig-DgyZbLy-.mjs.map