smart-admin-web 10.13.1 → 10.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/api/index.d.ts +37 -0
- package/dist/api/index.js +35 -14
- package/dist/api/index.js.map +1 -1
- package/dist/api/schema.d.ts +381 -3
- package/dist/assets/icons/ph-subset.json.js +3 -3
- package/dist/assets/smart-logo.svg.js +5 -0
- package/dist/assets/smart-logo.svg.js.map +1 -0
- package/dist/components/SmartLogo.vue.d.ts +3 -0
- package/dist/components/SmartLogo.vue.js +1 -1
- package/dist/components/SmartLogo2.vue.js +22 -64
- package/dist/components/SmartLogo2.vue.js.map +1 -1
- package/dist/composables/useLoginHero.d.ts +2 -0
- package/dist/composables/useLoginHero.js +22 -0
- package/dist/composables/useLoginHero.js.map +1 -0
- package/dist/composables/usePageTitle.js +16 -14
- package/dist/composables/usePageTitle.js.map +1 -1
- package/dist/composables/useSite.d.ts +5 -0
- package/dist/composables/useSite.js +16 -13
- package/dist/composables/useSite.js.map +1 -1
- package/dist/index.js +92 -91
- package/dist/lib/favicon.d.ts +1 -0
- package/dist/lib/favicon.js +12 -0
- package/dist/lib/favicon.js.map +1 -0
- package/dist/lib/loginHero.d.ts +16 -0
- package/dist/lib/loginHero.js +33 -0
- package/dist/lib/loginHero.js.map +1 -0
- package/dist/lib/logoCrop.d.ts +25 -0
- package/dist/lib/logoCrop.js +22 -0
- package/dist/lib/logoCrop.js.map +1 -0
- package/dist/lib/runtime.d.ts +2 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/runtime.js.map +1 -1
- package/dist/lib/securityRules.d.ts +26 -0
- package/dist/lib/securityRules.js +86 -0
- package/dist/lib/securityRules.js.map +1 -0
- package/dist/locales/en-US.d.ts +250 -28
- package/dist/locales/en-US.js +271 -58
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/zh-CN.d.ts +250 -28
- package/dist/locales/zh-CN.js +266 -58
- package/dist/locales/zh-CN.js.map +1 -1
- package/dist/router/viewRegistry.js +10 -10
- package/dist/router/viewRegistry.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/oauthBrand.d.ts +34 -9
- package/dist/utils/oauthBrand.js +70 -74
- package/dist/utils/oauthBrand.js.map +1 -1
- package/dist/views/login/components/LoginHeroPanel.vue.d.ts +18 -0
- package/dist/views/login/components/LoginHeroPanel.vue.js +8 -0
- package/dist/views/login/components/LoginHeroPanel.vue.js.map +1 -0
- package/dist/views/login/components/LoginHeroPanel2.vue.js +66 -0
- package/dist/views/login/components/LoginHeroPanel2.vue.js.map +1 -0
- package/dist/views/login/skins/SplitPanel.vue.js +1 -1
- package/dist/views/login/skins/SplitPanel2.vue.js +39 -59
- package/dist/views/login/skins/SplitPanel2.vue.js.map +1 -1
- package/dist/views/system/api-docs/index.vue.js +5 -0
- package/dist/views/system/api-docs/index.vue.js.map +1 -0
- package/dist/views/system/api-docs/index2.vue.js +64 -0
- package/dist/views/system/api-docs/index2.vue.js.map +1 -0
- package/dist/views/system/config/components/AdminMock.vue.js +8 -0
- package/dist/views/system/config/components/AdminMock.vue.js.map +1 -0
- package/dist/views/system/config/components/AdminMock2.vue.js +76 -0
- package/dist/views/system/config/components/AdminMock2.vue.js.map +1 -0
- package/dist/views/system/config/components/AdvancedSection.vue.js +5 -0
- package/dist/views/system/config/components/AdvancedSection.vue.js.map +1 -0
- package/dist/views/system/config/components/AdvancedSection2.vue.js +135 -0
- package/dist/views/system/config/components/AdvancedSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/BrandSection.vue.d.ts +7 -0
- package/dist/views/system/config/components/BrandSection.vue.js +8 -0
- package/dist/views/system/config/components/BrandSection.vue.js.map +1 -0
- package/dist/views/system/config/components/BrandSection2.vue.js +264 -0
- package/dist/views/system/config/components/BrandSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgGroup.vue.d.ts +18 -0
- package/dist/views/system/config/components/CfgGroup.vue.js +8 -0
- package/dist/views/system/config/components/CfgGroup.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgGroup2.vue.js +22 -0
- package/dist/views/system/config/components/CfgGroup2.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgRow.vue.d.ts +26 -0
- package/dist/views/system/config/components/CfgRow.vue.js +9 -0
- package/dist/views/system/config/components/CfgRow.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgRow2.vue.js +53 -0
- package/dist/views/system/config/components/CfgRow2.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgSegment.vue.d.ts +28 -0
- package/dist/views/system/config/components/CfgSegment.vue.js +8 -0
- package/dist/views/system/config/components/CfgSegment.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgSegment2.vue.js +44 -0
- package/dist/views/system/config/components/CfgSegment2.vue.js.map +1 -0
- package/dist/views/system/config/components/ConfigFormModal.vue.js +5 -2
- package/dist/views/system/config/components/ConfigFormModal.vue.js.map +1 -1
- package/dist/views/system/config/components/ConfigFormModal2.vue.js +66 -56
- package/dist/views/system/config/components/ConfigFormModal2.vue.js.map +1 -1
- package/dist/views/system/config/components/JobSection.vue.js +8 -0
- package/dist/views/system/config/components/JobSection.vue.js.map +1 -0
- package/dist/views/system/config/components/JobSection2.vue.js +138 -0
- package/dist/views/system/config/components/JobSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/{GroupExtraConfig.vue.d.ts → LoginMock.vue.d.ts} +3 -4
- package/dist/views/system/config/components/LoginMock.vue.js +8 -0
- package/dist/views/system/config/components/LoginMock.vue.js.map +1 -0
- package/dist/views/system/config/components/LoginMock2.vue.js +121 -0
- package/dist/views/system/config/components/LoginMock2.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoCropper.vue.d.ts +10 -0
- package/dist/views/system/config/components/LogoCropper.vue.js +8 -0
- package/dist/views/system/config/components/LogoCropper.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoCropper2.vue.js +122 -0
- package/dist/views/system/config/components/LogoCropper2.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoEditor.vue.js +8 -0
- package/dist/views/system/config/components/LogoEditor.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoEditor2.vue.js +163 -0
- package/dist/views/system/config/components/LogoEditor2.vue.js.map +1 -0
- package/dist/views/system/config/components/ProviderSheet.vue.d.ts +17 -0
- package/dist/views/system/config/components/ProviderSheet.vue.js +8 -0
- package/dist/views/system/config/components/ProviderSheet.vue.js.map +1 -0
- package/dist/views/system/config/components/ProviderSheet2.vue.js +343 -0
- package/dist/views/system/config/components/ProviderSheet2.vue.js.map +1 -0
- package/dist/views/system/config/components/ScaleToFit.vue.d.ts +17 -0
- package/dist/views/system/config/components/ScaleToFit.vue.js +8 -0
- package/dist/views/system/config/components/ScaleToFit.vue.js.map +1 -0
- package/dist/views/system/config/components/ScaleToFit2.vue.js +41 -0
- package/dist/views/system/config/components/ScaleToFit2.vue.js.map +1 -0
- package/dist/views/system/config/components/SectionLayout.vue.d.ts +28 -0
- package/dist/views/system/config/components/SectionLayout.vue.js +8 -0
- package/dist/views/system/config/components/SectionLayout.vue.js.map +1 -0
- package/dist/views/system/config/components/SectionLayout2.vue.js +45 -0
- package/dist/views/system/config/components/SectionLayout2.vue.js.map +1 -0
- package/dist/views/system/config/components/SecuritySection.vue.js +8 -0
- package/dist/views/system/config/components/SecuritySection.vue.js.map +1 -0
- package/dist/views/system/config/components/SecuritySection2.vue.js +416 -0
- package/dist/views/system/config/components/SecuritySection2.vue.js.map +1 -0
- package/dist/views/system/config/components/SensitiveSection.vue.js +8 -0
- package/dist/views/system/config/components/SensitiveSection.vue.js.map +1 -0
- package/dist/views/system/config/components/SensitiveSection2.vue.js +209 -0
- package/dist/views/system/config/components/SensitiveSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/SigninSection.vue.d.ts +3 -0
- package/dist/views/system/config/components/SigninSection.vue.js +8 -0
- package/dist/views/system/config/components/SigninSection.vue.js.map +1 -0
- package/dist/views/system/config/components/SigninSection2.vue.js +201 -0
- package/dist/views/system/config/components/SigninSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/UploadSection.vue.d.ts +3 -0
- package/dist/views/system/config/components/UploadSection.vue.js +8 -0
- package/dist/views/system/config/components/UploadSection.vue.js.map +1 -0
- package/dist/views/system/config/components/UploadSection2.vue.js +167 -0
- package/dist/views/system/config/components/UploadSection2.vue.js.map +1 -0
- package/dist/views/system/config/draft.d.ts +148 -0
- package/dist/views/system/config/draft.js +170 -0
- package/dist/views/system/config/draft.js.map +1 -0
- package/dist/views/system/config/flash.d.ts +2 -0
- package/dist/views/system/config/flash.js +9 -0
- package/dist/views/system/config/flash.js.map +1 -0
- package/dist/views/system/config/groups.d.ts +35 -7
- package/dist/views/system/config/groups.js +99 -14
- package/dist/views/system/config/groups.js.map +1 -1
- package/dist/views/system/config/index.vue.js +4 -1
- package/dist/views/system/config/index.vue.js.map +1 -1
- package/dist/views/system/config/index2.vue.js +180 -115
- package/dist/views/system/config/index2.vue.js.map +1 -1
- package/dist/views/system/config/providerForm.d.ts +33 -0
- package/dist/views/system/config/providerForm.js +63 -0
- package/dist/views/system/config/providerForm.js.map +1 -0
- package/package.json +4 -4
- package/dist/views/system/config/components/ExternalAuthConfig.vue.js +0 -8
- package/dist/views/system/config/components/ExternalAuthConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/ExternalAuthConfig2.vue.js +0 -218
- package/dist/views/system/config/components/ExternalAuthConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/GroupExtraConfig.vue.js +0 -8
- package/dist/views/system/config/components/GroupExtraConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/GroupExtraConfig2.vue.js +0 -108
- package/dist/views/system/config/components/GroupExtraConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/HighSensConfig.vue.js +0 -5
- package/dist/views/system/config/components/HighSensConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/HighSensConfig2.vue.js +0 -134
- package/dist/views/system/config/components/HighSensConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/JobConfig.vue.js +0 -5
- package/dist/views/system/config/components/JobConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/JobConfig2.vue.js +0 -116
- package/dist/views/system/config/components/JobConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/OtherConfig.vue.js +0 -5
- package/dist/views/system/config/components/OtherConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/OtherConfig2.vue.js +0 -121
- package/dist/views/system/config/components/OtherConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/SecurityConfig.vue.js +0 -8
- package/dist/views/system/config/components/SecurityConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/SecurityConfig2.vue.js +0 -456
- package/dist/views/system/config/components/SecurityConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/SysBaseConfig.vue.js +0 -5
- package/dist/views/system/config/components/SysBaseConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/SysBaseConfig2.vue.js +0 -107
- package/dist/views/system/config/components/SysBaseConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/UploadConfig.vue.js +0 -5
- package/dist/views/system/config/components/UploadConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/UploadConfig2.vue.js +0 -135
- package/dist/views/system/config/components/UploadConfig2.vue.js.map +0 -1
- /package/dist/views/system/{config/components/ExternalAuthConfig.vue.d.ts → api-docs/index.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{HighSensConfig.vue.d.ts → AdminMock.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{JobConfig.vue.d.ts → AdvancedSection.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{OtherConfig.vue.d.ts → JobSection.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{SecurityConfig.vue.d.ts → LogoEditor.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{SysBaseConfig.vue.d.ts → SecuritySection.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{UploadConfig.vue.d.ts → SensitiveSection.vue.d.ts} +0 -0
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { watchEffect as
|
|
1
|
+
import { watchEffect as i } from "vue";
|
|
2
2
|
import { useRoute as c } from "vue-router";
|
|
3
3
|
import { useAppStore as l } from "../stores/app.js";
|
|
4
|
-
import { useTabsStore as
|
|
5
|
-
import { useSite as
|
|
6
|
-
import { translateMenuTitle as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
document.
|
|
15
|
-
})
|
|
4
|
+
import { useTabsStore as s } from "../stores/tabs.js";
|
|
5
|
+
import { useSite as f } from "./useSite.js";
|
|
6
|
+
import { translateMenuTitle as u } from "../locales/menuTitle.js";
|
|
7
|
+
import { applyFavicon as d } from "../lib/favicon.js";
|
|
8
|
+
import { runtime as g } from "../lib/runtime.js";
|
|
9
|
+
function E() {
|
|
10
|
+
const o = c(), r = l(), a = s(), { site: e } = f();
|
|
11
|
+
i(() => {
|
|
12
|
+
r.locale;
|
|
13
|
+
const t = a.tabs.find((p) => p.path === o.path), m = (t == null ? void 0 : t.titleFixed) && t.title || o.meta.title || "", n = m ? u(m, o.path) : "";
|
|
14
|
+
document.title = n ? `${n} · ${e.title}` : e.title;
|
|
15
|
+
}), i(() => {
|
|
16
|
+
document.documentElement.lang = r.locale;
|
|
17
|
+
}), g.brand.faviconFromLogo !== !1 && i(() => d(document, e.logo));
|
|
16
18
|
}
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
E as usePageTitle
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=usePageTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePageTitle.js","sources":["../../src/composables/usePageTitle.ts"],"sourcesContent":["//
|
|
1
|
+
{"version":3,"file":"usePageTitle.js","sources":["../../src/composables/usePageTitle.ts"],"sourcesContent":["// 浏览器标题、标签页图标与文档语言。App.vue 调一次即可。\n//\n// 不这样动态维护的话,document.title 只会在启动时被站点名设一次,收藏夹/多窗口/历史记录里所有页面会长得一模一样;\n// <html lang> 也会硬编成 zh-CN,读屏器与浏览器翻译在英文界面下判错语言。\nimport { watchEffect } from 'vue'\nimport { useRoute } from 'vue-router'\nimport { useAppStore } from '#/stores/app'\nimport { useTabsStore } from '#/stores/tabs'\nimport { useSite } from '#/composables/useSite'\nimport { translateMenuTitle } from '#/locales/menuTitle'\nimport { applyFavicon } from '#/lib/favicon'\nimport { runtime } from '#/lib/runtime'\n\nexport function usePageTitle(): void {\n const route = useRoute()\n const app = useAppStore()\n const tabs = useTabsStore()\n const { site } = useSite()\n\n watchEffect(() => {\n void app.locale // 依赖:切语言后 i18n key 标题要重算\n // 详情页用 useTabTitle 设过动态标题(记录名)时以它为准 —— 静态 meta.title 是「详情」这种通名。\n const tab = tabs.tabs.find(x => x.path === route.path)\n const raw = (tab?.titleFixed && tab.title) || (route.meta.title as string | undefined) || ''\n const page = raw ? translateMenuTitle(raw, route.path) : ''\n document.title = page ? `${page} · ${site.title}` : site.title\n })\n\n watchEffect(() => {\n document.documentElement.lang = app.locale\n })\n\n // 标签页图标跟随站点 Logo(配置中心换 Logo 保存后 loadSite(true) 即时换掉);消费方可经 brand.faviconFromLogo 关掉\n if (runtime.brand.faviconFromLogo !== false) watchEffect(() => applyFavicon(document, site.logo))\n}\n"],"names":["usePageTitle","route","useRoute","app","useAppStore","tabs","useTabsStore","site","useSite","watchEffect","tab","x","raw","page","translateMenuTitle","runtime","applyFavicon"],"mappings":";;;;;;;;AAaO,SAASA,IAAqB;AACnC,QAAMC,IAAQC,EAAA,GACRC,IAAMC,EAAA,GACNC,IAAOC,EAAA,GACP,EAAE,MAAAC,EAAA,IAASC,EAAA;AAEjB,EAAAC,EAAY,MAAM;AAChB,IAAKN,EAAI;AAET,UAAMO,IAAML,EAAK,KAAK,KAAK,OAAKM,EAAE,SAASV,EAAM,IAAI,GAC/CW,KAAOF,KAAA,gBAAAA,EAAK,eAAcA,EAAI,SAAWT,EAAM,KAAK,SAAgC,IACpFY,IAAOD,IAAME,EAAmBF,GAAKX,EAAM,IAAI,IAAI;AACzD,aAAS,QAAQY,IAAO,GAAGA,CAAI,MAAMN,EAAK,KAAK,KAAKA,EAAK;AAAA,EAC3D,CAAC,GAEDE,EAAY,MAAM;AAChB,aAAS,gBAAgB,OAAON,EAAI;AAAA,EACtC,CAAC,GAGGY,EAAQ,MAAM,oBAAoB,MAAON,EAAY,MAAMO,EAAa,UAAUT,EAAK,IAAI,CAAC;AAClG;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { LoginHeroCopy } from '../lib/loginHero';
|
|
1
2
|
export interface SiteInfo {
|
|
2
3
|
title: string;
|
|
3
4
|
subtitle: string;
|
|
4
5
|
copyright: string;
|
|
5
6
|
copyrightUrl: string;
|
|
6
7
|
logo: string;
|
|
8
|
+
loginHero: Record<string, LoginHeroCopy>;
|
|
9
|
+
showFeatures: boolean;
|
|
7
10
|
captchaEnabled: boolean;
|
|
8
11
|
smsLoginEnabled: boolean;
|
|
9
12
|
}
|
|
@@ -16,6 +19,8 @@ export declare function useSite(): {
|
|
|
16
19
|
copyright: string;
|
|
17
20
|
copyrightUrl: string;
|
|
18
21
|
logo: string;
|
|
22
|
+
loginHero: Record<string, LoginHeroCopy>;
|
|
23
|
+
showFeatures: boolean;
|
|
19
24
|
captchaEnabled: boolean;
|
|
20
25
|
smsLoginEnabled: boolean;
|
|
21
26
|
};
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { configApi as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { reactive as r } from "vue";
|
|
2
|
+
import { configApi as l } from "../api/index.js";
|
|
3
|
+
import { normalizeLoginHero as n } from "../lib/loginHero.js";
|
|
4
|
+
import { runtime as a } from "../lib/runtime.js";
|
|
5
|
+
const e = r({
|
|
5
6
|
title: "SmartAdmin",
|
|
6
7
|
subtitle: "",
|
|
7
8
|
copyright: "",
|
|
8
9
|
copyrightUrl: "",
|
|
9
10
|
logo: "",
|
|
11
|
+
loginHero: {},
|
|
12
|
+
showFeatures: !0,
|
|
10
13
|
captchaEnabled: !1,
|
|
11
14
|
smsLoginEnabled: !1
|
|
12
15
|
});
|
|
13
|
-
let
|
|
14
|
-
function
|
|
15
|
-
return
|
|
16
|
-
t.title && (
|
|
16
|
+
let o = null;
|
|
17
|
+
function c(i = !1) {
|
|
18
|
+
return o && !i || (o = l.siteInfo().then((t) => {
|
|
19
|
+
t.title && (e.title = t.title), e.subtitle = t.subtitle ?? "", e.copyright = t.copyright ?? "", e.copyrightUrl = t.copyrightUrl ?? "", e.logo = t.logo ?? "", e.loginHero = n(t.loginHero), e.showFeatures = t.showFeatures !== !1, e.captchaEnabled = !!t.captchaEnabled, e.smsLoginEnabled = !!t.smsLoginEnabled;
|
|
17
20
|
}).catch(() => {
|
|
18
|
-
})),
|
|
21
|
+
})), o;
|
|
19
22
|
}
|
|
20
|
-
function
|
|
21
|
-
return { site:
|
|
23
|
+
function h() {
|
|
24
|
+
return { site: e, appVersion: a.version, loadSite: c };
|
|
22
25
|
}
|
|
23
26
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
c as loadSite,
|
|
28
|
+
h as useSite
|
|
26
29
|
};
|
|
27
30
|
//# sourceMappingURL=useSite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSite.js","sources":["../../src/composables/useSite.ts"],"sourcesContent":["import { reactive } from 'vue'\nimport { configApi } from '#/api'\nimport { runtime } from '#/lib/runtime'\n\n// 站点品牌信息(匿名 GET /sys/config/site 下发)。App.vue 启动、登录页各皮肤、登录后框架(侧栏/顶栏/水印)\n// 共用同一份响应式数据,只拉一次(模块级缓存);改配置保存后 loadSite(true) 强制重取即时生效。\nexport interface SiteInfo {\n title: string\n subtitle: string\n copyright: string\n copyrightUrl: string\n logo: string\n captchaEnabled: boolean\n smsLoginEnabled: boolean\n}\n\n// title 初值给内置名,防 siteInfo 到达前品牌词首帧空白;createSmartAdmin({ brand.title }) 会在挂载前改写它。\nconst site = reactive<SiteInfo>({\n title: 'SmartAdmin',\n subtitle: '',\n copyright: '',\n copyrightUrl: '',\n logo: '',\n captchaEnabled: false,\n smsLoginEnabled: false,\n})\n\nlet inflight: Promise<void> | null = null\n\nexport function loadSite(force = false): Promise<void> {\n if (inflight && !force) return inflight\n inflight = configApi\n .siteInfo()\n .then(s => {\n if (s.title) site.title = s.title\n site.subtitle = s.subtitle ?? ''\n site.copyright = s.copyright ?? ''\n site.copyrightUrl = s.copyrightUrl ?? ''\n site.logo = s.logo ?? ''\n site.captchaEnabled = !!s.captchaEnabled\n site.smsLoginEnabled = !!s.smsLoginEnabled\n })\n .catch(() => {\n // 拉取失败保留内置默认(title=SmartAdmin),不阻塞登录/渲染\n })\n return inflight\n}\n\n/** 版本号不走后端配置:默认是内核版本(库构建期常量),消费方经 createSmartAdmin({ version }) 换成应用版本。 */\nexport function useSite() {\n return { site, appVersion: runtime.version, loadSite }\n}\n"],"names":["site","reactive","inflight","loadSite","force","configApi","s","useSite","runtime"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSite.js","sources":["../../src/composables/useSite.ts"],"sourcesContent":["import { reactive } from 'vue'\nimport { configApi } from '#/api'\nimport { normalizeLoginHero, type LoginHeroCopy } from '#/lib/loginHero'\nimport { runtime } from '#/lib/runtime'\n\n// 站点品牌信息(匿名 GET /sys/config/site 下发)。App.vue 启动、登录页各皮肤、登录后框架(侧栏/顶栏/水印)\n// 共用同一份响应式数据,只拉一次(模块级缓存);改配置保存后 loadSite(true) 强制重取即时生效。\nexport interface SiteInfo {\n title: string\n subtitle: string\n copyright: string\n copyrightUrl: string\n logo: string\n loginHero: Record<string, LoginHeroCopy>\n showFeatures: boolean\n captchaEnabled: boolean\n smsLoginEnabled: boolean\n}\n\n// title 初值给内置名,防 siteInfo 到达前品牌词首帧空白;createSmartAdmin({ brand.title }) 会在挂载前改写它。\nconst site = reactive<SiteInfo>({\n title: 'SmartAdmin',\n subtitle: '',\n copyright: '',\n copyrightUrl: '',\n logo: '',\n loginHero: {},\n showFeatures: true,\n captchaEnabled: false,\n smsLoginEnabled: false,\n})\n\nlet inflight: Promise<void> | null = null\n\nexport function loadSite(force = false): Promise<void> {\n if (inflight && !force) return inflight\n inflight = configApi\n .siteInfo()\n .then(s => {\n if (s.title) site.title = s.title\n site.subtitle = s.subtitle ?? ''\n site.copyright = s.copyright ?? ''\n site.copyrightUrl = s.copyrightUrl ?? ''\n site.logo = s.logo ?? ''\n site.loginHero = normalizeLoginHero(s.loginHero)\n site.showFeatures = s.showFeatures !== false\n site.captchaEnabled = !!s.captchaEnabled\n site.smsLoginEnabled = !!s.smsLoginEnabled\n })\n .catch(() => {\n // 拉取失败保留内置默认(title=SmartAdmin),不阻塞登录/渲染\n })\n return inflight\n}\n\n/** 版本号不走后端配置:默认是内核版本(库构建期常量),消费方经 createSmartAdmin({ version }) 换成应用版本。 */\nexport function useSite() {\n return { site, appVersion: runtime.version, loadSite }\n}\n"],"names":["site","reactive","inflight","loadSite","force","configApi","s","normalizeLoginHero","useSite","runtime"],"mappings":";;;;AAoBA,MAAMA,IAAOC,EAAmB;AAAA,EAC9B,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,MAAM;AAAA,EACN,WAAW,CAAA;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AACnB,CAAC;AAED,IAAIC,IAAiC;AAE9B,SAASC,EAASC,IAAQ,IAAsB;AACrD,SAAIF,KAAY,CAACE,MACjBF,IAAWG,EACR,SAAA,EACA,KAAK,CAAAC,MAAK;AACT,IAAIA,EAAE,UAAON,EAAK,QAAQM,EAAE,QAC5BN,EAAK,WAAWM,EAAE,YAAY,IAC9BN,EAAK,YAAYM,EAAE,aAAa,IAChCN,EAAK,eAAeM,EAAE,gBAAgB,IACtCN,EAAK,OAAOM,EAAE,QAAQ,IACtBN,EAAK,YAAYO,EAAmBD,EAAE,SAAS,GAC/CN,EAAK,eAAeM,EAAE,iBAAiB,IACvCN,EAAK,iBAAiB,CAAC,CAACM,EAAE,gBAC1BN,EAAK,kBAAkB,CAAC,CAACM,EAAE;AAAA,EAC7B,CAAC,EACA,MAAM,MAAM;AAAA,EAEb,CAAC,IACIJ;AACT;AAGO,SAASM,IAAU;AACxB,SAAO,EAAE,MAAAR,GAAM,YAAYS,EAAQ,SAAS,UAAAN,EAAA;AAC9C;"}
|
package/dist/index.js
CHANGED
|
@@ -3,21 +3,21 @@ import { createSmartAdmin as s } from "./createSmartAdmin.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { ApiError as f, aiProviderApi as l, aiUsageApi as u, authApi as n, cacheApi as d, callApi as x, configApi as c, dashboardApi as A, dayRange as S, dictAdminApi as g, dictApi as T, externalAuthApi as C, fileApi as E, highSensApi as P, jobApi as
|
|
7
|
-
import { DEFAULT_TIMEOUT_MS as z, LONG_TIMEOUT_MS as K, client as
|
|
6
|
+
import { ApiError as f, aiProviderApi as l, aiUsageApi as u, authApi as n, cacheApi as d, callApi as x, configApi as c, dashboardApi as A, dayRange as S, dictAdminApi as g, dictApi as T, externalAuthApi as C, fileApi as E, highSensApi as P, jobApi as _, listQuery as h, logApi as b, menuApi as M, mfaApi as I, moduleApi as D, monitorApi as R, normalizeCommit as B, normalizePreview as y, noticeApi as w, orgApi as O, pageParams as L, personalApi as U, positionApi as N, recycleApi as v, roleApi as F, sessionApi as k, toPage as H, toWireRows as J, unwrap as G, unwrapDownload as V, userApi as W } from "./api/index.js";
|
|
7
|
+
import { DEFAULT_TIMEOUT_MS as z, LONG_TIMEOUT_MS as K, client as Y, createApiClient as j, ensureAccessToken as Z, readCookie as Q, refreshOnce as q } from "./api/client.js";
|
|
8
8
|
import { AI_USAGE_GROUP_BY as ee, AI_USAGE_SOURCE as re, DataScopeType as oe, DuplicateStrategy as te, JobConcurrencyMode as ae, JobFireMode as ie, JobHandlerKind as pe, JobMisfireStrategy as se, JobRunStatus as me, JobStatus as fe, JobTriggerKind as le, NoticeType as ue, ReceiverType as ne } from "./types/api.js";
|
|
9
9
|
import { MenuType as xe, PERMISSION_SEPARATOR as ce, joinPermission as Ae, splitPermission as Se, toMenuInput as ge } from "./types/menu.js";
|
|
10
10
|
import { useAppStore as Ce } from "./stores/app.js";
|
|
11
11
|
import { useAuthStore as Pe } from "./stores/auth.js";
|
|
12
|
-
import { useDictOptions as
|
|
13
|
-
import { useTabsStore as
|
|
14
|
-
import { useUserStore as
|
|
12
|
+
import { useDictOptions as he, useDictStore as be } from "./stores/dict.js";
|
|
13
|
+
import { useTabsStore as Ie } from "./stores/tabs.js";
|
|
14
|
+
import { useUserStore as Re } from "./stores/user.js";
|
|
15
15
|
import { registerDynamic as ye, resetRouter as we, router as Oe } from "./router/index.js";
|
|
16
16
|
import { namedPage as Ue } from "./router/namedPage.js";
|
|
17
|
-
import { i18n as ve, registerLocales as
|
|
17
|
+
import { i18n as ve, registerLocales as Fe, t as ke, withExt as He } from "./locales/index.js";
|
|
18
18
|
import { menuTitleKey as Ge, registerMenuTitles as Ve, translateMenuTitle as We } from "./locales/menuTitle.js";
|
|
19
19
|
import { vAuth as ze } from "./directives/auth.js";
|
|
20
|
-
import { describeMenuRoute as
|
|
20
|
+
import { describeMenuRoute as Ye } from "./composables/authMenuRoute.js";
|
|
21
21
|
import { clearClientCache as Ze } from "./composables/clearClientCache.js";
|
|
22
22
|
import { buildRoutesForModule as qe } from "./composables/useAuthMenu.js";
|
|
23
23
|
import { useBatchDelete as er } from "./composables/useBatchDelete.js";
|
|
@@ -29,17 +29,17 @@ import { useLayoutMenu as xr } from "./composables/useLayoutMenu.js";
|
|
|
29
29
|
import { menuBadge as Ar, registerMenuBadge as Sr } from "./composables/useMenuBadge.js";
|
|
30
30
|
import { useMenuFlat as Tr } from "./composables/useMenuFlat.js";
|
|
31
31
|
import { useModule as Er } from "./composables/useModule.js";
|
|
32
|
-
import { noticeActionButtonType as
|
|
32
|
+
import { noticeActionButtonType as _r, useNoticeAction as hr } from "./composables/useNoticeAction.js";
|
|
33
33
|
import { usePageTitle as Mr } from "./composables/usePageTitle.js";
|
|
34
|
-
import { beginVoluntaryLogout as
|
|
34
|
+
import { beginVoluntaryLogout as Dr, noticeBus as Rr, onRealtime as Br, useRealtime as yr } from "./composables/useRealtime.js";
|
|
35
35
|
import { loadSite as Or, useSite as Lr } from "./composables/useSite.js";
|
|
36
36
|
import { DRAG_HANDLE_CLASS as Nr, useTableRowSort as vr } from "./composables/useTableRowSort.js";
|
|
37
|
-
import { useTableZoom as
|
|
37
|
+
import { useTableZoom as kr } from "./composables/useTableZoom.js";
|
|
38
38
|
import { useTabTitle as Jr } from "./composables/useTabTitle.js";
|
|
39
39
|
import { useTheme as Vr } from "./composables/useTheme.js";
|
|
40
40
|
import { useVisualViewportHeight as Xr } from "./composables/useVisualViewportHeight.js";
|
|
41
41
|
import { default as Kr } from "./components/ApiSelect/index.vue.js";
|
|
42
|
-
import { default as
|
|
42
|
+
import { default as jr } from "./components/Chart/index.vue.js";
|
|
43
43
|
import { default as Qr } from "./components/Chart/LineChart.vue.js";
|
|
44
44
|
import { default as $r } from "./components/Chart/BarChart.vue.js";
|
|
45
45
|
import { default as ro } from "./components/Chart/PieChart.vue.js";
|
|
@@ -53,20 +53,20 @@ import { default as Ao } from "./components/DictTag/index.vue.js";
|
|
|
53
53
|
import { default as go } from "./components/ErrorBoundary/index.vue.js";
|
|
54
54
|
import { default as Co } from "./components/ExportColumnsModal/index.vue.js";
|
|
55
55
|
import { default as Po } from "./components/FileUpload/index.vue.js";
|
|
56
|
-
import { default as
|
|
56
|
+
import { default as ho } from "./components/FormContainer/index.vue.js";
|
|
57
57
|
/* empty css */
|
|
58
58
|
import { default as Mo } from "./components/IconPicker/index.vue.js";
|
|
59
|
-
import { default as
|
|
59
|
+
import { default as Do } from "./components/ImportWizard/index.vue.js";
|
|
60
60
|
import { default as Bo } from "./components/JsonEditor/index.vue.js";
|
|
61
61
|
import { default as wo } from "./components/MarkdownEditor/index.vue.js";
|
|
62
62
|
import { default as Lo } from "./components/MarkdownEditor/MarkdownView.vue.js";
|
|
63
63
|
import { default as No } from "./components/OrgTreeSelect/index.vue.js";
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
64
|
+
import { default as Fo } from "./components/PasswordStrength/index.vue.js";
|
|
65
|
+
import { default as Ho } from "./components/RoleSelect/index.vue.js";
|
|
66
66
|
import { default as Go } from "./components/SelectTable/index.vue.js";
|
|
67
67
|
import { default as Wo } from "./components/StatusSwitch/index.vue.js";
|
|
68
68
|
import { default as zo } from "./components/TableZoomButton/index.vue.js";
|
|
69
|
-
import { default as
|
|
69
|
+
import { default as Yo } from "./components/UserPicker/index.vue.js";
|
|
70
70
|
import { default as Zo } from "./components/UserSelect/index.vue.js";
|
|
71
71
|
import { default as qo } from "./components/AppIcon.vue.js";
|
|
72
72
|
import { default as et } from "./components/MenuSearch.vue.js";
|
|
@@ -77,20 +77,20 @@ import { triggerBlobDownload as mt } from "./utils/download.js";
|
|
|
77
77
|
import { translateError as lt, translateErrorDetail as ut } from "./utils/error.js";
|
|
78
78
|
import { fmtBytes as dt, fmtDateTime as xt, operatorText as ct } from "./utils/format.js";
|
|
79
79
|
import { IMPORT_DUPLICATE_IN_DB as St, hardErrorsOf as gt, isDuplicateOnly as Tt, isHardError as Ct } from "./utils/importDup.js";
|
|
80
|
-
import { BRAND_CODES as Pt, LINK_BY_ACCOUNT_CODES as ht, PREVIEW_ALL_SSO_BRANDS as
|
|
81
|
-
import { buildTree as
|
|
82
|
-
import { parseUserAgent as
|
|
83
|
-
import { FULLSCREEN_PATH_PREFIX as
|
|
84
|
-
import { default as
|
|
85
|
-
import { ACCENTS as
|
|
86
|
-
import { btnGrad as
|
|
87
|
-
import { buildThemeOverrides as
|
|
88
|
-
import { setupMarkdown as
|
|
89
|
-
import { LoadingBarBridge as
|
|
90
|
-
import { classifyNoticeAction as
|
|
91
|
-
import { registerViews as
|
|
80
|
+
import { BRAND_CODES as Pt, LINK_BY_ACCOUNT_CODES as _t, OFFICIAL_TYPES as ht, PREVIEW_ALL_SSO_BRANDS as bt, SSO_VISIBLE_MAX as Mt, brandDisplayName as It, buildConfigProviderRows as Dt, claimWeComAutoLogin as Rt, isBrandCode as Bt, isIconifyName as yt, mergeBindingRows as wt, previewAllBrandProviders as Ot, resolveProviderIcon as Lt, splitLoginProviders as Ut } from "./utils/oauthBrand.js";
|
|
81
|
+
import { buildTree as vt, collectSubtreeIds as Ft, expandableIds as kt, filterTree as Ht } from "./utils/tree.js";
|
|
82
|
+
import { parseUserAgent as Gt, uaSummary as Vt } from "./utils/ua.js";
|
|
83
|
+
import { FULLSCREEN_PATH_PREFIX as Xt, isFullscreenPath as zt, isHttpUrl as Kt, trimTrailingSlashes as Yt } from "./utils/url.js";
|
|
84
|
+
import { default as Zt } from "./assets/icons/ph-subset.json.js";
|
|
85
|
+
import { ACCENTS as qt } from "./theme/accents.js";
|
|
86
|
+
import { btnGrad as ea, derivePrimary as ra, glowSh as oa, mix as ta, rgba as aa } from "./theme/mix.js";
|
|
87
|
+
import { buildThemeOverrides as pa } from "./theme/naive-theme.js";
|
|
88
|
+
import { setupMarkdown as ma, withXssPlugin as fa } from "./lib/markdown.js";
|
|
89
|
+
import { LoadingBarBridge as ua, loadingBar as na } from "./lib/loadingBar.js";
|
|
90
|
+
import { classifyNoticeAction as xa, isSiteRelativeUrl as ca, noticeActionLabel as Aa } from "./lib/noticeActions.js";
|
|
91
|
+
import { registerViews as ga, viewComponentPaths as Ta } from "./router/viewRegistry.js";
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
qt as ACCENTS,
|
|
94
94
|
ee as AI_USAGE_GROUP_BY,
|
|
95
95
|
re as AI_USAGE_SOURCE,
|
|
96
96
|
f as ApiError,
|
|
@@ -101,7 +101,7 @@ export {
|
|
|
101
101
|
at as BrandIcon,
|
|
102
102
|
or as COMPACT_MAX_HEIGHT,
|
|
103
103
|
tr as COMPACT_MAX_WIDTH,
|
|
104
|
-
|
|
104
|
+
jr as Chart,
|
|
105
105
|
to as CodeBlock,
|
|
106
106
|
io as CronEditor,
|
|
107
107
|
z as DEFAULT_TIMEOUT_MS,
|
|
@@ -115,12 +115,12 @@ export {
|
|
|
115
115
|
te as DuplicateStrategy,
|
|
116
116
|
go as ErrorBoundary,
|
|
117
117
|
Co as ExportColumnsModal,
|
|
118
|
-
|
|
118
|
+
Xt as FULLSCREEN_PATH_PREFIX,
|
|
119
119
|
Po as FileUpload,
|
|
120
|
-
|
|
120
|
+
ho as FormContainer,
|
|
121
121
|
St as IMPORT_DUPLICATE_IN_DB,
|
|
122
122
|
Mo as IconPicker,
|
|
123
|
-
|
|
123
|
+
Do as ImportWizard,
|
|
124
124
|
ae as JobConcurrencyMode,
|
|
125
125
|
ie as JobFireMode,
|
|
126
126
|
pe as JobHandlerKind,
|
|
@@ -129,53 +129,54 @@ export {
|
|
|
129
129
|
fe as JobStatus,
|
|
130
130
|
le as JobTriggerKind,
|
|
131
131
|
Bo as JsonEditor,
|
|
132
|
-
|
|
132
|
+
_t as LINK_BY_ACCOUNT_CODES,
|
|
133
133
|
K as LONG_TIMEOUT_MS,
|
|
134
134
|
Qr as LineChart,
|
|
135
|
-
|
|
135
|
+
ua as LoadingBarBridge,
|
|
136
136
|
wo as MarkdownEditor,
|
|
137
137
|
Lo as MarkdownView,
|
|
138
138
|
et as MenuSearch,
|
|
139
139
|
xe as MenuType,
|
|
140
140
|
ue as NoticeType,
|
|
141
|
+
ht as OFFICIAL_TYPES,
|
|
141
142
|
No as OrgTreeSelect,
|
|
142
143
|
ce as PERMISSION_SEPARATOR,
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
bt as PREVIEW_ALL_SSO_BRANDS,
|
|
145
|
+
Fo as PasswordStrength,
|
|
145
146
|
ro as PieChart,
|
|
146
147
|
ne as ReceiverType,
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
Ho as RoleSelect,
|
|
149
|
+
Mt as SSO_VISIBLE_MAX,
|
|
149
150
|
Go as SelectTable,
|
|
150
151
|
ot as SmartLogo,
|
|
151
152
|
Wo as StatusSwitch,
|
|
152
153
|
zo as TableZoomButton,
|
|
153
|
-
|
|
154
|
+
Yo as UserPicker,
|
|
154
155
|
Zo as UserSelect,
|
|
155
156
|
l as aiProviderApi,
|
|
156
157
|
u as aiUsageApi,
|
|
157
158
|
n as authApi,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
Dr as beginVoluntaryLogout,
|
|
160
|
+
It as brandDisplayName,
|
|
161
|
+
ea as btnGrad,
|
|
161
162
|
Dt as buildConfigProviderRows,
|
|
162
163
|
qe as buildRoutesForModule,
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
pa as buildThemeOverrides,
|
|
165
|
+
vt as buildTree,
|
|
165
166
|
d as cacheApi,
|
|
166
167
|
x as callApi,
|
|
167
168
|
Rt as claimWeComAutoLogin,
|
|
168
|
-
|
|
169
|
+
xa as classifyNoticeAction,
|
|
169
170
|
Ze as clearClientCache,
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
Y as client,
|
|
172
|
+
Ft as collectSubtreeIds,
|
|
172
173
|
c as configApi,
|
|
173
|
-
|
|
174
|
+
j as createApiClient,
|
|
174
175
|
s as createSmartAdmin,
|
|
175
176
|
A as dashboardApi,
|
|
176
177
|
S as dayRange,
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
ra as derivePrimary,
|
|
179
|
+
Ye as describeMenuRoute,
|
|
179
180
|
g as dictAdminApi,
|
|
180
181
|
T as dictApi,
|
|
181
182
|
Z as ensureAccessToken,
|
|
@@ -185,76 +186,76 @@ export {
|
|
|
185
186
|
Ht as filterTree,
|
|
186
187
|
dt as fmtBytes,
|
|
187
188
|
xt as fmtDateTime,
|
|
188
|
-
|
|
189
|
+
oa as glowSh,
|
|
189
190
|
gt as hardErrorsOf,
|
|
190
191
|
P as highSensApi,
|
|
191
192
|
ve as i18n,
|
|
192
|
-
|
|
193
|
+
Bt as isBrandCode,
|
|
193
194
|
ar as isCompactSize,
|
|
194
195
|
Tt as isDuplicateOnly,
|
|
195
|
-
|
|
196
|
+
zt as isFullscreenPath,
|
|
196
197
|
Ct as isHardError,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
Kt as isHttpUrl,
|
|
199
|
+
yt as isIconifyName,
|
|
200
|
+
ca as isSiteRelativeUrl,
|
|
201
|
+
_ as jobApi,
|
|
201
202
|
Ae as joinPermission,
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
Zt as kernelIconSet,
|
|
204
|
+
h as listQuery,
|
|
204
205
|
Or as loadSite,
|
|
205
|
-
|
|
206
|
+
na as loadingBar,
|
|
206
207
|
b as logApi,
|
|
207
208
|
M as menuApi,
|
|
208
209
|
Ar as menuBadge,
|
|
209
210
|
Ge as menuTitleKey,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
wt as mergeBindingRows,
|
|
212
|
+
I as mfaApi,
|
|
213
|
+
ta as mix,
|
|
214
|
+
D as moduleApi,
|
|
215
|
+
R as monitorApi,
|
|
215
216
|
Ue as namedPage,
|
|
216
217
|
B as normalizeCommit,
|
|
217
218
|
y as normalizePreview,
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
_r as noticeActionButtonType,
|
|
220
|
+
Aa as noticeActionLabel,
|
|
220
221
|
w as noticeApi,
|
|
221
|
-
|
|
222
|
+
Rr as noticeBus,
|
|
222
223
|
Br as onRealtime,
|
|
223
224
|
ct as operatorText,
|
|
224
225
|
O as orgApi,
|
|
225
226
|
L as pageParams,
|
|
226
|
-
|
|
227
|
+
Gt as parseUserAgent,
|
|
227
228
|
U as personalApi,
|
|
228
229
|
N as positionApi,
|
|
229
|
-
|
|
230
|
+
Ot as previewAllBrandProviders,
|
|
230
231
|
Q as readCookie,
|
|
231
232
|
v as recycleApi,
|
|
232
233
|
q as refreshOnce,
|
|
233
234
|
ye as registerDynamic,
|
|
234
235
|
ur as registerHeaderTool,
|
|
235
|
-
|
|
236
|
+
Fe as registerLocales,
|
|
236
237
|
Sr as registerMenuBadge,
|
|
237
238
|
Ve as registerMenuTitles,
|
|
238
|
-
|
|
239
|
+
ga as registerViews,
|
|
239
240
|
we as resetRouter,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
Lt as resolveProviderIcon,
|
|
242
|
+
aa as rgba,
|
|
243
|
+
F as roleApi,
|
|
243
244
|
Oe as router,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
k as sessionApi,
|
|
246
|
+
ma as setupMarkdown,
|
|
247
|
+
Ut as splitLoginProviders,
|
|
247
248
|
Se as splitPermission,
|
|
248
|
-
|
|
249
|
+
ke as t,
|
|
249
250
|
ge as toMenuInput,
|
|
250
|
-
|
|
251
|
+
H as toPage,
|
|
251
252
|
J as toWireRows,
|
|
252
253
|
lt as translateError,
|
|
253
254
|
ut as translateErrorDetail,
|
|
254
255
|
We as translateMenuTitle,
|
|
255
256
|
mt as triggerBlobDownload,
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
Yt as trimTrailingSlashes,
|
|
258
|
+
Vt as uaSummary,
|
|
258
259
|
G as unwrap,
|
|
259
260
|
V as unwrapDownload,
|
|
260
261
|
pt as uploadChunked,
|
|
@@ -263,28 +264,28 @@ export {
|
|
|
263
264
|
er as useBatchDelete,
|
|
264
265
|
ir as useCompactScreen,
|
|
265
266
|
sr as useConfirm,
|
|
266
|
-
|
|
267
|
+
he as useDictOptions,
|
|
267
268
|
be as useDictStore,
|
|
268
269
|
fr as useFullscreenToggle,
|
|
269
270
|
nr as useHeaderTools,
|
|
270
271
|
xr as useLayoutMenu,
|
|
271
272
|
Tr as useMenuFlat,
|
|
272
273
|
Er as useModule,
|
|
273
|
-
|
|
274
|
+
hr as useNoticeAction,
|
|
274
275
|
Mr as usePageTitle,
|
|
275
276
|
yr as useRealtime,
|
|
276
277
|
Lr as useSite,
|
|
277
278
|
Jr as useTabTitle,
|
|
278
279
|
vr as useTableRowSort,
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
kr as useTableZoom,
|
|
281
|
+
Ie as useTabsStore,
|
|
281
282
|
Vr as useTheme,
|
|
282
|
-
|
|
283
|
+
Re as useUserStore,
|
|
283
284
|
Xr as useVisualViewportHeight,
|
|
284
285
|
W as userApi,
|
|
285
286
|
ze as vAuth,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
Ta as viewComponentPaths,
|
|
288
|
+
He as withExt,
|
|
289
|
+
fa as withXssPlugin
|
|
289
290
|
};
|
|
290
291
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function applyFavicon(doc: Document, logo: string | null | undefined): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const i = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
function l(f, r) {
|
|
3
|
+
const n = f.querySelectorAll('link[rel~="icon"]');
|
|
4
|
+
for (const e of n) {
|
|
5
|
+
let t = i.get(e);
|
|
6
|
+
t || (t = { href: e.getAttribute("href") ?? "", type: e.getAttribute("type") }, i.set(e, t)), r ? (e.href = r, e.removeAttribute("type")) : (e.setAttribute("href", t.href), t.type && e.setAttribute("type", t.type));
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
l as applyFavicon
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=favicon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favicon.js","sources":["../../src/lib/favicon.ts"],"sourcesContent":["// 浏览器标签页图标跟随站点 Logo。改写页面里所有 rel=icon 的 href,而不是再追加一个:\n// 多个候选时各浏览器挑哪个并不一致,追加的那个未必生效。原 href/type 记在 WeakMap 里,Logo 清空时还原。\n// 不记在 DOM 属性上:从 DOM 读出再写回 href,会被静态分析当成\"DOM 文本重新解释为 HTML\"。\n// apple-touch-icon 不动:iOS 主屏图标要 180×180 不透明底,和 Logo 的要求不同。\n\ninterface IconDefaults {\n href: string\n type: string | null\n}\n\nconst defaults = new WeakMap<HTMLLinkElement, IconDefaults>()\n\nexport function applyFavicon(doc: Document, logo: string | null | undefined): void {\n const links = doc.querySelectorAll<HTMLLinkElement>('link[rel~=\"icon\"]')\n for (const link of links) {\n let original = defaults.get(link)\n if (!original) {\n original = { href: link.getAttribute('href') ?? '', type: link.getAttribute('type') }\n defaults.set(link, original)\n }\n if (logo) {\n link.href = logo\n link.removeAttribute('type') // 原 type 可能是 image/svg+xml,留着会让浏览器按错的类型解析 Logo\n } else {\n link.setAttribute('href', original.href)\n if (original.type) link.setAttribute('type', original.type)\n }\n }\n}\n"],"names":["defaults","applyFavicon","doc","logo","links","link","original"],"mappings":"AAUA,MAAMA,wBAAe,QAAA;AAEd,SAASC,EAAaC,GAAeC,GAAuC;AACjF,QAAMC,IAAQF,EAAI,iBAAkC,mBAAmB;AACvE,aAAWG,KAAQD,GAAO;AACxB,QAAIE,IAAWN,EAAS,IAAIK,CAAI;AAChC,IAAKC,MACHA,IAAW,EAAE,MAAMD,EAAK,aAAa,MAAM,KAAK,IAAI,MAAMA,EAAK,aAAa,MAAM,EAAA,GAClFL,EAAS,IAAIK,GAAMC,CAAQ,IAEzBH,KACFE,EAAK,OAAOF,GACZE,EAAK,gBAAgB,MAAM,MAE3BA,EAAK,aAAa,QAAQC,EAAS,IAAI,GACnCA,EAAS,QAAMD,EAAK,aAAa,QAAQC,EAAS,IAAI;AAAA,EAE9D;AACF;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface LoginHeroCopy {
|
|
2
|
+
headline: string;
|
|
3
|
+
highlight: string;
|
|
4
|
+
features: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface LoginHeroFallbacks {
|
|
7
|
+
headline: string;
|
|
8
|
+
highlight: string;
|
|
9
|
+
features: string[];
|
|
10
|
+
}
|
|
11
|
+
/** 卖点按行输入;空行忽略,最多保留 5 条。 */
|
|
12
|
+
export declare function splitLoginHeroFeatures(value: string | null | undefined, max?: number): string[];
|
|
13
|
+
/** 归一化站点接口下发的 Hero 文案,非法形状按缺失处理。 */
|
|
14
|
+
export declare function normalizeLoginHero(value: unknown): Record<string, LoginHeroCopy>;
|
|
15
|
+
/** 空配置逐字段回退内置文案;卖点开关关闭时返回空清单。 */
|
|
16
|
+
export declare function resolveLoginHero(copy: Partial<LoginHeroCopy> | undefined, fallback: LoginHeroFallbacks, showFeatures?: boolean): LoginHeroCopy;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function s(r, t = 5) {
|
|
2
|
+
return r != null && r.trim() ? r.replace(/\r\n/g, `
|
|
3
|
+
`).split(`
|
|
4
|
+
`).map((n) => n.trim()).filter(Boolean).slice(0, t) : [];
|
|
5
|
+
}
|
|
6
|
+
function f(r) {
|
|
7
|
+
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
8
|
+
const t = {};
|
|
9
|
+
for (const [n, i] of Object.entries(r)) {
|
|
10
|
+
if (!i || typeof i != "object" || Array.isArray(i)) continue;
|
|
11
|
+
const e = i;
|
|
12
|
+
t[n] = {
|
|
13
|
+
headline: typeof e.headline == "string" ? e.headline : "",
|
|
14
|
+
highlight: typeof e.highlight == "string" ? e.highlight : "",
|
|
15
|
+
features: Array.isArray(e.features) ? e.features.filter((h) => typeof h == "string" && !!h.trim()) : []
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
function g(r, t, n = !0) {
|
|
21
|
+
var i, e, h;
|
|
22
|
+
return {
|
|
23
|
+
headline: ((i = r == null ? void 0 : r.headline) == null ? void 0 : i.trim()) || t.headline,
|
|
24
|
+
highlight: ((e = r == null ? void 0 : r.highlight) == null ? void 0 : e.trim()) || t.highlight,
|
|
25
|
+
features: n ? (h = r == null ? void 0 : r.features) != null && h.length ? r.features : t.features : []
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
f as normalizeLoginHero,
|
|
30
|
+
g as resolveLoginHero,
|
|
31
|
+
s as splitLoginHeroFeatures
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=loginHero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginHero.js","sources":["../../src/lib/loginHero.ts"],"sourcesContent":["export interface LoginHeroCopy {\n headline: string\n highlight: string\n features: string[]\n}\n\nexport interface LoginHeroFallbacks {\n headline: string\n highlight: string\n features: string[]\n}\n\n/** 卖点按行输入;空行忽略,最多保留 5 条。 */\nexport function splitLoginHeroFeatures(value: string | null | undefined, max = 5): string[] {\n if (!value?.trim()) return []\n return value\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n .map(line => line.trim())\n .filter(Boolean)\n .slice(0, max)\n}\n\n/** 归一化站点接口下发的 Hero 文案,非法形状按缺失处理。 */\nexport function normalizeLoginHero(value: unknown): Record<string, LoginHeroCopy> {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return {}\n\n const result: Record<string, LoginHeroCopy> = {}\n for (const [locale, raw] of Object.entries(value)) {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) continue\n const copy = raw as Record<string, unknown>\n result[locale] = {\n headline: typeof copy.headline === 'string' ? copy.headline : '',\n highlight: typeof copy.highlight === 'string' ? copy.highlight : '',\n features: Array.isArray(copy.features)\n ? copy.features.filter((item): item is string => typeof item === 'string' && !!item.trim())\n : [],\n }\n }\n return result\n}\n\n/** 空配置逐字段回退内置文案;卖点开关关闭时返回空清单。 */\nexport function resolveLoginHero(\n copy: Partial<LoginHeroCopy> | undefined,\n fallback: LoginHeroFallbacks,\n showFeatures = true,\n): LoginHeroCopy {\n return {\n headline: copy?.headline?.trim() || fallback.headline,\n highlight: copy?.highlight?.trim() || fallback.highlight,\n features: showFeatures ? (copy?.features?.length ? copy.features : fallback.features) : [],\n }\n}\n"],"names":["splitLoginHeroFeatures","value","max","line","normalizeLoginHero","result","locale","raw","copy","item","resolveLoginHero","fallback","showFeatures","_a","_b","_c"],"mappings":"AAaO,SAASA,EAAuBC,GAAkCC,IAAM,GAAa;AAC1F,SAAKD,KAAA,QAAAA,EAAO,SACLA,EACJ,QAAQ,SAAS;AAAA,CAAI,EACrB,MAAM;AAAA,CAAI,EACV,IAAI,OAAQE,EAAK,KAAA,CAAM,EACvB,OAAO,OAAO,EACd,MAAM,GAAGD,CAAG,IANY,CAAA;AAO7B;AAGO,SAASE,EAAmBH,GAA+C;AAChF,MAAI,CAACA,KAAS,OAAOA,KAAU,YAAY,MAAM,QAAQA,CAAK,EAAG,QAAO,CAAA;AAExE,QAAMI,IAAwC,CAAA;AAC9C,aAAW,CAACC,GAAQC,CAAG,KAAK,OAAO,QAAQN,CAAK,GAAG;AACjD,QAAI,CAACM,KAAO,OAAOA,KAAQ,YAAY,MAAM,QAAQA,CAAG,EAAG;AAC3D,UAAMC,IAAOD;AACb,IAAAF,EAAOC,CAAM,IAAI;AAAA,MACf,UAAU,OAAOE,EAAK,YAAa,WAAWA,EAAK,WAAW;AAAA,MAC9D,WAAW,OAAOA,EAAK,aAAc,WAAWA,EAAK,YAAY;AAAA,MACjE,UAAU,MAAM,QAAQA,EAAK,QAAQ,IACjCA,EAAK,SAAS,OAAO,CAACC,MAAyB,OAAOA,KAAS,YAAY,CAAC,CAACA,EAAK,KAAA,CAAM,IACxF,CAAA;AAAA,IAAC;AAAA,EAET;AACA,SAAOJ;AACT;AAGO,SAASK,EACdF,GACAG,GACAC,IAAe,IACA;AAlCV,MAAAC,GAAAC,GAAAC;AAmCL,SAAO;AAAA,IACL,YAAUF,IAAAL,KAAA,gBAAAA,EAAM,aAAN,gBAAAK,EAAgB,WAAUF,EAAS;AAAA,IAC7C,aAAWG,IAAAN,KAAA,gBAAAA,EAAM,cAAN,gBAAAM,EAAiB,WAAUH,EAAS;AAAA,IAC/C,UAAUC,KAAgBG,IAAAP,KAAA,gBAAAA,EAAM,aAAN,QAAAO,EAAgB,SAASP,EAAK,WAAWG,EAAS,WAAY,CAAA;AAAA,EAAC;AAE7F;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CropState {
|
|
2
|
+
/** 图片原始宽高 */
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
/** 取景框边长(px,视口坐标) */
|
|
6
|
+
frame: number;
|
|
7
|
+
/** 当前缩放(图片像素 → 视口像素) */
|
|
8
|
+
scale: number;
|
|
9
|
+
/** 图片中心相对取景框中心的偏移(视口像素) */
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}
|
|
13
|
+
/** 刚好铺满取景框的最小缩放:短边等于框边,不留空白。 */
|
|
14
|
+
export declare function coverScale(width: number, height: number, frame: number): number;
|
|
15
|
+
/** 把偏移收在"图片始终盖满取景框"的范围内。 */
|
|
16
|
+
export declare function clampOffset(s: CropState): {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
/** 取景框在原图上的区域(原图像素),供 drawImage 取源矩形。 */
|
|
21
|
+
export declare function sourceRect(s: CropState): {
|
|
22
|
+
sx: number;
|
|
23
|
+
sy: number;
|
|
24
|
+
size: number;
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function n(t, e, a) {
|
|
2
|
+
return a / Math.min(t, e);
|
|
3
|
+
}
|
|
4
|
+
const c = (t, e) => e === 0 ? 0 : Math.min(e, Math.max(-e, t));
|
|
5
|
+
function r(t) {
|
|
6
|
+
const e = Math.max(0, (t.width * t.scale - t.frame) / 2), a = Math.max(0, (t.height * t.scale - t.frame) / 2);
|
|
7
|
+
return { x: c(t.x, e), y: c(t.y, a) };
|
|
8
|
+
}
|
|
9
|
+
function h(t) {
|
|
10
|
+
const e = t.frame / t.scale;
|
|
11
|
+
return {
|
|
12
|
+
sx: t.width / 2 - t.x / t.scale - e / 2,
|
|
13
|
+
sy: t.height / 2 - t.y / t.scale - e / 2,
|
|
14
|
+
size: e
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
r as clampOffset,
|
|
19
|
+
n as coverScale,
|
|
20
|
+
h as sourceRect
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=logoCrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logoCrop.js","sources":["../../src/lib/logoCrop.ts"],"sourcesContent":["// Logo 裁剪的几何计算:图片以视口中心 + 偏移量摆放、按 scale 缩放,正方形取景框居中。\n// 与 DOM 无关,裁剪组件只负责把指针/滚轮事件换成 offset/scale,再用这里的结果画 canvas。\n\nexport interface CropState {\n /** 图片原始宽高 */\n width: number\n height: number\n /** 取景框边长(px,视口坐标) */\n frame: number\n /** 当前缩放(图片像素 → 视口像素) */\n scale: number\n /** 图片中心相对取景框中心的偏移(视口像素) */\n x: number\n y: number\n}\n\n/** 刚好铺满取景框的最小缩放:短边等于框边,不留空白。 */\nexport function coverScale(width: number, height: number, frame: number): number {\n return frame / Math.min(width, height)\n}\n\n// 可移范围为 0 时直接归零,避免 Math.max(-0, …) 产出 -0\nconst clamp = (v: number, max: number) => (max === 0 ? 0 : Math.min(max, Math.max(-max, v)))\n\n/** 把偏移收在\"图片始终盖满取景框\"的范围内。 */\nexport function clampOffset(s: CropState): { x: number; y: number } {\n const maxX = Math.max(0, (s.width * s.scale - s.frame) / 2)\n const maxY = Math.max(0, (s.height * s.scale - s.frame) / 2)\n return { x: clamp(s.x, maxX), y: clamp(s.y, maxY) }\n}\n\n/** 取景框在原图上的区域(原图像素),供 drawImage 取源矩形。 */\nexport function sourceRect(s: CropState): { sx: number; sy: number; size: number } {\n const size = s.frame / s.scale\n return {\n sx: s.width / 2 - s.x / s.scale - size / 2,\n sy: s.height / 2 - s.y / s.scale - size / 2,\n size,\n }\n}\n"],"names":["coverScale","width","height","frame","clamp","v","max","clampOffset","s","maxX","maxY","sourceRect","size"],"mappings":"AAiBO,SAASA,EAAWC,GAAeC,GAAgBC,GAAuB;AAC/E,SAAOA,IAAQ,KAAK,IAAIF,GAAOC,CAAM;AACvC;AAGA,MAAME,IAAQ,CAACC,GAAWC,MAAiBA,MAAQ,IAAI,IAAI,KAAK,IAAIA,GAAK,KAAK,IAAI,CAACA,GAAKD,CAAC,CAAC;AAGnF,SAASE,EAAYC,GAAwC;AAClE,QAAMC,IAAO,KAAK,IAAI,IAAID,EAAE,QAAQA,EAAE,QAAQA,EAAE,SAAS,CAAC,GACpDE,IAAO,KAAK,IAAI,IAAIF,EAAE,SAASA,EAAE,QAAQA,EAAE,SAAS,CAAC;AAC3D,SAAO,EAAE,GAAGJ,EAAMI,EAAE,GAAGC,CAAI,GAAG,GAAGL,EAAMI,EAAE,GAAGE,CAAI,EAAA;AAClD;AAGO,SAASC,EAAWH,GAAwD;AACjF,QAAMI,IAAOJ,EAAE,QAAQA,EAAE;AACzB,SAAO;AAAA,IACL,IAAIA,EAAE,QAAQ,IAAIA,EAAE,IAAIA,EAAE,QAAQI,IAAO;AAAA,IACzC,IAAIJ,EAAE,SAAS,IAAIA,EAAE,IAAIA,EAAE,QAAQI,IAAO;AAAA,IAC1C,MAAAA;AAAA,EAAA;AAEJ;"}
|