From c3d575ba1cb8e88324a45eaec2e716092a44519f Mon Sep 17 00:00:00 2001 From: hmt Date: Sun, 5 Jun 2022 20:06:52 +0200 Subject: [PATCH] =?UTF-8?q?fix=20f=C3=BCr=20Timezone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 1 + package.json | 1 + src/server.ts | 8 +++++--- src/store.ts | 2 +- tsconfig.json | 8 ++++++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1326a33..ba92a86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@rollup/plugin-node-resolve": "^13.3.0", "@rollup/plugin-typescript": "^8.1.1", "@tsconfig/svelte": "^3.0.0", + "@types/node": "^17.0.40", "bulma": "^0.9.2", "fast-xml-parser": "^4.0.8", "rollup": "^2.3.4", diff --git a/package.json b/package.json index f0af0e4..0f46a16 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@rollup/plugin-node-resolve": "^13.3.0", "@rollup/plugin-typescript": "^8.1.1", "@tsconfig/svelte": "^3.0.0", + "@types/node": "^17.0.40", "bulma": "^0.9.2", "fast-xml-parser": "^4.0.8", "rollup": "^2.3.4", diff --git a/src/server.ts b/src/server.ts index 648125c..2a119be 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,4 +1,4 @@ -import parser from "fast-xml-parser"; +import { XMLParser } from "fast-xml-parser"; import sha1 from "jssha/dist/sha1" import type { meeting } from './types' import type {ApexOptions} from 'apexcharts' @@ -11,7 +11,7 @@ export class Server { url: string status: string - interval_id: number + interval_id: Timer, meetings: meeting[] audio: number video: number @@ -64,6 +64,7 @@ export class Server { curve: "straight", }, xaxis: { + labels: {datetimeUTC: false}, type: "datetime", }, } @@ -113,6 +114,7 @@ export class Server { this.notify_subs() } handle_data (xml) { + const parser = new XMLParser(); const json = parser.parse(xml); if (json.response.returncode === "SUCCESS") { this.status = "success" @@ -124,7 +126,7 @@ export class Server { this.max_t = Math.max(this.max_t, this.teilnehmer) this.max_a = Math.max(this.max_a, this.audio) this.max_v = Math.max(this.max_v, this.video) - const t = Date.now() + const t = Date.now(); this.m.push([t, this.meetings.length]) this.t.push([t, this.teilnehmer]) this.a.push([t, this.audio]) diff --git a/src/store.ts b/src/store.ts index a39ce9d..a6f1a3b 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,4 +1,4 @@ -import { Writable, writable } from "svelte/store"; +import { type Writable, writable } from "svelte/store"; import { Server } from './server' let list: Server[] diff --git a/tsconfig.json b/tsconfig.json index 1399304..a0349bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,11 @@ "include": ["src/**/*"], "exclude": ["node_modules/*", "__sapper__/*", "public/*"], "compilerOptions": { - "target": "es6", - "lib": [ "es2019", "dom" ] + "target": "esnext", + "module": "esnext", + "lib": [ "es2019", "dom" ], + "types": [ + "node" + ] } } \ No newline at end of file