Compare commits

..
10 changed files with 453 additions and 420 deletions

No files matched your search

+3 -6
View File
@@ -108,7 +108,6 @@ declare module '@vue/runtime-core' {
Ipv4SubnetCalculator: typeof import('./src/tools/ipv4-subnet-calculator/ipv4-subnet-calculator.vue')['default']
Ipv6UlaGenerator: typeof import('./src/tools/ipv6-ula-generator/ipv6-ula-generator.vue')['default']
JsonDiff: typeof import('./src/tools/json-diff/json-diff.vue')['default']
JsonEditor: typeof import('./src/tools/json-editor/json-editor.vue')['default']
JsonMinify: typeof import('./src/tools/json-minify/json-minify.vue')['default']
JsonToCsv: typeof import('./src/tools/json-to-csv/json-to-csv.vue')['default']
JsonToToml: typeof import('./src/tools/json-to-toml/json-to-toml.vue')['default']
@@ -136,9 +135,6 @@ declare module '@vue/runtime-core' {
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDivider: typeof import('naive-ui')['NDivider']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NForm: typeof import('naive-ui')['NForm']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NH1: typeof import('naive-ui')['NH1']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
@@ -147,7 +143,8 @@ declare module '@vue/runtime-core' {
NMenu: typeof import('naive-ui')['NMenu']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSlider: typeof import('naive-ui')['NSlider']
NSpin: typeof import('naive-ui')['NSpin']
NSpace: typeof import('naive-ui')['NSpace']
NStatistic: typeof import('naive-ui')['NStatistic']
NSwitch: typeof import('naive-ui')['NSwitch']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
@@ -166,7 +163,7 @@ declare module '@vue/runtime-core' {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
SlaCalculator: typeof import('./src/tools/sla-calculator/sla-calculator.vue')['default']
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
+4 -2
View File
@@ -42,6 +42,7 @@
"@tiptap/pm": "2.1.6",
"@tiptap/starter-kit": "2.1.6",
"@tiptap/vue-3": "2.0.3",
"@types/big.js": "^6.2.2",
"@types/figlet": "^1.5.8",
"@types/markdown-it": "^13.0.7",
"@vicons/material": "^0.12.0",
@@ -50,6 +51,7 @@
"@vueuse/head": "^1.0.0",
"@vueuse/router": "^10.0.0",
"bcryptjs": "^2.4.3",
"big.js": "^6.2.2",
"change-case": "^4.1.2",
"colord": "^2.9.3",
"composerize-ts": "^0.6.2",
@@ -68,7 +70,6 @@
"iarna-toml-esm": "^3.0.5",
"ibantools": "^4.3.3",
"js-base64": "^3.7.6",
"json-editor-vue": "^0.16.0",
"json5": "^2.2.3",
"jwt-decode": "^3.1.2",
"libphonenumber-js": "^1.10.28",
@@ -82,9 +83,11 @@
"netmask": "^2.0.2",
"node-forge": "^1.3.1",
"oui-data": "^1.0.10",
"parse-duration": "^1.1.0",
"pdf-signature-reader": "^1.4.2",
"pinia": "^2.0.34",
"plausible-tracker": "^0.3.8",
"pretty-ms": "^9.1.0",
"qrcode": "^1.5.1",
"randexp": "^0.5.3",
"sql-formatter": "^13.0.0",
@@ -93,7 +96,6 @@
"unicode-emoji-json": "^0.4.0",
"unplugin-auto-import": "^0.16.4",
"uuid": "^9.0.0",
"vanilla-jsoneditor": "^0.23.8",
"vue": "^3.3.4",
"vue-i18n": "^9.9.1",
"vue-router": "^4.1.6",
+41 -343
View File
@@ -26,6 +26,9 @@ dependencies:
'@tiptap/vue-3':
specifier: 2.0.3
version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/pm@2.1.6)(vue@3.3.4)
'@types/big.js':
specifier: ^6.2.2
version: 6.2.2
'@types/figlet':
specifier: ^1.5.8
version: 1.5.8
@@ -50,6 +53,9 @@ dependencies:
bcryptjs:
specifier: ^2.4.3
version: 2.4.3
big.js:
specifier: ^6.2.2
version: 6.2.2
change-case:
specifier: ^4.1.2
version: 4.1.2
@@ -104,9 +110,6 @@ dependencies:
js-base64:
specifier: ^3.7.6
version: 3.7.7
json-editor-vue:
specifier: ^0.16.0
version: 0.16.0(@lezer/common@1.2.1)(vue@3.3.4)
json5:
specifier: ^2.2.3
version: 2.2.3
@@ -146,6 +149,9 @@ dependencies:
oui-data:
specifier: ^1.0.10
version: 1.0.10
parse-duration:
specifier: ^1.1.0
version: 1.1.0
pdf-signature-reader:
specifier: ^1.4.2
version: 1.4.2
@@ -155,6 +161,9 @@ dependencies:
plausible-tracker:
specifier: ^0.3.8
version: 0.3.8
pretty-ms:
specifier: ^9.1.0
version: 9.1.0
qrcode:
specifier: ^1.5.1
version: 1.5.1
@@ -179,9 +188,6 @@ dependencies:
uuid:
specifier: ^9.0.0
version: 9.0.0
vanilla-jsoneditor:
specifier: ^0.23.8
version: 0.23.8(@lezer/common@1.2.1)
vue:
specifier: ^3.3.4
version: 3.3.4
@@ -1925,75 +1931,6 @@ packages:
'@babel/helper-validator-identifier': 7.22.20
to-fast-properties: 2.0.0
/@codemirror/autocomplete@6.18.1(@codemirror/language@6.10.3)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1):
resolution: {integrity: sha512-iWHdj/B1ethnHRTwZj+C1obmmuCzquH29EbcKr0qIjA9NfDeBDJ7vs+WOHsFeLeflE4o+dHfYndJloMKHUkWUA==}
peerDependencies:
'@codemirror/language': ^6.0.0
'@codemirror/state': ^6.0.0
'@codemirror/view': ^6.0.0
'@lezer/common': ^1.0.0
dependencies:
'@codemirror/language': 6.10.3
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
dev: false
/@codemirror/commands@6.6.2:
resolution: {integrity: sha512-Fq7eWOl1Rcbrfn6jD8FPCj9Auaxdm5nIK5RYOeW7ughnd/rY5AmPg6b+CfsG39ZHdwiwe8lde3q8uR7CF5S0yQ==}
dependencies:
'@codemirror/language': 6.10.3
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
dev: false
/@codemirror/lang-json@6.0.1:
resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==}
dependencies:
'@codemirror/language': 6.10.3
'@lezer/json': 1.0.2
dev: false
/@codemirror/language@6.10.3:
resolution: {integrity: sha512-kDqEU5sCP55Oabl6E7m5N+vZRoc0iWqgDVhEKifcHzPzjqCegcO4amfrYVL9PmPZpl4G0yjkpTpUO/Ui8CzO8A==}
dependencies:
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
style-mod: 4.1.2
dev: false
/@codemirror/lint@6.8.1:
resolution: {integrity: sha512-IZ0Y7S4/bpaunwggW2jYqwLuHj0QtESf5xcROewY6+lDNwZ/NzvR4t+vpYgg9m7V8UXLPYqG+lu3DF470E5Oxg==}
dependencies:
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
crelt: 1.0.6
dev: false
/@codemirror/search@6.5.6:
resolution: {integrity: sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==}
dependencies:
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
crelt: 1.0.6
dev: false
/@codemirror/state@6.4.1:
resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==}
dev: false
/@codemirror/view@6.33.0:
resolution: {integrity: sha512-AroaR3BvnjRW8fiZBalAaK+ZzB5usGgI014YKElYZvQdNH5ZIidHlO+cyf/2rWzyBFRkvG6VhiXeAEbC53P2YQ==}
dependencies:
'@codemirror/state': 6.4.1
style-mod: 4.1.2
w3c-keyname: 2.2.8
dev: false
/@css-render/plugin-bem@0.15.12(css-render@0.15.12):
resolution: {integrity: sha512-Lq2jSOZn+wYQtsyaFj6QRz2EzAnd3iW5fZeHO1WSXQdVYwvwGX0ZiH3X2JQgtgYLT1yeGtrwrqJdNdMEUD2xTw==}
peerDependencies:
@@ -2249,25 +2186,6 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@fortawesome/fontawesome-common-types@6.6.0:
resolution: {integrity: sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw==}
engines: {node: '>=6'}
dev: false
/@fortawesome/free-regular-svg-icons@6.6.0:
resolution: {integrity: sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==}
engines: {node: '>=6'}
dependencies:
'@fortawesome/fontawesome-common-types': 6.6.0
dev: false
/@fortawesome/free-solid-svg-icons@6.6.0:
resolution: {integrity: sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA==}
engines: {node: '>=6'}
dependencies:
'@fortawesome/fontawesome-common-types': 6.6.0
dev: false
/@humanwhocodes/config-array@0.11.10:
resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
engines: {node: '>=10.10.0'}
@@ -2467,30 +2385,6 @@ packages:
resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
dev: false
/@lezer/common@1.2.1:
resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==}
dev: false
/@lezer/highlight@1.2.1:
resolution: {integrity: sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==}
dependencies:
'@lezer/common': 1.2.1
dev: false
/@lezer/json@1.0.2:
resolution: {integrity: sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==}
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
dev: false
/@lezer/lr@1.4.2:
resolution: {integrity: sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==}
dependencies:
'@lezer/common': 1.2.1
dev: false
/@linaria/core@4.2.9:
resolution: {integrity: sha512-ELcu37VNVOT/PU0L6WDIN+aLzNFyJrqoBYT0CucGOCAmODbojUMCv8oJYRbWzA3N34w1t199dN4UFdfRWFG2rg==}
engines: {node: ^12.16.0 || >=13.7.0}
@@ -2652,18 +2546,6 @@ packages:
type-fest: 2.19.0
dev: false
/@replit/codemirror-indentation-markers@6.5.3(@codemirror/language@6.10.3)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0):
resolution: {integrity: sha512-hL5Sfvw3C1vgg7GolLe/uxX5T3tmgOA3ZzqlMv47zjU1ON51pzNWiVbS22oh6crYhtVhv8b3gdXwoYp++2ilHw==}
peerDependencies:
'@codemirror/language': ^6.0.0
'@codemirror/state': ^6.0.0
'@codemirror/view': ^6.0.0
dependencies:
'@codemirror/language': 6.10.3
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
dev: false
/@rollup/plugin-babel@5.3.1(@babel/core@7.23.2)(rollup@2.79.1):
resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==}
engines: {node: '>= 10.0.0'}
@@ -2770,10 +2652,6 @@ packages:
escape-string-regexp: 5.0.0
dev: false
/@sphinxxxx/color-conversion@2.2.2:
resolution: {integrity: sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==}
dev: false
/@surma/rollup-plugin-off-main-thread@2.2.3:
resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==}
dependencies:
@@ -3054,6 +2932,10 @@ packages:
resolution: {integrity: sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==}
dev: true
/@types/big.js@6.2.2:
resolution: {integrity: sha512-e2cOW9YlVzFY2iScnGBBkplKsrn2CsObHQ2Hiw4V1sSyiGbgWL8IyqE3zFi1Pt5o1pdAtYkDAIsF3KKUPjdzaA==}
dev: false
/@types/chai-subset@1.3.3:
resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==}
dependencies:
@@ -3081,10 +2963,6 @@ packages:
/@types/estree@1.0.0:
resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
/@types/estree@1.0.6:
resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
dev: false
/@types/figlet@1.5.8:
resolution: {integrity: sha512-G22AUvy4Tl95XLE7jmUM8s8mKcoz+Hr+Xm9W90gJsppJq9f9tHvOGkrpn4gRX0q/cLtBdNkWtWCKDg2UDZoZvQ==}
dev: false
@@ -4251,15 +4129,6 @@ packages:
uri-js: 4.4.1
dev: true
/ajv@8.17.1:
resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==}
dependencies:
fast-deep-equal: 3.1.3
fast-uri: 3.0.1
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
dev: false
/ansi-colors@4.1.3:
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
engines: {node: '>=6'}
@@ -4301,11 +4170,6 @@ packages:
/argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
/aria-query@5.3.2:
resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==}
engines: {node: '>= 0.4'}
dev: false
/array-buffer-byte-length@1.0.0:
resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==}
dependencies:
@@ -4357,11 +4221,6 @@ packages:
engines: {node: '>= 0.4'}
dev: true
/axobject-query@4.1.0:
resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==}
engines: {node: '>= 0.4'}
dev: false
/babel-merge@3.0.0(@babel/core@7.23.2):
resolution: {integrity: sha512-eBOBtHnzt9xvnjpYNI5HmaPp/b2vMveE5XggzqHnQeHJ8mFIBrBv6WZEVIj5jJ2uwTItkqKo9gWzEEcBxEq0yw==}
peerDependencies:
@@ -4418,6 +4277,10 @@ packages:
resolution: {integrity: sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==}
dev: false
/big.js@6.2.2:
resolution: {integrity: sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==}
dev: false
/binary-extensions@2.2.0:
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
engines: {node: '>=8'}
@@ -4659,13 +4522,6 @@ packages:
optionalDependencies:
fsevents: 2.3.3
/chokidar@4.0.1:
resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==}
engines: {node: '>= 14.16.0'}
dependencies:
readdirp: 4.0.1
dev: false
/ci-info@3.8.0:
resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==}
engines: {node: '>=8'}
@@ -4703,28 +4559,6 @@ packages:
engines: {node: '>=0.8'}
dev: true
/code-red@1.0.4:
resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==}
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
'@types/estree': 1.0.6
acorn: 8.11.2
estree-walker: 3.0.3
periscopic: 3.1.0
dev: false
/codemirror-wrapped-line-indent@1.0.8(@codemirror/language@6.10.3)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0):
resolution: {integrity: sha512-5UwuHCz4oAZuvot1DbfFxSxJacTESdNGa/KpJD7HfpVpDAJdgB1vV9OG4b4pkJqPWuOfIpFLTQEKS85kTpV+XA==}
peerDependencies:
'@codemirror/language': ^6.9.0
'@codemirror/state': ^6.2.1
'@codemirror/view': ^6.17.1
dependencies:
'@codemirror/language': 6.10.3
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
dev: false
/color-convert@1.9.3:
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
dependencies:
@@ -4908,6 +4742,7 @@ packages:
dependencies:
mdn-data: 2.0.30
source-map-js: 1.0.2
dev: true
/css-what@6.1.0:
resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==}
@@ -5091,11 +4926,6 @@ packages:
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dev: true
/diff-sequences@29.6.3:
resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dev: false
/dijkstrajs@1.0.2:
resolution: {integrity: sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg==}
dev: false
@@ -5751,12 +5581,6 @@ packages:
/estree-walker@2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
/estree-walker@3.0.3:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
dependencies:
'@types/estree': 1.0.6
dev: false
/esutils@2.0.3:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
@@ -5832,10 +5656,6 @@ packages:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
dev: true
/fast-uri@3.0.1:
resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==}
dev: false
/fastq@1.15.0:
resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
dependencies:
@@ -6378,14 +6198,6 @@ packages:
dev: true
optional: true
/immutable-json-patch@6.0.1:
resolution: {integrity: sha512-BHL/cXMjwFZlTOffiWNdY8ZTvNyYLrutCnWxrcKPHr5FqpAb6vsO6WWSPnVSys3+DruFN6lhHJJPHi8uELQL5g==}
dev: false
/immutable@4.3.7:
resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==}
dev: false
/import-fresh@3.3.0:
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
engines: {node: '>=6'}
@@ -6619,12 +6431,6 @@ packages:
engines: {node: '>=0.10.0'}
dev: false
/is-reference@3.0.2:
resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==}
dependencies:
'@types/estree': 1.0.6
dev: false
/is-regex@1.1.4:
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'}
@@ -6740,11 +6546,6 @@ packages:
hasBin: true
dev: true
/jmespath@0.16.0:
resolution: {integrity: sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==}
engines: {node: '>= 0.6.0'}
dev: false
/js-base64@3.7.7:
resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==}
dev: false
@@ -6838,23 +6639,6 @@ packages:
hasBin: true
dev: true
/json-editor-vue@0.16.0(@lezer/common@1.2.1)(vue@3.3.4):
resolution: {integrity: sha512-8axbIR1DD6cf/AAXDkEYkPHDbWzEQDP762j2GiX3fFnHmE5+RzkcCFV2J/TGr6Mlw9sdZpQVMPHtt+7qYJ8Xyg==}
requiresBuild: true
peerDependencies:
'@vue/composition-api': '>=1'
vue: 2||3
peerDependenciesMeta:
'@vue/composition-api':
optional: true
dependencies:
vanilla-jsoneditor: 0.23.8(@lezer/common@1.2.1)
vue: 3.3.4
vue-demi: 0.14.10(vue@3.3.4)
transitivePeerDependencies:
- '@lezer/common'
dev: false
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: true
@@ -6865,15 +6649,12 @@ packages:
/json-schema-traverse@1.0.0:
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
dev: true
/json-schema@0.4.0:
resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
dev: true
/json-source-map@0.6.1:
resolution: {integrity: sha512-1QoztHPsMQqhDq0hlXY5ZqcEdUzxQEIxgFkKl4WUp2pgShObl+9ovi4kRh2TfvAfxAoHOJ9vIMEqk3k4iex7tg==}
dev: false
/json-stable-stringify-without-jsonify@1.0.1:
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
dev: true
@@ -6908,11 +6689,6 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/jsonrepair@3.8.1:
resolution: {integrity: sha512-5wnjaO53EJOhfLFY92nvBz2B9gqF9ql/D4HKUb1WOSBaqtVcAifFfmurblnhCJn/ySqKFA8U3n7nhGMAu/hEjQ==}
hasBin: true
dev: false
/jwt-decode@3.1.2:
resolution: {integrity: sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==}
dev: false
@@ -6981,10 +6757,6 @@ packages:
resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
engines: {node: '>=14'}
/locate-character@3.0.0:
resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
dev: false
/locate-path@5.0.0:
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
engines: {node: '>=8'}
@@ -7088,6 +6860,7 @@ packages:
engines: {node: '>=12'}
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
dev: true
/make-dir@2.1.0:
resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==}
@@ -7172,6 +6945,7 @@ packages:
/mdn-data@2.0.30:
resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
dev: true
/mdurl@1.0.1:
resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==}
@@ -7180,10 +6954,6 @@ packages:
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
dev: false
/memoize-one@6.0.0:
resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==}
dev: false
/merge-stream@2.0.0:
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
dev: true
@@ -7328,10 +7098,6 @@ packages:
resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
/natural-compare-lite@1.4.0:
resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
dev: false
/natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
dev: true
@@ -7598,6 +7364,10 @@ packages:
callsites: 3.1.0
dev: true
/parse-duration@1.1.0:
resolution: {integrity: sha512-z6t9dvSJYaPoQq7quMzdEagSFtpGu+utzHqqxmpVWNNZRIXnvqyCvn9XsTdh7c/w0Bqmdz3RB3YnRaKtpRtEXQ==}
dev: false
/parse-entities@2.0.0:
resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==}
dependencies:
@@ -7619,6 +7389,11 @@ packages:
lines-and-columns: 1.2.4
dev: true
/parse-ms@4.0.0:
resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==}
engines: {node: '>=18'}
dev: false
/parse-node-version@1.0.1:
resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==}
engines: {node: '>= 0.10'}
@@ -7704,14 +7479,6 @@ packages:
resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}
dev: true
/periscopic@3.1.0:
resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==}
dependencies:
'@types/estree': 1.0.6
estree-walker: 3.0.3
is-reference: 3.0.2
dev: false
/picocolors@1.0.0:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
@@ -7834,6 +7601,13 @@ packages:
react-is: 18.2.0
dev: true
/pretty-ms@9.1.0:
resolution: {integrity: sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==}
engines: {node: '>=18'}
dependencies:
parse-ms: 4.0.0
dev: false
/prosemirror-changeset@2.2.1:
resolution: {integrity: sha512-J7msc6wbxB4ekDFj+n9gTW/jav/p53kdlivvuppHsrZXCaQdVgRghoZbSS3kwrRyAstRVQ4/+u5k7YfLgkkQvQ==}
dependencies:
@@ -8101,11 +7875,6 @@ packages:
dependencies:
picomatch: 2.3.1
/readdirp@4.0.1:
resolution: {integrity: sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==}
engines: {node: '>= 14.16.0'}
dev: false
/regenerate-unicode-properties@10.1.1:
resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==}
engines: {node: '>=4'}
@@ -8174,6 +7943,7 @@ packages:
/require-from-string@2.0.2:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
dev: true
/require-main-filename@2.0.0:
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
@@ -8313,16 +8083,6 @@ packages:
requiresBuild: true
dev: true
/sass@1.79.3:
resolution: {integrity: sha512-m7dZxh0W9EZ3cw50Me5GOuYm/tVAJAn91SUnohLRo9cXBixGUOdvmryN+dXpwR831bhoY3Zv7rEFt85PUwTmzA==}
engines: {node: '>=14.0.0'}
hasBin: true
dependencies:
chokidar: 4.0.1
immutable: 4.3.7
source-map-js: 1.0.2
dev: false
/sax@1.2.4:
resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==}
requiresBuild: true
@@ -8685,10 +8445,6 @@ packages:
dependencies:
acorn: 8.11.2
/style-mod@4.1.2:
resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==}
dev: false
/supports-color@5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'}
@@ -8707,26 +8463,6 @@ packages:
engines: {node: '>= 0.4'}
dev: true
/svelte@4.2.19:
resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==}
engines: {node: '>=16'}
dependencies:
'@ampproject/remapping': 2.2.1
'@jridgewell/sourcemap-codec': 1.4.15
'@jridgewell/trace-mapping': 0.3.20
'@types/estree': 1.0.6
acorn: 8.11.2
aria-query: 5.3.2
axobject-query: 4.1.0
code-red: 1.0.4
css-tree: 2.3.1
estree-walker: 3.0.3
is-reference: 3.0.2
locate-character: 3.0.0
magic-string: 0.30.5
periscopic: 3.1.0
dev: false
/svg-tags@1.0.0:
resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==}
dev: true
@@ -9343,44 +9079,6 @@ packages:
spdx-expression-parse: 3.0.1
dev: true
/vanilla-jsoneditor@0.23.8(@lezer/common@1.2.1):
resolution: {integrity: sha512-ly5wmhnICxYhLunBVKbe0jEkPLjDeEGWPV1Lpt7HzzsPCFOmpIs05Go2XgXErmID2nWRp2s5DkT2hBVE4B+rmA==}
dependencies:
'@codemirror/autocomplete': 6.18.1(@codemirror/language@6.10.3)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/commands': 6.6.2
'@codemirror/lang-json': 6.0.1
'@codemirror/language': 6.10.3
'@codemirror/lint': 6.8.1
'@codemirror/search': 6.5.6
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@fortawesome/free-regular-svg-icons': 6.6.0
'@fortawesome/free-solid-svg-icons': 6.6.0
'@lezer/highlight': 1.2.1
'@replit/codemirror-indentation-markers': 6.5.3(@codemirror/language@6.10.3)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)
ajv: 8.17.1
codemirror-wrapped-line-indent: 1.0.8(@codemirror/language@6.10.3)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)
diff-sequences: 29.6.3
immutable-json-patch: 6.0.1
jmespath: 0.16.0
json-source-map: 0.6.1
jsonrepair: 3.8.1
lodash-es: 4.17.21
memoize-one: 6.0.0
natural-compare-lite: 1.4.0
sass: 1.79.3
svelte: 4.2.19
vanilla-picker: 2.12.3
transitivePeerDependencies:
- '@lezer/common'
dev: false
/vanilla-picker@2.12.3:
resolution: {integrity: sha512-qVkT1E7yMbUsB2mmJNFmaXMWE2hF8ffqzMMwe9zdAikd8u2VfnsVY2HQcOUi2F38bgbxzlJBEdS1UUhOXdF9GQ==}
dependencies:
'@sphinxxxx/color-conversion': 2.2.2
dev: false
/vdirs@0.1.8(vue@3.3.4):
resolution: {integrity: sha512-H9V1zGRLQZg9b+GdMk8MXDN2Lva0zx72MPahDKc30v+DtwKjfyOSXWRIX4t2mhDubM1H09gPhWeth/BJWPHGUw==}
peerDependencies:
+7 -3
View File
@@ -1,7 +1,7 @@
import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as jsonEditor } from './json-editor';
import { tool as slaCalculator } from './sla-calculator';
import { tool as emailNormalizer } from './email-normalizer';
import { tool as asciiTextDrawer } from './ascii-text-drawer';
@@ -158,7 +158,6 @@ export const toolsByCategory: ToolCategory[] = [
dockerRunToDockerComposeConverter,
xmlFormatter,
yamlViewer,
jsonEditor,
emailNormalizer,
regexTester,
regexMemo,
@@ -174,7 +173,12 @@ export const toolsByCategory: ToolCategory[] = [
},
{
name: 'Measurement',
components: [chronometer, temperatureConverter, benchmarkBuilder],
components: [
chronometer,
temperatureConverter,
benchmarkBuilder,
slaCalculator,
],
},
{
name: 'Text',
-12
View File
@@ -1,12 +0,0 @@
import { Braces } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'JSON Editor',
path: '/json-editor',
description: 'Edit JSON content',
keywords: ['json', 'editor'],
component: () => import('./json-editor.vue'),
icon: Braces,
createdAt: new Date('2024-05-11'),
});
-54
View File
@@ -1,54 +0,0 @@
<script setup lang="ts">
import JsonEditorVue from 'json-editor-vue';
import { type AfterSelection, type InsideSelection, type JSONEditorSelection, type KeySelection, type MultiSelection, type ValueSelection, isAfterSelection, isInsideSelection, isKeySelection, isMultiSelection, isValueSelection, stringifyJSONPath } from 'vanilla-jsoneditor';
import 'vanilla-jsoneditor/themes/jse-theme-dark.css';
import { useStyleStore } from '@/stores/style.store';
const styleStore = useStyleStore();
const jsonText = ref('{ "a": { "array": [1, 2, 3] } }');
const jsonPath = ref('');
function updateJsonPath(selection: JSONEditorSelection) {
if (isAfterSelection (selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as AfterSelection).path)}`;
}
else if (isInsideSelection (selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as InsideSelection).path)}`;
}
else if (isKeySelection (selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as KeySelection).path)}`;
}
else if (isValueSelection (selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as ValueSelection).path)}`;
}
else if (isMultiSelection (selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as MultiSelection).focusPath)}`;
}
else {
jsonPath.value = 'No available in this mode';
}
}
</script>
<template>
<div>
<JsonEditorVue
v-model="jsonText"
mode="text"
:class="styleStore.isDarkTheme ? 'jse-theme-dark' : ''"
:on-select="updateJsonPath"
mb-2
/>
<n-form-item label="Current Selected Node JSONPath:">
<textarea-copyable :value="jsonPath" />
</n-form-item>
<n-divider />
<n-form-item label="Your edited JSON:">
<textarea-copyable :value="jsonText" language="json" />
</n-form-item>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { Clock } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'SLA calculator',
path: '/sla-calculator',
description: 'Service Level Agreement Calcultator',
keywords: ['sla', 'service', 'level', 'agreement', 'calculator'],
component: () => import('./sla-calculator.vue'),
icon: Clock,
createdAt: new Date('2024-05-11'),
});
@@ -0,0 +1,81 @@
import { describe, expect, it } from 'vitest';
import { downTimeToSLA, slaToDowntimes } from './sla-calculator.service';
describe('sla-calculator', () => {
describe('downTimeToSLA', () => {
it('compute correct values', () => {
expect(downTimeToSLA({
downTimeSeconds: 100,
mondayHours: 16,
tuesdayHours: 6,
wednesdayHours: 4,
thursdayHours: 24,
fridayHours: 21,
saturdayHours: 16,
sundayHours: 13,
})).to.deep.eq({
slaForDay: null,
slaForMonth: 99.99361155031703,
slaForQuarter: 99.99787051677234,
slaForWeek: 99.97222222222223,
slaForYear: 99.99946762919309,
});
expect(downTimeToSLA({
downTimeSeconds: 86400 / 10000,
})).to.deep.eq({
slaForDay: 99.99,
slaForMonth: 99.99967145115916,
slaForQuarter: 99.99989048371972,
slaForWeek: 99.99857142857142,
slaForYear: 99.99997262092992,
});
expect(downTimeToSLA({
downTimeSeconds: 86400 / 2,
})).to.deep.eq({
slaForDay: 50,
slaForMonth: 98.35725579580689,
slaForQuarter: 99.45241859860229,
slaForWeek: 92.85714285714286,
slaForYear: 99.86310464965058,
});
});
});
describe('slaToDowntimes', () => {
it('compute correct values', () => {
expect(slaToDowntimes({
targetSLA: 99,
mondayHours: 9,
tuesdayHours: 24,
wednesdayHours: 10,
thursdayHours: 8,
fridayHours: 3,
saturdayHours: 24,
sundayHours: 4,
})).to.deep.eq({
secondsPerDay: null,
secondsPerMonth: 12835.665,
secondsPerQuarter: 38506.995,
secondsPerWeek: 2952,
secondsPerYear: 154027.98,
});
expect(slaToDowntimes({
targetSLA: 99.99,
})).to.deep.eq({
secondsPerDay: 8.64,
secondsPerMonth: 262.9746,
secondsPerQuarter: 788.9238,
secondsPerWeek: 60.48,
secondsPerYear: 3155.6952,
});
expect(slaToDowntimes({
targetSLA: 99,
})).to.deep.eq({
secondsPerDay: 864,
secondsPerMonth: 26297.46,
secondsPerQuarter: 78892.38,
secondsPerWeek: 6048,
secondsPerYear: 315569.52,
});
});
});
});
@@ -0,0 +1,126 @@
import Big from 'big.js';
const hoursDay = Big('24');
const daysWeek = Big('7');
const monthsYear = Big('12');
const daysYear = Big('365.2425');
const weeksYear = daysYear.div(daysWeek);
const daysMonth = daysYear.div(monthsYear);
const weeksMonth = daysMonth.div(daysWeek);
interface DaysHours {
mondayHours?: number
tuesdayHours?: number
wednesdayHours?: number
thursdayHours?: number
fridayHours?: number
saturdayHours?: number
sundayHours?: number
}
function prepareDurations({
mondayHours = 24,
tuesdayHours = 24,
wednesdayHours = 24,
thursdayHours = 24,
fridayHours = 24,
saturdayHours = 24,
sundayHours = 24,
}: DaysHours) {
const durHoursWeek = Big(mondayHours).plus(tuesdayHours).plus(wednesdayHours).plus(thursdayHours).plus(fridayHours).plus(saturdayHours).plus(sundayHours);
const durSecondsWeek = durHoursWeek.mul('3600');
const durSecondsDay = durSecondsWeek.div(daysWeek);
const durSecondsMonth = durSecondsWeek.mul(weeksMonth);
const durSecondsQuarter = durSecondsMonth.mul('3');
const durSecondsYear = durSecondsWeek.mul(weeksYear);
const fullWeekHours = daysWeek.mul(hoursDay);
return {
durHoursWeek,
durSecondsWeek,
durSecondsDay,
durSecondsMonth,
durSecondsQuarter,
durSecondsYear,
fullWeekHours,
};
}
export function downTimeToSLA({
downTimeSeconds,
mondayHours = 24,
tuesdayHours = 24,
wednesdayHours = 24,
thursdayHours = 24,
fridayHours = 24,
saturdayHours = 24,
sundayHours = 24,
}: {
downTimeSeconds: number
} & DaysHours) {
const {
durHoursWeek,
durSecondsWeek,
durSecondsDay,
durSecondsMonth,
durSecondsQuarter,
durSecondsYear,
fullWeekHours,
} = prepareDurations({
mondayHours, tuesdayHours, wednesdayHours, thursdayHours, fridayHours, saturdayHours, sundayHours,
});
const one = Big('1');
const hundred = Big('100');
const downTimeSecondsBig = Big(downTimeSeconds);
return {
slaForDay: fullWeekHours.eq(durHoursWeek) ? one.minus(downTimeSecondsBig.div(durSecondsDay)).mul(hundred).toNumber() : null,
slaForWeek: one.minus(downTimeSecondsBig.div(durSecondsWeek)).mul(hundred).toNumber(),
slaForMonth: one.minus(downTimeSecondsBig.div(durSecondsMonth)).mul(hundred).toNumber(),
slaForQuarter: one.minus(downTimeSecondsBig.div(durSecondsQuarter)).mul(hundred).toNumber(),
slaForYear: one.minus(downTimeSecondsBig.div(durSecondsYear)).mul(hundred).toNumber(),
};
}
export function slaToDowntimes({
targetSLA,
mondayHours = 24,
tuesdayHours = 24,
wednesdayHours = 24,
thursdayHours = 24,
fridayHours = 24,
saturdayHours = 24,
sundayHours = 24,
}: {
targetSLA: number
mondayHours?: number
tuesdayHours?: number
wednesdayHours?: number
thursdayHours?: number
fridayHours?: number
saturdayHours?: number
sundayHours?: number
}) {
const {
durHoursWeek,
durSecondsWeek,
durSecondsDay,
durSecondsMonth,
durSecondsQuarter,
durSecondsYear,
fullWeekHours,
} = prepareDurations({
mondayHours, tuesdayHours, wednesdayHours, thursdayHours, fridayHours, saturdayHours, sundayHours,
});
const allowedDowntime = Big('1').minus(Big(targetSLA).div('100'));
return {
secondsPerDay: fullWeekHours.eq(durHoursWeek) ? allowedDowntime.mul(durSecondsDay).toNumber() : null,
secondsPerWeek: allowedDowntime.mul(durSecondsWeek).toNumber(),
secondsPerMonth: allowedDowntime.mul(durSecondsMonth).toNumber(),
secondsPerQuarter: allowedDowntime.mul(durSecondsQuarter).toNumber(),
secondsPerYear: allowedDowntime.mul(durSecondsYear).toNumber(),
};
}
+179
View File
@@ -0,0 +1,179 @@
<script setup lang="ts">
import prettyMilliseconds from 'pretty-ms';
import parse from 'parse-duration';
import { downTimeToSLA, slaToDowntimes } from './sla-calculator.service';
import { useQueryParam, useQueryParamOrStorage } from '@/composable/queryParams';
import { useValidation } from '@/composable/validation';
function prettySeconds(seconds: number | null) {
if (!seconds) {
return '';
}
return prettyMilliseconds(seconds * 1000);
}
const daysHours = useQueryParamOrStorage<{
mon?: number
tue?: number
wed?: number
thu?: number
fri?: number
sat?: number
sun?: number
}>({
name: 'days',
storageName: 'sla:days',
defaultValue: {
mon: 24,
tue: 24,
wed: 24,
thu: 24,
fri: 24,
sat: 24,
sun: 24,
},
});
const inputSLA = useQueryParam({ name: 'sla', defaultValue: 99.99 });
const outputDownTimes = computed(() => {
const weekdaysHours = daysHours.value;
const downtimesSeconds = slaToDowntimes({
targetSLA: inputSLA.value,
mondayHours: weekdaysHours.mon,
tuesdayHours: weekdaysHours.tue,
wednesdayHours: weekdaysHours.wed,
thursdayHours: weekdaysHours.thu,
fridayHours: weekdaysHours.fri,
saturdayHours: weekdaysHours.sat,
sundayHours: weekdaysHours.sun,
});
return {
durationPerDay: prettySeconds(downtimesSeconds.secondsPerDay),
durationPerMonth: prettySeconds(downtimesSeconds.secondsPerMonth),
durationPerQuarter: prettySeconds(downtimesSeconds.secondsPerQuarter),
durationPerWeek: prettySeconds(downtimesSeconds.secondsPerWeek),
durationPerYear: prettySeconds(downtimesSeconds.secondsPerYear),
};
});
const inputDuration = useQueryParam({ name: 'dur', defaultValue: '1s' });
const inputDurationValidation = useValidation({
source: inputDuration,
rules: [
{
message: 'Invalid duration',
validator: value => parse(value),
},
],
});
const inputDurationSeconds = computed(() => {
if (!inputDurationValidation.isValid) {
return 0;
}
return parse(inputDuration.value, 's') || 0;
});
const outputSLAs = computed(() => {
const weekdaysHours = daysHours.value;
const slas = downTimeToSLA({
downTimeSeconds: inputDurationSeconds.value,
mondayHours: weekdaysHours.mon,
tuesdayHours: weekdaysHours.tue,
wednesdayHours: weekdaysHours.wed,
thursdayHours: weekdaysHours.thu,
fridayHours: weekdaysHours.fri,
saturdayHours: weekdaysHours.sat,
sundayHours: weekdaysHours.sun,
});
return {
slaForDay: slas.slaForDay?.toPrecision(6),
slaForWeek: slas.slaForWeek.toPrecision(6),
slaForMonth: slas.slaForMonth.toPrecision(6),
slaForQuarter: slas.slaForQuarter.toPrecision(6),
slaForYear: slas.slaForYear.toPrecision(6),
};
});
</script>
<template>
<div>
<c-card title="SLA to downtimes" mb-2>
<n-form-item label="Agreed SLA" label-placement="left">
<n-input-number v-model:value="inputSLA" :min="0" :max="100" />
</n-form-item>
<n-divider />
<n-form-item v-if="outputDownTimes.durationPerDay" label="Daily downtime" label-placement="left" label-width="100">
<input-copyable :value="outputDownTimes.durationPerDay" />
</n-form-item>
<n-form-item label="Weekly downtime" label-placement="left" label-width="100">
<input-copyable :value="outputDownTimes.durationPerWeek" />
</n-form-item>
<n-form-item label="Monthly downtime" label-placement="left" label-width="100">
<input-copyable :value="outputDownTimes.durationPerMonth" />
</n-form-item>
<n-form-item label="Quarterly downtime" label-placement="left" label-width="100">
<input-copyable :value="outputDownTimes.durationPerQuarter" />
</n-form-item>
<n-form-item label="Yearly downtime" label-placement="left" label-width="100">
<input-copyable :value="outputDownTimes.durationPerYear" />
</n-form-item>
</c-card>
<c-card title="Downtime to SLA" mb-2>
<c-input-text
v-model:value="inputDuration"
label="Downtime duration"
label-position="left"
placeholder="Put downtime duration here..."
:validation="inputDurationValidation"
mb-2
/>
<n-divider />
<n-form-item v-if="outputSLAs.slaForDay" label="Daily SLA" label-placement="left" label-width="100">
<input-copyable :value="outputSLAs.slaForDay" />
</n-form-item>
<n-form-item label="Weekly SLA" label-placement="left" label-width="100">
<input-copyable :value="outputSLAs.slaForWeek" />
</n-form-item>
<n-form-item label="Monthly SLA" label-placement="left" label-width="100">
<input-copyable :value="outputSLAs.slaForMonth" />
</n-form-item>
<n-form-item label="Quarterly SLA" label-placement="left" label-width="100">
<input-copyable :value="outputSLAs.slaForQuarter" />
</n-form-item>
<n-form-item label="Yearly SLA" label-placement="left" label-width="100">
<input-copyable :value="outputSLAs.slaForYear" />
</n-form-item>
</c-card>
<c-card title="Weekdays hours">
<div flex flex-wrap gap-1>
<n-form-item label="Monday" flex-1>
<n-input-number v-model:value="daysHours.mon" :min="0" :max="24" />
</n-form-item>
<n-form-item label="Tuesday" flex-1>
<n-input-number v-model:value="daysHours.tue" :min="0" :max="24" />
</n-form-item>
<n-form-item label="Wednesday" flex-1>
<n-input-number v-model:value="daysHours.wed" :min="0" :max="24" />
</n-form-item>
<n-form-item label="Thursday" flex-1>
<n-input-number v-model:value="daysHours.thu" :min="0" :max="24" />
</n-form-item>
<n-form-item label="Friday" flex-1>
<n-input-number v-model:value="daysHours.fri" :min="0" :max="24" />
</n-form-item>
</div>
<div flex flex-wrap gap-1>
<n-form-item label="Saturday" flex-1>
<n-input-number v-model:value="daysHours.sat" :min="0" :max="24" />
</n-form-item>
<n-form-item label="Sunday" flex-1>
<n-input-number v-model:value="daysHours.sun" :min="0" :max="24" />
</n-form-item>
</div>
</c-card>
</div>
</template>