underpost 2.7.1 → 2.7.2
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/.dockerignore +13 -13
- package/.env.development +7 -7
- package/.env.production +7 -7
- package/.env.test +7 -7
- package/.github/workflows/publish.yml +26 -0
- package/.nycrc +9 -9
- package/.prettierignore +12 -12
- package/.prettierrc +9 -9
- package/.vscode/extensions.json +72 -72
- package/.vscode/settings.json +100 -99
- package/Dockerfile +89 -89
- package/LICENSE +21 -21
- package/README.md +96 -96
- package/bin/db.js +172 -119
- package/bin/deploy.js +582 -661
- package/bin/dns.js +1 -1
- package/bin/file.js +92 -92
- package/bin/index.js +53 -53
- package/bin/install.js +398 -357
- package/bin/shortcut.js +44 -44
- package/bin/ssl.js +65 -64
- package/bin/util.js +182 -182
- package/bin/vs.js +35 -35
- package/conf.js +251 -249
- package/docker-compose.yml +67 -67
- package/jsconfig.json +7 -7
- package/jsdoc.json +32 -32
- package/nodemon.json +6 -6
- package/package.json +137 -132
- package/prometheus.yml +36 -36
- package/setup.sh +24 -24
- package/src/api/core/core.controller.js +69 -69
- package/src/api/core/core.model.js +11 -11
- package/src/api/core/core.router.js +23 -23
- package/src/api/core/core.service.js +29 -29
- package/src/api/crypto/crypto.controller.js +51 -51
- package/src/api/crypto/crypto.model.js +23 -23
- package/src/api/crypto/crypto.router.js +20 -20
- package/src/api/crypto/crypto.service.js +64 -64
- package/src/api/default/default.controller.js +69 -69
- package/src/api/default/default.model.js +20 -20
- package/src/api/default/default.router.js +23 -23
- package/src/api/default/default.service.js +31 -31
- package/src/api/file/file.controller.js +53 -51
- package/src/api/file/file.model.js +19 -19
- package/src/api/file/file.router.js +21 -20
- package/src/api/file/file.service.js +76 -70
- package/src/api/instance/instance.controller.js +69 -69
- package/src/api/instance/instance.model.js +36 -36
- package/src/api/instance/instance.router.js +33 -33
- package/src/api/instance/instance.service.js +48 -48
- package/src/api/test/test.controller.js +59 -59
- package/src/api/test/test.model.js +14 -14
- package/src/api/test/test.router.js +21 -21
- package/src/api/test/test.service.js +35 -35
- package/src/api/user/user.build.js +16 -0
- package/src/api/user/user.controller.js +70 -70
- package/src/api/user/user.model.js +65 -65
- package/src/api/user/user.router.js +345 -345
- package/src/api/user/user.service.js +479 -479
- package/src/api.js +23 -23
- package/src/client/Default.index.js +40 -40
- package/src/client/components/core/Account.js +290 -290
- package/src/client/components/core/AgGrid.js +160 -160
- package/src/client/components/core/Auth.js +19 -19
- package/src/client/components/core/Badge.js +32 -32
- package/src/client/components/core/BlockChain.js +41 -41
- package/src/client/components/core/Blog.js +9 -9
- package/src/client/components/core/BtnIcon.js +101 -94
- package/src/client/components/core/CalendarCore.js +458 -319
- package/src/client/components/core/Chat.js +64 -64
- package/src/client/components/core/ColorPalette.js +5267 -5267
- package/src/client/components/core/CommonJs.js +735 -732
- package/src/client/components/core/Content.js +193 -49
- package/src/client/components/core/Css.js +1064 -1027
- package/src/client/components/core/CssCore.js +817 -796
- package/src/client/components/core/D3Chart.js +44 -44
- package/src/client/components/core/Docs.js +229 -229
- package/src/client/components/core/DropDown.js +164 -164
- package/src/client/components/core/EventsUI.js +46 -54
- package/src/client/components/core/FileExplorer.js +699 -624
- package/src/client/components/core/FullScreen.js +45 -45
- package/src/client/components/core/Input.js +346 -259
- package/src/client/components/core/JoyStick.js +77 -77
- package/src/client/components/core/Keyboard.js +73 -73
- package/src/client/components/core/LoadingAnimation.js +179 -157
- package/src/client/components/core/LogIn.js +187 -181
- package/src/client/components/core/LogOut.js +58 -52
- package/src/client/components/core/Logger.js +26 -26
- package/src/client/components/core/Modal.js +1612 -1596
- package/src/client/components/core/NotificationManager.js +84 -84
- package/src/client/components/core/Panel.js +613 -413
- package/src/client/components/core/PanelForm.js +468 -0
- package/src/client/components/core/Polyhedron.js +162 -162
- package/src/client/components/core/Recover.js +204 -204
- package/src/client/components/core/Responsive.js +53 -53
- package/src/client/components/core/RichText.js +51 -27
- package/src/client/components/core/Router.js +76 -77
- package/src/client/components/core/Scroll.js +34 -0
- package/src/client/components/core/SignUp.js +125 -125
- package/src/client/components/core/SocketIo.js +72 -72
- package/src/client/components/core/Stream.js +113 -113
- package/src/client/components/core/ToggleSwitch.js +87 -87
- package/src/client/components/core/ToolTip.js +26 -26
- package/src/client/components/core/Translate.js +437 -408
- package/src/client/components/core/Validator.js +100 -100
- package/src/client/components/core/VanillaJs.js +460 -457
- package/src/client/components/core/Wallet.js +106 -106
- package/src/client/components/core/Webhook.js +25 -25
- package/src/client/components/core/Worker.js +272 -272
- package/src/client/components/default/CommonDefault.js +29 -29
- package/src/client/components/default/CssDefault.js +13 -13
- package/src/client/components/default/ElementsDefault.js +38 -38
- package/src/client/components/default/LogInDefault.js +41 -41
- package/src/client/components/default/LogOutDefault.js +28 -28
- package/src/client/components/default/MenuDefault.js +389 -389
- package/src/client/components/default/RoutesDefault.js +48 -48
- package/src/client/components/default/SettingsDefault.js +16 -16
- package/src/client/components/default/SignUpDefault.js +9 -9
- package/src/client/components/default/SocketIoDefault.js +54 -54
- package/src/client/components/default/TranslateDefault.js +7 -7
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/browserconfig.xml +11 -11
- package/src/client/public/default/manifest.webmanifest +68 -68
- package/src/client/public/default/plantuml/client-conf.svg +1 -0
- package/src/client/public/default/plantuml/client-schema.svg +1 -0
- package/src/client/public/default/plantuml/cron-conf.svg +1 -0
- package/src/client/public/default/plantuml/cron-schema.svg +1 -0
- package/src/client/public/default/plantuml/server-conf.svg +1 -0
- package/src/client/public/default/plantuml/server-schema.svg +1 -0
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -0
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -0
- package/src/client/public/default/sitemap +147 -147
- package/src/client/public/default/yandex-browser-manifest.json +8 -8
- package/src/client/public/doc/sitemap +147 -147
- package/src/client/public/test/sitemap +147 -147
- package/src/client/services/core/core.service.js +170 -152
- package/src/client/services/crypto/crypto.service.js +70 -70
- package/src/client/services/default/default.management.js +345 -345
- package/src/client/services/default/default.service.js +89 -89
- package/src/client/services/file/file.service.js +70 -70
- package/src/client/services/instance/instance.management.js +74 -74
- package/src/client/services/instance/instance.service.js +89 -89
- package/src/client/services/test/test.service.js +70 -70
- package/src/client/services/user/user.management.js +50 -50
- package/src/client/services/user/user.service.js +89 -89
- package/src/client/ssr/Render.js +16 -16
- package/src/client/ssr/body-components/CacheControl.js +114 -113
- package/src/client/ssr/body-components/DefaultSplashScreen.js +79 -79
- package/src/client/ssr/email-components/DefaultRecoverEmail.js +21 -21
- package/src/client/ssr/email-components/DefaultVerifyEmail.js +17 -17
- package/src/client/ssr/head-components/Css.js +241 -241
- package/src/client/ssr/head-components/DefaultScripts.js +3 -3
- package/src/client/ssr/head-components/Microdata.js +11 -11
- package/src/client/ssr/head-components/Production.js +1 -1
- package/src/client/ssr/head-components/PwaDefault.js +59 -59
- package/src/client/ssr/head-components/Seo.js +14 -14
- package/src/client/sw/default.sw.js +201 -201
- package/src/client/sw/template.sw.js +84 -84
- package/src/client.build.js +22 -22
- package/src/client.dev.js +21 -21
- package/src/cron.js +25 -25
- package/src/db/DataBaseProvider.js +34 -34
- package/src/db/mariadb/MariaDB.js +33 -33
- package/src/db/mongo/MongooseDB.js +46 -46
- package/src/dns.js +22 -22
- package/src/index.js +42 -29
- package/src/mailer/EmailRender.js +69 -69
- package/src/mailer/MailerProvider.js +96 -96
- package/src/proxy.js +22 -22
- package/src/runtime/lampp/Lampp.js +69 -44
- package/src/runtime/nginx/Nginx.js +3 -3
- package/src/runtime/xampp/Xampp.js +49 -49
- package/src/server/auth.js +235 -204
- package/src/server/backup.js +101 -94
- package/src/server/client-build-live.js +72 -72
- package/src/server/client-build.js +705 -699
- package/src/server/client-dev-server.js +60 -58
- package/src/server/client-formatted.js +48 -48
- package/src/server/client-icons.js +149 -150
- package/src/server/conf.js +860 -611
- package/src/server/dns.js +98 -98
- package/src/server/downloader.js +42 -42
- package/src/server/logger.js +180 -180
- package/src/server/network.js +122 -122
- package/src/server/peer.js +33 -33
- package/src/server/process.js +66 -66
- package/src/server/prompt-optimizer.js +28 -28
- package/src/server/proxy.js +118 -118
- package/src/server/runtime.js +444 -393
- package/src/server/ssl.js +109 -107
- package/src/server.js +25 -25
- package/src/ws/IoInterface.js +45 -45
- package/src/ws/IoServer.js +39 -39
- package/src/ws/core/channels/core.ws.chat.js +23 -23
- package/src/ws/core/channels/core.ws.mailer.js +35 -35
- package/src/ws/core/channels/core.ws.stream.js +31 -31
- package/src/ws/core/core.ws.connection.js +28 -28
- package/src/ws/core/core.ws.emit.js +14 -14
- package/src/ws/core/core.ws.server.js +24 -24
- package/src/ws/core/management/core.ws.chat.js +8 -8
- package/src/ws/core/management/core.ws.mailer.js +16 -16
- package/src/ws/core/management/core.ws.stream.js +8 -8
- package/src/ws/default/channels/default.ws.main.js +16 -16
- package/src/ws/default/default.ws.connection.js +22 -22
- package/src/ws/default/default.ws.emit.js +14 -14
- package/src/ws/default/default.ws.server.js +20 -20
- package/src/ws/default/management/default.ws.main.js +8 -8
- package/startup.js +11 -11
- package/supervisord-openssh-server.conf +4 -4
- package/test/api.test.js +60 -60
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import JoystickController from 'joystick-controller';
|
|
2
|
-
import { getDirection, getId } from './CommonJs.js';
|
|
3
|
-
import { loggerFactory } from './Logger.js';
|
|
4
|
-
import { append, getProxyPath, s } from './VanillaJs.js';
|
|
5
|
-
|
|
6
|
-
const logger = loggerFactory(import.meta);
|
|
7
|
-
|
|
8
|
-
const JoyStick = {
|
|
9
|
-
Tokens: {},
|
|
10
|
-
Render: async function (options = { id: '', callback: ({ joyDataSet }) => {}, callBackTime: 50 }) {
|
|
11
|
-
const { callback, callBackTime } = options;
|
|
12
|
-
const id = options.id ? options.id : getId(this.Tokens, 'joystick-');
|
|
13
|
-
this.Tokens[id] = { callback };
|
|
14
|
-
append(
|
|
15
|
-
'body',
|
|
16
|
-
html`
|
|
17
|
-
<style>
|
|
18
|
-
.dynamic-joystick-container-${id} {
|
|
19
|
-
/* border: 2px solid red; */
|
|
20
|
-
left: 5px;
|
|
21
|
-
bottom: 5px;
|
|
22
|
-
height: 200px;
|
|
23
|
-
width: 200px;
|
|
24
|
-
z-index: 3;
|
|
25
|
-
}
|
|
26
|
-
.joy-img-background-${id} {
|
|
27
|
-
width: 93%;
|
|
28
|
-
height: 93%;
|
|
29
|
-
opacity: 0.8;
|
|
30
|
-
}
|
|
31
|
-
.dynamic-joystick-container-${id}:hover .joy-img-background-${id} {
|
|
32
|
-
width: 97%;
|
|
33
|
-
height: 97%;
|
|
34
|
-
opacity: 1;
|
|
35
|
-
}
|
|
36
|
-
</style>
|
|
37
|
-
<div class="abs dynamic-joystick-container-${id}">
|
|
38
|
-
<img class="abs center joy-img-background-${id}" src="${getProxyPath()}assets/joy/joy_alpha.png" />
|
|
39
|
-
</div>
|
|
40
|
-
`,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
this.Tokens[id].instance = new JoystickController(
|
|
44
|
-
{
|
|
45
|
-
maxRange: 70,
|
|
46
|
-
level: 10,
|
|
47
|
-
radius: 70,
|
|
48
|
-
joystickRadius: 50,
|
|
49
|
-
opacity: 0.5,
|
|
50
|
-
// containerClass: 'joystick-container',
|
|
51
|
-
// controllerClass: 'joystick-controller',
|
|
52
|
-
// joystickClass: 'joystick',
|
|
53
|
-
distortion: true,
|
|
54
|
-
dynamicPosition: true,
|
|
55
|
-
dynamicPositionTarget: s(`.dynamic-joystick-container-${id}`),
|
|
56
|
-
mouseClickButton: 'ALL',
|
|
57
|
-
hideContextMenu: true,
|
|
58
|
-
// x: '120px',
|
|
59
|
-
// y: '120px',
|
|
60
|
-
},
|
|
61
|
-
(args = { x, y, leveledX, leveledY, distance, angle }) => {
|
|
62
|
-
const { angle } = args;
|
|
63
|
-
if (angle === 0) return (this.Tokens[id].joyDataSet = undefined);
|
|
64
|
-
const radians = parseFloat(angle);
|
|
65
|
-
const direction = getDirection({ radians });
|
|
66
|
-
this.Tokens[id].joyDataSet = { ...args, radians, direction };
|
|
67
|
-
// logger.info(this.Tokens[id].joyDataSet, id);
|
|
68
|
-
},
|
|
69
|
-
);
|
|
70
|
-
setInterval(() => {
|
|
71
|
-
if (!this.Tokens[id].joyDataSet || !this.Tokens[id].joyDataSet.direction) return;
|
|
72
|
-
this.Tokens[id].callback({ joyDataSet: this.Tokens[id].joyDataSet });
|
|
73
|
-
}, callBackTime);
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { JoyStick };
|
|
1
|
+
import JoystickController from 'joystick-controller';
|
|
2
|
+
import { getDirection, getId } from './CommonJs.js';
|
|
3
|
+
import { loggerFactory } from './Logger.js';
|
|
4
|
+
import { append, getProxyPath, s } from './VanillaJs.js';
|
|
5
|
+
|
|
6
|
+
const logger = loggerFactory(import.meta);
|
|
7
|
+
|
|
8
|
+
const JoyStick = {
|
|
9
|
+
Tokens: {},
|
|
10
|
+
Render: async function (options = { id: '', callback: ({ joyDataSet }) => {}, callBackTime: 50 }) {
|
|
11
|
+
const { callback, callBackTime } = options;
|
|
12
|
+
const id = options.id ? options.id : getId(this.Tokens, 'joystick-');
|
|
13
|
+
this.Tokens[id] = { callback };
|
|
14
|
+
append(
|
|
15
|
+
'body',
|
|
16
|
+
html`
|
|
17
|
+
<style>
|
|
18
|
+
.dynamic-joystick-container-${id} {
|
|
19
|
+
/* border: 2px solid red; */
|
|
20
|
+
left: 5px;
|
|
21
|
+
bottom: 5px;
|
|
22
|
+
height: 200px;
|
|
23
|
+
width: 200px;
|
|
24
|
+
z-index: 3;
|
|
25
|
+
}
|
|
26
|
+
.joy-img-background-${id} {
|
|
27
|
+
width: 93%;
|
|
28
|
+
height: 93%;
|
|
29
|
+
opacity: 0.8;
|
|
30
|
+
}
|
|
31
|
+
.dynamic-joystick-container-${id}:hover .joy-img-background-${id} {
|
|
32
|
+
width: 97%;
|
|
33
|
+
height: 97%;
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
<div class="abs dynamic-joystick-container-${id}">
|
|
38
|
+
<img class="abs center joy-img-background-${id}" src="${getProxyPath()}assets/joy/joy_alpha.png" />
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
this.Tokens[id].instance = new JoystickController(
|
|
44
|
+
{
|
|
45
|
+
maxRange: 70,
|
|
46
|
+
level: 10,
|
|
47
|
+
radius: 70,
|
|
48
|
+
joystickRadius: 50,
|
|
49
|
+
opacity: 0.5,
|
|
50
|
+
// containerClass: 'joystick-container',
|
|
51
|
+
// controllerClass: 'joystick-controller',
|
|
52
|
+
// joystickClass: 'joystick',
|
|
53
|
+
distortion: true,
|
|
54
|
+
dynamicPosition: true,
|
|
55
|
+
dynamicPositionTarget: s(`.dynamic-joystick-container-${id}`),
|
|
56
|
+
mouseClickButton: 'ALL',
|
|
57
|
+
hideContextMenu: true,
|
|
58
|
+
// x: '120px',
|
|
59
|
+
// y: '120px',
|
|
60
|
+
},
|
|
61
|
+
(args = { x, y, leveledX, leveledY, distance, angle }) => {
|
|
62
|
+
const { angle } = args;
|
|
63
|
+
if (angle === 0) return (this.Tokens[id].joyDataSet = undefined);
|
|
64
|
+
const radians = parseFloat(angle);
|
|
65
|
+
const direction = getDirection({ radians });
|
|
66
|
+
this.Tokens[id].joyDataSet = { ...args, radians, direction };
|
|
67
|
+
// logger.info(this.Tokens[id].joyDataSet, id);
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
setInterval(() => {
|
|
71
|
+
if (!this.Tokens[id].joyDataSet || !this.Tokens[id].joyDataSet.direction) return;
|
|
72
|
+
this.Tokens[id].callback({ joyDataSet: this.Tokens[id].joyDataSet });
|
|
73
|
+
}, callBackTime);
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { JoyStick };
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { cap, getId } from './CommonJs.js';
|
|
2
|
-
|
|
3
|
-
const Keyboard = {
|
|
4
|
-
ActiveKey: {},
|
|
5
|
-
Event: {},
|
|
6
|
-
Init: async function (options = { callBackTime: 50 }) {
|
|
7
|
-
const { callBackTime } = options;
|
|
8
|
-
window.onkeydown = (e = new KeyboardEvent()) => {
|
|
9
|
-
this.ActiveKey[e.key] = true;
|
|
10
|
-
// e.composedPath()
|
|
11
|
-
// if (['Tab'].includes(e.key)) {
|
|
12
|
-
// e.preventDefault();
|
|
13
|
-
// e.stopPropagation();
|
|
14
|
-
// e.stopImmediatePropagation();
|
|
15
|
-
// }
|
|
16
|
-
};
|
|
17
|
-
window.onkeyup = (e = new KeyboardEvent()) => {
|
|
18
|
-
delete this.ActiveKey[e.key];
|
|
19
|
-
};
|
|
20
|
-
setInterval(() => {
|
|
21
|
-
Object.keys(this.Event).map((key) => {
|
|
22
|
-
Object.keys(this.ActiveKey).map((activeKey) => {
|
|
23
|
-
if (activeKey in this.Event[key]) this.Event[key][activeKey]();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}, callBackTime);
|
|
27
|
-
},
|
|
28
|
-
instanceMultiPressKeyTokens: {},
|
|
29
|
-
instanceMultiPressKey: (options = { keys: [], id, timePressDelay, eventCallBack: () => {} }) => {
|
|
30
|
-
if (typeof options.keys[0] === 'string') options.keys[0] = [options.keys[0]];
|
|
31
|
-
if (!options.id) options.id = getId(Keyboard.instanceMultiPressKeyTokens, 'key-press-');
|
|
32
|
-
if (!options.timePressDelay) options.timePressDelay = 500;
|
|
33
|
-
const { id, timePressDelay, keys, eventCallBack } = options;
|
|
34
|
-
Keyboard.instanceMultiPressKeyTokens[id] = { ...options };
|
|
35
|
-
|
|
36
|
-
let indexCombined = -1;
|
|
37
|
-
for (const combinedKeys of keys) {
|
|
38
|
-
indexCombined++;
|
|
39
|
-
const privateIndexCombined = indexCombined;
|
|
40
|
-
const multiPressKey = {};
|
|
41
|
-
const triggerMultiPressKey = () => {
|
|
42
|
-
for (const key of Object.keys(multiPressKey)) {
|
|
43
|
-
if (!multiPressKey[key].press) return;
|
|
44
|
-
}
|
|
45
|
-
eventCallBack();
|
|
46
|
-
};
|
|
47
|
-
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`] = {};
|
|
48
|
-
for (const key of combinedKeys) {
|
|
49
|
-
multiPressKey[key] = {
|
|
50
|
-
press: false,
|
|
51
|
-
trigger: function () {
|
|
52
|
-
if (!multiPressKey[key].press) {
|
|
53
|
-
multiPressKey[key].press = true;
|
|
54
|
-
triggerMultiPressKey();
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
multiPressKey[key].press = false;
|
|
57
|
-
}, timePressDelay);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][key] = multiPressKey[key].trigger;
|
|
63
|
-
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][key.toLowerCase()] =
|
|
64
|
-
multiPressKey[key].trigger;
|
|
65
|
-
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][key.toUpperCase()] =
|
|
66
|
-
multiPressKey[key].trigger;
|
|
67
|
-
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][cap(key)] = multiPressKey[key].trigger;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export { Keyboard };
|
|
1
|
+
import { cap, getId } from './CommonJs.js';
|
|
2
|
+
|
|
3
|
+
const Keyboard = {
|
|
4
|
+
ActiveKey: {},
|
|
5
|
+
Event: {},
|
|
6
|
+
Init: async function (options = { callBackTime: 50 }) {
|
|
7
|
+
const { callBackTime } = options;
|
|
8
|
+
window.onkeydown = (e = new KeyboardEvent()) => {
|
|
9
|
+
this.ActiveKey[e.key] = true;
|
|
10
|
+
// e.composedPath()
|
|
11
|
+
// if (['Tab'].includes(e.key)) {
|
|
12
|
+
// e.preventDefault();
|
|
13
|
+
// e.stopPropagation();
|
|
14
|
+
// e.stopImmediatePropagation();
|
|
15
|
+
// }
|
|
16
|
+
};
|
|
17
|
+
window.onkeyup = (e = new KeyboardEvent()) => {
|
|
18
|
+
delete this.ActiveKey[e.key];
|
|
19
|
+
};
|
|
20
|
+
setInterval(() => {
|
|
21
|
+
Object.keys(this.Event).map((key) => {
|
|
22
|
+
Object.keys(this.ActiveKey).map((activeKey) => {
|
|
23
|
+
if (activeKey in this.Event[key]) this.Event[key][activeKey]();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}, callBackTime);
|
|
27
|
+
},
|
|
28
|
+
instanceMultiPressKeyTokens: {},
|
|
29
|
+
instanceMultiPressKey: (options = { keys: [], id, timePressDelay, eventCallBack: () => {} }) => {
|
|
30
|
+
if (typeof options.keys[0] === 'string') options.keys[0] = [options.keys[0]];
|
|
31
|
+
if (!options.id) options.id = getId(Keyboard.instanceMultiPressKeyTokens, 'key-press-');
|
|
32
|
+
if (!options.timePressDelay) options.timePressDelay = 500;
|
|
33
|
+
const { id, timePressDelay, keys, eventCallBack } = options;
|
|
34
|
+
Keyboard.instanceMultiPressKeyTokens[id] = { ...options };
|
|
35
|
+
|
|
36
|
+
let indexCombined = -1;
|
|
37
|
+
for (const combinedKeys of keys) {
|
|
38
|
+
indexCombined++;
|
|
39
|
+
const privateIndexCombined = indexCombined;
|
|
40
|
+
const multiPressKey = {};
|
|
41
|
+
const triggerMultiPressKey = () => {
|
|
42
|
+
for (const key of Object.keys(multiPressKey)) {
|
|
43
|
+
if (!multiPressKey[key].press) return;
|
|
44
|
+
}
|
|
45
|
+
eventCallBack();
|
|
46
|
+
};
|
|
47
|
+
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`] = {};
|
|
48
|
+
for (const key of combinedKeys) {
|
|
49
|
+
multiPressKey[key] = {
|
|
50
|
+
press: false,
|
|
51
|
+
trigger: function () {
|
|
52
|
+
if (!multiPressKey[key].press) {
|
|
53
|
+
multiPressKey[key].press = true;
|
|
54
|
+
triggerMultiPressKey();
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
multiPressKey[key].press = false;
|
|
57
|
+
}, timePressDelay);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][key] = multiPressKey[key].trigger;
|
|
63
|
+
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][key.toLowerCase()] =
|
|
64
|
+
multiPressKey[key].trigger;
|
|
65
|
+
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][key.toUpperCase()] =
|
|
66
|
+
multiPressKey[key].trigger;
|
|
67
|
+
Keyboard.Event[`instanceMultiPressKey-${id}-${privateIndexCombined}`][cap(key)] = multiPressKey[key].trigger;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { Keyboard };
|
|
@@ -1,157 +1,179 @@
|
|
|
1
|
-
import { CoreService } from '../../services/core/core.service.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{ time:
|
|
37
|
-
{ time:
|
|
38
|
-
{ time:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
s(`.${id}`)
|
|
52
|
-
s(`.${id}`).style.
|
|
53
|
-
|
|
54
|
-
setTimeout(() => s(`.${id}`).
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
getId: (id) => `spinner-progress-${id.slice(1)}`,
|
|
60
|
-
|
|
61
|
-
if (!
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
s(
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
1
|
+
import { CoreService } from '../../services/core/core.service.js';
|
|
2
|
+
import { BtnIcon } from './BtnIcon.js';
|
|
3
|
+
import { s4 } from './CommonJs.js';
|
|
4
|
+
import { darkTheme, renderCssAttr } from './Css.js';
|
|
5
|
+
import { loggerFactory } from './Logger.js';
|
|
6
|
+
import { append, getAllChildNodes, getProxyPath, htmls, s } from './VanillaJs.js';
|
|
7
|
+
|
|
8
|
+
const logger = loggerFactory(import.meta);
|
|
9
|
+
|
|
10
|
+
const LoadingAnimation = {
|
|
11
|
+
bar: {
|
|
12
|
+
tokens: {},
|
|
13
|
+
getId: (id) => `bar-progress-${id.slice(1)}`,
|
|
14
|
+
play: async function (container) {
|
|
15
|
+
const id = this.getId(container);
|
|
16
|
+
const idEvent = s4() + s4() + s4();
|
|
17
|
+
this.tokens[container] = `${idEvent}`;
|
|
18
|
+
// diagonal-bar-background-animation
|
|
19
|
+
// #6d68ff #790079
|
|
20
|
+
append(
|
|
21
|
+
'body',
|
|
22
|
+
html`
|
|
23
|
+
<div
|
|
24
|
+
class="fix progress-bar box-shadow ${id}"
|
|
25
|
+
style="left: -100%; background: ${darkTheme
|
|
26
|
+
? LoadingAnimation.darkColor
|
|
27
|
+
? LoadingAnimation.darkColor
|
|
28
|
+
: `#c9c9c9`
|
|
29
|
+
: LoadingAnimation.lightColor
|
|
30
|
+
? LoadingAnimation.lightColor
|
|
31
|
+
: `#515151`};"
|
|
32
|
+
></div>
|
|
33
|
+
`,
|
|
34
|
+
);
|
|
35
|
+
for (const frame of [
|
|
36
|
+
{ time: 500, value: 35 },
|
|
37
|
+
{ time: 1250, value: 15 },
|
|
38
|
+
{ time: 3000, value: 5 },
|
|
39
|
+
{ time: 5000, value: 1 },
|
|
40
|
+
])
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
if (this.tokens[container] === idEvent && s(`.${id}`)) {
|
|
43
|
+
s(`.${id}`).style.left = `-${frame.value}%`;
|
|
44
|
+
// const percentageRender = html`${100 - frame.value}%`;
|
|
45
|
+
}
|
|
46
|
+
}, frame.time);
|
|
47
|
+
},
|
|
48
|
+
stop: function (container) {
|
|
49
|
+
const id = this.getId(container);
|
|
50
|
+
delete this.tokens[container];
|
|
51
|
+
if (!s(`.${id}`)) return;
|
|
52
|
+
s(`.${id}`).style.left = '0%';
|
|
53
|
+
s(`.${id}`).style.opacity = 1;
|
|
54
|
+
setTimeout(() => (s(`.${id}`).style.opacity = 0));
|
|
55
|
+
setTimeout(() => s(`.${id}`).remove(), 400);
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
spinner: {
|
|
59
|
+
getId: (id) => `spinner-progress-${id.slice(1)}`,
|
|
60
|
+
play: async function (container, spinner) {
|
|
61
|
+
if (!s(container)) return;
|
|
62
|
+
const id = this.getId(container);
|
|
63
|
+
|
|
64
|
+
let render;
|
|
65
|
+
switch (spinner) {
|
|
66
|
+
case 'dual-ring':
|
|
67
|
+
render = html`<div class="lds-dual-ring"></div>`;
|
|
68
|
+
break;
|
|
69
|
+
case 'dual-ring-mini':
|
|
70
|
+
default:
|
|
71
|
+
render = html`<div class="lds-dual-ring-mini"></div>`;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const style = {
|
|
76
|
+
'text-align': 'center',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
if (s(container).classList) {
|
|
80
|
+
const classes = Array.from(s(container).classList);
|
|
81
|
+
if (classes.find((e) => e.match('management-table-btn-mini'))) {
|
|
82
|
+
style.top = '-2px';
|
|
83
|
+
style.left = '-2px';
|
|
84
|
+
} else if (classes.find((e) => e.match('action-bar-box'))) {
|
|
85
|
+
style.top = '-30px';
|
|
86
|
+
style.left = '-12px';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
append(
|
|
91
|
+
container,
|
|
92
|
+
html`
|
|
93
|
+
<div
|
|
94
|
+
class="in ${id}"
|
|
95
|
+
style="${renderCssAttr({
|
|
96
|
+
style,
|
|
97
|
+
})}"
|
|
98
|
+
>
|
|
99
|
+
${render}
|
|
100
|
+
</div>
|
|
101
|
+
`,
|
|
102
|
+
);
|
|
103
|
+
const label = BtnIcon.findLabel(s(container));
|
|
104
|
+
if (label) label.classList.add('hide');
|
|
105
|
+
},
|
|
106
|
+
stop: function (container) {
|
|
107
|
+
const id = this.getId(container);
|
|
108
|
+
if (!s(`.${id}`)) return;
|
|
109
|
+
s(`.${id}`).remove();
|
|
110
|
+
const label = BtnIcon.findLabel(s(container));
|
|
111
|
+
if (label) label.classList.remove('hide');
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
img: {
|
|
115
|
+
tokens: {},
|
|
116
|
+
load: function ({ key, src, classes, style }) {
|
|
117
|
+
this.tokens[key] = { src, classes, style };
|
|
118
|
+
},
|
|
119
|
+
play: function (container, key) {
|
|
120
|
+
append(
|
|
121
|
+
container,
|
|
122
|
+
html`<img
|
|
123
|
+
${this.tokens[key].classes ? `class="${this.tokens[key].classes}"` : ''}
|
|
124
|
+
${this.tokens[key].style ? `style="${this.tokens[key].style}"` : ''}
|
|
125
|
+
src="${getProxyPath()}${this.tokens[key].src}"
|
|
126
|
+
/>`,
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
barLevel: {
|
|
131
|
+
append: () => {
|
|
132
|
+
s(`.ssr-blink-bar`).classList.remove('ssr-blink-bar');
|
|
133
|
+
append('.ssr-loading-bar', html`<div class="ssr-loading-bar-block ssr-blink-bar"></div>`);
|
|
134
|
+
},
|
|
135
|
+
clear: () => {
|
|
136
|
+
htmls('.ssr-loading-bar', html`<div class="ssr-loading-bar-block ssr-blink-bar"></div>`);
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
removeSplashScreen: function () {
|
|
140
|
+
if (s(`.clean-cache-container`)) s(`.clean-cache-container`).style.display = 'none';
|
|
141
|
+
if (s('.ssr-background'))
|
|
142
|
+
setTimeout(() => {
|
|
143
|
+
s('.ssr-background').style.opacity = 0;
|
|
144
|
+
setTimeout(async () => {
|
|
145
|
+
s('.ssr-background').style.display = 'none';
|
|
146
|
+
}, 300);
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
lightColor: null,
|
|
150
|
+
setLightColor: function (color) {
|
|
151
|
+
this.lightColor = color;
|
|
152
|
+
},
|
|
153
|
+
darkColor: null,
|
|
154
|
+
setDarkColor: function (color) {
|
|
155
|
+
this.darkColor = color;
|
|
156
|
+
},
|
|
157
|
+
RenderCurrentSrcLoad: function (event) {
|
|
158
|
+
if (s(`.ssr-loading-info`)) {
|
|
159
|
+
let nameSrcLoad = event.data.path;
|
|
160
|
+
if (nameSrcLoad) {
|
|
161
|
+
if (nameSrcLoad.match('assets'))
|
|
162
|
+
nameSrcLoad =
|
|
163
|
+
location.hostname +
|
|
164
|
+
location.pathname +
|
|
165
|
+
(location.pathname[location.pathname.length - 1] !== '/' ? '/' : '') +
|
|
166
|
+
'assets';
|
|
167
|
+
else if (!nameSrcLoad.match('api')) nameSrcLoad = undefined;
|
|
168
|
+
if (nameSrcLoad)
|
|
169
|
+
htmls(
|
|
170
|
+
`.ssr-loading-info`,
|
|
171
|
+
html`<span style="color: white">Download </span> <br />
|
|
172
|
+
<br />
|
|
173
|
+
...${nameSrcLoad.slice(-30)}`,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
export { LoadingAnimation };
|