diff --git a/src/backend/FrontblockAdmin.ts b/src/backend/FrontblockAdmin.ts index 974a5a4..d145b0e 100644 --- a/src/backend/FrontblockAdmin.ts +++ b/src/backend/FrontblockAdmin.ts @@ -190,7 +190,11 @@ export class FrontblockAdmin extends ConfigLoader{ response.status(200) response.set('Content-Type', 'application/javascript') response.send(frontend) - }) + }) + + this.express.get("*", (req, res) => { + res.status(301).redirect("/") + }) this.httpServer = new http.Server(this.express) this.httpServer.listen(port, () => { diff --git a/src/backend/FrontblockLib.ts b/src/backend/FrontblockLib.ts index b815093..2b29b64 100644 --- a/src/backend/FrontblockLib.ts +++ b/src/backend/FrontblockLib.ts @@ -81,9 +81,9 @@ window['setup'] = async() => { await Promise.all([ fb.PluginManager.installPlugin("ApiClient"), fb.PluginManager.installPlugin("HtmlSupplier"), - fb.PluginManager.installPlugin("PluginManager"), fb.PluginManager.installPlugin("PaymentManager"), fb.PluginManager.installPlugin("BTCWallet"), ]) + await fb.PluginManager.installPlugin("PluginManager"), location.reload(); } \ No newline at end of file diff --git a/src/frontend/dashboard/src/app/app-routing.module.ts b/src/frontend/dashboard/src/app/app-routing.module.ts index ac008c1..1580cf6 100644 --- a/src/frontend/dashboard/src/app/app-routing.module.ts +++ b/src/frontend/dashboard/src/app/app-routing.module.ts @@ -1,11 +1,15 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule, Route } from '@angular/router'; import { HomeComponent } from './home/home.component'; +import { ErrorDisplayComponent } from './error-display/error-display.component'; const routes: Routes = [{ path: "", component: HomeComponent +},{ + path: "**", + component: ErrorDisplayComponent }]; export function getRoutes(){ diff --git a/src/frontend/dashboard/src/app/app.module.ts b/src/frontend/dashboard/src/app/app.module.ts index 5ecb36b..0889cb3 100644 --- a/src/frontend/dashboard/src/app/app.module.ts +++ b/src/frontend/dashboard/src/app/app.module.ts @@ -13,6 +13,7 @@ import { SidebarComponent } from './sidebar/sidebar.component'; import { MainComponent } from './main/main.component'; import { DynamicLoaderComponent } from './dynamic-loader/dynamic-loader.component'; import { HomeComponent } from './home/home.component'; +import { ErrorDisplayComponent } from './error-display/error-display.component'; export function createCompiler(fn: CompilerFactory): Compiler { return fn.createCompiler(); @@ -27,6 +28,7 @@ const entryComps = [] MainComponent, DynamicLoaderComponent, HomeComponent, + ErrorDisplayComponent ], imports: [ BrowserModule, 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 a7f2179..4669dc1 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 @@ -33,6 +33,7 @@ import { AfterViewInit, Component, ViewContainerRef, ViewChild } from '@angular/ import { SidebarComponent } from '../sidebar/sidebar.component'; import { MainComponent } from '../main/main.component'; import { Router } from '@angular/router'; +import { FrontendPlugin } from "frontblock-generic/Plugin" @Component({ @@ -64,7 +65,7 @@ export class DynamicLoaderComponent implements AfterViewInit { } private async installWidget(pluginName:string){ - const module: any = await SystemJS.import("plugins/"+pluginName+".js"); + const module: FrontendPlugin = await SystemJS.import("plugins/"+pluginName+".js"); const plugin = new module['PluginModule']() const entry = plugin.getSidebarEntry() entry.route = 'page/' + entry.route diff --git a/src/frontend/dashboard/tsconfig.app.json b/src/frontend/dashboard/tsconfig.app.json index 31f8397..c85ee27 100644 --- a/src/frontend/dashboard/tsconfig.app.json +++ b/src/frontend/dashboard/tsconfig.app.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": ["node"] }, "include": [ "src/**/*.ts" diff --git a/tsconfig.frontend.json b/tsconfig.frontend.json index 85d5bd1..0fc7e02 100644 --- a/tsconfig.frontend.json +++ b/tsconfig.frontend.json @@ -1,6 +1,6 @@ { "extends": "./tsconfig.json", - "include": ["src/frontend/widget"], + "include": ["src/frontend/**/*"], "exclude": [ "src/backend" ] diff --git a/tsconfig.json b/tsconfig.json index e15a496..4c77987 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,6 @@ "strict": true, "experimentalDecorators": true }, - "include": ["src/backend"], + "include": ["src/backend/**/*"], "exclude": ["node_modules", "**/__tests__/*"], } \ No newline at end of file