mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-27 07:22:28 +03:00
anydata added
This commit is contained in:
18
src/widgets/Anydata.svelte
Normal file
18
src/widgets/Anydata.svelte
Normal file
@@ -0,0 +1,18 @@
|
||||
<script context="module">
|
||||
import { WSpush } from "../App.svelte";
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let widget;
|
||||
</script>
|
||||
|
||||
<div class="card-items-psn-inline">
|
||||
<div class="widget-descr-width-inline">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
||||
</div>
|
||||
<div class="widget-width-inline">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="widget-anydata-style">{!widget.status ? "" : widget.status}</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -7,11 +7,11 @@
|
||||
</script>
|
||||
|
||||
<div class="card-items-psn">
|
||||
<div class="widget-descr-width">
|
||||
<div class="widget-descr-width-ajustable">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
||||
</div>
|
||||
<div class="widget-width-input">
|
||||
<div class="widget-width-ajustable">
|
||||
{#if widget.type == "number"}
|
||||
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input 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}
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
</script>
|
||||
|
||||
<div class="card-items-psn-inline">
|
||||
<div class="widget-descr-width-2-3">
|
||||
<div class="widget-descr-width-inline">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
||||
</div>
|
||||
<div class="widget-width-toggle">
|
||||
<div class="widget-width-inline">
|
||||
<label for={widget.topic} class="items-center cursor-pointer">
|
||||
<div class="relative">
|
||||
<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" />
|
||||
|
||||
Reference in New Issue
Block a user