diff --git a/src/frontend/dashboard/angular.json b/src/frontend/dashboard/angular.json index fa4c545..6d6286e 100644 --- a/src/frontend/dashboard/angular.json +++ b/src/frontend/dashboard/angular.json @@ -30,7 +30,7 @@ "styles": [ "src/styles.scss", "node_modules/@clr/icons/clr-icons.min.css", - "node_modules/@clr/ui/clr-ui.min.css" + "node_modules/@clr/ui/clr-ui-dark.min.css" ], "scripts": [ "node_modules/systemjs/dist/system.js", diff --git a/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts b/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts index cd43cc1..e2a3a50 100644 --- a/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts +++ b/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts @@ -1,28 +1,26 @@ -import { Component, OnInit } from '@angular/core'; -import { FrontblockApiConf } from 'frontblock'; +import { Component, OnInit, isDevMode } from '@angular/core'; import { SubscriptionResponse, parseResponse, SuccessResponse } from 'frontblock-generic/Types.js'; -import { environment } from "../../environments/environment" -const fb = environment.production?window["fb"]:{ - ApiClient : { - setConfig: async () => { +const fb = !isDevMode() ? window["fb"] : { + ApiClient: { + setConfig: async () => { await new Promise((resolve, reject) => { - setTimeout(() => { - resolve('Promise A win!'); - }, 500) - }) + setTimeout(() => { + resolve('Promise A win!'); + }, 500) + }) }, getConsumptions: async () => { return await new Promise((resolve, reject) => { setTimeout(() => { - resolve([new SubscriptionResponse("654", "321"), new SubscriptionResponse("456", "123")]); + resolve([new SubscriptionResponse("654", "321"), new SubscriptionResponse("456", "123")]); }, 500) }) }, getSubscriptions: async () => { return await new Promise((resolve, reject) => { setTimeout(() => { - resolve([new SubscriptionResponse("321"), new SubscriptionResponse("123")]); + resolve([new SubscriptionResponse("321"), new SubscriptionResponse("123")]); }, 500) }) }, @@ -50,29 +48,27 @@ const fb = environment.production?window["fb"]:{
- - - - - - - - - - - - - - - - - -
UUIDExpiryCreation
{{line.uid}}{{line.expiry}}{{line.created}}
+ + UUID + Expiry + Creation + + + + {{line.uid}} + {{line.expiry}} + {{line.created | date}} + + + + + + {{entries.length}} entries +
` @@ -80,11 +76,7 @@ const fb = environment.production?window["fb"]:{ export class ApiclientConsumptionComponent implements OnInit { loading:boolean = false actionName:string = "load" - entries:SubscriptionResponse[] = [{ - uid: "1231", - message: "", - result: "Success" - }] + entries:SubscriptionResponse[] = [] alerts: { severity: "danger" | "warning" | "success" message: string diff --git a/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts b/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts index cb3e5c8..d6e4b27 100644 --- a/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts +++ b/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { FrontblockApiConf } from 'frontblock'; -import { environment } from "../../environments/environment" +import { isDevMode } from '@angular/core'; -const fb = environment.production ? window["fb"] : { +const fb = !isDevMode ? window["fb"] : { ApiClient: { setConfig: async () => { await new Promise((resolve, reject) => { @@ -23,33 +23,35 @@ const fb = environment.production ? window["fb"] : {
-
- - - We need your first name for legal compliance - - - + +
+ +
+ +
+
+ - - - We need your first name for legal compliance + + - - + + This field is required! + +
+ +
+ +
+
- - - - - - - - + + + Valid range 1024 - 65536 @@ -59,7 +61,7 @@ const fb = environment.production ? window["fb"] : {
` diff --git a/src/frontend/dashboard/src/app/ApiClient/apiclient-subscriptions.component.ts b/src/frontend/dashboard/src/app/ApiClient/apiclient-subscriptions.component.ts index 0b2b32f..1eec5b3 100644 --- a/src/frontend/dashboard/src/app/ApiClient/apiclient-subscriptions.component.ts +++ b/src/frontend/dashboard/src/app/ApiClient/apiclient-subscriptions.component.ts @@ -1,9 +1,7 @@ -import { Component, OnInit } from '@angular/core'; -import { FrontblockApiConf } from 'frontblock'; +import { Component, OnInit, isDevMode } from '@angular/core'; import { SubscriptionResponse, SuccessResponse, parseResponse } from 'frontblock-generic/Types.js'; -import { environment } from "../../environments/environment" -const fb = environment.production ? window["fb"] : { +const fb = !isDevMode() ? window["fb"] : { ApiClient: { setConfig: async () => { await new Promise((resolve, reject) => { @@ -34,50 +32,48 @@ const fb = environment.production ? window["fb"] : { @Component({ selector: 'subscriptions', template: ` -
-
- Subscriptions +
+
+ Subscriptions +
+ + + + {{entry.message}} + + + + +
+ +
+
+
+ + UUID + Expiry + Creation + + + + {{line.uid}} + {{line.expiry}} + {{line.created | date}} + + + + + + {{entries.length}} entries + +
+
+
- - - - - {{entry.message}} - - - - -
- -
-
-
- - - - - - - - - - - - - - - - - -
UUIDExpiryCreation
{{line.uid}}{{line.expiry}}{{line.created}}
-
-
- -
- ` +` }) export class ApiclientSubscriptionComponent implements OnInit { loading: boolean = false diff --git a/src/frontend/dashboard/src/app/ApiClient/module.ts b/src/frontend/dashboard/src/app/ApiClient/module.ts index 1d26dcc..2ba8bf2 100644 --- a/src/frontend/dashboard/src/app/ApiClient/module.ts +++ b/src/frontend/dashboard/src/app/ApiClient/module.ts @@ -7,7 +7,7 @@ import { ApiclientFormComponent } from './apiclient-settings-form.component'; import { ApiclientConsumptionComponent } from './apiclient-consumptions.component'; import { ApiclientSubscriptionComponent } from './apiclient-subscriptions.component'; -import { FrontendPlugin, SidebarEntry } from 'frontblock-generic/Plugin'; +import { FrontendPlugin, SidebarEntry, SidebarEntries } from 'frontblock-generic/Plugin'; import { ClarityModule } from '@clr/angular'; import { FormsModule } from '@angular/forms'; @@ -19,7 +19,9 @@ import { FormsModule } from '@angular/forms'; CommonModule, RouterModule.forChild([ - {path: "apiclient", component: ApiclientComponent}, + {path: "settings", component: ApiclientFormComponent}, + {path: "subscriptions", component: ApiclientSubscriptionComponent}, + {path: "consumptions", component: ApiclientConsumptionComponent}, ]), ], exports: [RouterModule], @@ -31,11 +33,21 @@ import { FormsModule } from '@angular/forms'; ] }) export class PluginModule implements FrontendPlugin{ - getSidebarEntry(): SidebarEntry { + getSidebarEntry(): SidebarEntries { return { icon: "key", - route: "apiclient", + parentRoute: "apiclient", text: "Api client", + links: [{ + route: "settings", + text: "Settings" + },{ + route: "consumptions", + text: "Consumptions" + },{ + route: "subscriptions", + text: "Subscriptions" + },] } } } diff --git a/src/frontend/dashboard/src/app/PluginManager/debug.component.ts b/src/frontend/dashboard/src/app/PluginManager/debug.component.ts index b57dc70..adb2805 100644 --- a/src/frontend/dashboard/src/app/PluginManager/debug.component.ts +++ b/src/frontend/dashboard/src/app/PluginManager/debug.component.ts @@ -23,7 +23,7 @@ declare const fb
diff --git a/src/frontend/dashboard/src/app/PluginManager/plugins.component.ts b/src/frontend/dashboard/src/app/PluginManager/plugins.component.ts index 9e08b15..99a47a7 100644 --- a/src/frontend/dashboard/src/app/PluginManager/plugins.component.ts +++ b/src/frontend/dashboard/src/app/PluginManager/plugins.component.ts @@ -1,28 +1,18 @@ import { Component, OnInit } from '@angular/core'; -import { SidebarEntry } from 'frontblock-generic/Plugin'; declare const fb @Component({ - selector: 'plugins', //!!!! - template: ` -