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"]:{
-
-
-
- | UUID |
- Expiry |
- Creation |
- |
-
-
-
-
- | {{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"] : {
`
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: `
-
-
- `
+`
})
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: `
-
-
-
-
-
-
{{updateCandidate}} But not much to say...
-
-
-
-
-
+ selector: 'plugins', //!!!!
+ template: `
+
+ Confirm installation
+
+
{{updateCandidate}} But not much to say...
-
-
+
+
@@ -64,48 +54,48 @@ export class PluginsComponent implements OnInit {
available: "0.0.1",
installed: "0.0.1",
status: "Running"
- },{
+ }, {
name: "test II: Return of test",
available: "0.0.1",
installed: "0.0.1",
status: "Available"
- },{
+ }, {
name: "test 3",
available: "0.0.2",
installed: "0.0.1",
status: "Stopped"
},]
- updatepending = true
+ updatepending = false
updateCandidate = ""
constructor() { }
- start(name){
+ start(name) {
this.plugins.find((el) => el.name === name).status = "Running"
}
- stop(name){
+ stop(name) {
this.plugins.find((el) => el.name === name).status = "Stopped"
}
- delete(name){
+ delete(name) {
this.plugins.find((el) => el.name === name).status = "Available"
}
- showConfirmation(name){
+ showConfirmation(name) {
this.updateCandidate = name
this.updatepending = !this.updatepending
}
- download(name){
+ download(name) {
let plugin = this.plugins.find((el) => el.name === name)
plugin.status = "Stopped"
plugin.installed = plugin.available
this.updatepending = !this.updatepending
}
- cancelModal(){
+ cancelModal() {
this.updateCandidate = ""
this.updatepending = !this.updatepending
}
diff --git a/src/frontend/dashboard/src/app/app.component.ts b/src/frontend/dashboard/src/app/app.component.ts
index bd819cd..6cebd83 100644
--- a/src/frontend/dashboard/src/app/app.component.ts
+++ b/src/frontend/dashboard/src/app/app.component.ts
@@ -14,7 +14,7 @@ export class AppComponent implements AfterContentInit {
sidebar: SidebarComponent
constructor(private zone:NgZone, private sidebarService: SidebarEntryService){
- window["refresh"] = () => zone.run(()=>{ /*this triggers an angular reload*/})
+ window["refresh"] = setInterval(() => zone.run(()=>{ /*this triggers an angular reload*/}), 200)
}
ngAfterContentInit(){
diff --git a/src/frontend/dashboard/src/app/dynamic-loader/dynamic-loader.component.ts b/src/frontend/dashboard/src/app/dynamic-loader/dynamic-loader.component.ts
index 91f5fe2..b9897db 100644
--- a/src/frontend/dashboard/src/app/dynamic-loader/dynamic-loader.component.ts
+++ b/src/frontend/dashboard/src/app/dynamic-loader/dynamic-loader.component.ts
@@ -12,12 +12,12 @@ import * as angularCommon from '@angular/common';
import * as angularCommonHttp from '@angular/common/http';
import * as angularForms from '@angular/forms';
import * as angularAnimations from '@angular/animations';
-//import * as angularAnimationsBrowser from '@angular/animations/browser'
+import * as angularAnimationsBrowser from '@angular/animations/browser'
import * as angularPlatformBrowser from '@angular/platform-browser';
import * as angularPlatformBrowserDynamic from '@angular/platform-browser-dynamic';
import * as clarityModule from '@clr/angular';
import * as frontblockGenericTypes from 'frontblock-generic/Types.js'
-//import * as browserAnimationsModule from "@angular/platform-browser/animations";
+import * as browserAnimationsModule from "@angular/platform-browser/animations";
SystemJS.set('@clr/angular', SystemJS.newModule(clarityModule));
SystemJS.set('@angular/router', SystemJS.newModule(angularRouter));
@@ -26,16 +26,15 @@ SystemJS.set('@angular/common', SystemJS.newModule(angularCommon));
SystemJS.set('@angular/common/http', SystemJS.newModule(angularCommonHttp));
SystemJS.set('@angular/forms', SystemJS.newModule(angularForms));
SystemJS.set('@angular/animations', SystemJS.newModule(angularAnimations));
-//SystemJS.set('@angular/animations/browser', SystemJS.newModule(angularAnimationsBrowser));
+SystemJS.set('@angular/animations/browser', SystemJS.newModule(angularAnimationsBrowser));
SystemJS.set('@angular/platform-browser', SystemJS.newModule(angularPlatformBrowser));
-//SystemJS.set('@angular/platform-browser/animations', SystemJS.newModule(browserAnimationsModule));
+SystemJS.set('@angular/platform-browser/animations', SystemJS.newModule(browserAnimationsModule));
SystemJS.set('@angular/platform-browser-dynamic', SystemJS.newModule(angularPlatformBrowserDynamic));
SystemJS.set('frontblock-generic/Types', SystemJS.newModule(frontblockGenericTypes));
SystemJS.config({ meta: { '*': { authorization: true } } });
/** --------- */
-
import { AfterViewInit, Component } from '@angular/core';
import { SidebarComponent } from '../sidebar/sidebar.component';
import { Router } from '@angular/router';
diff --git a/src/frontend/dashboard/src/app/header-bar/header-bar.component.html b/src/frontend/dashboard/src/app/header-bar/header-bar.component.html
index 382d068..1372a16 100644
--- a/src/frontend/dashboard/src/app/header-bar/header-bar.component.html
+++ b/src/frontend/dashboard/src/app/header-bar/header-bar.component.html
@@ -1,4 +1,4 @@
-