diff --git a/web/public/favicon.ico b/web/public/favicon.ico deleted file mode 100644 index df36fcf..0000000 Binary files a/web/public/favicon.ico and /dev/null differ diff --git a/web/src/Class/Query.ts b/web/src/Class/Query.ts new file mode 100644 index 0000000..cb07fdb --- /dev/null +++ b/web/src/Class/Query.ts @@ -0,0 +1,32 @@ +import { InfluxDB, QueryApi } from '@influxdata/influxdb-client'; + +export class Query { + private client!: InfluxDB; + private queryApi!: QueryApi; + + constructor() { + this.initDatabase(); + } + + private initDatabase(): void { + this.client = new InfluxDB({ + url: process.env.VUE_APP_DB_URL!, + token: process.env.VUE_APP_DB_TOKEN!, + }); + this.queryApi = this.client.getQueryApi(process.env.VUE_APP_DB_ORG!); + } + + async query(filter: string) { + const query = `from(bucket: "${process.env.VUE_APP_DB_BUCKET}") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "${filter}") |> aggregateWindow(every: 10m, fn: mean)`; + + try { + const data = await this.queryApi.collectRows(query); + console.log('\nCollect ROWS SUCCESS'); + return data; + } catch (error) { + console.error(error); + console.log('\nCollect ROWS ERROR'); + return [{ Error: 'Error occured' }]; + } + } +} diff --git a/web/src/assets/logo.png b/web/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/web/src/assets/logo.png and /dev/null differ diff --git a/web/src/components/Footer.vue b/web/src/components/Footer.vue index c528749..648ae27 100644 --- a/web/src/components/Footer.vue +++ b/web/src/components/Footer.vue @@ -3,14 +3,14 @@
diff --git a/web/src/components/Hero.vue b/web/src/components/Hero.vue index 76362d7..aef7487 100644 --- a/web/src/components/Hero.vue +++ b/web/src/components/Hero.vue @@ -5,8 +5,24 @@+ +
++ +
++ +
+