mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-27 23:42:33 +03:00
реорганизация файлов проекта
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
export let widget;
|
||||
export let wsPushProp = (ws, topic, status) => {};
|
||||
export let wsPush = (ws, topic, status) => {};
|
||||
export let value;
|
||||
value = value;
|
||||
</script>
|
||||
@@ -12,16 +12,16 @@
|
||||
</div>
|
||||
<div class="wgt-w">
|
||||
{#if widget.type == "number"}
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} step="0.1" type="number" />
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} step="0.1" type="number" />
|
||||
{/if}
|
||||
{#if widget.type == "text"}
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="text" />
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="text" />
|
||||
{/if}
|
||||
{#if widget.type == "date"}
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="date" />
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="date" />
|
||||
{/if}
|
||||
{#if widget.type == "time"}
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="time" />
|
||||
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="time" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
export let widget;
|
||||
export let value;
|
||||
value = value;
|
||||
export let wsPushProp = (ws, topic, status) => {};
|
||||
export let wsPush = (ws, topic, status) => {};
|
||||
</script>
|
||||
|
||||
<div class="crd-itm-psn">
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="wgt-w">
|
||||
<label for={widget.topic} class="items-center cursor-pointer">
|
||||
<div class="relative">
|
||||
<input on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} id={widget.topic} type="checkbox" class="sr-only" />
|
||||
<input on:change={() => ((widget["send"] = true), wsPush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} id={widget.topic} type="checkbox" class="sr-only" />
|
||||
<div class="block bg-gray-600 w-10 h-6 rounded-full" />
|
||||
<div class="dot {widget['send'] == true ? 'bg-red-400' : 'bg-white'} absolute left-1 top-1 w-4 h-4 rounded-full transition" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user