mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-27 07:22:28 +03:00
ввод даты
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
<script>
|
||||
import Card from "../components/Card.svelte";
|
||||
|
||||
export let wigetsUpdate;
|
||||
export let layoutJson;
|
||||
|
||||
export let showModal = () => {};
|
||||
export let syntaxHighlight = (json) => {};
|
||||
</script>
|
||||
|
||||
<button on:click={() => showModal()} type="button"> Toggle modal </button>
|
||||
<Card title="Редактор JSON">
|
||||
<textarea on:input={wigetsUpdate} rows="10" class="ipt-big w-full" id="text1">{syntaxHighlight(JSON.stringify(layoutJson))}</textarea>
|
||||
</Card>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
{#if show}
|
||||
<div class="grd-3col1">
|
||||
{#if layoutJson === []}
|
||||
{#if !layoutJson}
|
||||
<Card title={"Ваша панель управления пуста, вначале добавьте новые элементы в конфигураторе!"} />
|
||||
{/if}
|
||||
{#each pages as pagesName, p}
|
||||
|
||||
40
src/pages/Dev.svelte
Normal file
40
src/pages/Dev.svelte
Normal file
@@ -0,0 +1,40 @@
|
||||
<script>
|
||||
import Card from "../components/Card.svelte";
|
||||
|
||||
const syntaxHighlight = (json) => {
|
||||
try {
|
||||
json = JSON.stringify(JSON.parse(json), null, 4);
|
||||
} catch (e) {
|
||||
return json;
|
||||
}
|
||||
json = json.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||
json = json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
|
||||
return match;
|
||||
});
|
||||
return json;
|
||||
};
|
||||
|
||||
export let errorsJson;
|
||||
export let layoutJson;
|
||||
export let settingsJson;
|
||||
export let configJson;
|
||||
export let itemsJson;
|
||||
</script>
|
||||
|
||||
<div class="grd-3col1">
|
||||
<Card title="layoutJson">
|
||||
<textarea on:input={layoutJson} rows="23" cols="50" id="1">{syntaxHighlight(JSON.stringify(layoutJson))}</textarea>
|
||||
</Card>
|
||||
<Card title="errorsJson">
|
||||
<textarea on:input={errorsJson} rows="23" cols="50" id="2">{syntaxHighlight(JSON.stringify(errorsJson))}</textarea>
|
||||
</Card>
|
||||
<Card title="settingsJson">
|
||||
<textarea on:input={settingsJson} rows="23" cols="50" id="3">{syntaxHighlight(JSON.stringify(settingsJson))}</textarea>
|
||||
</Card>
|
||||
<Card title="configJson">
|
||||
<textarea on:input={configJson} rows="23" cols="50" id="3">{syntaxHighlight(JSON.stringify(configJson))}</textarea>
|
||||
</Card>
|
||||
<Card title="itemsJson">
|
||||
<textarea on:input={itemsJson} rows="23" cols="50" id="3">{syntaxHighlight(JSON.stringify(itemsJson))}</textarea>
|
||||
</Card>
|
||||
</div>
|
||||
Reference in New Issue
Block a user