From ba10b3bc555362c285deeecdd79bb8f5435bd79d Mon Sep 17 00:00:00 2001
From: IoT Manager <67171972+IoTManagerProject@users.noreply.github.com>
Date: Thu, 5 Oct 2023 14:38:57 +0200
Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D0=BA?=
=?UTF-8?q?=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB=D1=8F=D1=82=D0=BE=D1=80=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
rollup.config.js | 146 ++++++++++++++++++++++-----------------
src/App.svelte | 14 ++--
src/lang.js | 4 +-
src/pages/Profile.svelte | 103 +++++++++++++++++++++++++--
4 files changed, 190 insertions(+), 77 deletions(-)
diff --git a/rollup.config.js b/rollup.config.js
index 1b03a2e..a832614 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,81 +1,97 @@
-import svelte from 'rollup-plugin-svelte';
-import commonjs from '@rollup/plugin-commonjs';
-import resolve from '@rollup/plugin-node-resolve';
-import livereload from 'rollup-plugin-livereload';
-import { terser } from 'rollup-plugin-terser';
-import css from 'rollup-plugin-css-only';
+import svelte from "rollup-plugin-svelte";
+import commonjs from "@rollup/plugin-commonjs";
+import resolve from "@rollup/plugin-node-resolve";
+import livereload from "rollup-plugin-livereload";
+import { terser } from "rollup-plugin-terser";
+import css from "rollup-plugin-css-only";
import sveltePreprocess from "svelte-preprocess";
const production = !process.env.ROLLUP_WATCH;
function serve() {
- let server;
+ let server;
- function toExit() {
- if (server) server.kill(0);
- }
+ function toExit() {
+ if (server) server.kill(0);
+ }
- return {
- writeBundle() {
- if (server) return;
- server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
- stdio: ['ignore', 'inherit', 'inherit'],
- shell: true
- });
+ return {
+ writeBundle() {
+ if (server) return;
+ server = require("child_process").spawn(
+ "npm",
+ ["run", "start", "--", "--dev"],
+ {
+ stdio: ["ignore", "inherit", "inherit"],
+ shell: true,
+ }
+ );
- process.on('SIGTERM', toExit);
- process.on('exit', toExit);
- }
- };
+ process.on("SIGTERM", toExit);
+ process.on("exit", toExit);
+ },
+ };
}
export default {
- input: 'src/main.js',
- output: {
- sourcemap: true,
- format: 'iife',
- name: 'app',
- file: 'public/build/bundle.js'
- },
- plugins: [
- svelte({
- compilerOptions: {
- // enable run-time checks when not in production
- dev: !production
- },
- preprocess: sveltePreprocess({
- sourceMap: !production,
- postcss: true,
- }),
- }),
- // we'll extract any component CSS out into
- // a separate file - better for performance
- css({ output: 'bundle.css' }),
+ input: "src/main.js",
+ output: {
+ sourcemap: true,
+ format: "iife",
+ name: "app",
+ file: "public/build/bundle.js",
+ },
+ plugins: [
+ terser({
+ ecma: 2020,
+ mangle: { toplevel: true },
+ compress: {
+ module: true,
+ toplevel: true,
+ unsafe_arrows: true,
+ drop_console: false,
+ drop_debugger: true,
+ },
+ output: { quote_style: 1 },
+ }),
+ svelte({
+ compilerOptions: {
+ // enable run-time checks when not in production
+ dev: !production,
+ },
+ preprocess: sveltePreprocess({
+ sourceMap: !production,
+ postcss: true,
+ }),
+ }),
+ // we'll extract any component CSS out into
+ // a separate file - better for performance
+ css({ output: "bundle.css" }),
- // If you have external dependencies installed from
- // npm, you'll most likely need these plugins. In
- // some cases you'll need additional configuration -
- // consult the documentation for details:
- // https://github.com/rollup/plugins/tree/master/packages/commonjs
- resolve({
- browser: true,
- dedupe: ['svelte']
- }),
- commonjs(),
+ // If you have external dependencies installed from
+ // npm, you'll most likely need these plugins. In
+ // some cases you'll need additional configuration -
+ // consult the documentation for details:
+ // https://github.com/rollup/plugins/tree/master/packages/commonjs
+ resolve({
+ browser: true,
+ dedupe: ["svelte"],
+ }),
+ commonjs(),
- // In dev mode, call `npm run start` once
- // the bundle has been generated
- !production && serve(),
+ // In dev mode, call `npm run start` once
+ // the bundle has been generated
+ !production && serve(),
- // Watch the `public` directory and refresh the
- // browser on changes when not in production
- !production && livereload('public'),
+ // Watch the `public` directory and refresh the
+ // browser on changes when not in production
+ !production && livereload("public"),
- // If we're building for production (npm run build
- // instead of npm run dev), minify
- production && terser()
- ],
- watch: {
- clearScreen: false
- }
+ // If we're building for production (npm run build
+ // instead of npm run dev), minify
+ production && terser(),
+ ],
+ watch: {
+ clearScreen: false,
+ },
};
diff --git a/src/App.svelte b/src/App.svelte
index a51ecb6..4753a35 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -48,8 +48,9 @@
const rebootingTimeout = 30000;
const updatingTimeout = 130000;
let rebootTimer;
- let opened = false;
+ let opened = true;
let preventMove = false;
+ let screenSize;
const blobDebug = false;
const devMode = true;
@@ -182,6 +183,9 @@
onMount(async () => {
console.log("[i]", "mounted");
await getUser();
+ onCheck();
+
+ opened = screenSize > 900 ? true : false;
selectedDeviceDataRefresh();
//флаг первого запроса списка устройств
firstDevListRequest = true;
@@ -1125,14 +1129,10 @@
//**********************************************************modal*************************************************************************/
function onCheck() {
- let width = screen.width;
- //console.log("width", width);
- if (width < 900) {
+ if (screenSize < 900) {
preventMove = true;
- //opened = false;
} else {
preventMove = false;
- //opened = true;
}
}
@@ -1244,6 +1244,8 @@
}
+
{myProfileJson.projectProp.platformio.default_envs}
-{userdata.username}
+{myProfileJson.projectProp.platformio.default_envs}
+{userdata.username}
{$t(e.msg)}
{/each} + {#if userBuilds} +| Название | +Версия | +Время | + +Подготовка | +Сборка build | +Сборка fs | +|
|---|---|---|---|---|---|---|
| {build.projectProp.platformio.default_envs} | +{build.ver} | +{new Date(build.dateAdded).toLocaleString("ru", { timeZone: "Europe/Vienna" })} | + {#if build.status.preparation === 0 && build.status.build === 0 && build.status.fs === 0} +
+ {"Ожидание очереди..."} + |
+ {:else}
+
+ showLog(build, "py.txt")}>
+ {st[build.status.preparation]}
+
+ |
+
+ showLog(build, "build.txt")}>
+ {st[build.status.build]}
+
+ |
+
+ showLog(build, "fs.txt")}>{st[build.status.fs]}
+ |
+ {/if}
+