2021-09-16 02:00:52 +08:00
|
|
|
<script>
|
2022-02-22 20:20:59 +01:00
|
|
|
/*
|
|
|
|
|
Svelte IoT Manager app
|
|
|
|
|
created by Dmitry Borisenko
|
2023-06-08 22:37:43 +02:00
|
|
|
Vienna, Austria 1030, Juchgasse 5/17
|
|
|
|
|
+43 67761588253
|
2022-02-22 20:20:59 +01:00
|
|
|
*/
|
2022-02-19 23:35:30 +01:00
|
|
|
|
2021-09-16 02:00:52 +08:00
|
|
|
import { onMount } from "svelte";
|
2026-02-08 23:28:48 +01:00
|
|
|
import { Route, router } from "tinro";
|
2022-02-06 23:02:20 +01:00
|
|
|
router.mode.hash();
|
|
|
|
|
|
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 Login from "./pages/Login.svelte";
|
2023-10-04 18:56:24 +02:00
|
|
|
import Profile from "./pages/Profile.svelte";
|
2023-10-05 01:39:15 +02:00
|
|
|
import Cookies from "js-cookie";
|
2022-02-08 21:42:40 +01:00
|
|
|
|
2026-02-08 22:41:16 +01:00
|
|
|
import * as portal from "./api/portal.js";
|
|
|
|
|
import * as firmware from "./api/firmware.js";
|
2026-02-08 23:28:48 +01:00
|
|
|
import WebSocketManager from "./lib/WebSocketManager.js";
|
|
|
|
|
import { eventEmitter } from "./eventEmitter.js";
|
2026-02-08 22:41:16 +01:00
|
|
|
import AppHeader from "./components/layout/AppHeader.svelte";
|
|
|
|
|
import AppNav from "./components/layout/AppNav.svelte";
|
|
|
|
|
import AppFooter from "./components/layout/AppFooter.svelte";
|
2022-02-07 16:36:43 +01:00
|
|
|
|
2026-02-07 00:38:05 +01:00
|
|
|
const devMode = true;
|
2026-02-08 23:28:48 +01:00
|
|
|
const myip = devMode ? "127.0.0.1" : document.location.hostname;
|
|
|
|
|
const initialDeviceList = [
|
|
|
|
|
{ name: "--", id: "--", ip: myip, ws: 0, status: false },
|
|
|
|
|
];
|
2021-12-14 20:55:53 +01:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
const wsManager = new WebSocketManager(initialDeviceList, { debug: true });
|
2022-02-24 00:59:10 +01:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
// Local reactive state (synced from wsManager via events)
|
|
|
|
|
let layoutJson = [];
|
2021-12-14 20:55:53 +01:00
|
|
|
let pages = [];
|
2026-02-08 23:28:48 +01:00
|
|
|
let deviceList = [...initialDeviceList];
|
2022-09-25 17:49:24 +02:00
|
|
|
let pageReady = {
|
|
|
|
|
dash: false,
|
|
|
|
|
config: false,
|
|
|
|
|
connection: false,
|
|
|
|
|
list: false,
|
|
|
|
|
system: false,
|
|
|
|
|
dev: false,
|
2026-02-08 23:28:48 +01:00
|
|
|
profile: false,
|
2022-09-25 17:49:24 +02:00
|
|
|
};
|
2022-10-09 14:31:07 +02:00
|
|
|
let configJson = [];
|
2022-10-12 03:18:04 +02:00
|
|
|
let scenarioTxt = " ";
|
2026-02-08 23:28:48 +01:00
|
|
|
let widgetsJson = [];
|
|
|
|
|
let itemsJson = [];
|
2022-02-02 23:37:15 +01:00
|
|
|
let settingsJson = {};
|
2022-10-09 14:31:07 +02:00
|
|
|
let errorsJson = {};
|
2026-02-08 23:28:48 +01:00
|
|
|
let ssidJson = {};
|
|
|
|
|
let versionsList = {};
|
|
|
|
|
let choosingVersion = undefined;
|
2022-02-13 00:37:58 +01:00
|
|
|
let selectedWs = 0;
|
2026-02-09 00:06:48 +01:00
|
|
|
let socketConnected = false;
|
|
|
|
|
let percent = 0;
|
|
|
|
|
let remainingTimeout = 60;
|
2022-02-13 00:37:58 +01:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
let opened = true;
|
|
|
|
|
let preventMove = false;
|
|
|
|
|
let screenSize;
|
|
|
|
|
let showInput = false;
|
2022-02-13 00:37:58 +01:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
$: currentPageName = wsManager.currentPageName;
|
|
|
|
|
$: wsManager.choosingVersion = choosingVersion;
|
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() {
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.currentPageName = $router.path.toString() + "|";
|
|
|
|
|
console.log("[i]", "user on page:", wsManager.currentPageName);
|
|
|
|
|
wsManager.clearData();
|
|
|
|
|
if (wsManager.currentPageName === "/|") {
|
|
|
|
|
wsManager.sendToAllDevices(wsManager.currentPageName);
|
2022-02-26 01:09:17 +01:00
|
|
|
} else {
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.sendCurrentPageNameToSelectedWs();
|
2022-01-30 17:44:53 +01:00
|
|
|
}
|
|
|
|
|
}
|
2021-12-28 21:18:03 +01:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
function devicesDropdownChange() {
|
|
|
|
|
wsManager.selectedWs = selectedWs;
|
|
|
|
|
if (currentPageName === "/list|") {
|
|
|
|
|
console.log("[i]", "user change dropdown on list page!!!");
|
2026-02-08 22:41:16 +01:00
|
|
|
} else {
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.selectedDeviceDataRefresh();
|
|
|
|
|
wsManager.clearData();
|
|
|
|
|
handleNavigation();
|
|
|
|
|
console.log("[i]", "user selected device:", wsManager.selectedDeviceData?.name);
|
2026-02-08 22:41:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
function onCheck() {
|
|
|
|
|
preventMove = screenSize < 900;
|
2022-10-09 14:31:07 +02:00
|
|
|
}
|
|
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
onMount(async () => {
|
|
|
|
|
console.log("[i]", "mounted");
|
2026-02-08 22:41:16 +01:00
|
|
|
const JWT = Cookies.get("token_iotm2");
|
2026-02-08 23:28:48 +01:00
|
|
|
const res = await portal.getUser(JWT);
|
2026-02-08 22:41:16 +01:00
|
|
|
if (res.ok) {
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.userdata = res.userdata;
|
|
|
|
|
wsManager.serverOnline = true;
|
2022-09-18 18:11:50 +02:00
|
|
|
} else {
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.serverOnline = res.serverOnline !== false;
|
2022-09-18 18:11:50 +02:00
|
|
|
}
|
2022-09-11 01:30:38 +02:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.options.onSystemParsed = async () => {
|
|
|
|
|
const r = await firmware.getVersionsList(wsManager.settingsJson.serverip);
|
|
|
|
|
if (r.ok && r.data) {
|
|
|
|
|
wsManager.versionsList = r.data[wsManager.errorsJson.bn] || {};
|
|
|
|
|
wsManager.choosingVersion = wsManager.errorsJson.bver;
|
|
|
|
|
} else {
|
|
|
|
|
wsManager.choosingVersion = undefined;
|
2022-09-18 18:11:50 +02:00
|
|
|
}
|
2022-09-11 14:14:16 +02:00
|
|
|
};
|
2022-09-10 02:59:03 +02:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.options.onProfileParsed = async () => {
|
|
|
|
|
const modRes = await portal.getModInfo();
|
|
|
|
|
if (modRes.ok) wsManager.allmodeinfo = modRes.allmodeinfo;
|
|
|
|
|
const JWT2 = Cookies.get("token_iotm2");
|
|
|
|
|
const profRes = await portal.getProfile(JWT2);
|
|
|
|
|
if (profRes.ok) {
|
|
|
|
|
wsManager.profile = profRes.profile;
|
|
|
|
|
const p = wsManager.profile;
|
|
|
|
|
const fp = wsManager.flashProfileJson;
|
|
|
|
|
if (p && fp) {
|
|
|
|
|
p.projectProp.platformio.default_envs = fp.projectProp?.platformio?.default_envs;
|
|
|
|
|
for (const [compilerCategory, compilerCategoryModules] of Object.entries(p.modules || {})) {
|
|
|
|
|
const devCategoryModules = fp.modules?.[compilerCategory];
|
|
|
|
|
compilerCategoryModules.forEach((compilerModule) => {
|
|
|
|
|
compilerModule.active = false;
|
|
|
|
|
(devCategoryModules || []).forEach((devModule) => {
|
|
|
|
|
if (devModule.path === compilerModule.path) compilerModule.active = devModule.active;
|
|
|
|
|
});
|
|
|
|
|
});
|
2022-09-10 02:59:03 +02:00
|
|
|
}
|
2022-01-31 01:45:42 +01:00
|
|
|
}
|
|
|
|
|
}
|
2026-02-08 23:28:48 +01:00
|
|
|
};
|
2022-10-07 22:29:04 +02:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
onCheck();
|
|
|
|
|
opened = screenSize > 900;
|
|
|
|
|
wsManager.firstDevListRequest = true;
|
|
|
|
|
wsManager.selectedDeviceDataRefresh();
|
2026-02-09 00:06:48 +01:00
|
|
|
socketConnected = wsManager.socketConnected;
|
|
|
|
|
percent = wsManager.percent;
|
|
|
|
|
remainingTimeout = wsManager.remainingTimeout;
|
2026-02-08 23:28:48 +01:00
|
|
|
wsManager.connectToAllDevices();
|
|
|
|
|
wsManager.startReconnectTask();
|
|
|
|
|
|
|
|
|
|
eventEmitter.on("layoutJsonUpdated", (data) => {
|
|
|
|
|
layoutJson = data.layoutJson || [];
|
|
|
|
|
pages = data.pages || [];
|
|
|
|
|
if (data.pageReady) pageReady = data.pageReady;
|
2026-02-09 00:06:48 +01:00
|
|
|
if (data.configJson !== undefined) configJson = data.configJson;
|
|
|
|
|
if (data.scenarioTxt !== undefined) scenarioTxt = data.scenarioTxt;
|
2022-10-07 22:29:04 +02:00
|
|
|
});
|
2026-02-08 23:28:48 +01:00
|
|
|
eventEmitter.on("deviceListUpdated", () => {
|
2026-02-09 00:06:48 +01:00
|
|
|
deviceList = [...wsManager.deviceList];
|
|
|
|
|
socketConnected = wsManager.socketConnected;
|
|
|
|
|
});
|
|
|
|
|
eventEmitter.on("reconnectTick", (data) => {
|
|
|
|
|
percent = data.percent;
|
|
|
|
|
remainingTimeout = data.remainingTimeout;
|
2022-02-15 00:02:30 +01:00
|
|
|
});
|
2026-02-08 23:28:48 +01:00
|
|
|
eventEmitter.on("configUpdated", (data) => {
|
|
|
|
|
configJson = data.configJson || [];
|
|
|
|
|
scenarioTxt = data.scenarioTxt ?? " ";
|
|
|
|
|
if (data.widgetsJson) widgetsJson = data.widgetsJson;
|
|
|
|
|
if (data.itemsJson) itemsJson = data.itemsJson;
|
|
|
|
|
});
|
|
|
|
|
eventEmitter.on("connectionUpdated", (data) => {
|
|
|
|
|
if (data.settingsJson) settingsJson = data.settingsJson;
|
|
|
|
|
if (data.errorsJson) errorsJson = data.errorsJson;
|
|
|
|
|
if (data.ssidJson) ssidJson = data.ssidJson;
|
|
|
|
|
});
|
|
|
|
|
eventEmitter.on("systemUpdated", () => {
|
|
|
|
|
versionsList = wsManager.versionsList || {};
|
|
|
|
|
choosingVersion = wsManager.choosingVersion;
|
2021-12-05 00:49:36 +01:00
|
|
|
});
|
2022-02-18 19:48:15 +01:00
|
|
|
|
2026-02-08 23:28:48 +01:00
|
|
|
handleNavigation();
|
|
|
|
|
});
|
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">
|
2026-02-08 23:28:48 +01:00
|
|
|
{#if wsManager.showAwaitingCircle}
|
2022-02-08 16:47:26 +01:00
|
|
|
<Progress />
|
|
|
|
|
{/if}
|
2023-06-17 22:26:52 +02:00
|
|
|
|
2026-02-08 22:41:16 +01:00
|
|
|
<AppHeader
|
|
|
|
|
{deviceList}
|
|
|
|
|
bind:selectedWs
|
2026-02-08 23:28:48 +01:00
|
|
|
showDropdown={wsManager.currentPageName !== "/|" && wsManager.currentPageName !== "/list|"}
|
2026-02-09 00:06:48 +01:00
|
|
|
{socketConnected}
|
2026-02-08 22:41:16 +01:00
|
|
|
{devicesDropdownChange}
|
|
|
|
|
/>
|
2026-02-08 23:28:48 +01:00
|
|
|
<AppNav bind:opened onCheck={() => onCheck()} userdata={wsManager.userdata} />
|
2022-02-01 16:01:19 +01:00
|
|
|
|
|
|
|
|
<main class="flex-1 overflow-y-auto p-0 {opened === true && !preventMove ? 'ml-36' : 'ml-0'}">
|
|
|
|
|
<ul class="menu__main">
|
|
|
|
|
<div class="bg-cover pt-0 px-4">
|
2026-02-09 00:06:48 +01:00
|
|
|
{#if !socketConnected && wsManager.currentPageName !== "/|"}
|
2023-10-06 01:07:49 +02:00
|
|
|
<Alarm title="Подключение через {remainingTimeout} сек." />
|
2022-02-05 02:13:46 +01:00
|
|
|
{:else}
|
|
|
|
|
<Route path="/">
|
2026-02-08 23:28:48 +01:00
|
|
|
<DashboardPage show={pageReady.dash} layoutJson={layoutJson} pages={pages} wsPush={(ws, topic, status) => wsManager.wsPush(ws, topic, status)} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/config">
|
2026-02-08 23:28:48 +01:00
|
|
|
<ConfigPage show={pageReady.config} bind:configJson bind:scenarioTxt {widgetsJson} {itemsJson} saveConfig={() => { wsManager.configJson = configJson; wsManager.scenarioTxt = scenarioTxt; wsManager.saveConfig(); }} cleanLogs={() => wsManager.cleanLogs()} rebootEsp={() => wsManager.rebootEsp()} moduleOrder={(id, key, value) => wsManager.moduleOrder(id, key, value)} userdata={wsManager.userdata} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/connection">
|
2026-02-08 23:28:48 +01:00
|
|
|
<ConnectionPage show={pageReady.connection} rebootEsp={() => wsManager.rebootEsp()} ssidClick={() => wsManager.ssidClick()} saveSett={() => { wsManager.settingsJson = settingsJson; wsManager.saveSett(); }} saveMqtt={() => { wsManager.settingsJson = settingsJson; wsManager.saveMqtt(); }} {settingsJson} {errorsJson} {ssidJson} />
|
2022-02-13 00:37:58 +01:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/list">
|
2026-02-09 00:06:48 +01:00
|
|
|
<ListPage show={pageReady.list} deviceList={deviceList} settingsJson={wsManager.settingsJson} saveSett={() => wsManager.saveSett()} rebootEsp={() => wsManager.rebootEsp()} showInput={showInput} addDevInList={() => wsManager.addDevInList()} newDevice={wsManager.newDevice} sendToAllDevices={(msg) => wsManager.sendToAllDevices(msg)} saveList={() => wsManager.saveList()} {percent} devListOverride={() => wsManager.devListOverride()} applicationReboot={() => wsManager.applicationReboot()} />
|
2022-02-05 02:13:46 +01:00
|
|
|
</Route>
|
2022-02-08 21:42:40 +01:00
|
|
|
<Route path="/system">
|
2026-02-08 23:28:48 +01:00
|
|
|
<SystemPage show={pageReady.system} errorsJson={wsManager.errorsJson} settingsJson={wsManager.settingsJson} saveSett={() => wsManager.saveSett()} rebootEsp={() => wsManager.rebootEsp()} cleanLogs={() => wsManager.cleanLogs()} cancelAlarm={(alarmKey) => wsManager.cancelAlarm(alarmKey)} versionsList={versionsList} bind:choosingVersion coreMessages={wsManager.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">
|
2026-02-08 23:28:48 +01:00
|
|
|
<Profile show={pageReady.profile} flashProfileJson={wsManager.flashProfileJson} userdata={wsManager.userdata} updateBuild={(path) => wsManager.updateBuild(path)} allmodeinfo={wsManager.allmodeinfo} profile={wsManager.profile} serverOnline={wsManager.serverOnline} otaJson={wsManager.otaJson} />
|
2023-10-05 01:39:15 +02:00
|
|
|
</Route>
|
|
|
|
|
<Route path="/login">
|
2026-02-08 23:28:48 +01:00
|
|
|
<Login show={true} serverOnline={wsManager.serverOnline} />
|
2023-10-02 17:25:05 +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
|
|
|
|
2026-02-08 22:41:16 +01:00
|
|
|
<AppFooter />
|
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>
|