mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 15:02:21 +03:00
cleaning
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
<script>
|
||||
export let show = true;
|
||||
export let header = "header";
|
||||
export let text = "text";
|
||||
let onlyCloseButton = true;
|
||||
</script>
|
||||
|
||||
<div class="modal">
|
||||
{#if show}
|
||||
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true" />
|
||||
<!-- This element is to trick the browser into centering the modal contents. -->
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
|
||||
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
||||
<div class="sm:flex sm:items-start">
|
||||
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title">{header}</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">{text}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
{#if onlyCloseButton}
|
||||
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"> Deactivate </button>
|
||||
{/if}
|
||||
<button on:click={() => (show = false)} type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">Закрыть</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -1,36 +0,0 @@
|
||||
<script>
|
||||
export let show = true;
|
||||
export let pass;
|
||||
export let checkPassword = (pass) => {};
|
||||
|
||||
import Card from "../components/Card.svelte";
|
||||
</script>
|
||||
|
||||
<div class="modal">
|
||||
{#if show}
|
||||
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true" />
|
||||
<!-- This element is to trick the browser into centering the modal contents. -->
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
<div class="inline-block align-bottom bg-white rounded-lg overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
|
||||
<Card>
|
||||
<div class="flex items-center mb-4">
|
||||
<div class="w-1/2">
|
||||
<h2 class="pr-4 text-gray-500 font-bold text-xxl truncate">Введите пароль</h2>
|
||||
</div>
|
||||
<div class="flex justify-center w-1/2">
|
||||
<input bind:value={pass} class="ipt-rnd text-center focus:border-indigo-500" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="grd-2col1">
|
||||
<button class="btn-lg">{"Закрыть"}</button>
|
||||
<button class="btn-lg" on:click={() => checkPassword(pass)}>{"Вход"}</button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -1,11 +0,0 @@
|
||||
<script>
|
||||
import Card from "../components/Card.svelte";
|
||||
|
||||
export let coreMessages;
|
||||
</script>
|
||||
|
||||
<Card title={"Лог"}>
|
||||
{#each coreMessages as message, i}
|
||||
<div class={message.msg.toString().includes("[E]") ? "text-red-500" : "text-black"}>{message.msg}</div>
|
||||
{/each}
|
||||
</Card>
|
||||
@@ -1,53 +0,0 @@
|
||||
<script>
|
||||
import Card from "../components/Card.svelte";
|
||||
import Alarm from "../components/Alarm.svelte";
|
||||
import Chart from "svelte-frappe-charts";
|
||||
|
||||
let datachart = {
|
||||
labels: ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"],
|
||||
datasets: [
|
||||
{
|
||||
values: [10, 12, 3, 9, 8, 15, 9],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
//объединение двух массивов с удалением дубликатов полностью
|
||||
let a = [
|
||||
{ item: "1", description: "lorem" },
|
||||
{ item: "2", description: "impsum" },
|
||||
];
|
||||
let b = [
|
||||
{ item: "2", description: "dolor" },
|
||||
{ item: "4", description: "enum" },
|
||||
];
|
||||
function joinWithoutDupes(A, B) {
|
||||
let output = [];
|
||||
const a = new Set(A.map((x) => x.item));
|
||||
const b = new Set(B.map((x) => x.item));
|
||||
output = [...A.filter((x) => !b.has(x.item)), ...B.filter((x) => !a.has(x.item))];
|
||||
console.log(output);
|
||||
}
|
||||
//объединение двух массивов с удалением дубликатов, оставляя один из дубликатов
|
||||
let c = [
|
||||
{ ID: "1", description: "lorem" },
|
||||
{ ID: "2", description: "impsum" },
|
||||
];
|
||||
let d = [
|
||||
{ ID: "2", description: "dolor" },
|
||||
{ ID: "4", description: "enum" },
|
||||
];
|
||||
function joinWithoutDupesAndRmooving(A, B) {
|
||||
var ids = new Set(A.map((d) => d.ID));
|
||||
let output = [...A, ...B.filter((d) => !ids.has(d.ID))];
|
||||
console.log(output);
|
||||
}
|
||||
</script>
|
||||
|
||||
<Alarm>
|
||||
<button class="btn-lg" on:click={() => joinWithoutDupesAndRmooving(c, d)}>{"Проверить"}</button>
|
||||
</Alarm>
|
||||
|
||||
<Alarm>
|
||||
<Chart data={datachart} type="line" />
|
||||
</Alarm>
|
||||
@@ -1,7 +0,0 @@
|
||||
<script>
|
||||
export let color;
|
||||
export let x = 0;
|
||||
export let y = 0;
|
||||
</script>
|
||||
|
||||
<svg class="h-8 w-8 {color}" width="8" height="8" viewBox="{x} {y} 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" /> <rect x="4" y="4" width="16" height="16" rx="2" /> <line x1="4" y1="12" x2="20" y2="12" /> <line x1="12" y1="4" x2="12" y2="20" /></svg>
|
||||
@@ -1,29 +0,0 @@
|
||||
<script>
|
||||
let dataReceived;
|
||||
let awaiting = 0;
|
||||
|
||||
async function awaitingData() {
|
||||
console.log("Awaiting Data start...");
|
||||
return new Promise(function (resolve, reject) {
|
||||
setTimeout(() => reject(), 10000);
|
||||
dataReceived = resolve;
|
||||
});
|
||||
}
|
||||
|
||||
function startAwaiting() {
|
||||
awaiting = awaitingData();
|
||||
}
|
||||
|
||||
function onReceive() {
|
||||
dataReceived();
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await awaiting}
|
||||
<p>Connecting...</p>
|
||||
<button on:click={() => onReceive()}>Resolve</button>
|
||||
{:then}
|
||||
<button on:click={() => startAwaiting()}>Start</button>
|
||||
{:catch}
|
||||
<p>error</p>
|
||||
{/await}
|
||||
@@ -1,7 +0,0 @@
|
||||
<script>
|
||||
// вывести время чего либо в консоль
|
||||
var t0 = performance.now();
|
||||
var t1 = performance.now();
|
||||
console.log("layout time: " + (t1 - t0) + " mls");
|
||||
//
|
||||
</script>
|
||||
Reference in New Issue
Block a user