mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-26 15:43:59 +03:00
1 parent
c96fd39482
commit
0f4c7b1d68
2 files changed
+17
-3
No files matched your search
@@ -2697,6 +2697,7 @@ tools:
|
|||||||
title-schema-validation-errors: Schema Validation Errors
|
title-schema-validation-errors: Schema Validation Errors
|
||||||
label-indent-size-0-compact: 'Indent size (0 = Compact):'
|
label-indent-size-0-compact: 'Indent size (0 = Compact):'
|
||||||
repair-json: Repair JSON
|
repair-json: Repair JSON
|
||||||
|
label-auto-height: Auto Height
|
||||||
externalAccess: >-
|
externalAccess: >-
|
||||||
This tool may download a JSON schema from https://www.schemastore.org when
|
This tool may download a JSON schema from https://www.schemastore.org when
|
||||||
validation is requested. No data is send externally.
|
validation is requested. No data is send externally.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const styleStore = useStyleStore();
|
const styleStore = useStyleStore();
|
||||||
|
|
||||||
const jsonText = ref('{ "a": { "array": [1, 2, 3] } }');
|
const jsonText = useITStorage('json-editor:data', '{ "a": { "array": [1, 2, 3] } }');
|
||||||
const jsonPath = ref('');
|
const jsonPath = ref('');
|
||||||
|
|
||||||
function updateJsonPath(selection: JSONEditorSelection) {
|
function updateJsonPath(selection: JSONEditorSelection) {
|
||||||
@@ -46,7 +46,8 @@ function updateJsonPath(selection: JSONEditorSelection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const jsonSchemaInputElement = ref<HTMLElement>();
|
const jsonSchemaInputElement = ref<HTMLElement>();
|
||||||
const schemaData = useITStorage('json-linter:schema-data', '');
|
const schemaData = useITStorage('json-editor:schema-data', '');
|
||||||
|
const autoHeight = useITStorage('json-editor:auto-height', false);
|
||||||
|
|
||||||
const schemaUrl = useQueryParamOrStorage<string>({
|
const schemaUrl = useQueryParamOrStorage<string>({
|
||||||
name: 'schema',
|
name: 'schema',
|
||||||
@@ -74,10 +75,17 @@ const formattedJson = computed(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<n-space justify="center">
|
||||||
|
<n-checkbox v-model:checked="autoHeight" mb-2>
|
||||||
|
{{ t('tools.json-editor.texts.label-auto-height') }}
|
||||||
|
</n-checkbox>
|
||||||
|
</n-space>
|
||||||
|
|
||||||
<JsonEditorVue
|
<JsonEditorVue
|
||||||
v-model="jsonText"
|
v-model="jsonText"
|
||||||
:mode="Mode.text"
|
:mode="Mode.text"
|
||||||
:class="styleStore.isDarkTheme ? 'jse-theme-dark' : ''"
|
:class="styleStore.isDarkTheme ? 'jse-theme-dark' : ''"
|
||||||
|
:style="autoHeight ? { height: '80vh' } : {}"
|
||||||
:on-select="updateJsonPath"
|
:on-select="updateJsonPath"
|
||||||
mb-2
|
mb-2
|
||||||
/>
|
/>
|
||||||
@@ -98,7 +106,12 @@ const formattedJson = computed(() => {
|
|||||||
<n-input-number-i18n v-model:value="indentSize" min="0" max="10" style="width: 100px" />
|
<n-input-number-i18n v-model:value="indentSize" min="0" max="10" style="width: 100px" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.json-editor.texts.label-your-edited-json')">
|
<n-form-item :label="t('tools.json-editor.texts.label-your-edited-json')">
|
||||||
<textarea-copyable :value="formattedJson" language="json" download-file-name="output.json" />
|
<textarea-copyable
|
||||||
|
:value="formattedJson"
|
||||||
|
language="json"
|
||||||
|
download-file-name="output.json"
|
||||||
|
:style="autoHeight ? { height: '80vh' } : {}"
|
||||||
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item
|
<n-form-item
|
||||||
|
|||||||
Reference in new issue
Block a user