Skip to content

Commit 8754d62

Browse files
committed
Merge branch 'fix/crontab-enh' of https://github.com/sharevb/it-tools into fix/crontab-enh
2 parents 605229f + 9fa5866 commit 8754d62

20 files changed

+729
-12
lines changed

.github/logo-dark.png

39.5 KB
Loading

.github/logo-white.png

38.7 KB
Loading

.github/logo.png

-7.81 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
![logo](.github/logo.png)
1+
<picture>
2+
<source srcset="./.github/logo-dark.png" media="(prefers-color-scheme: light)">
3+
<source srcset="./.github/logo-white.png" media="(prefers-color-scheme: dark)">
4+
<img src="./.github/logo-dark.png" alt="logo">
5+
</picture>
26

37
Useful tools for developer and people working in IT. [Have a look !](https://it-tools.tech).
48

components.d.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ declare module '@vue/runtime-core' {
121121
LoremIpsumGenerator: typeof import('./src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue')['default']
122122
MacAddressGenerator: typeof import('./src/tools/mac-address-generator/mac-address-generator.vue')['default']
123123
MacAddressLookup: typeof import('./src/tools/mac-address-lookup/mac-address-lookup.vue')['default']
124+
MarkdownToHtml: typeof import('./src/tools/markdown-to-html/markdown-to-html.vue')['default']
124125
MathEvaluator: typeof import('./src/tools/math-evaluator/math-evaluator.vue')['default']
125126
MenuBar: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar.vue')['default']
126127
MenuBarItem: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue')['default']
@@ -129,22 +130,19 @@ declare module '@vue/runtime-core' {
129130
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
130131
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
131132
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
132-
NCode: typeof import('naive-ui')['NCode']
133+
NCheckbox: typeof import('naive-ui')['NCheckbox']
133134
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
134135
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
136+
NDivider: typeof import('naive-ui')['NDivider']
135137
NEllipsis: typeof import('naive-ui')['NEllipsis']
136-
NForm: typeof import('naive-ui')['NForm']
137-
NFormItem: typeof import('naive-ui')['NFormItem']
138138
NH1: typeof import('naive-ui')['NH1']
139139
NH3: typeof import('naive-ui')['NH3']
140140
NIcon: typeof import('naive-ui')['NIcon']
141-
NInputNumber: typeof import('naive-ui')['NInputNumber']
142141
NLayout: typeof import('naive-ui')['NLayout']
143142
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
144143
NMenu: typeof import('naive-ui')['NMenu']
145-
NScrollbar: typeof import('naive-ui')['NScrollbar']
146-
NSlider: typeof import('naive-ui')['NSlider']
147-
NSwitch: typeof import('naive-ui')['NSwitch']
144+
NSpace: typeof import('naive-ui')['NSpace']
145+
NTable: typeof import('naive-ui')['NTable']
148146
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
149147
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
150148
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
@@ -154,6 +152,9 @@ declare module '@vue/runtime-core' {
154152
PhoneParserAndFormatter: typeof import('./src/tools/phone-parser-and-formatter/phone-parser-and-formatter.vue')['default']
155153
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
156154
RandomPortGenerator: typeof import('./src/tools/random-port-generator/random-port-generator.vue')['default']
155+
RegexMemo: typeof import('./src/tools/regex-memo/regex-memo.vue')['default']
156+
'RegexMemo.content': typeof import('./src/tools/regex-memo/regex-memo.content.md')['default']
157+
RegexTester: typeof import('./src/tools/regex-tester/regex-tester.vue')['default']
157158
ResultRow: typeof import('./src/tools/ipv4-range-expander/result-row.vue')['default']
158159
RomanNumeralConverter: typeof import('./src/tools/roman-numeral-converter/roman-numeral-converter.vue')['default']
159160
RouterLink: typeof import('vue-router')['RouterLink']

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
"dependencies": {
3838
"@it-tools/bip39": "^0.0.4",
3939
"@it-tools/oggen": "^1.3.0",
40+
"@regexper/render": "^1.0.0",
4041
"@sindresorhus/slugify": "^2.2.1",
4142
"@tiptap/pm": "2.1.6",
4243
"@tiptap/starter-kit": "2.1.6",
4344
"@tiptap/vue-3": "2.0.3",
4445
"@types/figlet": "^1.5.8",
46+
"@types/markdown-it": "^13.0.7",
4547
"@vicons/material": "^0.12.0",
4648
"@vicons/tabler": "^0.12.0",
4749
"@vueuse/core": "^10.3.0",
@@ -74,6 +76,7 @@
7476
"jwt-decode": "^3.1.2",
7577
"libphonenumber-js": "^1.10.28",
7678
"lodash": "^4.17.21",
79+
"markdown-it": "^14.0.0",
7780
"marked": "^10.0.0",
7881
"mathjs": "^11.9.1",
7982
"mime-types": "^2.1.35",
@@ -86,6 +89,7 @@
8689
"pinia": "^2.0.34",
8790
"plausible-tracker": "^0.3.8",
8891
"qrcode": "^1.5.1",
92+
"randexp": "^0.5.3",
8993
"sql-formatter": "^13.0.0",
9094
"ua-parser-js": "^1.0.35",
9195
"ulid": "^2.3.0",
@@ -95,6 +99,7 @@
9599
"vue": "^3.3.4",
96100
"vue-i18n": "^9.9.1",
97101
"vue-router": "^4.1.6",
102+
"vue-shadow-dom": "^4.2.0",
98103
"vue-tsc": "^1.8.1",
99104
"xml-formatter": "^3.3.2",
100105
"xml-js": "^1.6.11",

pnpm-lock.yaml

Lines changed: 90 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/TextareaCopyable.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import sqlHljs from 'highlight.js/lib/languages/sql';
77
import xmlHljs from 'highlight.js/lib/languages/xml';
88
import yamlHljs from 'highlight.js/lib/languages/yaml';
99
import iniHljs from 'highlight.js/lib/languages/ini';
10+
import markdownHljs from 'highlight.js/lib/languages/markdown';
1011
import { useCopy } from '@/composable/copy';
1112
1213
const props = withDefaults(
@@ -30,6 +31,7 @@ hljs.registerLanguage('html', xmlHljs);
3031
hljs.registerLanguage('xml', xmlHljs);
3132
hljs.registerLanguage('yaml', yamlHljs);
3233
hljs.registerLanguage('toml', iniHljs);
34+
hljs.registerLanguage('markdown', markdownHljs);
3335
3436
const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(props);
3537
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };

src/composable/validation.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import _ from 'lodash';
33
import { type Ref, reactive, watch } from 'vue';
44

55
type ValidatorReturnType = unknown;
6+
type GetErrorMessageReturnType = string;
67

78
export interface UseValidationRule<T> {
89
validator: (value: T) => ValidatorReturnType
10+
getErrorMessage?: (value: T) => GetErrorMessageReturnType
911
message: string
1012
}
1113

@@ -24,6 +26,15 @@ export function isFalsyOrHasThrown(cb: () => ValidatorReturnType): boolean {
2426
}
2527
}
2628

29+
export function getErrorMessageOrThrown(cb: () => GetErrorMessageReturnType): string {
30+
try {
31+
return cb() || '';
32+
}
33+
catch (e: any) {
34+
return e.toString();
35+
}
36+
}
37+
2738
export interface ValidationAttrs {
2839
feedback: string
2940
validationStatus: string | undefined
@@ -61,7 +72,13 @@ export function useValidation<T>({
6172

6273
for (const rule of get(rules)) {
6374
if (isFalsyOrHasThrown(() => rule.validator(source.value))) {
64-
state.message = rule.message;
75+
if (rule.getErrorMessage) {
76+
const getErrorMessage = rule.getErrorMessage;
77+
state.message = rule.message.replace('{0}', getErrorMessageOrThrown(() => getErrorMessage(source.value)));
78+
}
79+
else {
80+
state.message = rule.message;
81+
}
6582
state.status = 'error';
6683
}
6784
}

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { createPinia } from 'pinia';
33
import { createHead } from '@vueuse/head';
44

55
import { registerSW } from 'virtual:pwa-register';
6+
import shadow from 'vue-shadow-dom';
67
import { plausible } from './plugins/plausible.plugin';
78

89
import 'virtual:uno.css';
@@ -23,5 +24,6 @@ app.use(i18nPlugin);
2324
app.use(router);
2425
app.use(naive);
2526
app.use(plausible);
27+
app.use(shadow);
2628

2729
app.mount('#app');

0 commit comments

Comments
 (0)