fix setup
This commit is contained in:
@@ -190,7 +190,11 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
|
|||||||
response.status(200)
|
response.status(200)
|
||||||
response.set('Content-Type', 'application/javascript')
|
response.set('Content-Type', 'application/javascript')
|
||||||
response.send(frontend)
|
response.send(frontend)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.express.get("*", (req, res) => {
|
||||||
|
res.status(301).redirect("/")
|
||||||
|
})
|
||||||
|
|
||||||
this.httpServer = new http.Server(this.express)
|
this.httpServer = new http.Server(this.express)
|
||||||
this.httpServer.listen(port, () => {
|
this.httpServer.listen(port, () => {
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ window['setup'] = async() => {
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
fb.PluginManager.installPlugin("ApiClient"),
|
fb.PluginManager.installPlugin("ApiClient"),
|
||||||
fb.PluginManager.installPlugin("HtmlSupplier"),
|
fb.PluginManager.installPlugin("HtmlSupplier"),
|
||||||
fb.PluginManager.installPlugin("PluginManager"),
|
|
||||||
fb.PluginManager.installPlugin("PaymentManager"),
|
fb.PluginManager.installPlugin("PaymentManager"),
|
||||||
fb.PluginManager.installPlugin("BTCWallet"),
|
fb.PluginManager.installPlugin("BTCWallet"),
|
||||||
])
|
])
|
||||||
|
await fb.PluginManager.installPlugin("PluginManager"),
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule, Route } from '@angular/router';
|
import { Routes, RouterModule, Route } from '@angular/router';
|
||||||
import { HomeComponent } from './home/home.component';
|
import { HomeComponent } from './home/home.component';
|
||||||
|
import { ErrorDisplayComponent } from './error-display/error-display.component';
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [{
|
const routes: Routes = [{
|
||||||
path: "",
|
path: "",
|
||||||
component: HomeComponent
|
component: HomeComponent
|
||||||
|
},{
|
||||||
|
path: "**",
|
||||||
|
component: ErrorDisplayComponent
|
||||||
}];
|
}];
|
||||||
|
|
||||||
export function getRoutes(){
|
export function getRoutes(){
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { SidebarComponent } from './sidebar/sidebar.component';
|
|||||||
import { MainComponent } from './main/main.component';
|
import { MainComponent } from './main/main.component';
|
||||||
import { DynamicLoaderComponent } from './dynamic-loader/dynamic-loader.component';
|
import { DynamicLoaderComponent } from './dynamic-loader/dynamic-loader.component';
|
||||||
import { HomeComponent } from './home/home.component';
|
import { HomeComponent } from './home/home.component';
|
||||||
|
import { ErrorDisplayComponent } from './error-display/error-display.component';
|
||||||
|
|
||||||
export function createCompiler(fn: CompilerFactory): Compiler {
|
export function createCompiler(fn: CompilerFactory): Compiler {
|
||||||
return fn.createCompiler();
|
return fn.createCompiler();
|
||||||
@@ -27,6 +28,7 @@ const entryComps = []
|
|||||||
MainComponent,
|
MainComponent,
|
||||||
DynamicLoaderComponent,
|
DynamicLoaderComponent,
|
||||||
HomeComponent,
|
HomeComponent,
|
||||||
|
ErrorDisplayComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { AfterViewInit, Component, ViewContainerRef, ViewChild } from '@angular/
|
|||||||
import { SidebarComponent } from '../sidebar/sidebar.component';
|
import { SidebarComponent } from '../sidebar/sidebar.component';
|
||||||
import { MainComponent } from '../main/main.component';
|
import { MainComponent } from '../main/main.component';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { FrontendPlugin } from "frontblock-generic/Plugin"
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -64,7 +65,7 @@ export class DynamicLoaderComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async installWidget(pluginName:string){
|
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 plugin = new module['PluginModule']()
|
||||||
const entry = plugin.getSidebarEntry()
|
const entry = plugin.getSidebarEntry()
|
||||||
entry.route = 'page/' + entry.route
|
entry.route = 'page/' + entry.route
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out-tsc/app",
|
"outDir": "./out-tsc/app",
|
||||||
"types": []
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": ["src/frontend/widget"],
|
"include": ["src/frontend/**/*"],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"src/backend"
|
"src/backend"
|
||||||
]
|
]
|
||||||
|
|||||||
+1
-1
@@ -9,6 +9,6 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"experimentalDecorators": true
|
"experimentalDecorators": true
|
||||||
},
|
},
|
||||||
"include": ["src/backend"],
|
"include": ["src/backend/**/*"],
|
||||||
"exclude": ["node_modules", "**/__tests__/*"],
|
"exclude": ["node_modules", "**/__tests__/*"],
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user