webui: Update
13
webui/.eslintignore
Normal file
@ -0,0 +1,13 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
15
webui/.eslintrc.cjs
Normal file
@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['eslint:recommended', 'prettier'],
|
||||
plugins: ['svelte3'],
|
||||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
es2017: true,
|
||||
node: true
|
||||
}
|
||||
};
|
2
webui/.gitignore
vendored
@ -8,3 +8,5 @@ node_modules
|
||||
!.env.example
|
||||
.vercel
|
||||
.output
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
13
webui/.prettierignore
Normal file
@ -0,0 +1,13 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
9
webui/.prettierrc
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"plugins": ["prettier-plugin-svelte"],
|
||||
"pluginSearchDirs": ["."],
|
||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||
}
|
17
webui/jsconfig.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true
|
||||
}
|
||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
|
||||
//
|
||||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
||||
// from the referenced tsconfig.json - TypeScript does not merge them in
|
||||
}
|
4948
webui/package-lock.json
generated
@ -1,20 +1,36 @@
|
||||
{
|
||||
"name": "my-app",
|
||||
"name": "home",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
||||
"test": "playwright test",
|
||||
"test:unit": "vitest",
|
||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||
"format": "prettier --plugin-search-dir . --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-static": "next",
|
||||
"@sveltejs/kit": "next",
|
||||
"svelte": "^3.46.0",
|
||||
"vite": "^3.1.0"
|
||||
"@fontsource/fira-mono": "^4.5.10",
|
||||
"@neoconfetti/svelte": "^1.0.0",
|
||||
"@playwright/test": "^1.28.1",
|
||||
"@sveltejs/adapter-auto": "^1.0.0",
|
||||
"@sveltejs/adapter-node": "^1.1.4",
|
||||
"@sveltejs/adapter-static": "^1.0.5",
|
||||
"@sveltejs/kit": "^1.0.0",
|
||||
"@types/cookie": "^0.5.1",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-svelte3": "^4.0.0",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier-plugin-svelte": "^2.8.1",
|
||||
"svelte": "^3.54.0",
|
||||
"svelte-check": "^3.0.1",
|
||||
"typescript": "^4.9.3",
|
||||
"vite": "^4.0.4",
|
||||
"vitest": "^0.25.3"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@fontsource/fira-mono": "^4.5.0",
|
||||
"svelte-spa-router": "^3.3.0"
|
||||
}
|
||||
"type": "module"
|
||||
}
|
||||
|
10
webui/playwright.config.js
Normal file
@ -0,0 +1,10 @@
|
||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||
const config = {
|
||||
webServer: {
|
||||
command: 'npm run build && npm run preview',
|
||||
port: 4173
|
||||
},
|
||||
testDir: 'tests'
|
||||
};
|
||||
|
||||
export default config;
|
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/haus.svg"/>
|
||||
<!-- <link rel="icon" href="%sveltekit.assets%/haus.svg"/> -->
|
||||
<meta name="viewport" content="width=device-width"/>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
|
@ -1,18 +1,17 @@
|
||||
<script>
|
||||
// import perinetLogo from '../../static/perinet-logo.png'
|
||||
// import favicon from '../../static/favicon.png'
|
||||
import favicon from '$lib/images/haus.svg'
|
||||
</script>
|
||||
|
||||
<header class="header">
|
||||
<!-- <a href="https://www.perinet.io" target="_blank" class="logo">
|
||||
<img src={perinetLogo} alt="Perinet Logo" width="180">
|
||||
</a>
|
||||
</a> -->
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href={favicon} /> -->
|
||||
<link rel="shortcut icon" type="image/svg" href={favicon} />
|
||||
|
||||
<input class="menu-btn" type="checkbox" id="menu-btn" />
|
||||
|
||||
<!-- <label class="menu-icon" for="menu-btn"><span class="nav-icon"></span></label> -->
|
||||
<label class="menu-icon" for="menu-btn"><span class="nav-icon"></span></label>
|
||||
|
||||
<ul class="menu">
|
||||
<li><a href="/">Home</a></li>
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import icon from "../../static/haus.svg"
|
||||
import icon from "$lib/images/haus.svg"
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { bind, onMount } from "svelte/internal";
|
||||
import icon from "../../../static/hahn.svg"
|
||||
import icon from "$lib/images/hahn.svg"
|
||||
|
||||
// base api url
|
||||
let backend_url = "http://localhost:5000/gates";
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { onMount } from "../../../node_modules/svelte/internal";
|
||||
import icon from "../../../static/sauna.svg"
|
||||
import icon from "$lib/images/sauna.svg"
|
||||
|
||||
let backend_url = "https://home.blackfinn.de/sauna/sample";
|
||||
|
||||
@ -34,8 +34,9 @@
|
||||
</svelte:head>
|
||||
|
||||
<section id='content_id' class='content'>
|
||||
<h1>{temperature_value} {temperature_unit}</h1>
|
||||
<figure>
|
||||
<img src={icon} alt="Sauna" width=150/>
|
||||
</figure>
|
||||
<h1>{temperature_value} {temperature_unit}</h1>
|
||||
<h1>Sauna</h1>
|
||||
</section>
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 5.1 KiB |
@ -1 +0,0 @@
|
||||
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 566.93 629.92"><defs><style>.cls-1{fill:#c2d100;}.cls-2{fill:#2c2b5a;stroke:#2c2b5a;stroke-width:5.31px;}.cls-2,.cls-4{stroke-miterlimit:10;}.cls-3{fill:#2b2a59;}.cls-4{fill:none;stroke:#2b2a59;stroke-width:10.63px;}</style></defs><path class="cls-1" d="M317.59,621.73s-34.13,18.43-68.25,0L34.12,498S0,476.9,0,437.4V192.52S0,150.39,34.12,132L249.34,8.19s34.12-18.43,68.25,0L532.81,132s34.12,18.44,34.12,60.57V437.4s0,39.5-34.12,60.57Z"/><g id="periNODE"><path class="cls-2" d="M373.25,334.38c21.36,4.51,41.57,31.1,54,71.08,6.88,22.18,14.21,37.33,23.84,49.27A39.27,39.27,0,0,0,465,466.18c3.85,1.88,4.46,2,9.41,2s5.45-.11,9.63-2.15c8.59-4.24,17.84-15.25,25.38-30.28a208.35,208.35,0,0,0,9.8-23.35l.94-2.86h8.48c7.71,0,8.48.11,8.48.94,0,1.7-5.4,16.9-8.59,24.22-12.28,28.24-28,45.58-45.37,50.1A46.76,46.76,0,0,1,466,485a53.67,53.67,0,0,1-15.91-7.71c-15.3-11.39-29.51-35.56-38.37-65.29-6.34-21.31-17-41.41-27.15-51.54-9.79-9.74-19.32-11.89-29.67-6.77-11.84,5.84-24.67,25.22-33.75,51.15l-1.54,4.4-8.59.17c-7.38.11-8.53,0-8.53-.72a69.68,69.68,0,0,1,2.25-7.6c9.36-28,23.4-50.21,38.16-60.34a47.92,47.92,0,0,1,14.31-6.38A43.47,43.47,0,0,1,373.25,334.38Z"/><path class="cls-3" d="M123.67,123.2v21.25a1.54,1.54,0,0,1,.64.1L194.73,185a2,2,0,0,1,.85,1.72V267a4.11,4.11,0,0,1-1.07,2.44l-69.73,40.1a6.41,6.41,0,0,1-1.94.37,1.54,1.54,0,0,1-.64-.1L52.43,269.69c-.62-.54-1.5-1.55-1.5-2.08v-80.4a6.94,6.94,0,0,1,.52-2l.08-.05,70.58-40.59c.16,0,1.17-.15,1.56-.15V123.2m0,0A27,27,0,0,0,112,125.9L41,166.76c-11.27,6.09-11.27,20-11.27,20v80.85c0,13,11.27,20,11.27,20L112,328.46a22.55,22.55,0,0,0,10.85,2.7,27,27,0,0,0,11.68-2.7l71.06-40.86c11.26-7,11.26-20,11.26-20V186.76a23.42,23.42,0,0,0-11.26-20L134.52,125.9A22.44,22.44,0,0,0,123.67,123.2Z"/><line class="cls-4" x1="393.98" y1="112.27" x2="141.22" y2="550.06"/></g></svg>
|
Before Width: | Height: | Size: 1.8 KiB |
@ -1 +0,0 @@
|
||||
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 708.66 708.66"><defs><style>.cls-1{fill:#c2d100;}.cls-2{fill:#292659;}.cls-3{fill:#c1d00e;}</style></defs><path class="cls-1" d="M400.36,22.71s-44-25.4-88,0L91.28,150.36s-44,25.4-44,76.2V481.85s0,50.81,44,76.2L312.36,685.7s44,25.4,88,0L621.45,558.05s44-25.39,44-76.2V226.56s0-50.8-44-76.2L400.36,22.71Z"/><path class="cls-2" d="M397.25,329.78v-28c0-21.82-17.46-39.58-38.93-39.58S319.38,280,319.38,301.78v28H292.79V449.51H423.85V329.78Zm-66.48-28a27.55,27.55,0,1,1,55.09,0v28H330.77Z"/><path class="cls-3" d="M352.62,392.76v20.68H364V392.75a13.29,13.29,0,1,0-11.39,0Z"/><path class="cls-2" d="M540.55,246.53c-.22-11.57-.44-22.51-.44-33.08a15.14,15.14,0,0,0-15.3-15c-65.43,0-115.25-18.44-156.77-58a15.53,15.53,0,0,0-21.34,0c-41.52,39.6-91.33,58-156.76,58a15.15,15.15,0,0,0-15.3,15c0,10.58-.21,21.51-.44,33.09-2.09,107.69-5,255.18,178.16,317.42a15.54,15.54,0,0,0,10,0C545.52,501.72,542.65,354.22,540.55,246.53ZM357.37,533.87c-157-55.95-154.68-178.5-152.57-286.76.13-6.5.25-12.8.33-19,61.29-2.53,110.29-20.74,152.24-56.58,42,35.84,91,54.05,152.25,56.58.09,6.17.21,12.47.34,19C512.06,355.36,514.44,477.92,357.37,533.87Z"/></svg>
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1 +0,0 @@
|
||||
<svg id="Nachtrag" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 708.66 708.66"><defs><style>.cls-1{fill:#c3d205;}.cls-2{fill:#2a2459;}</style></defs><path class="cls-1" d="M387.82,689.7s-37.2,20.1-74.41,0l-234.67-135s-37.21-23-37.21-66v-267s0-45.94,37.21-66L313.41,20.71s37.21-20.1,74.41,0l234.68,135s37.2,20.09,37.2,66v267s0,43.07-37.2,66l-234.68,135Z"/><path class="cls-2" d="M540.34,249.13c0,12.51-.26,25,.06,37.52.26,10.28-3.4,16.12-15.58,16-28.05-.28-56.12,0-84.18-.08-4,0-9.14,1.1-11.06-3.41s2.71-6.92,5.24-9.87c.87-1,2-1.88,2.92-2.84,26.1-26.13,26.26-26.37-6-46.24-45.6-28.06-94.14-30.34-142-7.91-48.28,22.63-73.61,61.14-75.74,112.53-.38,9.2,6,22-5.92,26.91-12.75,5.26-27.7,2.95-41.53,1-9.3-1.29-8-9.53-8.44-15.91-6-86.38,57.26-167.22,148-186.66,66.36-14.23,127.35-1.66,178.1,42,15.37,13.22,24,11.16,34.89-2a50.26,50.26,0,0,1,7.47-6.93c3.06-2.43,5.94-6.75,10.6-4.35,4.22,2.18,3.09,6.94,3.13,10.73C540.45,222.8,540.36,236,540.34,249.13Z"/><path class="cls-2" d="M157.81,462.76c0-12.51.26-25-.06-37.52-.26-10.28,3.39-16.11,15.57-16,28.06.29,56.13,0,84.19.08,4,0,9.13-1.09,11.05,3.42s-2.7,6.92-5.23,9.87c-.88,1-2,1.87-2.93,2.84-26.09,26.12-26.26,26.36,6,46.23,45.6,28.07,94.15,30.34,142,7.92C456.68,457,482,418.47,484.14,367.07c.38-9.2-6-22,5.92-26.91,12.75-5.25,27.7-3,41.52-1,9.31,1.29,8,9.52,8.44,15.91,6,86.37-57.26,167.21-148,186.66-66.36,14.22-127.36,1.66-178.1-42-15.38-13.22-24-11.15-34.89,2a50.9,50.9,0,0,1-7.48,6.94c-3.06,2.43-5.93,6.75-10.6,4.34-4.22-2.17-3.09-6.94-3.13-10.73C157.7,489.09,157.79,475.92,157.81,462.76Z"/></svg>
|
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 6.4 KiB |
@ -1,16 +1,20 @@
|
||||
//import adapter from '@sveltejs/adapter-auto';
|
||||
// import adapter from '@sveltejs/adapter-node';
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
kit: {
|
||||
adapter: adapter({
|
||||
pages: '../static',
|
||||
assets: '../static',
|
||||
// fallback: '200.html',
|
||||
// default options are shown. On some platforms
|
||||
// these options are set automatically — see below
|
||||
pages: 'build',
|
||||
assets: 'build',
|
||||
fallback: null,
|
||||
precompress: false,
|
||||
}),
|
||||
trailingSlash: 'always'
|
||||
strict: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
export const trailingSlash = 'always';
|
6
webui/tests/test.js
Normal file
@ -0,0 +1,6 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test('about page has expected h1', async ({ page }) => {
|
||||
await page.goto('/about');
|
||||
await expect(page.locator('h1')).toHaveText('About this app');
|
||||
});
|
@ -1,7 +1,11 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
|
||||
/** @type {import('vite').UserConfig} */
|
||||
const config = {
|
||||
plugins: [sveltekit()]
|
||||
plugins: [sveltekit()],
|
||||
test: {
|
||||
include: ['src/**/*.{test,spec}.{js,ts}']
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|