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.
Files changed (199) hide show
  1. package/README.md +5 -5
  2. package/dist/api/index.d.ts +37 -0
  3. package/dist/api/index.js +35 -14
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/schema.d.ts +381 -3
  6. package/dist/assets/icons/ph-subset.json.js +3 -3
  7. package/dist/assets/smart-logo.svg.js +5 -0
  8. package/dist/assets/smart-logo.svg.js.map +1 -0
  9. package/dist/components/SmartLogo.vue.d.ts +3 -0
  10. package/dist/components/SmartLogo.vue.js +1 -1
  11. package/dist/components/SmartLogo2.vue.js +22 -64
  12. package/dist/components/SmartLogo2.vue.js.map +1 -1
  13. package/dist/composables/useLoginHero.d.ts +2 -0
  14. package/dist/composables/useLoginHero.js +22 -0
  15. package/dist/composables/useLoginHero.js.map +1 -0
  16. package/dist/composables/usePageTitle.js +16 -14
  17. package/dist/composables/usePageTitle.js.map +1 -1
  18. package/dist/composables/useSite.d.ts +5 -0
  19. package/dist/composables/useSite.js +16 -13
  20. package/dist/composables/useSite.js.map +1 -1
  21. package/dist/index.js +92 -91
  22. package/dist/lib/favicon.d.ts +1 -0
  23. package/dist/lib/favicon.js +12 -0
  24. package/dist/lib/favicon.js.map +1 -0
  25. package/dist/lib/loginHero.d.ts +16 -0
  26. package/dist/lib/loginHero.js +33 -0
  27. package/dist/lib/loginHero.js.map +1 -0
  28. package/dist/lib/logoCrop.d.ts +25 -0
  29. package/dist/lib/logoCrop.js +22 -0
  30. package/dist/lib/logoCrop.js.map +1 -0
  31. package/dist/lib/runtime.d.ts +2 -0
  32. package/dist/lib/runtime.js +1 -1
  33. package/dist/lib/runtime.js.map +1 -1
  34. package/dist/lib/securityRules.d.ts +26 -0
  35. package/dist/lib/securityRules.js +86 -0
  36. package/dist/lib/securityRules.js.map +1 -0
  37. package/dist/locales/en-US.d.ts +250 -28
  38. package/dist/locales/en-US.js +271 -58
  39. package/dist/locales/en-US.js.map +1 -1
  40. package/dist/locales/zh-CN.d.ts +250 -28
  41. package/dist/locales/zh-CN.js +266 -58
  42. package/dist/locales/zh-CN.js.map +1 -1
  43. package/dist/router/viewRegistry.js +10 -10
  44. package/dist/router/viewRegistry.js.map +1 -1
  45. package/dist/style.css +1 -1
  46. package/dist/utils/oauthBrand.d.ts +34 -9
  47. package/dist/utils/oauthBrand.js +70 -74
  48. package/dist/utils/oauthBrand.js.map +1 -1
  49. package/dist/views/login/components/LoginHeroPanel.vue.d.ts +18 -0
  50. package/dist/views/login/components/LoginHeroPanel.vue.js +8 -0
  51. package/dist/views/login/components/LoginHeroPanel.vue.js.map +1 -0
  52. package/dist/views/login/components/LoginHeroPanel2.vue.js +66 -0
  53. package/dist/views/login/components/LoginHeroPanel2.vue.js.map +1 -0
  54. package/dist/views/login/skins/SplitPanel.vue.js +1 -1
  55. package/dist/views/login/skins/SplitPanel2.vue.js +39 -59
  56. package/dist/views/login/skins/SplitPanel2.vue.js.map +1 -1
  57. package/dist/views/system/api-docs/index.vue.js +5 -0
  58. package/dist/views/system/api-docs/index.vue.js.map +1 -0
  59. package/dist/views/system/api-docs/index2.vue.js +64 -0
  60. package/dist/views/system/api-docs/index2.vue.js.map +1 -0
  61. package/dist/views/system/config/components/AdminMock.vue.js +8 -0
  62. package/dist/views/system/config/components/AdminMock.vue.js.map +1 -0
  63. package/dist/views/system/config/components/AdminMock2.vue.js +76 -0
  64. package/dist/views/system/config/components/AdminMock2.vue.js.map +1 -0
  65. package/dist/views/system/config/components/AdvancedSection.vue.js +5 -0
  66. package/dist/views/system/config/components/AdvancedSection.vue.js.map +1 -0
  67. package/dist/views/system/config/components/AdvancedSection2.vue.js +135 -0
  68. package/dist/views/system/config/components/AdvancedSection2.vue.js.map +1 -0
  69. package/dist/views/system/config/components/BrandSection.vue.d.ts +7 -0
  70. package/dist/views/system/config/components/BrandSection.vue.js +8 -0
  71. package/dist/views/system/config/components/BrandSection.vue.js.map +1 -0
  72. package/dist/views/system/config/components/BrandSection2.vue.js +264 -0
  73. package/dist/views/system/config/components/BrandSection2.vue.js.map +1 -0
  74. package/dist/views/system/config/components/CfgGroup.vue.d.ts +18 -0
  75. package/dist/views/system/config/components/CfgGroup.vue.js +8 -0
  76. package/dist/views/system/config/components/CfgGroup.vue.js.map +1 -0
  77. package/dist/views/system/config/components/CfgGroup2.vue.js +22 -0
  78. package/dist/views/system/config/components/CfgGroup2.vue.js.map +1 -0
  79. package/dist/views/system/config/components/CfgRow.vue.d.ts +26 -0
  80. package/dist/views/system/config/components/CfgRow.vue.js +9 -0
  81. package/dist/views/system/config/components/CfgRow.vue.js.map +1 -0
  82. package/dist/views/system/config/components/CfgRow2.vue.js +53 -0
  83. package/dist/views/system/config/components/CfgRow2.vue.js.map +1 -0
  84. package/dist/views/system/config/components/CfgSegment.vue.d.ts +28 -0
  85. package/dist/views/system/config/components/CfgSegment.vue.js +8 -0
  86. package/dist/views/system/config/components/CfgSegment.vue.js.map +1 -0
  87. package/dist/views/system/config/components/CfgSegment2.vue.js +44 -0
  88. package/dist/views/system/config/components/CfgSegment2.vue.js.map +1 -0
  89. package/dist/views/system/config/components/ConfigFormModal.vue.js +5 -2
  90. package/dist/views/system/config/components/ConfigFormModal.vue.js.map +1 -1
  91. package/dist/views/system/config/components/ConfigFormModal2.vue.js +66 -56
  92. package/dist/views/system/config/components/ConfigFormModal2.vue.js.map +1 -1
  93. package/dist/views/system/config/components/JobSection.vue.js +8 -0
  94. package/dist/views/system/config/components/JobSection.vue.js.map +1 -0
  95. package/dist/views/system/config/components/JobSection2.vue.js +138 -0
  96. package/dist/views/system/config/components/JobSection2.vue.js.map +1 -0
  97. package/dist/views/system/config/components/{GroupExtraConfig.vue.d.ts → LoginMock.vue.d.ts} +3 -4
  98. package/dist/views/system/config/components/LoginMock.vue.js +8 -0
  99. package/dist/views/system/config/components/LoginMock.vue.js.map +1 -0
  100. package/dist/views/system/config/components/LoginMock2.vue.js +121 -0
  101. package/dist/views/system/config/components/LoginMock2.vue.js.map +1 -0
  102. package/dist/views/system/config/components/LogoCropper.vue.d.ts +10 -0
  103. package/dist/views/system/config/components/LogoCropper.vue.js +8 -0
  104. package/dist/views/system/config/components/LogoCropper.vue.js.map +1 -0
  105. package/dist/views/system/config/components/LogoCropper2.vue.js +122 -0
  106. package/dist/views/system/config/components/LogoCropper2.vue.js.map +1 -0
  107. package/dist/views/system/config/components/LogoEditor.vue.js +8 -0
  108. package/dist/views/system/config/components/LogoEditor.vue.js.map +1 -0
  109. package/dist/views/system/config/components/LogoEditor2.vue.js +163 -0
  110. package/dist/views/system/config/components/LogoEditor2.vue.js.map +1 -0
  111. package/dist/views/system/config/components/ProviderSheet.vue.d.ts +17 -0
  112. package/dist/views/system/config/components/ProviderSheet.vue.js +8 -0
  113. package/dist/views/system/config/components/ProviderSheet.vue.js.map +1 -0
  114. package/dist/views/system/config/components/ProviderSheet2.vue.js +343 -0
  115. package/dist/views/system/config/components/ProviderSheet2.vue.js.map +1 -0
  116. package/dist/views/system/config/components/ScaleToFit.vue.d.ts +17 -0
  117. package/dist/views/system/config/components/ScaleToFit.vue.js +8 -0
  118. package/dist/views/system/config/components/ScaleToFit.vue.js.map +1 -0
  119. package/dist/views/system/config/components/ScaleToFit2.vue.js +41 -0
  120. package/dist/views/system/config/components/ScaleToFit2.vue.js.map +1 -0
  121. package/dist/views/system/config/components/SectionLayout.vue.d.ts +28 -0
  122. package/dist/views/system/config/components/SectionLayout.vue.js +8 -0
  123. package/dist/views/system/config/components/SectionLayout.vue.js.map +1 -0
  124. package/dist/views/system/config/components/SectionLayout2.vue.js +45 -0
  125. package/dist/views/system/config/components/SectionLayout2.vue.js.map +1 -0
  126. package/dist/views/system/config/components/SecuritySection.vue.js +8 -0
  127. package/dist/views/system/config/components/SecuritySection.vue.js.map +1 -0
  128. package/dist/views/system/config/components/SecuritySection2.vue.js +416 -0
  129. package/dist/views/system/config/components/SecuritySection2.vue.js.map +1 -0
  130. package/dist/views/system/config/components/SensitiveSection.vue.js +8 -0
  131. package/dist/views/system/config/components/SensitiveSection.vue.js.map +1 -0
  132. package/dist/views/system/config/components/SensitiveSection2.vue.js +209 -0
  133. package/dist/views/system/config/components/SensitiveSection2.vue.js.map +1 -0
  134. package/dist/views/system/config/components/SigninSection.vue.d.ts +3 -0
  135. package/dist/views/system/config/components/SigninSection.vue.js +8 -0
  136. package/dist/views/system/config/components/SigninSection.vue.js.map +1 -0
  137. package/dist/views/system/config/components/SigninSection2.vue.js +201 -0
  138. package/dist/views/system/config/components/SigninSection2.vue.js.map +1 -0
  139. package/dist/views/system/config/components/UploadSection.vue.d.ts +3 -0
  140. package/dist/views/system/config/components/UploadSection.vue.js +8 -0
  141. package/dist/views/system/config/components/UploadSection.vue.js.map +1 -0
  142. package/dist/views/system/config/components/UploadSection2.vue.js +167 -0
  143. package/dist/views/system/config/components/UploadSection2.vue.js.map +1 -0
  144. package/dist/views/system/config/draft.d.ts +148 -0
  145. package/dist/views/system/config/draft.js +170 -0
  146. package/dist/views/system/config/draft.js.map +1 -0
  147. package/dist/views/system/config/flash.d.ts +2 -0
  148. package/dist/views/system/config/flash.js +9 -0
  149. package/dist/views/system/config/flash.js.map +1 -0
  150. package/dist/views/system/config/groups.d.ts +35 -7
  151. package/dist/views/system/config/groups.js +99 -14
  152. package/dist/views/system/config/groups.js.map +1 -1
  153. package/dist/views/system/config/index.vue.js +4 -1
  154. package/dist/views/system/config/index.vue.js.map +1 -1
  155. package/dist/views/system/config/index2.vue.js +180 -115
  156. package/dist/views/system/config/index2.vue.js.map +1 -1
  157. package/dist/views/system/config/providerForm.d.ts +33 -0
  158. package/dist/views/system/config/providerForm.js +63 -0
  159. package/dist/views/system/config/providerForm.js.map +1 -0
  160. package/package.json +4 -4
  161. package/dist/views/system/config/components/ExternalAuthConfig.vue.js +0 -8
  162. package/dist/views/system/config/components/ExternalAuthConfig.vue.js.map +0 -1
  163. package/dist/views/system/config/components/ExternalAuthConfig2.vue.js +0 -218
  164. package/dist/views/system/config/components/ExternalAuthConfig2.vue.js.map +0 -1
  165. package/dist/views/system/config/components/GroupExtraConfig.vue.js +0 -8
  166. package/dist/views/system/config/components/GroupExtraConfig.vue.js.map +0 -1
  167. package/dist/views/system/config/components/GroupExtraConfig2.vue.js +0 -108
  168. package/dist/views/system/config/components/GroupExtraConfig2.vue.js.map +0 -1
  169. package/dist/views/system/config/components/HighSensConfig.vue.js +0 -5
  170. package/dist/views/system/config/components/HighSensConfig.vue.js.map +0 -1
  171. package/dist/views/system/config/components/HighSensConfig2.vue.js +0 -134
  172. package/dist/views/system/config/components/HighSensConfig2.vue.js.map +0 -1
  173. package/dist/views/system/config/components/JobConfig.vue.js +0 -5
  174. package/dist/views/system/config/components/JobConfig.vue.js.map +0 -1
  175. package/dist/views/system/config/components/JobConfig2.vue.js +0 -116
  176. package/dist/views/system/config/components/JobConfig2.vue.js.map +0 -1
  177. package/dist/views/system/config/components/OtherConfig.vue.js +0 -5
  178. package/dist/views/system/config/components/OtherConfig.vue.js.map +0 -1
  179. package/dist/views/system/config/components/OtherConfig2.vue.js +0 -121
  180. package/dist/views/system/config/components/OtherConfig2.vue.js.map +0 -1
  181. package/dist/views/system/config/components/SecurityConfig.vue.js +0 -8
  182. package/dist/views/system/config/components/SecurityConfig.vue.js.map +0 -1
  183. package/dist/views/system/config/components/SecurityConfig2.vue.js +0 -456
  184. package/dist/views/system/config/components/SecurityConfig2.vue.js.map +0 -1
  185. package/dist/views/system/config/components/SysBaseConfig.vue.js +0 -5
  186. package/dist/views/system/config/components/SysBaseConfig.vue.js.map +0 -1
  187. package/dist/views/system/config/components/SysBaseConfig2.vue.js +0 -107
  188. package/dist/views/system/config/components/SysBaseConfig2.vue.js.map +0 -1
  189. package/dist/views/system/config/components/UploadConfig.vue.js +0 -5
  190. package/dist/views/system/config/components/UploadConfig.vue.js.map +0 -1
  191. package/dist/views/system/config/components/UploadConfig2.vue.js +0 -135
  192. package/dist/views/system/config/components/UploadConfig2.vue.js.map +0 -1
  193. /package/dist/views/system/{config/components/ExternalAuthConfig.vue.d.ts → api-docs/index.vue.d.ts} +0 -0
  194. /package/dist/views/system/config/components/{HighSensConfig.vue.d.ts → AdminMock.vue.d.ts} +0 -0
  195. /package/dist/views/system/config/components/{JobConfig.vue.d.ts → AdvancedSection.vue.d.ts} +0 -0
  196. /package/dist/views/system/config/components/{OtherConfig.vue.d.ts → JobSection.vue.d.ts} +0 -0
  197. /package/dist/views/system/config/components/{SecurityConfig.vue.d.ts → LogoEditor.vue.d.ts} +0 -0
  198. /package/dist/views/system/config/components/{SysBaseConfig.vue.d.ts → SecuritySection.vue.d.ts} +0 -0
  199. /package/dist/views/system/config/components/{UploadConfig.vue.d.ts → SensitiveSection.vue.d.ts} +0 -0
@@ -5,6 +5,8 @@ export interface BrandOptions {
5
5
  title?: string;
6
6
  /** 组件或图片地址;不传则用内置 SmartLogo 矢量标 */
7
7
  logo?: Component | string;
8
+ /** 浏览器标签页图标跟随 sys.site.logo(配了 Logo 才换,清空即还原模板自带图标);默认 true */
9
+ faviconFromLogo?: boolean;
8
10
  }
9
11
  /**
10
12
  * 运行期配置:由 createSmartAdmin 在挂载前写入,内核各处读这里而不读 import.meta.env ——
@@ -2,7 +2,7 @@ const e = {
2
2
  /** API 根地址;空串 = 同源(dev 由 Vite 代理,生产由反代或后端托管 dist) */
3
3
  apiBase: "",
4
4
  /** 登录页页脚展示的版本号;默认内核版本,消费方可覆盖为应用版本 */
5
- version: "10.13.1",
5
+ version: "10.15.0",
6
6
  /** 开发态:登录页预填超管账号、设置抽屉显示「复制配置」 */
7
7
  dev: !1,
8
8
  brand: {}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sources":["../../src/lib/runtime.ts"],"sourcesContent":["import type { Component } from 'vue'\n\n/** 品牌默认值:sys.site.* 配置有值时以配置为准,为空时用这里。 */\nexport interface BrandOptions {\n /** 站点标题默认值;siteInfo 里 sys.site.title 有值时被覆盖 */\n title?: string\n /** 组件或图片地址;不传则用内置 SmartLogo 矢量标 */\n logo?: Component | string\n}\n\n/**\n * 运行期配置:由 createSmartAdmin 在挂载前写入,内核各处读这里而不读 import.meta.env ——\n * 库预编译时 import.meta.env 会被静态替换成库自己构建时的值,消费方改不了。\n */\nexport const runtime = {\n /** API 根地址;空串 = 同源(dev 由 Vite 代理,生产由反代或后端托管 dist) */\n apiBase: '',\n /** 登录页页脚展示的版本号;默认内核版本,消费方可覆盖为应用版本 */\n version: typeof __SMART_ADMIN_VERSION__ !== 'undefined' ? __SMART_ADMIN_VERSION__ : '',\n /** 开发态:登录页预填超管账号、设置抽屉显示「复制配置」 */\n dev: false,\n brand: {} as BrandOptions,\n}\n"],"names":["runtime"],"mappings":"AAcO,MAAMA,IAAU;AAAA;AAAA,EAErB,SAAS;AAAA;AAAA,EAET,SAA0D;AAAA;AAAA,EAE1D,KAAK;AAAA,EACL,OAAO,CAAA;AACT;"}
1
+ {"version":3,"file":"runtime.js","sources":["../../src/lib/runtime.ts"],"sourcesContent":["import type { Component } from 'vue'\n\n/** 品牌默认值:sys.site.* 配置有值时以配置为准,为空时用这里。 */\nexport interface BrandOptions {\n /** 站点标题默认值;siteInfo 里 sys.site.title 有值时被覆盖 */\n title?: string\n /** 组件或图片地址;不传则用内置 SmartLogo 矢量标 */\n logo?: Component | string\n /** 浏览器标签页图标跟随 sys.site.logo(配了 Logo 才换,清空即还原模板自带图标);默认 true */\n faviconFromLogo?: boolean\n}\n\n/**\n * 运行期配置:由 createSmartAdmin 在挂载前写入,内核各处读这里而不读 import.meta.env ——\n * 库预编译时 import.meta.env 会被静态替换成库自己构建时的值,消费方改不了。\n */\nexport const runtime = {\n /** API 根地址;空串 = 同源(dev 由 Vite 代理,生产由反代或后端托管 dist) */\n apiBase: '',\n /** 登录页页脚展示的版本号;默认内核版本,消费方可覆盖为应用版本 */\n version: typeof __SMART_ADMIN_VERSION__ !== 'undefined' ? __SMART_ADMIN_VERSION__ : '',\n /** 开发态:登录页预填超管账号、设置抽屉显示「复制配置」 */\n dev: false,\n brand: {} as BrandOptions,\n}\n"],"names":["runtime"],"mappings":"AAgBO,MAAMA,IAAU;AAAA;AAAA,EAErB,SAAS;AAAA;AAAA,EAET,SAA0D;AAAA;AAAA,EAE1D,KAAK;AAAA,EACL,OAAO,CAAA;AACT;"}
@@ -0,0 +1,26 @@
1
+ export interface RuleLine {
2
+ icon: string;
3
+ /** 关闭的规则灰显划线,仍列出来让人知道有这一项 */
4
+ on: boolean;
5
+ key: string;
6
+ params?: Record<string, string | number>;
7
+ }
8
+ export interface Duration {
9
+ key: 'config.preview.minutes' | 'config.preview.hours' | 'config.preview.days';
10
+ n: number;
11
+ }
12
+ /** 分钟数取最合适的单位,最多一位小数。 */
13
+ export declare function humanizeMinutes(minutes: number): Duration;
14
+ type Values = Record<string, string | undefined>;
15
+ /** 规则里嵌的短语由调用方按当前语言渲染。 */
16
+ export interface RuleFormatters {
17
+ duration: (d: Duration) => string;
18
+ /** upper / lower / digit / special */
19
+ requirement: (code: string) => string;
20
+ /** char / path / math */
21
+ captchaType: (code: string) => string;
22
+ /** 把若干短语连成一句("、" 或 ", ") */
23
+ join: (items: string[]) => string;
24
+ }
25
+ export declare function securityRules(v: Values, f: RuleFormatters): RuleLine[];
26
+ export {};
@@ -0,0 +1,86 @@
1
+ const u = (e) => Math.round(e * 10) / 10, i = (e) => `sys.security.${e}`;
2
+ function w(e) {
3
+ return e >= 1440 ? { key: "config.preview.days", n: u(e / 1440) } : e >= 60 ? { key: "config.preview.hours", n: u(e / 60) } : { key: "config.preview.minutes", n: e };
4
+ }
5
+ const r = (e, o, c) => {
6
+ const s = Number(e[o]);
7
+ return e[o] === void 0 || e[o] === "" || Number.isNaN(s) ? c : s;
8
+ }, n = (e, o) => e[o] === "true";
9
+ function f(e, o) {
10
+ const c = [
11
+ n(e, i("password.requireUpper")) && "upper",
12
+ n(e, i("password.requireLower")) && "lower",
13
+ n(e, i("password.requireDigit")) && "digit",
14
+ n(e, i("password.requireSpecial")) && "special"
15
+ ].filter((h) => !!h), s = r(e, i("password.expireDays"), 0), t = r(e, i("password.historyCount"), 0), p = r(e, i("loginLock.maxFailCount"), 0), a = n(e, i("totp.enabled"));
16
+ return [
17
+ p > 0 ? {
18
+ icon: "ph:lock-key",
19
+ on: !0,
20
+ key: "config.preview.lock",
21
+ params: { count: p, minutes: r(e, i("loginLock.lockMinutes"), 1) }
22
+ } : { icon: "ph:lock-key", on: !1, key: "config.preview.lockOff" },
23
+ {
24
+ icon: "ph:textbox",
25
+ on: n(e, i("captcha.enabled")),
26
+ key: "config.preview.captcha",
27
+ params: { type: o.captchaType(e[i("captcha.type")] || "char") }
28
+ },
29
+ {
30
+ icon: "ph:device-mobile",
31
+ on: a,
32
+ key: a && n(e, i("totp.requireForSuperAdmin")) ? "config.preview.totpSuper" : "config.preview.totp"
33
+ },
34
+ { icon: "ph:chat-circle-dots", on: n(e, i("mfa.enabled")), key: "config.preview.smsMfa" },
35
+ c.length ? {
36
+ icon: "ph:password",
37
+ on: !0,
38
+ key: "config.preview.password",
39
+ params: {
40
+ min: r(e, i("password.minLength"), 1),
41
+ reqs: o.join(c.map(o.requirement))
42
+ }
43
+ } : {
44
+ icon: "ph:password",
45
+ on: !0,
46
+ key: "config.preview.passwordMin",
47
+ params: { min: r(e, i("password.minLength"), 1) }
48
+ },
49
+ s > 0 ? {
50
+ icon: "ph:hourglass",
51
+ on: !0,
52
+ key: "config.preview.expire",
53
+ params: { days: s }
54
+ } : { icon: "ph:hourglass", on: !0, key: "config.preview.noExpire" },
55
+ t > 0 ? {
56
+ icon: "ph:clock-counter-clockwise",
57
+ on: !0,
58
+ key: "config.preview.history",
59
+ params: { n: t }
60
+ } : { icon: "ph:clock-counter-clockwise", on: !1, key: "config.preview.historyOff" },
61
+ n(e, i("password.forceChangeOnFirstLogin")) ? { icon: "ph:user-switch", on: !0, key: "config.preview.firstChange" } : { icon: "ph:user-switch", on: !1, key: "config.preview.firstChangeOff" },
62
+ {
63
+ icon: "ph:timer",
64
+ on: !0,
65
+ key: "config.preview.session",
66
+ params: {
67
+ access: o.duration(w(r(e, i("session.accessMinutes"), 30))),
68
+ refresh: o.duration(w(r(e, i("session.refreshMinutes"), 10080)))
69
+ }
70
+ },
71
+ {
72
+ icon: "ph:traffic-signal",
73
+ on: n(e, i("rateLimit.enabled")),
74
+ key: "config.preview.rateLimit",
75
+ params: {
76
+ seconds: r(e, i("rateLimit.windowSeconds"), 1),
77
+ permit: r(e, i("rateLimit.permitPerWindow"), 0)
78
+ }
79
+ }
80
+ ];
81
+ }
82
+ export {
83
+ w as humanizeMinutes,
84
+ f as securityRules
85
+ };
86
+ //# sourceMappingURL=securityRules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"securityRules.js","sources":["../../src/lib/securityRules.ts"],"sourcesContent":["// 安全策略预览:把 sys.security.* 的草稿值翻成\"用户会遇到的规则\"。\n// 短信验证码登录是登录方式,不在这里(见配置中心「登录方式」页)。\n// 只产出 i18n 键 + 参数,文案在 locales 里;纯函数,便于单测。\n\nexport interface RuleLine {\n icon: string\n /** 关闭的规则灰显划线,仍列出来让人知道有这一项 */\n on: boolean\n key: string\n params?: Record<string, string | number>\n}\n\nexport interface Duration {\n key: 'config.preview.minutes' | 'config.preview.hours' | 'config.preview.days'\n n: number\n}\n\nconst round = (v: number) => Math.round(v * 10) / 10\nconst k = (s: string) => `sys.security.${s}`\n\n/** 分钟数取最合适的单位,最多一位小数。 */\nexport function humanizeMinutes(minutes: number): Duration {\n if (minutes >= 1440) return { key: 'config.preview.days', n: round(minutes / 1440) }\n if (minutes >= 60) return { key: 'config.preview.hours', n: round(minutes / 60) }\n return { key: 'config.preview.minutes', n: minutes }\n}\n\ntype Values = Record<string, string | undefined>\n\nconst num = (v: Values, key: string, fallback: number) => {\n const n = Number(v[key])\n return v[key] === undefined || v[key] === '' || Number.isNaN(n) ? fallback : n\n}\nconst on = (v: Values, key: string) => v[key] === 'true'\n\n/** 规则里嵌的短语由调用方按当前语言渲染。 */\nexport interface RuleFormatters {\n duration: (d: Duration) => string\n /** upper / lower / digit / special */\n requirement: (code: string) => string\n /** char / path / math */\n captchaType: (code: string) => string\n /** 把若干短语连成一句(\"、\" 或 \", \") */\n join: (items: string[]) => string\n}\n\nexport function securityRules(v: Values, f: RuleFormatters): RuleLine[] {\n const requirements = [\n on(v, k('password.requireUpper')) && 'upper',\n on(v, k('password.requireLower')) && 'lower',\n on(v, k('password.requireDigit')) && 'digit',\n on(v, k('password.requireSpecial')) && 'special',\n ].filter((r): r is string => !!r)\n const expireDays = num(v, k('password.expireDays'), 0)\n const history = num(v, k('password.historyCount'), 0)\n const maxFail = num(v, k('loginLock.maxFailCount'), 0)\n const totp = on(v, k('totp.enabled'))\n\n return [\n maxFail > 0\n ? {\n icon: 'ph:lock-key',\n on: true,\n key: 'config.preview.lock',\n params: { count: maxFail, minutes: num(v, k('loginLock.lockMinutes'), 1) },\n }\n : { icon: 'ph:lock-key', on: false, key: 'config.preview.lockOff' },\n {\n icon: 'ph:textbox',\n on: on(v, k('captcha.enabled')),\n key: 'config.preview.captcha',\n params: { type: f.captchaType(v[k('captcha.type')] || 'char') },\n },\n {\n icon: 'ph:device-mobile',\n on: totp,\n key:\n totp && on(v, k('totp.requireForSuperAdmin'))\n ? 'config.preview.totpSuper'\n : 'config.preview.totp',\n },\n { icon: 'ph:chat-circle-dots', on: on(v, k('mfa.enabled')), key: 'config.preview.smsMfa' },\n requirements.length\n ? {\n icon: 'ph:password',\n on: true,\n key: 'config.preview.password',\n params: {\n min: num(v, k('password.minLength'), 1),\n reqs: f.join(requirements.map(f.requirement)),\n },\n }\n : {\n icon: 'ph:password',\n on: true,\n key: 'config.preview.passwordMin',\n params: { min: num(v, k('password.minLength'), 1) },\n },\n expireDays > 0\n ? {\n icon: 'ph:hourglass',\n on: true,\n key: 'config.preview.expire',\n params: { days: expireDays },\n }\n : { icon: 'ph:hourglass', on: true, key: 'config.preview.noExpire' },\n history > 0\n ? {\n icon: 'ph:clock-counter-clockwise',\n on: true,\n key: 'config.preview.history',\n params: { n: history },\n }\n : { icon: 'ph:clock-counter-clockwise', on: false, key: 'config.preview.historyOff' },\n on(v, k('password.forceChangeOnFirstLogin'))\n ? { icon: 'ph:user-switch', on: true, key: 'config.preview.firstChange' }\n : { icon: 'ph:user-switch', on: false, key: 'config.preview.firstChangeOff' },\n {\n icon: 'ph:timer',\n on: true,\n key: 'config.preview.session',\n params: {\n access: f.duration(humanizeMinutes(num(v, k('session.accessMinutes'), 30))),\n refresh: f.duration(humanizeMinutes(num(v, k('session.refreshMinutes'), 10080))),\n },\n },\n {\n icon: 'ph:traffic-signal',\n on: on(v, k('rateLimit.enabled')),\n key: 'config.preview.rateLimit',\n params: {\n seconds: num(v, k('rateLimit.windowSeconds'), 1),\n permit: num(v, k('rateLimit.permitPerWindow'), 0),\n },\n },\n ]\n}\n"],"names":["round","v","k","s","humanizeMinutes","minutes","num","key","fallback","n","on","securityRules","f","requirements","r","expireDays","history","maxFail","totp"],"mappings":"AAiBA,MAAMA,IAAQ,CAACC,MAAc,KAAK,MAAMA,IAAI,EAAE,IAAI,IAC5CC,IAAI,CAACC,MAAc,gBAAgBA,CAAC;AAGnC,SAASC,EAAgBC,GAA2B;AACzD,SAAIA,KAAW,OAAa,EAAE,KAAK,uBAAuB,GAAGL,EAAMK,IAAU,IAAI,EAAA,IAC7EA,KAAW,KAAW,EAAE,KAAK,wBAAwB,GAAGL,EAAMK,IAAU,EAAE,EAAA,IACvE,EAAE,KAAK,0BAA0B,GAAGA,EAAA;AAC7C;AAIA,MAAMC,IAAM,CAACL,GAAWM,GAAaC,MAAqB;AACxD,QAAMC,IAAI,OAAOR,EAAEM,CAAG,CAAC;AACvB,SAAON,EAAEM,CAAG,MAAM,UAAaN,EAAEM,CAAG,MAAM,MAAM,OAAO,MAAME,CAAC,IAAID,IAAWC;AAC/E,GACMC,IAAK,CAACT,GAAWM,MAAgBN,EAAEM,CAAG,MAAM;AAa3C,SAASI,EAAcV,GAAWW,GAA+B;AACt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ChC,KAAK;AAAA,MACL,QAAQ;AAAA,QACN,SAASI,EAAIL,GAAGC,EAAE,yBAAyB,GAAG,CAAC;AAAA,QAC/C,QAAQI,EAAIL,GAAGC,EAAE,2BAA2B,GAAG,CAAC;AAAA,MAAA;AAAA,IAClD;AAAA,EACF;AAEJ;"}
@@ -520,69 +520,254 @@ declare const _default: {
520
520
  deleteConfirm: string;
521
521
  saved: string;
522
522
  deleted: string;
523
- groupManagedBy: string;
524
- groupExtra: {
525
- title: string;
526
- hint: string;
527
- };
523
+ keyManagedBy: string;
524
+ unsaved: string;
525
+ unsavedTab: string;
526
+ discard: string;
527
+ leaveTitle: string;
528
+ leaveConfirm: string;
528
529
  tab: {
529
- base: string;
530
+ brand: string;
530
531
  security: string;
531
- externalAuth: string;
532
+ signin: string;
533
+ sensitive: string;
532
534
  upload: string;
533
535
  job: string;
534
- other: string;
536
+ advanced: string;
537
+ };
538
+ brand: {
539
+ desc: string;
540
+ preview: string;
541
+ previewAdmin: string;
542
+ previewLogin: string;
543
+ groupSite: string;
544
+ groupLogin: string;
545
+ copyrightPh: string;
546
+ copyrightUrlHint: string;
547
+ };
548
+ logo: {
549
+ title: string;
550
+ edit: string;
551
+ upload: string;
552
+ useUrl: string;
553
+ remove: string;
554
+ help: string;
555
+ fallback: string;
556
+ badType: string;
557
+ tooLarge: string;
558
+ cropTitle: string;
559
+ cropTip: string;
560
+ zoom: string;
561
+ apply: string;
562
+ cropFailed: string;
563
+ badUrl: string;
564
+ urlHint: string;
565
+ };
566
+ advanced: {
567
+ desc: string;
568
+ };
569
+ preview: {
570
+ minutes: string;
571
+ hours: string;
572
+ days: string;
573
+ off: string;
574
+ sep: string;
575
+ req: {
576
+ upper: string;
577
+ lower: string;
578
+ digit: string;
579
+ special: string;
580
+ };
581
+ lock: string;
582
+ lockOff: string;
583
+ captcha: string;
584
+ totp: string;
585
+ totpSuper: string;
586
+ smsMfa: string;
587
+ password: string;
588
+ passwordMin: string;
589
+ expire: string;
590
+ noExpire: string;
591
+ history: string;
592
+ historyOff: string;
593
+ firstChange: string;
594
+ firstChangeOff: string;
595
+ session: string;
596
+ rateLimit: string;
535
597
  };
536
598
  job: {
599
+ desc: string;
600
+ preview: string;
601
+ groupLog: string;
602
+ groupAlert: string;
537
603
  logRetentionDays: string;
604
+ logRetentionHint: string;
538
605
  alertEmails: string;
539
606
  alertEmailsHint: string;
607
+ previewRetention: string;
608
+ previewKeep: string;
609
+ previewAxisStart: string;
610
+ previewToday: string;
611
+ previewTo: string;
612
+ previewSubject: string;
613
+ previewSubjectText: string;
614
+ previewBody: string;
615
+ previewError: string;
616
+ previewNoAlert: string;
540
617
  };
541
618
  externalAuth: {
619
+ preview: string;
620
+ previewOther: string;
542
621
  hint: string;
543
- empty: string;
544
- showOnLogin: string;
545
- hidden: string;
546
- loginVisible: string;
547
- summary: string;
548
- summaryFull: string;
549
- reset: string;
550
- notConfigured: string;
551
- notConfiguredTip: string;
622
+ groupLocal: string;
623
+ groupThird: string;
624
+ password: string;
625
+ passwordHint: string;
626
+ smsHint: string;
627
+ state: {
628
+ notInstalled: string;
629
+ unconfigured: string;
630
+ configured: string;
631
+ };
632
+ settings: string;
633
+ addOidc: string;
634
+ needPackage: string;
635
+ codeRegistered: string;
552
636
  linkByAccount: string;
637
+ linkByAccountHint: string;
553
638
  linkByAccountConfirmTitle: string;
554
639
  linkByAccountConfirm: string;
640
+ field: {
641
+ displayName: string;
642
+ code: string;
643
+ corpId: string;
644
+ agentId: string;
645
+ corpSecret: string;
646
+ appKey: string;
647
+ appSecret: string;
648
+ clientId: string;
649
+ clientSecret: string;
650
+ appId: string;
651
+ authority: string;
652
+ scopes: string;
653
+ usePkce: string;
654
+ };
655
+ sheet: {
656
+ title: string;
657
+ addOidc: string;
658
+ oidcHint: string;
659
+ secretNote: string;
660
+ namePlaceholder: string;
661
+ codePlaceholder: string;
662
+ codeFixed: string;
663
+ codeTaken: string;
664
+ secretPlaceholder: string;
665
+ secretSet: string;
666
+ keepSecret: string;
667
+ secretRetype: string;
668
+ endpointMoved: string;
669
+ ephemeralKey: string;
670
+ ephemeralTitle: string;
671
+ callback: string;
672
+ callbackHint: string;
673
+ idp: string;
674
+ callbackMissing: string;
675
+ copyFailed: string;
676
+ test: string;
677
+ testing: string;
678
+ saved: string;
679
+ clear: string;
680
+ clearTitle: string;
681
+ clearConfirm: string;
682
+ cleared: string;
683
+ };
684
+ check: {
685
+ reachable: string;
686
+ credentials: string;
687
+ agent: string;
688
+ appId: string;
689
+ secret: string;
690
+ discovery: string;
691
+ issuer: string;
692
+ endpoints: string;
693
+ clientSecret: string;
694
+ timeout: string;
695
+ error: string;
696
+ };
697
+ checkStatus: {
698
+ ok: string;
699
+ failed: string;
700
+ skipped: string;
701
+ };
555
702
  };
556
703
  base: {
557
704
  siteTitle: string;
558
- logo: string;
559
705
  siteSubtitle: string;
560
706
  copyright: string;
561
707
  copyrightUrl: string;
562
708
  };
709
+ login: {
710
+ language: string;
711
+ localeZh: string;
712
+ localeEn: string;
713
+ showFeatures: string;
714
+ headline: string;
715
+ headlinePlaceholder: string;
716
+ highlight: string;
717
+ highlightPlaceholder: string;
718
+ highlightHint: string;
719
+ features: string;
720
+ featuresPlaceholder: string;
721
+ featuresHint: string;
722
+ highlightMissing: string;
723
+ tooManyFeatures: string;
724
+ };
563
725
  security: {
726
+ desc: string;
727
+ preview: string;
728
+ groupLogin: string;
729
+ groupSession: string;
730
+ groupRate: string;
731
+ zeroNoLock: string;
732
+ zeroNever: string;
733
+ zeroOff: string;
734
+ unit: {
735
+ times: string;
736
+ minutes: string;
737
+ days: string;
738
+ seconds: string;
739
+ chars: string;
740
+ };
741
+ tryLabel: string;
742
+ tryMin: string;
743
+ tryPass: string;
744
+ tryFail: string;
564
745
  loginLock: {
565
- title: string;
566
746
  maxFailCount: string;
567
747
  lockMinutes: string;
568
748
  };
569
749
  password: {
570
750
  title: string;
571
751
  minLength: string;
752
+ mustContain: string;
753
+ chipUpper: string;
754
+ chipLower: string;
755
+ chipDigit: string;
756
+ chipSpecial: string;
572
757
  requireUpper: string;
573
758
  requireLower: string;
574
759
  requireDigit: string;
575
760
  requireSpecial: string;
576
761
  expireDays: string;
577
762
  historyCount: string;
763
+ forceChangeOnFirstLogin: string;
764
+ forceChangeOnFirstLoginHint: string;
578
765
  };
579
766
  session: {
580
- title: string;
581
767
  accessMinutes: string;
582
768
  refreshMinutes: string;
583
769
  };
584
770
  captcha: {
585
- title: string;
586
771
  enabled: string;
587
772
  type: string;
588
773
  types: {
@@ -592,13 +777,11 @@ declare const _default: {
592
777
  };
593
778
  };
594
779
  totp: {
595
- title: string;
596
780
  enabled: string;
597
781
  requireForSuperAdmin: string;
598
782
  hint: string;
599
783
  };
600
784
  sms: {
601
- title: string;
602
785
  hint: string;
603
786
  };
604
787
  mfa: {
@@ -608,15 +791,12 @@ declare const _default: {
608
791
  enabled: string;
609
792
  };
610
793
  rateLimit: {
611
- title: string;
612
794
  enabled: string;
613
795
  windowSeconds: string;
614
796
  permitPerWindow: string;
615
797
  authPermitPerWindow: string;
616
798
  };
617
799
  highSens: {
618
- title: string;
619
- hint: string;
620
800
  code: string;
621
801
  remark: string;
622
802
  codePh: string;
@@ -624,12 +804,39 @@ declare const _default: {
624
804
  codeRequired: string;
625
805
  };
626
806
  };
807
+ sensitive: {
808
+ desc: string;
809
+ preview: string;
810
+ previewTip: string;
811
+ previewDoing: string;
812
+ method: string;
813
+ path: string;
814
+ builtin: string;
815
+ added: string;
816
+ removed: string;
817
+ removeConfirm: string;
818
+ };
627
819
  upload: {
628
- title: string;
820
+ desc: string;
821
+ preview: string;
822
+ previewDrop: string;
823
+ previewLimit: string;
824
+ previewDefault: string;
825
+ groupLimit: string;
629
826
  maxSizeMb: string;
630
827
  allowedExtensions: string;
631
- extPlaceholder: string;
632
828
  extTip: string;
829
+ quickAdd: string;
830
+ preset: {
831
+ images: string;
832
+ docs: string;
833
+ archives: string;
834
+ clear: string;
835
+ };
836
+ fileOk: string;
837
+ fileBadExt: string;
838
+ fileTooBig: string;
839
+ fileDefault: string;
633
840
  };
634
841
  };
635
842
  dict: {
@@ -1323,6 +1530,13 @@ declare const _default: {
1323
1530
  reauthRequired: string;
1324
1531
  mfaBindPasswordRequired: string;
1325
1532
  apiKeyInvalid: string;
1533
+ externalAuthTypeNotFound: string;
1534
+ externalAuthCodeExists: string;
1535
+ externalAuthCodeInvalid: string;
1536
+ externalAuthFieldMissing: string;
1537
+ externalAuthDataProtectionKeyMissing: string;
1538
+ externalAuthProviderNotFound: string;
1539
+ externalAuthEndpointBlocked: string;
1326
1540
  };
1327
1541
  perm: {
1328
1542
  denied: string;
@@ -1490,6 +1704,14 @@ declare const _default: {
1490
1704
  job: string;
1491
1705
  };
1492
1706
  };
1707
+ apiDocs: {
1708
+ title: string;
1709
+ openedHint: string;
1710
+ fallbackLink: string;
1711
+ copyToken: string;
1712
+ copyTokenHint: string;
1713
+ tokenCopied: string;
1714
+ };
1493
1715
  userExport: {
1494
1716
  account: string;
1495
1717
  name: string;