mirror of
https://github.com/sharevb/it-tools.git
synced 2026-12-03 10:00:17 +03:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
729a10c68e | ||
|
|
9c9b0d5ac0 | ||
|
|
c49ff00c31 |
No files matched your search
Vendored
+1
@@ -50,6 +50,7 @@ declare module '@vue/runtime-core' {
|
|||||||
'CModal.demo': typeof import('./src/ui/c-modal/c-modal.demo.vue')['default']
|
'CModal.demo': typeof import('./src/ui/c-modal/c-modal.demo.vue')['default']
|
||||||
CModalValue: typeof import('./src/ui/c-modal-value/c-modal-value.vue')['default']
|
CModalValue: typeof import('./src/ui/c-modal-value/c-modal-value.vue')['default']
|
||||||
'CModalValue.demo': typeof import('./src/ui/c-modal-value/c-modal-value.demo.vue')['default']
|
'CModalValue.demo': typeof import('./src/ui/c-modal-value/c-modal-value.demo.vue')['default']
|
||||||
|
CMonacoEditor: typeof import('./src/ui/c-monaco-editor/c-monaco-editor.vue')['default']
|
||||||
CollapsibleToolMenu: typeof import('./src/components/CollapsibleToolMenu.vue')['default']
|
CollapsibleToolMenu: typeof import('./src/components/CollapsibleToolMenu.vue')['default']
|
||||||
ColorConverter: typeof import('./src/tools/color-converter/color-converter.vue')['default']
|
ColorConverter: typeof import('./src/tools/color-converter/color-converter.vue')['default']
|
||||||
ColoredCard: typeof import('./src/components/ColoredCard.vue')['default']
|
ColoredCard: typeof import('./src/components/ColoredCard.vue')['default']
|
||||||
|
|||||||
+2
-4
@@ -35,6 +35,7 @@
|
|||||||
"release": "node ./scripts/release.mjs"
|
"release": "node ./scripts/release.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@guolao/vue-monaco-editor": "^1.4.1",
|
||||||
"@it-tools/bip39": "^0.0.4",
|
"@it-tools/bip39": "^0.0.4",
|
||||||
"@it-tools/oggen": "^1.3.0",
|
"@it-tools/oggen": "^1.3.0",
|
||||||
"@sindresorhus/slugify": "^2.2.1",
|
"@sindresorhus/slugify": "^2.2.1",
|
||||||
@@ -47,11 +48,11 @@
|
|||||||
"@vueuse/core": "^10.3.0",
|
"@vueuse/core": "^10.3.0",
|
||||||
"@vueuse/head": "^1.0.0",
|
"@vueuse/head": "^1.0.0",
|
||||||
"@vueuse/router": "^10.0.0",
|
"@vueuse/router": "^10.0.0",
|
||||||
"apache-md5": "^1.1.8",
|
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"change-case": "^4.1.2",
|
"change-case": "^4.1.2",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
"composerize-ts": "^0.6.2",
|
"composerize-ts": "^0.6.2",
|
||||||
|
"composeverter": "^1.7.2",
|
||||||
"country-code-lookup": "^0.1.0",
|
"country-code-lookup": "^0.1.0",
|
||||||
"cron-validator": "^1.3.1",
|
"cron-validator": "^1.3.1",
|
||||||
"cronstrue": "^2.26.0",
|
"cronstrue": "^2.26.0",
|
||||||
@@ -82,7 +83,6 @@
|
|||||||
"plausible-tracker": "^0.3.8",
|
"plausible-tracker": "^0.3.8",
|
||||||
"qrcode": "^1.5.1",
|
"qrcode": "^1.5.1",
|
||||||
"sql-formatter": "^13.0.0",
|
"sql-formatter": "^13.0.0",
|
||||||
"sshpk": "^1.18.0",
|
|
||||||
"ua-parser-js": "^1.0.35",
|
"ua-parser-js": "^1.0.35",
|
||||||
"ulid": "^2.3.0",
|
"ulid": "^2.3.0",
|
||||||
"unicode-emoji-json": "^0.4.0",
|
"unicode-emoji-json": "^0.4.0",
|
||||||
@@ -112,7 +112,6 @@
|
|||||||
"@types/node": "^18.15.11",
|
"@types/node": "^18.15.11",
|
||||||
"@types/node-forge": "^1.3.2",
|
"@types/node-forge": "^1.3.2",
|
||||||
"@types/qrcode": "^1.5.0",
|
"@types/qrcode": "^1.5.0",
|
||||||
"@types/sshpk": "^1.17.4",
|
|
||||||
"@types/ua-parser-js": "^0.7.36",
|
"@types/ua-parser-js": "^0.7.36",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.0",
|
||||||
"@unocss/eslint-config": "^0.57.0",
|
"@unocss/eslint-config": "^0.57.0",
|
||||||
@@ -134,7 +133,6 @@
|
|||||||
"unplugin-icons": "^0.17.0",
|
"unplugin-icons": "^0.17.0",
|
||||||
"unplugin-vue-components": "^0.25.0",
|
"unplugin-vue-components": "^0.25.0",
|
||||||
"vite": "^4.4.9",
|
"vite": "^4.4.9",
|
||||||
"vite-plugin-node-polyfills": "^0.21.0",
|
|
||||||
"vite-plugin-pwa": "^0.16.0",
|
"vite-plugin-pwa": "^0.16.0",
|
||||||
"vite-plugin-vue-markdown": "^0.23.5",
|
"vite-plugin-vue-markdown": "^0.23.5",
|
||||||
"vite-svg-loader": "^4.0.0",
|
"vite-svg-loader": "^4.0.0",
|
||||||
|
|||||||
Generated
+70
-647
File diff suppressed because it is too large.
Load diff
@@ -16,7 +16,6 @@ const props = withDefaults(
|
|||||||
language?: string
|
language?: string
|
||||||
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
||||||
copyMessage?: string
|
copyMessage?: string
|
||||||
wordWrap?: boolean
|
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
followHeightOf: null,
|
followHeightOf: null,
|
||||||
@@ -48,7 +47,7 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.
|
|||||||
:style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''"
|
:style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''"
|
||||||
>
|
>
|
||||||
<n-config-provider :hljs="hljs">
|
<n-config-provider :hljs="hljs">
|
||||||
<n-code :code="value" :language="language" :word-wrap="wordWrap" :trim="false" data-test-id="area-content" />
|
<n-code :code="value" :language="language" :trim="false" data-test-id="area-content" />
|
||||||
</n-config-provider>
|
</n-config-provider>
|
||||||
</n-scrollbar>
|
</n-scrollbar>
|
||||||
<div absolute right-10px top-10px>
|
<div absolute right-10px top-10px>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import { createApp } from 'vue';
|
|||||||
import { createPinia } from 'pinia';
|
import { createPinia } from 'pinia';
|
||||||
import { createHead } from '@vueuse/head';
|
import { createHead } from '@vueuse/head';
|
||||||
|
|
||||||
|
import { install as VueMonacoEditorPlugin, loader } from '@guolao/vue-monaco-editor';
|
||||||
|
import * as monaco from 'monaco-editor';
|
||||||
|
|
||||||
import { registerSW } from 'virtual:pwa-register';
|
import { registerSW } from 'virtual:pwa-register';
|
||||||
import { plausible } from './plugins/plausible.plugin';
|
import { plausible } from './plugins/plausible.plugin';
|
||||||
|
|
||||||
@@ -13,10 +16,14 @@ import App from './App.vue';
|
|||||||
import router from './router';
|
import router from './router';
|
||||||
import { i18nPlugin } from './plugins/i18n.plugin';
|
import { i18nPlugin } from './plugins/i18n.plugin';
|
||||||
|
|
||||||
|
// loaded monaco-editor from `node_modules`
|
||||||
|
loader.config({ monaco });
|
||||||
|
|
||||||
registerSW();
|
registerSW();
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
|
app.use(VueMonacoEditorPlugin);
|
||||||
app.use(createPinia());
|
app.use(createPinia());
|
||||||
app.use(createHead());
|
app.use(createHead());
|
||||||
app.use(i18nPlugin);
|
app.use(i18nPlugin);
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
declare module 'composeverter' {
|
||||||
|
interface Configuration {
|
||||||
|
expandVolumes?: boolean;
|
||||||
|
expandPorts?: boolean;
|
||||||
|
indent?: number;
|
||||||
|
}
|
||||||
|
interface DockerComposeValidatioError {
|
||||||
|
line?: number;
|
||||||
|
message: string;
|
||||||
|
helpLink?: string;
|
||||||
|
}
|
||||||
|
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
|
||||||
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateFromV3xToV2x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateFromV1ToV2x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateToCommonSpec(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function getDockerComposeSchemaWithoutFormats(): object;
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {
|
||||||
|
validateDockerComposeToCommonSpec,
|
||||||
|
} from 'composeverter';
|
||||||
|
|
||||||
|
const dockerCompose = ref(
|
||||||
|
`version: '3.3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
ports:
|
||||||
|
- '80:80'
|
||||||
|
volumes:
|
||||||
|
- '/var/run/docker.sock:/tmp/docker.sock:ro'
|
||||||
|
restart: always
|
||||||
|
logging:
|
||||||
|
options:
|
||||||
|
max-size: 1g
|
||||||
|
image: nginx`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const conversionResult = computed(() => {
|
||||||
|
try {
|
||||||
|
return validateDockerComposeToCommonSpec(dockerCompose.value);
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return e.toString().split('\n').map((err: string) => ({ line: -1, message: err, helpLink: '' }));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const errors = computed(() => conversionResult.value);
|
||||||
|
|
||||||
|
const MONACO_EDITOR_OPTIONS = {
|
||||||
|
automaticLayout: true,
|
||||||
|
formatOnType: true,
|
||||||
|
formatOnPaste: true,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<c-label label="Paste your Docker Compose file content:">
|
||||||
|
<div relative w-full>
|
||||||
|
<c-monaco-editor
|
||||||
|
v-model:value="dockerCompose"
|
||||||
|
theme="vs-dark"
|
||||||
|
language="yaml"
|
||||||
|
height="250px"
|
||||||
|
:options="MONACO_EDITOR_OPTIONS"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</c-label>
|
||||||
|
|
||||||
|
<div v-if="errors.length > 0">
|
||||||
|
<n-alert title="The following errors occured" type="error" mt-5>
|
||||||
|
<ul>
|
||||||
|
<li v-for="(message, index) of errors" :key="index">
|
||||||
|
{{ message.message }} (<n-a v-if="message.helpLink" target="_blank" rel="noreferer noopener">
|
||||||
|
See Docker Compose help
|
||||||
|
</n-a>)
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</n-alert>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<n-alert type="success" mt-5>
|
||||||
|
Validation successful!
|
||||||
|
</n-alert>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { BrandDocker } from '@vicons/tabler';
|
||||||
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
|
export const tool = defineTool({
|
||||||
|
name: 'Docker Compose Validator',
|
||||||
|
path: '/docker-compose-validator',
|
||||||
|
description: 'Validate Docker Compose files against CommonSpec schema',
|
||||||
|
keywords: ['docker', 'compose', 'validator', 'commonspec'],
|
||||||
|
component: () => import('./docker-compose-validator.vue'),
|
||||||
|
icon: BrandDocker,
|
||||||
|
createdAt: new Date('2024-01-25'),
|
||||||
|
});
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { hashSync } from 'bcryptjs';
|
|
||||||
import md5 from 'apache-md5';
|
|
||||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
|
||||||
|
|
||||||
const username = ref('');
|
|
||||||
const password = ref('');
|
|
||||||
const hashMethod = ref('bcrypt');
|
|
||||||
const saltCount = ref(10);
|
|
||||||
|
|
||||||
const htpasswd = computed(() => {
|
|
||||||
if (username.value === '' || password.value === '') {
|
|
||||||
return '# username and password must not be empty';
|
|
||||||
}
|
|
||||||
let hash;
|
|
||||||
if (hashMethod.value === 'md5') {
|
|
||||||
hash = md5(password.value);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
hash = hashSync(password.value, saltCount.value);
|
|
||||||
}
|
|
||||||
return `${username.value}:${hash}`;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<c-input-text
|
|
||||||
v-model:value="username"
|
|
||||||
label="Username"
|
|
||||||
placeholder="Your username..."
|
|
||||||
clearable raw-text mb-5
|
|
||||||
/>
|
|
||||||
<c-input-text
|
|
||||||
v-model:value="password"
|
|
||||||
label="Password"
|
|
||||||
placeholder="Your password..."
|
|
||||||
clearable
|
|
||||||
raw-text
|
|
||||||
mb-2
|
|
||||||
type="password"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<c-select
|
|
||||||
v-model:value="hashMethod"
|
|
||||||
label="Hash method:"
|
|
||||||
:options="['bcrypt', 'md5']"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<n-form-item v-if="hashMethod === 'bcrypt'" label="Salt count: " label-placement="left" label-width="120">
|
|
||||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
|
|
||||||
</n-form-item>
|
|
||||||
|
|
||||||
<n-divider />
|
|
||||||
|
|
||||||
<n-form-item label="htpasswd content:">
|
|
||||||
<TextareaCopyable :value="htpasswd" />
|
|
||||||
</n-form-item>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { PasswordRound } from '@vicons/material';
|
|
||||||
import { defineTool } from '../tool';
|
|
||||||
|
|
||||||
export const tool = defineTool({
|
|
||||||
name: 'Htpasswd/htaccess generator',
|
|
||||||
path: '/htpasswd-generator',
|
|
||||||
description: 'htpassword/htaccess user/password generator',
|
|
||||||
keywords: ['htpasswd', 'htaccess', 'bcrypt', 'password'],
|
|
||||||
component: () => import('./htpasswd-generator.vue'),
|
|
||||||
icon: PasswordRound,
|
|
||||||
createdAt: new Date('2024-02-20'),
|
|
||||||
});
|
|
||||||
+2
-2
@@ -5,8 +5,8 @@ import { tool as basicAuthGenerator } from './basic-auth-generator';
|
|||||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||||
|
|
||||||
import { tool as textToUnicode } from './text-to-unicode';
|
import { tool as textToUnicode } from './text-to-unicode';
|
||||||
import { tool as htpasswdGenerator } from './htpasswd-generator';
|
|
||||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||||
|
import { tool as dockerComposeValidator } from './docker-compose-validator';
|
||||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||||
@@ -118,7 +118,6 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
urlParser,
|
urlParser,
|
||||||
deviceInformation,
|
deviceInformation,
|
||||||
basicAuthGenerator,
|
basicAuthGenerator,
|
||||||
htpasswdGenerator,
|
|
||||||
metaTagGenerator,
|
metaTagGenerator,
|
||||||
otpCodeGeneratorAndValidator,
|
otpCodeGeneratorAndValidator,
|
||||||
mimeTypes,
|
mimeTypes,
|
||||||
@@ -148,6 +147,7 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
sqlPrettify,
|
sqlPrettify,
|
||||||
chmodCalculator,
|
chmodCalculator,
|
||||||
dockerRunToDockerComposeConverter,
|
dockerRunToDockerComposeConverter,
|
||||||
|
dockerComposeValidator,
|
||||||
xmlFormatter,
|
xmlFormatter,
|
||||||
yamlViewer,
|
yamlViewer,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import * as monacoEditor from 'monaco-editor';
|
||||||
|
import type { MonacoEditor } from '@guolao/vue-monaco-editor';
|
||||||
|
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||||
|
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||||
|
import CssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
|
||||||
|
import HtmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
|
||||||
|
import TsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
||||||
|
import { useStyleStore } from '@/stores/style.store';
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<EditorProps>(), {
|
||||||
|
theme: 'vs',
|
||||||
|
options: () => ({}),
|
||||||
|
overrideServices: () => ({}),
|
||||||
|
saveViewState: true,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits<{
|
||||||
|
(e: 'update:value', value: string | undefined): void
|
||||||
|
(e: 'beforeMount', monaco: MonacoEditor): void
|
||||||
|
(e: 'mount', editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: MonacoEditor): void
|
||||||
|
(e: 'change', value: string | undefined, event: monacoEditor.editor.IModelContentChangedEvent): void
|
||||||
|
(e: 'validate', markers: monacoEditor.editor.IMarker[]): void
|
||||||
|
}>();
|
||||||
|
|
||||||
|
interface MonacoEnvironment {
|
||||||
|
getWorker(_: any, label: string): Worker
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
|
declare module globalThis {
|
||||||
|
let MonacoEnvironment: MonacoEnvironment;
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = useVModel(props, 'value', emits);
|
||||||
|
|
||||||
|
globalThis.MonacoEnvironment = {
|
||||||
|
getWorker(_: any, label: string) {
|
||||||
|
if (label === 'json') {
|
||||||
|
return new JsonWorker();
|
||||||
|
}
|
||||||
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||||
|
return new CssWorker();
|
||||||
|
}
|
||||||
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||||
|
return new HtmlWorker();
|
||||||
|
}
|
||||||
|
if (label === 'typescript' || label === 'javascript') {
|
||||||
|
return new TsWorker();
|
||||||
|
}
|
||||||
|
return new EditorWorker();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface EditorProps {
|
||||||
|
defaultValue?: string
|
||||||
|
defaultPath?: string
|
||||||
|
defaultLanguage?: string
|
||||||
|
value?: string
|
||||||
|
language?: string
|
||||||
|
path?: string
|
||||||
|
|
||||||
|
/* === */
|
||||||
|
|
||||||
|
theme: 'vs' | string
|
||||||
|
line?: number
|
||||||
|
options?: monacoEditor.editor.IStandaloneEditorConstructionOptions
|
||||||
|
overrideServices?: monacoEditor.editor.IEditorOverrideServices
|
||||||
|
saveViewState?: boolean
|
||||||
|
|
||||||
|
/* === */
|
||||||
|
|
||||||
|
width?: number | string
|
||||||
|
height?: number | string
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
monacoEditor.editor.defineTheme('it-tools-dark', {
|
||||||
|
base: 'vs-dark',
|
||||||
|
inherit: true,
|
||||||
|
rules: [],
|
||||||
|
colors: {
|
||||||
|
'editor.background': '#00000000',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
monacoEditor.editor.defineTheme('it-tools-light', {
|
||||||
|
base: 'vs',
|
||||||
|
inherit: true,
|
||||||
|
rules: [],
|
||||||
|
colors: {
|
||||||
|
'editor.background': '#00000000',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const styleStore = useStyleStore();
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => styleStore.isDarkTheme,
|
||||||
|
isDarkTheme => monacoEditor.editor.setTheme(isDarkTheme ? 'it-tools-dark' : 'it-tools-light'),
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
const attrs = useAttrs();
|
||||||
|
const inheritedAttrs = { ...attrs, ...props };
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
inheritAttrs: false,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<vue-monaco-editor
|
||||||
|
v-bind="inheritedAttrs"
|
||||||
|
v-model:value="value"
|
||||||
|
@before-mount="(monaco: MonacoEditor) => emits('beforeMount', monaco)"
|
||||||
|
@mount="(editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: MonacoEditor) => emits('mount', editor, monaco)"
|
||||||
|
@change="(value: string | undefined, event: monacoEditor.editor.IModelContentChangedEvent) => emits('change', value, event)"
|
||||||
|
@validate="(markers: monacoEditor.editor.IMarker[]) => emits('validate', markers)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { resolve } from 'node:path';
|
import { resolve } from 'node:path';
|
||||||
import { URL, fileURLToPath } from 'node:url';
|
import { URL, fileURLToPath } from 'node:url';
|
||||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
||||||
|
|
||||||
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
||||||
import vue from '@vitejs/plugin-vue';
|
import vue from '@vitejs/plugin-vue';
|
||||||
@@ -98,7 +97,6 @@ export default defineConfig({
|
|||||||
resolvers: [NaiveUiResolver(), IconsResolver({ prefix: 'icon' })],
|
resolvers: [NaiveUiResolver(), IconsResolver({ prefix: 'icon' })],
|
||||||
}),
|
}),
|
||||||
Unocss(),
|
Unocss(),
|
||||||
nodePolyfills(),
|
|
||||||
],
|
],
|
||||||
base: baseUrl,
|
base: baseUrl,
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in new issue
Block a user