2021-09-16 02:00:52 +08:00
|
|
|
<script>
|
|
|
|
|
import { onMount } from "svelte";
|
2024-08-24 23:00:03 +02:00
|
|
|
import { Route, router } from "tinro";
|
2022-02-07 02:08:21 +01:00
|
|
|
import Alarm from "./components/Alarm.svelte";
|
2022-02-08 16:47:26 +01:00
|
|
|
import Progress from "./components/Progress.svelte";
|
2022-02-06 23:02:20 +01:00
|
|
|
import DashboardPage from "./pages/Dashboard.svelte";
|
|
|
|
|
import ConfigPage from "./pages/Config.svelte";
|
|
|
|
|
import ConnectionPage from "./pages/Connection.svelte";
|
2022-02-08 21:42:40 +01:00
|
|
|
import ListPage from "./pages/List.svelte";
|
|
|
|
|
import SystemPage from "./pages/System.svelte";
|
2023-10-05 01:39:15 +02:00
|
|
|
import Cookies from "js-cookie";
|
2024-08-24 23:00:03 +02:00
|
|
|
import CloudIcon from "./svg/Cloud.svelte";
|
|
|
|
|
import WebSocketManager from "./WebSocketManager";
|
2022-02-08 21:42:40 +01:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
router.mode.hash();
|
2021-12-26 01:34:29 +01:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
let opened = true;
|
2022-02-07 16:36:43 +01:00
|
|
|
|
2022-10-09 17:03:41 +02:00
|
|
|
const debug = true;
|
2024-08-24 23:00:03 +02:00
|
|
|
const devMode = true;
|
2023-10-05 14:38:57 +02:00
|
|
|
let screenSize;
|
2022-08-16 00:56:12 +02:00
|
|
|
let myip = document.location.hostname;
|
2024-08-24 23:00:03 +02:00
|
|
|
if (devMode) myip = "192.168.0.103";
|
2021-12-14 20:55:53 +01:00
|
|
|
|
2023-06-08 22:37:43 +02:00
|
|
|
let showDropdown = true;
|
2023-06-13 21:06:04 +02:00
|
|
|
let showAwaitingCircle = false;
|
2024-08-24 23:00:03 +02:00
|
|
|
let currentPageName = undefined;
|
2022-02-24 00:59:10 +01:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
let deviceList = [
|
2021-12-13 02:36:26 +01:00
|
|
|
{
|
2022-02-07 23:40:00 +01:00
|
|
|
name: "--",
|
|
|
|
|
id: "--",
|
|
|
|
|
ip: myip,
|
2022-02-13 23:13:08 +01:00
|
|
|
ws: 0,
|
2022-02-07 02:08:21 +01:00
|
|
|
status: false,
|
|
|
|
|
},
|
2021-12-13 02:36:26 +01:00
|
|
|
];
|
2022-10-09 14:31:07 +02:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
const wsManager = new WebSocketManager(deviceList, debug);
|
2022-02-05 02:13:46 +01:00
|
|
|
|
2021-12-16 00:18:40 +01:00
|
|
|
router.subscribe(handleNavigation);
|
|
|
|
|
|
2022-01-30 17:44:53 +01:00
|
|
|
function handleNavigation() {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.currentPageName = $router.path.toString();
|
|
|
|
|
wsManager.currentPageName = wsManager.currentPageName + "|";
|
2023-06-11 17:01:57 +02:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
console.log("[i]", "user on page:", wsManager.currentPageName);
|
2023-06-09 01:00:14 +02:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
//wsManager.clearData();
|
2023-06-08 22:37:43 +02:00
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
if (wsManager.currentPageName === "/|") {
|
|
|
|
|
wsManager.sendToAllDevices(wsManager.currentPageName);
|
2023-06-11 17:01:57 +02:00
|
|
|
showDropdown = false;
|
2022-02-26 01:09:17 +01:00
|
|
|
} else {
|
2024-08-24 23:00:03 +02:00
|
|
|
if (wsManager.currentPageName === "/list|") {
|
2023-06-11 17:01:57 +02:00
|
|
|
showDropdown = false;
|
|
|
|
|
} else {
|
|
|
|
|
showDropdown = true;
|
|
|
|
|
}
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.sendCurrentPageNameToSelectedWs();
|
2022-02-26 01:09:17 +01:00
|
|
|
}
|
2022-01-30 17:44:53 +01:00
|
|
|
}
|
|
|
|
|
|
2022-02-23 22:56:17 +01:00
|
|
|
onMount(async () => {
|
|
|
|
|
console.log("[i]", "mounted");
|
2023-10-05 01:39:15 +02:00
|
|
|
await getUser();
|
2023-10-05 14:38:57 +02:00
|
|
|
onCheck();
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.selectedDeviceDataRefresh();
|
|
|
|
|
wsManager.connectToAllDevices();
|
|
|
|
|
wsManager.wsTestMsgTask();
|
2022-02-23 22:56:17 +01:00
|
|
|
});
|
|
|
|
|
|
2023-10-05 01:39:15 +02:00
|
|
|
const getUser = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const JWT = Cookies.get("token_iotm2");
|
|
|
|
|
let res = await fetch("https://portal.iotmanager.org/api/user/email", {
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
Authorization: `Bearer ${JWT}`,
|
|
|
|
|
},
|
|
|
|
|
mode: "cors",
|
|
|
|
|
method: "GET",
|
|
|
|
|
});
|
|
|
|
|
if (res.ok) {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.userdata = await res.json();
|
|
|
|
|
wsManager.serverOnline = true;
|
2023-10-10 16:14:19 +02:00
|
|
|
} else {
|
|
|
|
|
console.log("error", res.statusText);
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.serverOnline = true;
|
2023-10-10 16:14:19 +02:00
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log("error", e);
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.serverOnline = false;
|
2023-10-10 16:14:19 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
function onCheck() {
|
|
|
|
|
if (screenSize < 900) {
|
|
|
|
|
wsManager.preventMove = true;
|
2021-12-08 22:59:21 +01:00
|
|
|
} else {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.preventMove = false;
|
2021-12-07 22:14:59 +01:00
|
|
|
}
|
2021-12-06 01:21:55 +01:00
|
|
|
}
|
|
|
|
|
|
2022-02-07 23:40:00 +01:00
|
|
|
function devicesDropdownChange() {
|
2024-08-24 23:00:03 +02:00
|
|
|
if (wsManager.currentPageName === "/list|") {
|
2023-06-11 17:01:57 +02:00
|
|
|
console.log("[i]", "user change dropdown on list page!!!");
|
|
|
|
|
} else {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.selectedDeviceDataRefresh();
|
|
|
|
|
//wsManager.clearData();
|
2023-06-11 17:01:57 +02:00
|
|
|
handleNavigation();
|
2024-08-24 23:00:03 +02:00
|
|
|
if (debug) console.log("[i]", "user selected device:", wsManager.selectedDeviceData.name);
|
|
|
|
|
if (wsManager.selectedDeviceData.ip === myip) {
|
|
|
|
|
wsManager.originalWs = wsManager.selectedWs;
|
|
|
|
|
if (debug) console.log("[i]", "user selected original device", wsManager.selectedDeviceData.name);
|
2023-06-11 17:01:57 +02:00
|
|
|
}
|
2021-12-13 00:01:21 +01:00
|
|
|
}
|
2021-12-09 22:35:04 +01:00
|
|
|
}
|
|
|
|
|
|
2022-02-12 03:07:59 +01:00
|
|
|
function ssidClick() {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.wsSendMsg(wsManager.selectedWs, "/scan|");
|
2022-02-05 02:13:46 +01:00
|
|
|
}
|
|
|
|
|
|
2022-02-08 16:47:26 +01:00
|
|
|
function rebootEsp() {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.rebootOrUpdateProcess = true;
|
2022-02-08 16:47:26 +01:00
|
|
|
if (debug) console.log("[i]", "reboot...");
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.wsSendMsg(wsManager.selectedWs, "/reboot|");
|
|
|
|
|
wsManager.markDeviceStatus(wsManager.selectedWs, false);
|
2023-06-13 21:06:04 +02:00
|
|
|
showAwaitingCircle = true;
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.socketConnected = false;
|
|
|
|
|
wsManager.reconnectTimeout = 10;
|
|
|
|
|
wsManager.remainingTimeout = wsManager.reconnectTimeout;
|
2023-06-13 21:06:04 +02:00
|
|
|
}
|
|
|
|
|
|
2023-10-06 01:36:13 +02:00
|
|
|
function updateBuild(path) {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.rebootOrUpdateProcess = true;
|
2023-10-06 01:36:13 +02:00
|
|
|
console.log(path);
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.wsSendMsg(wsManager.selectedWs, "/update|" + path);
|
2023-10-06 01:36:13 +02:00
|
|
|
showAwaitingCircle = true;
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.socketConnected = false;
|
|
|
|
|
wsManager.reconnectTimeout = 20;
|
|
|
|
|
wsManager.remainingTimeout = wsManager.reconnectTimeout;
|
2023-10-06 01:36:13 +02:00
|
|
|
}
|
|
|
|
|
|
2023-06-13 21:06:04 +02:00
|
|
|
function applicationReboot() {
|
|
|
|
|
console.log("[i]", "reboot svelte...");
|
2024-08-24 23:00:03 +02:00
|
|
|
for (const key in wsManager.pageReady) {
|
|
|
|
|
wsManager.pageReady[key] = false;
|
2023-06-13 21:06:04 +02:00
|
|
|
}
|
|
|
|
|
showAwaitingCircle = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
}, 1000);
|
2022-02-08 16:47:26 +01:00
|
|
|
}
|
|
|
|
|
|
2022-02-09 16:43:24 +01:00
|
|
|
function cancelAlarm(alarmKey) {
|
|
|
|
|
console.log("[x]", alarmKey);
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.errorsJson[alarmKey] = 0;
|
|
|
|
|
wsManager.wsSendMsg(wsManager.selectedWs, '/rorre|{"' + alarmKey + '":0}');
|
2022-02-09 16:43:24 +01:00
|
|
|
}
|
2022-02-11 19:32:05 +01:00
|
|
|
|
2022-02-18 19:48:15 +01:00
|
|
|
async function getVersionsList() {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.versionsList = {};
|
|
|
|
|
if (wsManager.settingsJson.serverip) {
|
2022-09-25 17:49:24 +02:00
|
|
|
try {
|
2024-08-24 23:00:03 +02:00
|
|
|
let url = wsManager.settingsJson.serverip + "/iotm/ver.json";
|
2022-09-25 17:49:24 +02:00
|
|
|
console.log("url", url);
|
|
|
|
|
let res = await fetch(url, {
|
|
|
|
|
mode: "cors",
|
|
|
|
|
method: "GET",
|
|
|
|
|
});
|
|
|
|
|
if (res.ok) {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.versionsList = await res.json();
|
|
|
|
|
wsManager.versionsList = wsManager.versionsList[wsManager.errorsJson.bn];
|
|
|
|
|
wsManager.choosingVersion = wsManager.errorsJson.bver;
|
|
|
|
|
console.log(JSON.stringify(wsManager.versionsList));
|
2022-09-25 17:49:24 +02:00
|
|
|
} else {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.choosingVersion = undefined;
|
2022-09-25 17:49:24 +02:00
|
|
|
console.log("error, versions list not received", res.statusText);
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.choosingVersion = undefined;
|
2022-09-25 17:49:24 +02:00
|
|
|
console.log("error, versions list not received");
|
|
|
|
|
console.log(e);
|
2022-02-18 19:48:15 +01:00
|
|
|
}
|
2022-09-25 17:49:24 +02:00
|
|
|
} else {
|
|
|
|
|
console.log("error, server missing");
|
2022-02-18 19:48:15 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-14 00:52:42 +01:00
|
|
|
function moduleOrder(id, key, value) {
|
|
|
|
|
console.log("order: ", id, key, value);
|
|
|
|
|
let json = {
|
|
|
|
|
id: id,
|
|
|
|
|
key: key,
|
|
|
|
|
value: value,
|
|
|
|
|
};
|
|
|
|
|
console.log(json);
|
2024-08-24 23:00:03 +02:00
|
|
|
wsManager.wsSendMsg(wsManager.selectedWs, "/order|" + JSON.stringify(json));
|
2022-12-14 00:52:42 +01:00
|
|
|
}
|
2021-09-16 02:00:52 +08:00
|
|
|
</script>
|
|
|
|
|
|
2023-10-05 14:38:57 +02:00
|
|
|
<svelte:window bind:innerWidth={screenSize} />
|
|
|
|
|
|
2022-02-01 16:01:19 +01:00
|
|
|
<div class="flex flex-col h-screen bg-gray-50">
|
2023-06-13 21:06:04 +02:00
|
|
|
{#if showAwaitingCircle}
|
2022-02-08 16:47:26 +01:00
|
|
|
<Progress />
|
|
|
|
|
{/if}
|
2023-06-17 22:26:52 +02:00
|
|
|
|
|
|
|
|
<!--{#if authorization}
|
|
|
|
|
<ModalPass checkPassword={(pass) => checkPassword(pass)} />
|
|
|
|
|
{/if}-->
|
|
|
|
|
|
2022-02-01 16:01:19 +01:00
|
|
|
<header class="h-10 w-full bg-gray-100 overflow-auto shadow-md">
|
2022-02-07 16:36:43 +01:00
|
|
|
<div class="flex content-center items-center justify-end">
|
2023-06-08 22:37:43 +02:00
|
|
|
{#if showDropdown}
|
|
|
|
|
<div class="px-15 py-1">
|
2024-08-24 23:00:03 +02:00
|
|
|
<select class="border border-indigo-500 border-1" bind:value={wsManager.selectedWs} on:change={() => devicesDropdownChange()}>
|
2023-06-08 22:37:43 +02:00
|
|
|
{#each deviceList as device}
|
|
|
|
|
<option value={device.ws}>
|
|
|
|
|
{device.name}
|
|
|
|
|
</option>
|
|
|
|
|
{/each}
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2022-08-31 22:25:22 +02:00
|
|
|
<!--<div class="pl-4 pr-1 py-1">-->
|
|
|
|
|
<!--<BookIcon color={socketConnected === true ? "text-green-500" : "text-red-500"} />-->
|
|
|
|
|
<!--</div>-->
|
2022-02-07 16:36:43 +01:00
|
|
|
<div class="pl-4 pr-4 py-1">
|
2024-08-24 23:00:03 +02:00
|
|
|
<CloudIcon color={wsManager.socketConnected === true ? "text-green-500" : "text-red-500"} />
|
2021-12-09 00:10:10 +01:00
|
|
|
</div>
|
2021-12-06 01:21:55 +01:00
|
|
|
</div>
|
2022-02-01 16:01:19 +01:00
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<nav class="flex">
|
2022-02-24 00:59:10 +01:00
|
|
|
<input class="w-0 h-0" bind:checked={opened} on:change={() => onCheck()} id="menu__toggle" type="checkbox" />
|
|
|
|
|
|
2022-02-01 16:01:19 +01:00
|
|
|
<label class="menu__btn" for="menu__toggle">
|
|
|
|
|
<span />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<ul class="menu__box">
|
|
|
|
|
<li>
|
|
|
|
|
<a class="menu__item" href="/">{"Управление"}</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a class="menu__item" href="/config">{"Конфигуратор"}</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a class="menu__item" href="/connection">{"Подключение"}</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
2023-06-13 21:06:04 +02:00
|
|
|
<a class="menu__item" href="/system">{"Системные"}</a>
|
2022-02-01 16:01:19 +01:00
|
|
|
</li>
|
|
|
|
|
<li>
|
2023-06-13 21:06:04 +02:00
|
|
|
<a class="menu__item" href="/list">{"Устройства"}</a>
|
2022-02-01 16:01:19 +01:00
|
|
|
</li>
|
2024-08-24 23:00:03 +02:00
|
|
|
{#if wsManager.userdata}
|
2023-10-05 01:39:15 +02:00
|
|
|
<li>
|
|
|
|
|
<a class="menu__item" href="/profile">{"Модули"}</a>
|
|
|
|
|
</li>
|
|
|
|
|
{:else}
|
|
|
|
|
<li>
|
|
|
|
|
<a class="menu__item" href="/login">{"Вход"}</a>
|
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
2023-10-02 17:25:05 +02:00
|
|
|
<li class="flex flex-col pl-6 pt-3 w-full h-screen">
|
2023-10-02 17:51:40 +02:00
|
|
|
<!--<select class="border border-indigo-500 border-1 h-6 w-12" bind:value={$locale}>
|
2023-10-02 17:25:05 +02:00
|
|
|
{#each locales as l}
|
|
|
|
|
<option value={l}>{l}</option>
|
|
|
|
|
{/each}
|
2023-10-02 17:51:40 +02:00
|
|
|
</select>-->
|
2023-10-02 17:25:05 +02:00
|
|
|
</li>
|
2022-02-01 16:01:19 +01:00
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
|
2024-08-24 23:00:03 +02:00
|
|
|
<main class="flex-1 overflow-y-auto p-0 {opened === true && !wsManager.preventMove ? 'ml-36' : 'ml-0'}">
|
2022-02-01 16:01:19 +01:00
|
|
|
<ul class="menu__main">
|
|
|
|
|
<div class="bg-cover pt-0 px-4">
|
2024-08-24 23:00:03 +02:00
|
|
|
{#if !wsManager.socketConnected && wsManager.currentPageName != "/|"}
|
|
|
|
|
<Alarm title="Подключение через {wsManager.remainingTimeout} сек." />
|
2022-02-05 02:13:46 +01:00
|
|
|
{:else}
|
|
|
|
|
<Route path="/">
|
2024-08-24 23:00:03 +02:00
|
|
|
<DashboardPage show={wsManager.pageReady.dash} layoutJson={wsManager.layoutJson} pages={wsManager.pages} wsPush={(ws, topic, status) => wsManager.wsPush(ws, topic, status)} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
2024-08-24 23:00:03 +02:00
|
|
|
<!--<Route path="/config">
|
2023-10-15 02:28:10 +02:00
|
|
|
<ConfigPage show={pageReady.config} bind:configJson={configJson} bind:scenarioTxt={scenarioTxt} widgetsJson={widgetsJson} itemsJson={itemsJson} saveConfig={() => saveConfig()} cleanLogs={() => cleanLogs()} rebootEsp={() => rebootEsp()} moduleOrder={(id, key, value) => moduleOrder(id, key, value)} userdata={userdata} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/connection">
|
2022-09-25 17:49:24 +02:00
|
|
|
<ConnectionPage show={pageReady.connection} rebootEsp={() => rebootEsp()} ssidClick={() => ssidClick()} saveSett={() => saveSett()} saveMqtt={() => saveMqtt()} settingsJson={settingsJson} errorsJson={errorsJson} ssidJson={ssidJson} />
|
2022-02-13 00:37:58 +01:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/list">
|
2023-06-13 21:06:04 +02:00
|
|
|
<ListPage show={pageReady.list} deviceList={deviceList} settingsJson={settingsJson} saveSett={() => saveSett()} rebootEsp={() => rebootEsp()} showInput={showInput} addDevInList={() => addDevInList()} newDevice={newDevice} sendToAllDevices={(msg) => sendToAllDevices(msg)} saveList={() => saveList()} percent={percent} devListOverride={() => devListOverride()} applicationReboot={() => applicationReboot()} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
2022-02-08 21:42:40 +01:00
|
|
|
<Route path="/system">
|
2023-10-06 01:07:49 +02:00
|
|
|
<SystemPage show={pageReady.system} errorsJson={errorsJson} settingsJson={settingsJson} saveSett={() => saveSett()} rebootEsp={() => rebootEsp()} cleanLogs={() => cleanLogs()} cancelAlarm={(alarmKey) => cancelAlarm(alarmKey)} versionsList={versionsList} bind:choosingVersion={choosingVersion} coreMessages={coreMessages} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
2023-10-02 17:25:05 +02:00
|
|
|
|
2023-10-04 18:56:24 +02:00
|
|
|
<Route path="/profile">
|
2023-10-11 01:50:08 +02:00
|
|
|
<Profile show={pageReady.profile} flashProfileJson={flashProfileJson} userdata={userdata} updateBuild={(path) => updateBuild(path)} allmodeinfo={allmodeinfo} profile={profile} serverOnline={serverOnline} otaJson={otaJson} />
|
2023-10-05 01:39:15 +02:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/login">
|
2023-10-10 16:14:19 +02:00
|
|
|
<Login show={true} serverOnline={serverOnline} />
|
2024-08-24 23:00:03 +02:00
|
|
|
</Route>-->
|
2022-02-05 02:13:46 +01:00
|
|
|
{/if}
|
2022-02-01 16:01:19 +01:00
|
|
|
</div>
|
|
|
|
|
</ul>
|
|
|
|
|
</main>
|
2022-02-05 02:13:46 +01:00
|
|
|
|
2023-06-08 22:37:43 +02:00
|
|
|
<footer class="h-4 bg-gray-100 border-gray-300 shadow-lg">
|
2022-02-07 16:36:43 +01:00
|
|
|
<div class="flex justify-center content-center text-xxs text-gray-500">Developed by Dmitry Borisenko</div>
|
|
|
|
|
</footer>
|
2022-02-01 16:01:19 +01:00
|
|
|
</div>
|
2021-09-16 02:00:52 +08:00
|
|
|
|
|
|
|
|
<style lang="postcss" global>
|
|
|
|
|
@tailwind base;
|
|
|
|
|
@tailwind components;
|
|
|
|
|
@tailwind utilities;
|
|
|
|
|
|
|
|
|
|
@layer components {
|
2022-02-07 16:36:43 +01:00
|
|
|
/*==================================================grids=====================================================*/
|
|
|
|
|
.grd-1col1 {
|
2021-10-16 20:49:17 +00:00
|
|
|
@apply grid grid-cols-1 justify-items-center;
|
|
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
.grd-2col1 {
|
2022-02-08 16:47:26 +01:00
|
|
|
@apply grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2 2xl:grid-cols-2 justify-items-center;
|
2022-02-07 16:36:43 +01:00
|
|
|
}
|
|
|
|
|
.grd-2col2 {
|
|
|
|
|
@apply grid gap-4 grid-cols-2 justify-items-center;
|
|
|
|
|
}
|
|
|
|
|
.grd-3col1 {
|
|
|
|
|
@apply grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 2xl:grid-cols-3 justify-items-center;
|
|
|
|
|
}
|
2023-06-02 15:29:45 +02:00
|
|
|
.grd-4col1 {
|
|
|
|
|
@apply grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 justify-items-center;
|
|
|
|
|
}
|
2021-10-20 20:53:07 +08:00
|
|
|
/*=============================================card and items inside===============================================*/
|
2021-12-28 23:55:14 +01:00
|
|
|
.crd-itm-psn {
|
2023-06-02 15:29:45 +02:00
|
|
|
@apply flex mb-2 h-6 items-center;
|
2021-10-20 20:53:07 +08:00
|
|
|
}
|
2021-12-28 23:55:14 +01:00
|
|
|
.wgt-dscr-stl {
|
2021-10-20 20:53:07 +08:00
|
|
|
@apply pr-4 text-gray-500 font-bold;
|
|
|
|
|
}
|
2021-10-25 16:50:31 +07:00
|
|
|
/*====================================================others=====================================================*/
|
2021-12-28 23:55:14 +01:00
|
|
|
.btn-i {
|
2021-10-25 16:50:31 +07:00
|
|
|
@apply py-2 px-4 bg-indigo-500 text-white font-semibold rounded-lg shadow-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:ring-opacity-75;
|
|
|
|
|
}
|
2021-12-28 23:55:14 +01:00
|
|
|
.wgt-adt-stl {
|
2021-10-27 05:11:28 +07:00
|
|
|
@apply text-center text-gray-500 font-bold;
|
2021-10-25 20:05:21 +07:00
|
|
|
}
|
2021-12-11 13:54:28 +01:00
|
|
|
/*====================================================table=====================================================*/
|
2022-02-07 02:08:21 +01:00
|
|
|
.tbl {
|
|
|
|
|
@apply table-fixed w-full select-none my-2;
|
|
|
|
|
}
|
2021-12-28 23:55:14 +01:00
|
|
|
.tbl-hd {
|
2022-11-22 15:07:41 +01:00
|
|
|
@apply text-center px-1 break-words text-gray-500 font-bold truncate;
|
2021-12-11 13:54:28 +01:00
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
.tbl-bdy-lg {
|
2022-11-22 15:07:41 +01:00
|
|
|
@apply text-center px-1 break-words truncate;
|
2021-12-11 13:54:28 +01:00
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
.tbl-bdy-sm {
|
2022-02-05 02:13:46 +01:00
|
|
|
@apply px-1 break-words;
|
2021-12-28 01:06:01 +01:00
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
/*====================================================inputs=====================================================*/
|
|
|
|
|
.ipt-lg {
|
|
|
|
|
@apply h-4 sm:h-7 md:h-7 lg:h-7 xl:h-7 2xl:h-7 content-center mt-2 bg-gray-50 focus:bg-white border-2 border-gray-100 text-gray-700 leading-tight focus:outline-none text-center focus:border-indigo-500;
|
|
|
|
|
}
|
|
|
|
|
.ipt-sm {
|
|
|
|
|
@apply h-3 sm:h-6 md:h-6 lg:h-6 xl:h-6 2xl:h-6 content-center bg-gray-50 focus:bg-white border-2 border-gray-100 text-gray-700 leading-tight focus:outline-none text-center focus:border-indigo-500 rounded-sm;
|
2021-12-27 22:46:16 +01:00
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
.ipt-rnd {
|
|
|
|
|
@apply content-center px-2 h-8 bg-gray-50 border-2 border-gray-200 rounded w-full text-gray-700 leading-tight focus:outline-none focus:bg-white;
|
|
|
|
|
}
|
|
|
|
|
.ipt-big {
|
|
|
|
|
@apply content-center px-2 h-8 bg-gray-50 border-2 border-gray-200 rounded w-full text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-indigo-500;
|
2021-12-29 01:21:28 +01:00
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
/*====================================================text=====================================================*/
|
|
|
|
|
.txt-ita {
|
2021-12-29 01:21:28 +01:00
|
|
|
@apply inline-block italic align-top text-right text-gray-500;
|
2021-12-12 00:20:47 +01:00
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
.txt-pad {
|
2021-12-28 22:09:44 +01:00
|
|
|
@apply px-2 py-0 sm:py-0 md:py-0 lg:py-1 xl:py-2 2xl:py-2;
|
|
|
|
|
}
|
2022-02-07 16:36:43 +01:00
|
|
|
.txt-sz {
|
2021-12-29 01:21:28 +01:00
|
|
|
@apply text-xxs sm:text-base md:text-base lg:text-base xl:text-base 2xl:text-base;
|
2021-12-28 22:09:44 +01:00
|
|
|
}
|
2021-12-12 00:20:47 +01:00
|
|
|
/*====================================================buttons=====================================================*/
|
2021-12-28 23:55:14 +01:00
|
|
|
.btn-lg {
|
2022-11-22 15:07:41 +01:00
|
|
|
@apply flex justify-center break-words content-center bg-blue-100 hover:bg-blue-200 text-gray-500 font-bold text-sm sm:text-base md:text-base lg:text-base xl:text-base 2xl:text-base h-6 sm:h-8 md:h-8 lg:h-8 xl:h-8 2xl:h-8 w-full mt-0 border border-gray-300 rounded truncate;
|
2021-12-12 00:20:47 +01:00
|
|
|
}
|
2021-12-28 23:55:14 +01:00
|
|
|
.btn-tbl {
|
2021-12-29 01:21:28 +01:00
|
|
|
@apply flex justify-center content-center text-gray-500 font-bold w-6 h-auto border border-gray-300;
|
2021-12-25 23:13:15 +01:00
|
|
|
}
|
2021-12-28 01:06:01 +01:00
|
|
|
/*====================================================select=====================================================*/
|
2021-12-28 23:55:14 +01:00
|
|
|
.slct-lg {
|
2022-02-08 16:47:26 +01:00
|
|
|
@apply flex w-full justify-center break-words content-center bg-blue-100 hover:bg-blue-200 text-gray-500 font-bold text-sm sm:text-base md:text-base lg:text-base xl:text-base 2xl:text-base h-6 sm:h-8 md:h-8 lg:h-8 xl:h-8 2xl:h-8 mb-0 border border-gray-300 rounded;
|
2021-12-28 01:06:01 +01:00
|
|
|
}
|
2021-09-16 02:00:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu__toggle {
|
2022-02-01 16:01:19 +01:00
|
|
|
position: relative;
|
2021-09-16 02:00:52 +08:00
|
|
|
opacity: 0;
|
|
|
|
|
}
|
|
|
|
|
#menu__toggle:checked ~ .menu__btn > span {
|
|
|
|
|
transform: rotate(45deg);
|
|
|
|
|
}
|
|
|
|
|
#menu__toggle:checked ~ .menu__btn > span::before {
|
|
|
|
|
top: 0;
|
|
|
|
|
transform: rotate(0);
|
|
|
|
|
}
|
|
|
|
|
#menu__toggle:checked ~ .menu__btn > span::after {
|
|
|
|
|
top: 0;
|
|
|
|
|
transform: rotate(90deg);
|
|
|
|
|
}
|
|
|
|
|
#menu__toggle:checked ~ .menu__box {
|
|
|
|
|
visibility: visible;
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu__toggle:checked ~ .menu__main {
|
2021-10-10 23:46:18 +08:00
|
|
|
margin-left: 150px; /* насколько сужать правую часть */
|
2021-10-16 06:33:15 +08:00
|
|
|
transition-duration: 0.25s;
|
2021-09-16 02:00:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu__btn {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
position: fixed;
|
2022-09-08 23:35:58 +02:00
|
|
|
z-index: 2;
|
2021-09-16 02:00:52 +08:00
|
|
|
top: 10px;
|
|
|
|
|
left: 20px;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu__btn > span,
|
|
|
|
|
.menu__btn > span::before,
|
|
|
|
|
.menu__btn > span::after {
|
|
|
|
|
display: block;
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 2px;
|
|
|
|
|
background-color: #616161;
|
|
|
|
|
transition-duration: 0.25s;
|
|
|
|
|
}
|
|
|
|
|
.menu__btn > span::before {
|
|
|
|
|
content: "";
|
|
|
|
|
top: -8px;
|
|
|
|
|
}
|
|
|
|
|
.menu__btn > span::after {
|
|
|
|
|
content: "";
|
|
|
|
|
top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu__box {
|
|
|
|
|
display: block;
|
|
|
|
|
position: fixed;
|
|
|
|
|
visibility: hidden;
|
2022-09-08 23:35:58 +02:00
|
|
|
z-index: 1;
|
2021-09-16 02:00:52 +08:00
|
|
|
top: 0;
|
|
|
|
|
left: -100%;
|
|
|
|
|
width: 150px; /* размер выхода бокового меню */
|
|
|
|
|
height: 100%;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 80px 0;
|
|
|
|
|
list-style: none;
|
|
|
|
|
background-color: #eceff1;
|
|
|
|
|
box-shadow: 1px 0px 6px rgba(0, 0, 0, 0.2);
|
|
|
|
|
transition-duration: 0.25s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu__item {
|
|
|
|
|
display: block;
|
|
|
|
|
padding: 12px 24px;
|
|
|
|
|
color: rgba(51, 51, 51, 0.788);
|
|
|
|
|
font-family: "Roboto", sans-serif;
|
|
|
|
|
font-size: 15px; /* размер шрифта бокового меню */
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
transition-duration: 0.25s;
|
|
|
|
|
}
|
|
|
|
|
.menu__item:hover {
|
|
|
|
|
background-color: #cfd8dc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upper__bar {
|
|
|
|
|
background-color: rgba(51, 51, 51, 0.144);
|
|
|
|
|
height: 70px;
|
|
|
|
|
position: fixed;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
top: 0px;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
box-shadow: 1px 0px 3px rgba(0, 0, 0, 0.2);
|
|
|
|
|
}
|
2021-09-16 03:36:40 +08:00
|
|
|
|
|
|
|
|
input[type="date"]::-webkit-calendar-picker-indicator {
|
2021-09-17 03:35:49 +08:00
|
|
|
margin-left: 5px;
|
|
|
|
|
margin-right: -8px;
|
2021-09-16 03:36:40 +08:00
|
|
|
}
|
|
|
|
|
input[type="time"]::-webkit-calendar-picker-indicator {
|
2021-09-17 03:35:49 +08:00
|
|
|
margin-left: 5px;
|
|
|
|
|
margin-right: -8px;
|
2021-09-16 03:36:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input[type="number"]::-webkit-outer-spin-button,
|
|
|
|
|
input[type="number"]::-webkit-inner-spin-button {
|
2021-09-17 03:35:49 +08:00
|
|
|
margin-left: 7px;
|
|
|
|
|
margin-right: -6px;
|
2021-09-16 03:36:40 +08:00
|
|
|
width: 30px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
2021-10-19 05:54:52 +08:00
|
|
|
|
2021-10-19 21:59:48 +08:00
|
|
|
/* Toggle */
|
2021-10-19 05:54:52 +08:00
|
|
|
input:checked ~ .dot {
|
|
|
|
|
transform: translateX(100%);
|
2021-10-25 16:50:31 +07:00
|
|
|
/* background-color: #48bb78;*/
|
2021-10-19 05:54:52 +08:00
|
|
|
}
|
2022-09-29 00:56:22 +02:00
|
|
|
|
|
|
|
|
input[type="file"] {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
2023-09-22 19:40:34 +02:00
|
|
|
|
|
|
|
|
/* width */
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
width: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Track */
|
|
|
|
|
::-webkit-scrollbar-track {
|
|
|
|
|
background: #ebebeb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Handle */
|
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
|
background: #cbcbcb;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Handle on hover */
|
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
background: #aeaeae;
|
|
|
|
|
}
|
2021-09-16 02:00:52 +08:00
|
|
|
</style>
|