import { defineComponent, ref, reactive, computed, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrIncludeBooleanAttr, ssrRenderAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrInterpolate } from 'vue/server-renderer'; import { u as useApi } from './useApi-B-E5eLsI.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import './server.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'; import './useLoading-D4zrSa2m.mjs'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "appconfig", __ssrInlineRender: true, setup(__props) { useApi(); useToast(); const view = ref("list"); const apps = ref([]); const curApp = ref(0); const items = ref([]); const loading = ref(false); const submitting = ref(false); const isEditing = ref(false); const keyword = ref(""); const form = reactive({ id: 0, group: "", key: "", value: "", description: "" }); const curAppLabel = computed(() => { const a = apps.value.find((x) => x.id === curApp.value); return a ? a.name || a.app_name : ""; }); const filteredRows = computed(() => { const kw = keyword.value.trim().toLowerCase(); if (!kw) return items.value; return items.value.filter((c) => ((c.group || "") + (c.key || "")).toLowerCase().includes(kw)); }); const groupedRows = computed(() => { const groups = {}; filteredRows.value.forEach((c) => { const g = c.group || ""; (groups[g] = groups[g] || []).push(c); }); const names = Object.keys(groups).sort((a, b) => { if (a === "") return -1; if (b === "") return 1; return a < b ? -1 : 1; }); return names.map((g) => ({ key: g, label: g || "未分组", items: groups[g] })); }); return (_ctx, _push, _parent, _attrs) => { _push(`

应用环境配置

应用自有的 key/value 配置(音乐、OSS 等),直接读写所选应用的业务库。结构同「全局环境配置」但不分区域。

应用
`); if (!curApp.value) { _push(`
🗂️

请先在上方选择一个应用

`); } else { _push(`
`); if (loading.value) { _push(``); } else if (!filteredRows.value.length) { _push(``); } else { _push(``); } _push(``); ssrRenderList(groupedRows.value, (grp) => { _push(``); ssrRenderList(grp.items, (c) => { _push(``); }); _push(``); }); _push(`
键值描述操作
暂无配置
▸ ${ssrInterpolate(grp.label)}${ssrInterpolate(grp.items.length)} 项
${ssrInterpolate(c.key || "")}${ssrInterpolate(c.value || "")}${ssrInterpolate(c.description || "")}
`); } _push(`

${ssrInterpolate(isEditing.value ? "编辑配置" : "新增配置")}

应用:${ssrInterpolate(curAppLabel.value)}
`); }; } }); 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; }; export { _sfc_main as default }; //# sourceMappingURL=appconfig-BTmHA76P.mjs.map