@dssp/dcsp 1.0.0-alpha.98 → 1.0.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 (40) hide show
  1. package/package.json +53 -53
  2. package/schema.graphql +16 -0
  3. package/dist-client/bootstrap.d.ts +0 -10
  4. package/dist-client/bootstrap.js +0 -274
  5. package/dist-client/bootstrap.js.map +0 -1
  6. package/dist-client/entries/auth/checkin.d.ts +0 -38
  7. package/dist-client/entries/auth/checkin.js +0 -546
  8. package/dist-client/entries/auth/checkin.js.map +0 -1
  9. package/dist-client/entries/public/home.d.ts +0 -8
  10. package/dist-client/entries/public/home.js +0 -97
  11. package/dist-client/entries/public/home.js.map +0 -1
  12. package/dist-client/icons/menu-icons.d.ts +0 -5
  13. package/dist-client/icons/menu-icons.js +0 -84
  14. package/dist-client/icons/menu-icons.js.map +0 -1
  15. package/dist-client/index.d.ts +0 -0
  16. package/dist-client/index.js +0 -2
  17. package/dist-client/index.js.map +0 -1
  18. package/dist-client/menu.d.ts +0 -1
  19. package/dist-client/menu.js +0 -4
  20. package/dist-client/menu.js.map +0 -1
  21. package/dist-client/pages/sv-user-management.d.ts +0 -6
  22. package/dist-client/pages/sv-user-management.js +0 -224
  23. package/dist-client/pages/sv-user-management.js.map +0 -1
  24. package/dist-client/route.d.ts +0 -1
  25. package/dist-client/route.js +0 -20
  26. package/dist-client/route.js.map +0 -1
  27. package/dist-client/themes/dark.css +0 -51
  28. package/dist-client/themes/light.css +0 -51
  29. package/dist-client/themes/popup-theme.css +0 -18
  30. package/dist-client/tsconfig.tsbuildinfo +0 -1
  31. package/dist-client/viewparts/menu-tools.d.ts +0 -16
  32. package/dist-client/viewparts/menu-tools.js +0 -171
  33. package/dist-client/viewparts/menu-tools.js.map +0 -1
  34. package/dist-client/viewparts/user-circle.d.ts +0 -5
  35. package/dist-client/viewparts/user-circle.js +0 -26
  36. package/dist-client/viewparts/user-circle.js.map +0 -1
  37. package/dist-server/index.d.ts +0 -0
  38. package/dist-server/index.js +0 -1
  39. package/dist-server/index.js.map +0 -1
  40. package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1,97 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import '@material/web/icon/icon.js';
3
- import { css, html, LitElement } from 'lit';
4
- import { customElement } from 'lit/decorators.js';
5
- let HomePage = class HomePage extends LitElement {
6
- render() {
7
- var { title, description } = this.applicationMeta;
8
- return html `
9
- <div message>
10
- <strong>${title}</strong>
11
- ${description}
12
- <video autoplay muted playsinline loop>
13
- <source src="/assets/videos/intro.mp4" type="video/mp4" />
14
- </video>
15
- </div>
16
-
17
- <md-icon signin @click=${e => (window.location.href = '/auth/signin')}>login</md-icon>
18
- `;
19
- }
20
- get applicationMeta() {
21
- if (!this._applicationMeta) {
22
- var iconLink = document.querySelector('link[rel="application-icon"]');
23
- var titleMeta = document.querySelector('meta[name="application-name"]');
24
- var descriptionMeta = document.querySelector('meta[name="application-description"]');
25
- this._applicationMeta = {
26
- icon: iconLink === null || iconLink === void 0 ? void 0 : iconLink.href,
27
- title: (titleMeta === null || titleMeta === void 0 ? void 0 : titleMeta.content) || 'Things Factory',
28
- description: (descriptionMeta === null || descriptionMeta === void 0 ? void 0 : descriptionMeta.content) || 'Reimagining Software'
29
- };
30
- }
31
- return this._applicationMeta;
32
- }
33
- };
34
- HomePage.styles = [
35
- css `
36
- :host {
37
- background-color: var(--md-sys-color-background);
38
-
39
- display: block;
40
- position: relative;
41
-
42
- max-width: 100vw;
43
- width: 100vw;
44
- height: 100vh;
45
- height: 100dvh;
46
- }
47
-
48
- [signin] {
49
- position: absolute;
50
- right: 20px;
51
- top: 20px;
52
- font-size: 2em;
53
- color: white;
54
- }
55
-
56
- [message] {
57
- background-color: rgba(50, 66, 97, 0.8);
58
- padding: 60px 50px 0 50px;
59
- color: #fff;
60
- text-align: center;
61
- font-size: 20px;
62
- }
63
-
64
- [message] strong {
65
- display: block;
66
- font-size: 2.5rem;
67
- }
68
-
69
- video {
70
- position: absolute;
71
- top: 50%;
72
- left: 50%;
73
- width: 100vw;
74
- height: 100vh;
75
- object-fit: cover;
76
- transform: translate(-50%, -50%);
77
- }
78
-
79
- @media screen and (max-width: 480px) {
80
- [message] {
81
- padding: 60px 30px 0 30px;
82
- color: #fff;
83
- text-align: center;
84
- font-size: 15px;
85
- }
86
-
87
- [message] strong {
88
- font-size: 1.6rem;
89
- }
90
- }
91
- `
92
- ];
93
- HomePage = __decorate([
94
- customElement('home-page')
95
- ], HomePage);
96
- export { HomePage };
97
- //# sourceMappingURL=home.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/entries/public/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAG1C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IA+DtC,MAAM;QACJ,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEjD,OAAO,IAAI,CAAA;;kBAEG,KAAK;UACb,WAAW;;;;;;+BAMU,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC;KACtE,CAAA;IACH,CAAC;IAED,IAAI,eAAe;QACjB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3B,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,8BAA8B,CAAoB,CAAA;YACxF,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,+BAA+B,CAAoB,CAAA;YAC1F,IAAI,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,sCAAsC,CAAoB,CAAA;YAEvG,IAAI,CAAC,gBAAgB,GAAG;gBACtB,IAAI,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI;gBACpB,KAAK,EAAE,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,gBAAgB;gBAC7C,WAAW,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,KAAI,sBAAsB;aAChE,CAAA;QACH,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;;AA5FM,eAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDF;CACF,AA1DY,CA0DZ;AA3DU,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA8FpB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('home-page')\nexport class HomePage extends LitElement {\n static styles = [\n css`\n :host {\n background-color: var(--md-sys-color-background);\n\n display: block;\n position: relative;\n\n max-width: 100vw;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n }\n\n [signin] {\n position: absolute;\n right: 20px;\n top: 20px;\n font-size: 2em;\n color: white;\n }\n\n [message] {\n background-color: rgba(50, 66, 97, 0.8);\n padding: 60px 50px 0 50px;\n color: #fff;\n text-align: center;\n font-size: 20px;\n }\n\n [message] strong {\n display: block;\n font-size: 2.5rem;\n }\n\n video {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n transform: translate(-50%, -50%);\n }\n\n @media screen and (max-width: 480px) {\n [message] {\n padding: 60px 30px 0 30px;\n color: #fff;\n text-align: center;\n font-size: 15px;\n }\n\n [message] strong {\n font-size: 1.6rem;\n }\n }\n `\n ]\n\n private _applicationMeta\n\n render() {\n var { title, description } = this.applicationMeta\n\n return html`\n <div message>\n <strong>${title}</strong>\n ${description}\n <video autoplay muted playsinline loop>\n <source src=\"/assets/videos/intro.mp4\" type=\"video/mp4\" />\n </video>\n </div>\n\n <md-icon signin @click=${e => (window.location.href = '/auth/signin')}>login</md-icon>\n `\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink = document.querySelector('link[rel=\"application-icon\"]') as HTMLLinkElement\n var titleMeta = document.querySelector('meta[name=\"application-name\"]') as HTMLMetaElement\n var descriptionMeta = document.querySelector('meta[name=\"application-description\"]') as HTMLMetaElement\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta?.content || 'Things Factory',\n description: descriptionMeta?.content || 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- export declare const ICONS_PROGRESS: string[];
2
- export declare const ICONS_COMPLETED: string[];
3
- export declare const ICONS_STATUS: string[];
4
- export declare const ICONS_OPERATING: string[];
5
- export declare const ICONS_SETTING: string[];
@@ -1,84 +0,0 @@
1
- const ICON_PROGRESS = `
2
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
3
- <defs>
4
- <style>
5
- .menu-svg {
6
- fill: #fff;
7
- stroke: {{strokecolor}};
8
- stroke-width: 0px;
9
- }
10
- </style>
11
- </defs>
12
-
13
- <path class="menu-svg" d="M31,36.5c-.2,0-.4,0-.6,0-.2,0-.3-.2-.5-.3l-8.3-8.3c-.2-.2-.3-.3-.3-.5,0-.2,0-.4,0-.6s0-.4,0-.6c0-.2.2-.3.3-.5l3.1-3.1c.2-.2.3-.3.5-.3.2,0,.4,0,.6,0s.4,0,.6,0c.2,0,.3.2.5.3l8.3,8.3c.2.2.3.3.3.5,0,.2,0,.4,0,.6s0,.4,0,.6c0,.2-.2.3-.3.5l-3.1,3.1c-.2.2-.3.3-.5.3-.2,0-.4,0-.6,0ZM31,33.6l1.8-1.8-6.9-6.9-1.8,1.8,6.9,6.9ZM8.9,36.5c-.2,0-.4,0-.6-.1-.2,0-.3-.2-.5-.3l-3.1-3.1c-.2-.2-.3-.3-.3-.5,0-.2-.1-.4-.1-.6s0-.4.1-.6c0-.2.2-.3.3-.5l8.6-8.6h3.5l1.3-1.3-6.9-6.9h-2.4l-4.6-4.6,4.1-4.1,4.6,4.6v2.4l6.9,6.9,4.9-4.9-2.4-2.4,2.1-2.1h-4.2l-.9-.9,5.3-5.3.9.9v4.2l2.1-2.1,6.2,6.2c.4.4.8.9,1,1.5.2.5.3,1.1.3,1.7s0,1-.3,1.5c-.2.5-.5.9-.8,1.4l-3.5-3.5-2.3,2.3-1.8-1.8-8,8v3.5l-8.6,8.6c-.2.2-.3.3-.5.3-.2,0-.4.1-.6.1ZM8.9,33.6l7.6-7.6v-1.8h-1.8l-7.6,7.6,1.8,1.8ZM8.9,33.6l-1.8-1.8.9.9.9.9ZM31,33.6l1.8-1.8-1.8,1.8Z"/>
14
- </svg>
15
- `;
16
- const ICON_COMPLETED = `
17
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
18
- <defs>
19
- <style>
20
- .menu-svg {
21
- fill: #fff;
22
- stroke: {{strokecolor}};
23
- stroke-width: 0px;
24
- }
25
- </style>
26
- </defs>
27
-
28
- <path class="menu-svg" d="M27.9,15.1h2.7v-2.8h-2.7v2.8ZM27.9,21.4h2.7v-2.8h-2.7v2.8ZM27.9,27.7h2.7v-2.8h-2.7v2.8ZM26.9,33.3v-2.4h6.9V9h-14.2v2.8l-2.3-1.7v-3.5h18.7v26.7s-9.1,0-9.1,0ZM4,33.3v-14.5l9.9-7.3,9.9,7.3v14.5h-8.1v-7.5h-3.5v7.5H4ZM6.3,31h3.6v-7.5h8v7.5h3.6v-11l-7.7-5.5-7.7,5.5v11h0ZM18,31v-7.5h-8v7.5-7.5h8v7.5Z"/>
29
- </svg>
30
- `;
31
- const ICON_STATUS = `
32
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
33
- <defs>
34
- <style>
35
- .menu-svg {
36
- fill: #fff;
37
- stroke: {{strokecolor}};
38
- stroke-width: 0px;
39
- }
40
- </style>
41
- </defs>
42
-
43
- <path class="menu-svg" d="M7.4,33.9c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.3-.8-2.1V9c0-.8.3-1.5.8-2.1.6-.6,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v21.9c0,.8-.3,1.5-.8,2.1s-1.3.8-2.1.8H7.4ZM7.4,31.4h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.4c0,0-.3,0-.4.2,0,0-.2.2-.2.4v21.9c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM8.9,27.7h7.3v-2.4h-7.3v2.4ZM24.2,24.3l7.5-7.5-1.8-1.8-5.7,5.8-2.4-2.4-1.7,1.8s4.1,4.1,4.1,4.1ZM8.9,21.2h7.3v-2.4h-7.3v2.4ZM8.9,14.6h7.3v-2.4h-7.3s0,2.4,0,2.4ZM6.9,31.4V8.5v22.9Z"/>
44
- </svg>
45
- `;
46
- const ICON_OPERATING = `
47
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
48
- <defs>
49
- <style>
50
- .menu-svg {
51
- fill: #fff;
52
- stroke: {{strokecolor}};
53
- stroke-width: 0px;
54
- }
55
- </style>
56
- </defs>
57
-
58
- <path class="menu-svg" d="M9.1,35.5c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.2-.8-2.1V10.9c0-.8.3-1.5.8-2.1.6-.6,1.2-.8,2.1-.8h2.3v-3.5h2.5v3.5h12.3v-3.5h2.4v3.5h2.3c.8,0,1.5.3,2.1.8.6.6.8,1.2.8,2.1v21.7c0,.8-.3,1.5-.8,2.1s-1.2.8-2.1.8c0,0-21.8,0-21.8,0ZM9.1,33.1h21.7c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4v-15.2H8.5v15.2c0,0,0,.3.2.4,0,0,.2.2.4.2ZM8.5,14.9h22.7v-4c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H9.1c0,0-.3,0-.4.2,0,0-.2.2-.2.4,0,0,0,4,0,4ZM8.5,14.9v-4.5,4.5ZM12.2,22.9v-2.4h15.4v2.4s-15.4,0-15.4,0ZM12.2,29.4v-2.4h10.5v2.4h-10.5Z"/>
59
- </svg>
60
- `;
61
- const ICON_SETTING = `
62
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
63
- <defs>
64
- <style>
65
- .menu-svg {
66
- fill: #fff;
67
- stroke: {{strokecolor}};
68
- stroke-width: 0px;
69
- }
70
- </style>
71
- </defs>
72
-
73
- <path class="menu-svg" d="M13.1,24.2h2v-5.7h-2v1.9h-2.4v2h2.4v1.9h0ZM16.7,22.3h12.8v-2h-12.8v2ZM25,18.1h2v-1.9h2.4v-2h-2.4v-1.9h-2v5.7h0ZM10.6,16.2h12.8v-2h-12.8v2ZM14.3,34v-3.3h-6.9c-.8,0-1.5-.3-2.1-.8s-.8-1.3-.8-2.1V8.9c0-.8.3-1.6.8-2.1.6-.5,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v18.8c0,.8-.3,1.6-.8,2.1-.6.5-1.3.8-2.1.8h-6.9v3.3h-11.5,0ZM7.5,28.2h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V8.9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.5c0,0-.3,0-.4.2,0,0-.2.2-.2.4v18.8c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM6.9,28.2V8.4v19.8Z"/>
74
- </svg>
75
- `;
76
- function icons(template) {
77
- return ['#ffffff', '#64A3D9'].map(color => 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(template.replace(/{{strokecolor}}/g, color)));
78
- }
79
- export const ICONS_PROGRESS = icons(ICON_PROGRESS);
80
- export const ICONS_COMPLETED = icons(ICON_COMPLETED);
81
- export const ICONS_STATUS = icons(ICON_STATUS);
82
- export const ICONS_OPERATING = icons(ICON_OPERATING);
83
- export const ICONS_SETTING = icons(ICON_SETTING);
84
- //# sourceMappingURL=menu-icons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu-icons.js","sourceRoot":"","sources":["../../client/icons/menu-icons.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG;;;;;;;;;;;;;;CAcrB,CAAA;AAED,MAAM,cAAc,GAAG;;;;;;;;;;;;;;CActB,CAAA;AAED,MAAM,WAAW,GAAG;;;;;;;;;;;;;;CAcnB,CAAA;AAED,MAAM,cAAc,GAAG;;;;;;;;;;;;;;CActB,CAAA;AAED,MAAM,YAAY,GAAG;;;;;;;;;;;;;;CAcpB,CAAA;AAED,SAAS,KAAK,CAAC,QAAQ;IACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,CAC/B,KAAK,CAAC,EAAE,CAAC,0CAA0C,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC,CACxG,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;AAClD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,CAAA;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAA;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,CAAA;AACpD,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,CAAA","sourcesContent":["const ICON_PROGRESS = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M31,36.5c-.2,0-.4,0-.6,0-.2,0-.3-.2-.5-.3l-8.3-8.3c-.2-.2-.3-.3-.3-.5,0-.2,0-.4,0-.6s0-.4,0-.6c0-.2.2-.3.3-.5l3.1-3.1c.2-.2.3-.3.5-.3.2,0,.4,0,.6,0s.4,0,.6,0c.2,0,.3.2.5.3l8.3,8.3c.2.2.3.3.3.5,0,.2,0,.4,0,.6s0,.4,0,.6c0,.2-.2.3-.3.5l-3.1,3.1c-.2.2-.3.3-.5.3-.2,0-.4,0-.6,0ZM31,33.6l1.8-1.8-6.9-6.9-1.8,1.8,6.9,6.9ZM8.9,36.5c-.2,0-.4,0-.6-.1-.2,0-.3-.2-.5-.3l-3.1-3.1c-.2-.2-.3-.3-.3-.5,0-.2-.1-.4-.1-.6s0-.4.1-.6c0-.2.2-.3.3-.5l8.6-8.6h3.5l1.3-1.3-6.9-6.9h-2.4l-4.6-4.6,4.1-4.1,4.6,4.6v2.4l6.9,6.9,4.9-4.9-2.4-2.4,2.1-2.1h-4.2l-.9-.9,5.3-5.3.9.9v4.2l2.1-2.1,6.2,6.2c.4.4.8.9,1,1.5.2.5.3,1.1.3,1.7s0,1-.3,1.5c-.2.5-.5.9-.8,1.4l-3.5-3.5-2.3,2.3-1.8-1.8-8,8v3.5l-8.6,8.6c-.2.2-.3.3-.5.3-.2,0-.4.1-.6.1ZM8.9,33.6l7.6-7.6v-1.8h-1.8l-7.6,7.6,1.8,1.8ZM8.9,33.6l-1.8-1.8.9.9.9.9ZM31,33.6l1.8-1.8-1.8,1.8Z\"/>\n</svg>\n`\n\nconst ICON_COMPLETED = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M27.9,15.1h2.7v-2.8h-2.7v2.8ZM27.9,21.4h2.7v-2.8h-2.7v2.8ZM27.9,27.7h2.7v-2.8h-2.7v2.8ZM26.9,33.3v-2.4h6.9V9h-14.2v2.8l-2.3-1.7v-3.5h18.7v26.7s-9.1,0-9.1,0ZM4,33.3v-14.5l9.9-7.3,9.9,7.3v14.5h-8.1v-7.5h-3.5v7.5H4ZM6.3,31h3.6v-7.5h8v7.5h3.6v-11l-7.7-5.5-7.7,5.5v11h0ZM18,31v-7.5h-8v7.5-7.5h8v7.5Z\"/>\n</svg>\n`\n\nconst ICON_STATUS = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n\n <path class=\"menu-svg\" d=\"M7.4,33.9c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.3-.8-2.1V9c0-.8.3-1.5.8-2.1.6-.6,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v21.9c0,.8-.3,1.5-.8,2.1s-1.3.8-2.1.8H7.4ZM7.4,31.4h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.4c0,0-.3,0-.4.2,0,0-.2.2-.2.4v21.9c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM8.9,27.7h7.3v-2.4h-7.3v2.4ZM24.2,24.3l7.5-7.5-1.8-1.8-5.7,5.8-2.4-2.4-1.7,1.8s4.1,4.1,4.1,4.1ZM8.9,21.2h7.3v-2.4h-7.3v2.4ZM8.9,14.6h7.3v-2.4h-7.3s0,2.4,0,2.4ZM6.9,31.4V8.5v22.9Z\"/>\n</svg>\n`\n\nconst ICON_OPERATING = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M9.1,35.5c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.2-.8-2.1V10.9c0-.8.3-1.5.8-2.1.6-.6,1.2-.8,2.1-.8h2.3v-3.5h2.5v3.5h12.3v-3.5h2.4v3.5h2.3c.8,0,1.5.3,2.1.8.6.6.8,1.2.8,2.1v21.7c0,.8-.3,1.5-.8,2.1s-1.2.8-2.1.8c0,0-21.8,0-21.8,0ZM9.1,33.1h21.7c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4v-15.2H8.5v15.2c0,0,0,.3.2.4,0,0,.2.2.4.2ZM8.5,14.9h22.7v-4c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H9.1c0,0-.3,0-.4.2,0,0-.2.2-.2.4,0,0,0,4,0,4ZM8.5,14.9v-4.5,4.5ZM12.2,22.9v-2.4h15.4v2.4s-15.4,0-15.4,0ZM12.2,29.4v-2.4h10.5v2.4h-10.5Z\"/>\n</svg>\n`\n\nconst ICON_SETTING = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M13.1,24.2h2v-5.7h-2v1.9h-2.4v2h2.4v1.9h0ZM16.7,22.3h12.8v-2h-12.8v2ZM25,18.1h2v-1.9h2.4v-2h-2.4v-1.9h-2v5.7h0ZM10.6,16.2h12.8v-2h-12.8v2ZM14.3,34v-3.3h-6.9c-.8,0-1.5-.3-2.1-.8s-.8-1.3-.8-2.1V8.9c0-.8.3-1.6.8-2.1.6-.5,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v18.8c0,.8-.3,1.6-.8,2.1-.6.5-1.3.8-2.1.8h-6.9v3.3h-11.5,0ZM7.5,28.2h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V8.9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.5c0,0-.3,0-.4.2,0,0-.2.2-.2.4v18.8c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM6.9,28.2V8.4v19.8Z\"/>\n</svg>\n`\n\nfunction icons(template) {\n return ['#ffffff', '#64A3D9'].map(\n color => 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(template.replace(/{{strokecolor}}/g, color))\n )\n}\n\nexport const ICONS_PROGRESS = icons(ICON_PROGRESS)\nexport const ICONS_COMPLETED = icons(ICON_COMPLETED)\nexport const ICONS_STATUS = icons(ICON_STATUS)\nexport const ICONS_OPERATING = icons(ICON_OPERATING)\nexport const ICONS_SETTING = icons(ICON_SETTING)\n"]}
File without changes
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1 +0,0 @@
1
- export declare function getMenuTemplate(): Promise<never[]>;
@@ -1,4 +0,0 @@
1
- export async function getMenuTemplate() {
2
- return [].filter(Boolean);
3
- }
4
- //# sourceMappingURL=menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["../client/menu.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["export async function getMenuTemplate() {\n return [].filter(Boolean)\n}\n"]}
@@ -1,6 +0,0 @@
1
- import '@material/web/icon/icon.js';
2
- import '@things-factory/component-ui';
3
- import '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup';
4
- import '@things-factory/auth-ui/dist-client/components/user-role-editor';
5
- import '@things-factory/auth-ui/dist-client/components/create-user';
6
- import '@things-factory/auth-ui/dist-client/components/invite-user.js';
@@ -1,224 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import '@material/web/icon/icon.js';
3
- import '@things-factory/component-ui';
4
- import '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup';
5
- import '@things-factory/auth-ui/dist-client/components/user-role-editor';
6
- import '@things-factory/auth-ui/dist-client/components/create-user';
7
- import '@things-factory/auth-ui/dist-client/components/invite-user.js';
8
- import gql from 'graphql-tag';
9
- import { css, html } from 'lit';
10
- import { customElement, property, query } from 'lit/decorators.js';
11
- import { client, gqlContext } from '@operato/graphql';
12
- import { i18next } from '@operato/i18n';
13
- import { PageView } from '@operato/shell';
14
- import { OxPrompt } from '@operato/popup/ox-prompt.js';
15
- let SVUserManagement = class SVUserManagement extends PageView {
16
- constructor() {
17
- super(...arguments);
18
- this.domainUsers = [];
19
- this.currentTab = '';
20
- this.passwordResettable = false;
21
- this.userCreatable = false;
22
- }
23
- get context() {
24
- return {
25
- title: i18next.t('text.user management'),
26
- help: 'auth/users'
27
- };
28
- }
29
- render() {
30
- const groupingUser = (this.domainUsers || []).reduce((groupingUser, user) => {
31
- const userType = user.userType;
32
- if (!groupingUser[userType]) {
33
- groupingUser[userType] = [];
34
- }
35
- user.activated = user.status === 'activated';
36
- groupingUser[userType].push(user);
37
- return groupingUser;
38
- }, {
39
- admin: [],
40
- user: [],
41
- application: [],
42
- appliance: []
43
- });
44
- const USER_TYPES = {
45
- USER: i18next.t('label.user'),
46
- APPLICATION: i18next.t('label.application'),
47
- APPLIANCE: i18next.t('text.appliance')
48
- };
49
- const userSet = {
50
- [USER_TYPES.USER]: [...groupingUser.user, ...groupingUser.admin],
51
- [USER_TYPES.APPLICATION]: groupingUser.application,
52
- [USER_TYPES.APPLIANCE]: groupingUser.appliance
53
- };
54
- return html `
55
- ${this.userCreatable
56
- ? html `<create-user
57
- @create-user=${async (event) => {
58
- const user = event.detail;
59
- user.userType = 'user';
60
- await this.createUser(user);
61
- }}
62
- ></create-user>`
63
- : ''}
64
- <quick-find-list
65
- id="user-list"
66
- .data=${userSet}
67
- @tabChanged=${e => (this.currentTab = e.detail.currentTabKey)}
68
- .headerRenderer=${user => {
69
- return html `
70
- ${!user.activated
71
- ? html `
72
- <md-icon>do_disturb</md-icon>
73
- ${user.name}
74
- `
75
- : html ` ${user.owner ? html ` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `}
76
- `;
77
- }}
78
- .contentRenderer=${user => html ` <user-role-editor
79
- .user=${user}
80
- .domainOwner=${this.owner}
81
- .activate=${user.activated}
82
- @userUpdated=${this.refreshUsers.bind(this)}
83
- @ownershipTransferred=${this.refreshUsers.bind(this)}
84
- .passwordResettable=${this.passwordResettable}
85
- ></user-role-editor>`}
86
- ></quick-find-list>
87
-
88
- ${this.currentTab === USER_TYPES.USER
89
- ? html `<invite-user @invitationCompleted=${this.refreshUsers.bind(this)}></invite-user>`
90
- : ''}
91
- `;
92
- }
93
- async pageUpdated(changes, lifecycle, before) {
94
- if (this.active) {
95
- this.refreshUsers();
96
- this.checkPasswordResettable();
97
- this.checkUserCreatable();
98
- }
99
- }
100
- async refreshUsers() {
101
- var _a, _b;
102
- const domainUsersResp = await client.query({
103
- query: gql `
104
- query {
105
- users {
106
- items {
107
- id
108
- name
109
- email
110
- userType
111
- status
112
- owner
113
- }
114
- }
115
- }
116
- `,
117
- context: gqlContext()
118
- });
119
- if (!((_a = domainUsersResp.errors) === null || _a === void 0 ? void 0 : _a.length)) {
120
- this.domainUsers = domainUsersResp.data.users.items || [];
121
- this.owner = this.domainUsers.filter(user => user.owner)[0] || {};
122
- (_b = this.userListElement) === null || _b === void 0 ? void 0 : _b.close();
123
- }
124
- }
125
- async checkPasswordResettable() {
126
- const response = await client.query({
127
- query: gql `
128
- query {
129
- checkResettablePasswordToDefault
130
- }
131
- `
132
- });
133
- if (!response.errors) {
134
- this.passwordResettable = response.data.checkResettablePasswordToDefault;
135
- }
136
- }
137
- async checkUserCreatable() {
138
- const response = await client.query({
139
- query: gql `
140
- query {
141
- checkDefaultPassword
142
- }
143
- `
144
- });
145
- if (!response.errors) {
146
- this.userCreatable = response.data.checkDefaultPassword;
147
- }
148
- }
149
- async createUser(user) {
150
- if (await OxPrompt.open({
151
- title: i18next.t('text.are_you_sure'),
152
- text: i18next.t('text.are_you_sure_to_x_user', { x: i18next.t('button.create') }),
153
- confirmButton: { text: i18next.t('button.confirm') },
154
- cancelButton: { text: i18next.t('button.cancel') }
155
- })) {
156
- const response = await client.mutate({
157
- mutation: gql `
158
- mutation createUser($user: NewUser!) {
159
- createUser(user: $user) {
160
- name
161
- }
162
- }
163
- `,
164
- variables: { user },
165
- context: gqlContext()
166
- });
167
- if (!response.errors) {
168
- await OxPrompt.open({
169
- title: i18next.t('text.completed'),
170
- confirmButton: { text: i18next.t('button.confirm') }
171
- });
172
- await this.refreshUsers();
173
- }
174
- }
175
- }
176
- showToast(message) {
177
- document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }));
178
- }
179
- };
180
- SVUserManagement.styles = [
181
- css `
182
- :host {
183
- display: flex;
184
- flex-direction: column;
185
- background-color: var(--main-section-background-color);
186
- padding: var(--padding-wide);
187
- overflow: auto;
188
- }
189
-
190
- @media screen and (max-width: 600px) {
191
- :host {
192
- padding: var(--padding-narrow);
193
- }
194
- }
195
- `
196
- ];
197
- __decorate([
198
- property({ type: Array }),
199
- __metadata("design:type", Array)
200
- ], SVUserManagement.prototype, "domainUsers", void 0);
201
- __decorate([
202
- property({ type: Object }),
203
- __metadata("design:type", Object)
204
- ], SVUserManagement.prototype, "owner", void 0);
205
- __decorate([
206
- property({ type: String }),
207
- __metadata("design:type", String)
208
- ], SVUserManagement.prototype, "currentTab", void 0);
209
- __decorate([
210
- property({ type: Boolean }),
211
- __metadata("design:type", Boolean)
212
- ], SVUserManagement.prototype, "passwordResettable", void 0);
213
- __decorate([
214
- property({ type: Boolean }),
215
- __metadata("design:type", Boolean)
216
- ], SVUserManagement.prototype, "userCreatable", void 0);
217
- __decorate([
218
- query('#user-list'),
219
- __metadata("design:type", Object)
220
- ], SVUserManagement.prototype, "userListElement", void 0);
221
- SVUserManagement = __decorate([
222
- customElement('sv-user-management')
223
- ], SVUserManagement);
224
- //# sourceMappingURL=sv-user-management.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sv-user-management.js","sourceRoot":"","sources":["../../client/pages/sv-user-management.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,8BAA8B,CAAA;AACrC,OAAO,yEAAyE,CAAA;AAChF,OAAO,iEAAiE,CAAA;AACxE,OAAO,4DAA4D,CAAA;AACnE,OAAO,+DAA+D,CAAA;AAEtE,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ;IAAvC;;QAmB6B,gBAAW,GAAU,EAAE,CAAA;QAEtB,eAAU,GAAW,EAAE,CAAA;QACtB,uBAAkB,GAAY,KAAK,CAAA;QACnC,kBAAa,GAAY,KAAK,CAAA;IAsL7D,CAAC;IAlLC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;YACxC,IAAI,EAAE,YAAY;SACnB,CAAA;IACH,CAAC;IAED,MAAM;QACJ,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,MAAM,CAClD,CAAC,YAAY,EAA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E,CAAC;;oDAAwB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4DAAoC;AACnC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;uDAA+B;AAEtC;IAApB,KAAK,CAAC,YAAY,CAAC;;yDAAsD;AAzBtE,gBAAgB;IADrB,aAAa,CAAC,oBAAoB,CAAC;GAC9B,gBAAgB,CA6MrB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@things-factory/component-ui'\nimport '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup'\nimport '@things-factory/auth-ui/dist-client/components/user-role-editor'\nimport '@things-factory/auth-ui/dist-client/components/create-user'\nimport '@things-factory/auth-ui/dist-client/components/invite-user.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('sv-user-management')\nclass SVUserManagement extends PageView {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n padding: var(--padding-wide);\n overflow: auto;\n }\n\n @media screen and (max-width: 600px) {\n :host {\n padding: var(--padding-narrow);\n }\n }\n `\n ]\n\n @property({ type: Array }) domainUsers: any[] = []\n @property({ type: Object }) owner: any\n @property({ type: String }) currentTab: string = ''\n @property({ type: Boolean }) passwordResettable: boolean = false\n @property({ type: Boolean }) userCreatable: boolean = false\n\n @query('#user-list') userListElement!: HTMLElement & { close: () => void }\n\n get context() {\n return {\n title: i18next.t('text.user management'),\n help: 'auth/users'\n }\n }\n\n render() {\n const groupingUser = (this.domainUsers || []).reduce(\n (groupingUser, user) => {\n const userType = user.userType\n if (!groupingUser[userType]) {\n groupingUser[userType] = []\n }\n user.activated = user.status === 'activated'\n groupingUser[userType].push(user)\n\n return groupingUser\n },\n {\n admin: [],\n user: [],\n application: [],\n appliance: []\n }\n )\n\n const USER_TYPES = {\n USER: i18next.t('label.user'),\n APPLICATION: i18next.t('label.application'),\n APPLIANCE: i18next.t('text.appliance')\n }\n\n const userSet = {\n [USER_TYPES.USER]: [...groupingUser.user, ...groupingUser.admin],\n [USER_TYPES.APPLICATION]: groupingUser.application,\n [USER_TYPES.APPLIANCE]: groupingUser.appliance\n }\n\n return html`\n ${this.userCreatable\n ? html`<create-user\n @create-user=${async event => {\n const user = event.detail\n user.userType = 'user'\n\n await this.createUser(user)\n }}\n ></create-user>`\n : ''}\n <quick-find-list\n id=\"user-list\"\n .data=${userSet}\n @tabChanged=${e => (this.currentTab = e.detail.currentTabKey)}\n .headerRenderer=${user => {\n return html`\n ${!user.activated\n ? html`\n <md-icon>do_disturb</md-icon>\n ${user.name}\n `\n : html` ${user.owner ? html` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `}\n `\n }}\n .contentRenderer=${user =>\n html` <user-role-editor\n .user=${user}\n .domainOwner=${this.owner}\n .activate=${user.activated}\n @userUpdated=${this.refreshUsers.bind(this)}\n @ownershipTransferred=${this.refreshUsers.bind(this)}\n .passwordResettable=${this.passwordResettable}\n ></user-role-editor>`}\n ></quick-find-list>\n\n ${this.currentTab === USER_TYPES.USER\n ? html`<invite-user @invitationCompleted=${this.refreshUsers.bind(this)}></invite-user>`\n : ''}\n `\n }\n\n async pageUpdated(changes, lifecycle, before) {\n if (this.active) {\n this.refreshUsers()\n this.checkPasswordResettable()\n this.checkUserCreatable()\n }\n }\n\n async refreshUsers() {\n const domainUsersResp = await client.query({\n query: gql`\n query {\n users {\n items {\n id\n name\n email\n userType\n status\n owner\n }\n }\n }\n `,\n context: gqlContext()\n })\n\n if (!domainUsersResp.errors?.length) {\n this.domainUsers = domainUsersResp.data.users.items || []\n this.owner = this.domainUsers.filter(user => user.owner)[0] || {}\n this.userListElement?.close()\n }\n }\n\n async checkPasswordResettable() {\n const response = await client.query({\n query: gql`\n query {\n checkResettablePasswordToDefault\n }\n `\n })\n\n if (!response.errors) {\n this.passwordResettable = response.data.checkResettablePasswordToDefault\n }\n }\n\n async checkUserCreatable() {\n const response = await client.query({\n query: gql`\n query {\n checkDefaultPassword\n }\n `\n })\n\n if (!response.errors) {\n this.userCreatable = response.data.checkDefaultPassword\n }\n }\n\n async createUser(user) {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x_user', { x: i18next.t('button.create') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation createUser($user: NewUser!) {\n createUser(user: $user) {\n name\n }\n }\n `,\n variables: { user },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n await this.refreshUsers()\n }\n }\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n}\n"]}
@@ -1 +0,0 @@
1
- export default function route(page: string): "/project-detail" | "/dashboard" | "users" | undefined;
@@ -1,20 +0,0 @@
1
- function getDomainType() {
2
- // URL pattern: /{extType}/{subdomain}/<rest>
3
- const match = window.location.pathname.match(/^\/([^\/]+)\/[^\/]+/);
4
- return (match === null || match === void 0 ? void 0 : match[1]) || 'domain';
5
- }
6
- export default function route(page) {
7
- if (page === '') {
8
- const domainType = getDomainType();
9
- if (domainType === 'project') {
10
- return '/project-detail';
11
- }
12
- return '/dashboard';
13
- }
14
- switch (page) {
15
- case 'users':
16
- import('./pages/sv-user-management');
17
- return page;
18
- }
19
- }
20
- //# sourceMappingURL=route.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,SAAS,aAAa;IACpB,6CAA6C;IAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACnE,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,KAAI,QAAQ,CAAA;AAC/B,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;QAClC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,iBAAiB,CAAA;QAC1B,CAAC;QACD,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,MAAM,CAAC,4BAA4B,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["function getDomainType(): string {\n // URL pattern: /{extType}/{subdomain}/<rest>\n const match = window.location.pathname.match(/^\\/([^\\/]+)\\/[^\\/]+/)\n return match?.[1] || 'domain'\n}\n\nexport default function route(page: string) {\n if (page === '') {\n const domainType = getDomainType()\n if (domainType === 'project') {\n return '/project-detail'\n }\n return '/dashboard'\n }\n\n switch (page) {\n case 'users':\n import('./pages/sv-user-management')\n return page\n }\n}\n"]}
@@ -1,51 +0,0 @@
1
- .dark {
2
- --md-sys-color-primary: rgb(255 179 174);
3
- --md-sys-color-surface-tint: rgb(255 179 174);
4
- --md-sys-color-on-primary: rgb(87 29 28);
5
- --md-sys-color-primary-container: rgb(115 51 49);
6
- --md-sys-color-on-primary-container: rgb(255 218 215);
7
- --md-sys-color-secondary: rgb(231 189 185);
8
- --md-sys-color-on-secondary: rgb(68 41 40);
9
- --md-sys-color-secondary-container: rgb(93 63 61);
10
- --md-sys-color-on-secondary-container: rgb(255 218 215);
11
- --md-sys-color-tertiary: rgb(226 194 140);
12
- --md-sys-color-on-tertiary: rgb(64 45 4);
13
- --md-sys-color-tertiary-container: rgb(89 67 25);
14
- --md-sys-color-on-tertiary-container: rgb(255 222 167);
15
- --md-sys-color-error: rgb(255 180 171);
16
- --md-sys-color-on-error: rgb(105 0 5);
17
- --md-sys-color-error-container: rgb(147 0 10);
18
- --md-sys-color-on-error-container: rgb(255 218 214);
19
- --md-sys-color-background: rgb(26 17 17);
20
- --md-sys-color-on-background: rgb(241 222 221);
21
- --md-sys-color-surface: rgb(26 17 17);
22
- --md-sys-color-on-surface: rgb(241 222 221);
23
- --md-sys-color-surface-variant: rgb(83 67 66);
24
- --md-sys-color-on-surface-variant: rgb(216 194 192);
25
- --md-sys-color-outline: rgb(160 140 139);
26
- --md-sys-color-outline-variant: rgb(83 67 66);
27
- --md-sys-color-shadow: rgb(0 0 0);
28
- --md-sys-color-scrim: rgb(0 0 0);
29
- --md-sys-color-inverse-surface: rgb(241 222 221);
30
- --md-sys-color-inverse-on-surface: rgb(56 46 45);
31
- --md-sys-color-inverse-primary: rgb(144 74 71);
32
- --md-sys-color-primary-fixed: rgb(255 218 215);
33
- --md-sys-color-on-primary-fixed: rgb(59 8 9);
34
- --md-sys-color-primary-fixed-dim: rgb(255 179 174);
35
- --md-sys-color-on-primary-fixed-variant: rgb(115 51 49);
36
- --md-sys-color-secondary-fixed: rgb(255 218 215);
37
- --md-sys-color-on-secondary-fixed: rgb(44 21 20);
38
- --md-sys-color-secondary-fixed-dim: rgb(231 189 185);
39
- --md-sys-color-on-secondary-fixed-variant: rgb(93 63 61);
40
- --md-sys-color-tertiary-fixed: rgb(255 222 167);
41
- --md-sys-color-on-tertiary-fixed: rgb(39 25 0);
42
- --md-sys-color-tertiary-fixed-dim: rgb(226 194 140);
43
- --md-sys-color-on-tertiary-fixed-variant: rgb(89 67 25);
44
- --md-sys-color-surface-dim: rgb(26 17 17);
45
- --md-sys-color-surface-bright: rgb(66 55 54);
46
- --md-sys-color-surface-container-lowest: rgb(20 12 12);
47
- --md-sys-color-surface-container-low: rgb(35 25 25);
48
- --md-sys-color-surface-container: rgb(39 29 29);
49
- --md-sys-color-surface-container-high: rgb(50 40 39);
50
- --md-sys-color-surface-container-highest: rgb(61 50 49);
51
- }
@@ -1,51 +0,0 @@
1
- .light {
2
- --md-sys-color-primary: rgb(144 74 71);
3
- --md-sys-color-surface-tint: rgb(144 74 71);
4
- --md-sys-color-on-primary: rgb(255 255 255);
5
- --md-sys-color-primary-container: rgb(255 218 215);
6
- --md-sys-color-on-primary-container: rgb(59 8 9);
7
- --md-sys-color-secondary: rgb(119 86 84);
8
- --md-sys-color-on-secondary: rgb(255 255 255);
9
- --md-sys-color-secondary-container: rgb(255 218 215);
10
- --md-sys-color-on-secondary-container: rgb(44 21 20);
11
- --md-sys-color-tertiary: #b85d5a;
12
- --md-sys-color-on-tertiary: rgb(255 255 255);
13
- --md-sys-color-tertiary-container: rgb(255 222 167);
14
- --md-sys-color-on-tertiary-container: rgb(39 25 0);
15
- --md-sys-color-error: rgb(186 26 26);
16
- --md-sys-color-on-error: rgb(255 255 255);
17
- --md-sys-color-error-container: rgb(255 218 214);
18
- --md-sys-color-on-error-container: rgb(65 0 2);
19
- --md-sys-color-background: rgb(255 248 247);
20
- --md-sys-color-on-background: rgb(35 25 25);
21
- --md-sys-color-surface: rgb(255 248 247);
22
- --md-sys-color-on-surface: rgb(35 25 25);
23
- --md-sys-color-surface-variant: rgb(245 221 219);
24
- --md-sys-color-on-surface-variant: rgb(83 67 66);
25
- --md-sys-color-outline: rgb(133 115 113);
26
- --md-sys-color-outline-variant: rgb(216 194 192);
27
- --md-sys-color-shadow: rgb(0 0 0);
28
- --md-sys-color-scrim: rgb(0 0 0);
29
- --md-sys-color-inverse-surface: rgb(56 46 45);
30
- --md-sys-color-inverse-on-surface: rgb(255 237 235);
31
- --md-sys-color-inverse-primary: rgb(255 179 174);
32
- --md-sys-color-primary-fixed: rgb(255 218 215);
33
- --md-sys-color-on-primary-fixed: rgb(59 8 9);
34
- --md-sys-color-primary-fixed-dim: rgb(255 179 174);
35
- --md-sys-color-on-primary-fixed-variant: rgb(115 51 49);
36
- --md-sys-color-secondary-fixed: rgb(255 218 215);
37
- --md-sys-color-on-secondary-fixed: rgb(44 21 20);
38
- --md-sys-color-secondary-fixed-dim: rgb(231 189 185);
39
- --md-sys-color-on-secondary-fixed-variant: rgb(93 63 61);
40
- --md-sys-color-tertiary-fixed: rgb(255 222 167);
41
- --md-sys-color-on-tertiary-fixed: rgb(39 25 0);
42
- --md-sys-color-tertiary-fixed-dim: rgb(226 194 140);
43
- --md-sys-color-on-tertiary-fixed-variant: rgb(89 67 25);
44
- --md-sys-color-surface-dim: rgb(232 214 212);
45
- --md-sys-color-surface-bright: rgb(255 248 247);
46
- --md-sys-color-surface-container-lowest: rgb(255 255 255);
47
- --md-sys-color-surface-container-low: rgb(255 240 239);
48
- --md-sys-color-surface-container: rgb(252 234 232);
49
- --md-sys-color-surface-container-high: rgb(246 228 226);
50
- --md-sys-color-surface-container-highest: rgb(241 222 221);
51
- }
@@ -1,18 +0,0 @@
1
- body {
2
- --overlay-center-full-width: 90%;
3
- --overlay-center-full-height: 90%;
4
- }
5
-
6
- @media only screen and (max-width: 460px) {
7
- body {
8
- --overlay-center-full-width: 90%;
9
- --overlay-center-full-height: 90%;
10
- }
11
- }
12
-
13
- @media (min-width: 461px) and (max-width: 1024px) {
14
- body {
15
- --overlay-center-full-width: 90%;
16
- --overlay-center-full-height: 90%;
17
- }
18
- }