Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

1.0 KB
Raw Blame
import type {SettingTabBuilder} from "../setting/builder";
import {
    genSecretsBlockHtml,
    getSecretsBlockKeywords,
    mountSecretsBlock,
    genVariablesBlockHtml,
    getVariablesBlockKeywords,
    mountVariablesBlock,
} from "./secretsVariablesUi";

const registerSecretsGroup = (tab: SettingTabBuilder) => {
    const group = tab.group("secrets", window.siyuan.languages.secrets);

    group.slot({
        key: "secrets",
        keywords: getSecretsBlockKeywords(),
        html: genSecretsBlockHtml,
        afterMount: mountSecretsBlock,
    });
};

const registerVariablesGroup = (tab: SettingTabBuilder) => {
    const group = tab.group("variables", window.siyuan.languages.variables);

    group.slot({
        key: "variables",
        keywords: getVariablesBlockKeywords(),
        html: genVariablesBlockHtml,
        afterMount: mountVariablesBlock,
    });
};

export const registerSecretsVariablesTab = (tab: SettingTabBuilder) => {
    registerSecretsGroup(tab);
    registerVariablesGroup(tab);
};