working on frontend
This commit is contained in:
Generated
+3
-3
@@ -3858,9 +3858,9 @@
|
||||
}
|
||||
},
|
||||
"frontblock-generic": {
|
||||
"version": "0.17.0",
|
||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.17.0.tgz",
|
||||
"integrity": "sha512-5l5w5gnn5RpwzLmI4icdQI/yueoQQDhbH56pRsfVV+opNMRa8cvW9DJ3FXo0CgZ5BEKA6EHqF4iDIFsgYyPPpA==",
|
||||
"version": "0.20.0",
|
||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.20.0.tgz",
|
||||
"integrity": "sha512-QYXKpDmznkWM4UuNlZg+QcOwcwjVi8IRvlOv+Shm6n2qmU7WMliB0HMfRjw8JNKi8aC3EYx1YpgvXmY9tdN4QQ==",
|
||||
"requires": {
|
||||
"@types/node": "^12.7.1",
|
||||
"bsock": "^0.1.9",
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
"bsock": "^0.1.9",
|
||||
"easy-unzip": "^1.1.0",
|
||||
"express": "^4.16.4",
|
||||
"frontblock-generic": "^0.17.0",
|
||||
"frontblock-generic": "^0.20.0",
|
||||
"hdkey": "^1.1.1",
|
||||
"http": "0.0.0",
|
||||
"key-file-storage": "^2.2.4",
|
||||
|
||||
@@ -24,7 +24,7 @@ export default class PluginManagerPlugin extends PluginManager implements Plugin
|
||||
this.loadedPlugins[this.name] = {backend: this, frontend: this.loadFrontend(this.name)}
|
||||
}
|
||||
|
||||
exportRPCs(): socketioRPC[] {
|
||||
exportExtraRPCs(): socketioRPC[] {
|
||||
return [
|
||||
{
|
||||
name: "getAvailablePluginNames",
|
||||
@@ -66,12 +66,6 @@ export default class PluginManagerPlugin extends PluginManager implements Plugin
|
||||
visibility: "private",
|
||||
rpc: async(pluginName:string) => { return this.unloadPlugin(pluginName) },
|
||||
type: 'call'
|
||||
},
|
||||
{
|
||||
name: "updateConfig",
|
||||
visibility: "private",
|
||||
rpc: async(conf) => { return this.updateConfig(conf) },
|
||||
type: 'call'
|
||||
},{
|
||||
name: "extractPlugin",
|
||||
visibility: "private",
|
||||
|
||||
@@ -7,7 +7,7 @@ import path = require('path')
|
||||
import unzip = require('unzip')
|
||||
import easyunzip = require('easy-unzip')
|
||||
|
||||
import { Plugin, ConfigLoader } from 'frontblock-generic/Plugin';
|
||||
import { Plugin, ConfigLoader, PluginConfigLoader } from 'frontblock-generic/Plugin';
|
||||
import { SemVer, parse } from "semver";
|
||||
import { once } from 'events';
|
||||
|
||||
@@ -39,7 +39,7 @@ export type PluginManagerConfig = {
|
||||
installDir:string
|
||||
}
|
||||
|
||||
export default class PluginManager extends ConfigLoader<PluginManagerConfig&PluginVersioning>{
|
||||
export default abstract class PluginManager extends PluginConfigLoader<PluginManagerConfig&PluginVersioning>{
|
||||
|
||||
private cacheDir: string
|
||||
protected loadedPlugins: PluginMap = {}
|
||||
@@ -152,7 +152,7 @@ export default class PluginManager extends ConfigLoader<PluginManagerConfig&Plug
|
||||
this.conf[pluginName] = {}
|
||||
}
|
||||
this.conf[pluginName]!["cached"] = version
|
||||
this.updateConfig(this.conf)
|
||||
this.setConfig(this.conf)
|
||||
|
||||
|
||||
} catch (error) {
|
||||
@@ -172,7 +172,7 @@ export default class PluginManager extends ConfigLoader<PluginManagerConfig&Plug
|
||||
this.conf[pluginName] = {}
|
||||
}
|
||||
this.conf[pluginName]!["installed"] = this.conf[pluginName]!["cached"]
|
||||
this.updateConfig(this.conf)
|
||||
this.setConfig(this.conf)
|
||||
}
|
||||
|
||||
public async installPlugin(pluginName: string) {
|
||||
|
||||
Generated
+3
-3
@@ -4294,9 +4294,9 @@
|
||||
}
|
||||
},
|
||||
"frontblock-generic": {
|
||||
"version": "0.17.0",
|
||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.17.0.tgz",
|
||||
"integrity": "sha512-5l5w5gnn5RpwzLmI4icdQI/yueoQQDhbH56pRsfVV+opNMRa8cvW9DJ3FXo0CgZ5BEKA6EHqF4iDIFsgYyPPpA==",
|
||||
"version": "0.20.0",
|
||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.20.0.tgz",
|
||||
"integrity": "sha512-QYXKpDmznkWM4UuNlZg+QcOwcwjVi8IRvlOv+Shm6n2qmU7WMliB0HMfRjw8JNKi8aC3EYx1YpgvXmY9tdN4QQ==",
|
||||
"requires": {
|
||||
"@types/node": "^12.7.1",
|
||||
"bsock": "^0.1.9",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"@clr/icons": "^2.1.1",
|
||||
"@clr/ui": "^2.1.1",
|
||||
"@webcomponents/custom-elements": "^1.0.0",
|
||||
"frontblock-generic": "^0.17.0",
|
||||
"frontblock-generic": "^0.20.0",
|
||||
"key-file-storage": "^2.2.4",
|
||||
"rxjs": "~6.5.2",
|
||||
"systemjs": "^0.21.3",
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { SidebarEntry } from 'frontblock-generic/Plugin';
|
||||
declare const fb
|
||||
@Component({
|
||||
selector: 'apiclient', //!!!!
|
||||
template: `
|
||||
<div class="clr-row">
|
||||
<div class="clr-col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Configuration
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
Settings
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<settings></settings>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="btn btn-success" onclick="">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<settings></settings>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
@@ -32,3 +18,9 @@ export class ApiclientDevComponent implements OnInit {
|
||||
ngOnInit() { }
|
||||
|
||||
}
|
||||
|
||||
export const sidebarEntry:SidebarEntry = {
|
||||
icon: "wrench",
|
||||
route: "dev/apiclient",
|
||||
text: "DEV ApiClient",
|
||||
}
|
||||
|
||||
@@ -3,50 +3,85 @@ import { Component, OnInit } from '@angular/core';
|
||||
@Component({
|
||||
selector: 'settings',
|
||||
template: `
|
||||
<form clrForm clrLayout="vertical">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Configuration
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
Settings
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<form clrForm clrLayout="vertical">
|
||||
<clr-input-container>
|
||||
<label>testnet</label>
|
||||
<clr-control-error>We need your first name for legal compliance</clr-control-error>
|
||||
</clr-input-container>
|
||||
<input type="checkbox" [(ngModel)]="testnet" (change)="updateTestnet($event)" name="testnetToggle" clrToggle />
|
||||
|
||||
<clr-input-container *ngIf="!testnet">
|
||||
<label>API key</label>
|
||||
<input clrInput type="text" name="apikey" required />
|
||||
<clr-control-error>We need your first name for legal compliance</clr-control-error>
|
||||
</clr-input-container>
|
||||
|
||||
<clr-input-container *ngIf="advanced">
|
||||
<label>API address</label>
|
||||
<input type="text" [(ngModel)]="data.apihost" (change)="updatePort($event)" clrInput name="apihost" required />
|
||||
<clr-control-error>This field is required!</clr-control-error>
|
||||
</clr-input-container>
|
||||
|
||||
<clr-checkbox-wrapper *ngIf="advanced" >
|
||||
<input [(ngModel)]="data.tls" type="checkbox" clrCheckbox value="tls" name="options" />
|
||||
<label>Use TLS</label>
|
||||
</clr-checkbox-wrapper>
|
||||
|
||||
<clr-input-container *ngIf="advanced">
|
||||
<label>Port</label>
|
||||
<input [(ngModel)]="data.port" clrInput type="number" name="lastName" required />
|
||||
<clr-control-error>Valid range 1024 - 65536
|
||||
</clr-control-error>
|
||||
</clr-input-container>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button class="btn btn-success" ngClick="">Save</button>
|
||||
<button *ngIf="!advanced" class="btn btn-sm btn-link" (click)="setAdvanced()">Advanced</button>
|
||||
|
||||
<clr-input-container>
|
||||
<label>API key</label>
|
||||
<input clrInput type="text" name="apikey" required />
|
||||
<clr-control-error>We need your first name for legal compliance</clr-control-error>
|
||||
</clr-input-container>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<clr-select-container>
|
||||
<label>API address</label>
|
||||
<select [(ngModel)]="data.address" (change)="updatePort($event)" clrSelect name="apihost" required>
|
||||
<option value="api.testnet.frontblock.me">api.testnet.frontblock.me</option>
|
||||
<option value="api.frontblock.me">api.frontblock.me</option>
|
||||
</select>
|
||||
<clr-control-error>This field is required!</clr-control-error>
|
||||
</clr-select-container>
|
||||
|
||||
<clr-checkbox-wrapper>
|
||||
<input [(ngModel)]="data.tls" type="checkbox" clrCheckbox value="tls" name="options" />
|
||||
<label>Use TLS</label>
|
||||
</clr-checkbox-wrapper>
|
||||
|
||||
<clr-input-container>
|
||||
<label>Port</label>
|
||||
<input [(ngModel)]="data.port" clrInput type="number" name="lastName" required />
|
||||
<clr-control-error>Valid range 1024 - 65536
|
||||
</clr-control-error>
|
||||
</clr-input-container>
|
||||
|
||||
|
||||
</form>
|
||||
`
|
||||
})
|
||||
export class ApiclientFormComponent implements OnInit {
|
||||
|
||||
data:any = {}
|
||||
testnet:boolean = true
|
||||
advanced:boolean = false
|
||||
data:any = {
|
||||
apihost: "api.testnet.frontblock.me",
|
||||
port: "10001"
|
||||
}
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() { }
|
||||
|
||||
setAdvanced(){ this.advanced = true }
|
||||
|
||||
updateTestnet(){
|
||||
if(this.testnet){
|
||||
this.data.apihost = "api.testnet.frontblock.me"
|
||||
this.data.port = 10001
|
||||
}else{
|
||||
this.data.apihost = "api.frontblock.me"
|
||||
this.data.port = 10000
|
||||
}
|
||||
}
|
||||
|
||||
updatePort(obj){
|
||||
console.log(obj, this.data)
|
||||
switch (this.data.address) {
|
||||
switch (this.data.apihost) {
|
||||
case "api.testnet.frontblock.me":
|
||||
this.data.port = 10001
|
||||
break;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { SidebarEntry } from 'frontblock-generic/Plugin';
|
||||
declare const fb
|
||||
@Component({
|
||||
selector: 'pluginmanager', //!!!!
|
||||
@@ -36,3 +37,11 @@ export class PluginmanagerDevComponent implements OnInit {
|
||||
ngOnInit() { }
|
||||
|
||||
}
|
||||
|
||||
export const sidebarEntry: SidebarEntry = {
|
||||
icon: "wrench",
|
||||
route: "dev/pluginmanager",
|
||||
text: "DEV Plugin manager",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { SidebarEntries, SidebarEntry } from 'frontblock-generic/Plugin';
|
||||
import { sidebarEntry as apiclient } from "../apiclient-dev/apiclient-dev.component"
|
||||
import { sidebarEntry as pluginmanager } from "../pluginmanager-dev/pluginmanager-dev.component"
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-sidebar',
|
||||
@@ -8,15 +11,10 @@ import { SidebarEntries, SidebarEntry } from 'frontblock-generic/Plugin';
|
||||
})
|
||||
export class SidebarComponent implements OnInit {
|
||||
|
||||
entries:SidebarEntry[] = [{
|
||||
icon: "wrench",
|
||||
route: "dev/pluginmanager",
|
||||
text: "DEV Plugin manager",
|
||||
},{
|
||||
icon: "wrench",
|
||||
route: "dev/apiclient",
|
||||
text: "DEV ApiClient",
|
||||
}]
|
||||
entries:SidebarEntry[] = [
|
||||
pluginmanager,
|
||||
apiclient
|
||||
]
|
||||
|
||||
multientires:SidebarEntries[] = [{
|
||||
icon: "times",
|
||||
|
||||
Reference in New Issue
Block a user