Quellcode durchsuchen

fuck you merge

master
Daniel Huebleitner vor 2 Jahren
Ursprung
Commit
fd2ec801f7
9 geänderte Dateien mit 14 neuen und 1817 gelöschten Zeilen
  1. 2
    0
      .gitignore
  2. 4
    3
      .gitmodules
  3. 5
    5
      package.json
  4. 1
    1
      src/app/apiclient
  5. 1
    1
      src/app/pluginmanager
  6. 1
    1
      src/app/wallet
  7. 0
    417
      src/assets/apiclient.js
  8. 0
    283
      src/assets/pluginmanager.js
  9. 0
    1106
      src/assets/wallet.js

+ 2
- 0
.gitignore Datei anzeigen

@@ -44,3 +44,5 @@ testem.log
44 44
 # System Files
45 45
 .DS_Store
46 46
 Thumbs.db
47
+
48
+src/assets/*.js

+ 4
- 3
.gitmodules Datei anzeigen

@@ -1,9 +1,10 @@
1 1
 [submodule "src/app/apiclient"]
2 2
 	path = src/app/apiclient
3 3
 	url = ssh://git@gitea.frontblock.me:2222/fb-plugin/apiclient.git
4
-[submodule "src/app/wallet"]
5
-	path = src/app/wallet
6
-	url = ssh://git@gitea.frontblock.me:2222/fb-plugin/wallet.git
7 4
 [submodule "src/app/pluginmanager"]
8 5
 	path = src/app/pluginmanager
9 6
 	url = ssh://git@gitea.frontblock.me:2222/fb-plugin/pluginmanager.git
7
+[submodule "src/app/wallet"]
8
+	path = src/app/wallet
9
+	url = ssh://git@gitea.frontblock.me:2222/fb-plugin/wallet.git
10
+

+ 5
- 5
package.json Datei anzeigen

@@ -3,14 +3,14 @@
3 3
   "version": "0.0.0",
4 4
   "scripts": {
5 5
     "ng": "ng",
6
-    "start": "npm run copy-dev-gui; ng serve --aot=false --optimization=false --proxy-config proxy.conf.json ",
6
+    "start": "npm run get-submodules && npm run copy-frontends; ng serve --aot=false --optimization=false --proxy-config proxy.conf.json ",
7 7
     "build": "rm -f src/assets/*.js; ng build --prod --aot=false --optimization=false --build-optimizer=false",
8
-    "copy-dev-gui": "cp src/app/apiclient/dist/FrontendPlugin.js src/assets/apiclient.js; cp src/app/wallet/dist/FrontendPlugin.js src/assets/wallet.js; cp src/app/pluginmanager/dist/FrontendPlugin.js src/assets/pluginmanager.js;",
8
+    "get-submodules": "git submodule init && git submodule update",
9
+    "copy-frontends": "for module in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do npm i --prefix $module && npm run --prefix $module build && cp $module/dist/FrontendPlugin.js ./src/assets/$(basename $module).js; done",
10
+    "update-frontblock": "rm -rf node_modules/frontblock*; npm install",
9 11
     "test": "ng test",
10 12
     "lint": "ng lint",
11
-    "e2e": "ng e2e",
12
-    "get-submodules": "git submodule init && git submodule update",
13
-    "update-frontblock": "rm -rf node_modules/frontblock*; npm install"
13
+    "e2e": "ng e2e"
14 14
   },
15 15
   "private": true,
16 16
   "dependencies": {

+ 1
- 1
src/app/apiclient

@@ -1 +1 @@
1
-Subproject commit 08d9914da48fef30389798f64cf636a20f65f2d3
1
+Subproject commit 2e073876e9189a3cc9fae6fceafc6a06d5cb38a7

+ 1
- 1
src/app/pluginmanager

@@ -1 +1 @@
1
-Subproject commit ca427ed2e67c86a2b58a96730e719342c20f1adc
1
+Subproject commit 60d3abcf63b9e410d4a07527dd2e03d9136d4d83

+ 1
- 1
src/app/wallet

@@ -1 +1 @@
1
-Subproject commit 02e7c8aaa614dd6b0eb0445a62c1503335cd5673
1
+Subproject commit c65fdbf219c1bd7959f7743dee240b650e0cc4b5

+ 0
- 417
src/assets/apiclient.js Datei anzeigen

@@ -1,417 +0,0 @@
1
-System.register(['@angular/core', 'frontblock-generic/Types', '@angular/common', '@angular/router', '@clr/angular', '@angular/forms'], function (exports, module) {
2
-'use strict';
3
-var Component, NgModule, parseResponse, SuccessResponse, CommonModule, RouterModule, ClarityModule, FormsModule;
4
-return {
5
-setters: [function (module) {
6
-Component = module.Component;
7
-NgModule = module.NgModule;
8
-}, function (module) {
9
-parseResponse = module.parseResponse;
10
-SuccessResponse = module.SuccessResponse;
11
-}, function (module) {
12
-CommonModule = module.CommonModule;
13
-}, function (module) {
14
-RouterModule = module.RouterModule;
15
-}, function (module) {
16
-ClarityModule = module.ClarityModule;
17
-}, function (module) {
18
-FormsModule = module.FormsModule;
19
-}],
20
-execute: function () {
21
-
22
-/*! *****************************************************************************
23
-Copyright (c) Microsoft Corporation. All rights reserved.
24
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
25
-this file except in compliance with the License. You may obtain a copy of the
26
-License at http://www.apache.org/licenses/LICENSE-2.0
27
-
28
-THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
29
-KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
30
-WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
31
-MERCHANTABLITY OR NON-INFRINGEMENT.
32
-
33
-See the Apache Version 2.0 License for specific language governing permissions
34
-and limitations under the License.
35
-***************************************************************************** */
36
-/* global Reflect, Promise */
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-function __decorate(decorators, target, key, desc) {
45
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
46
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
47
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
48
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
49
-}
50
-
51
-
52
-
53
-
54
-
55
-function __awaiter(thisArg, _arguments, P, generator) {
56
-    return new (P || (P = Promise))(function (resolve, reject) {
57
-        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
58
-        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
59
-        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
60
-        step((generator = generator.apply(thisArg, _arguments || [])).next());
61
-    });
62
-}
63
-
64
-let ApiclientFormComponent = class ApiclientFormComponent {
65
-    constructor() {
66
-        this.testnet = true;
67
-        this.saving = false;
68
-        this.advanced = false;
69
-        this.data = {
70
-            apiHost: "api.testnet.frontblock.me",
71
-            apiPort: 10001,
72
-            tls: false,
73
-            apiKey: ""
74
-        };
75
-    }
76
-    ngOnInit() { }
77
-    setAdvanced() { this.advanced = true; }
78
-    checkData() {
79
-        return (typeof this.data.apiPort === "number" &&
80
-            typeof this.data.apiHost === "string" &&
81
-            typeof this.data.tls === "boolean" &&
82
-            typeof this.data.apiKey === "string");
83
-    }
84
-    updateTestnet() {
85
-        if (this.testnet) {
86
-            this.data.apiHost = "api.testnet.frontblock.me";
87
-            this.data.apiPort = 10001;
88
-        }
89
-        else {
90
-            this.data.apiHost = "api.frontblock.me";
91
-            this.data.apiPort = 10000;
92
-        }
93
-    }
94
-    updatePort(obj) {
95
-        switch (this.data.apiHost) {
96
-            case "api.testnet.frontblock.me":
97
-                this.data.apiPort = 10001;
98
-                break;
99
-            case "api.frontblock.me":
100
-                this.data.apiPort = 10000;
101
-                break;
102
-            default:
103
-                console.warn("A non-standard api host was chosen: " + this.data.apiPort);
104
-                break;
105
-        }
106
-        console.log(this.data);
107
-    }
108
-    save() {
109
-        return __awaiter(this, void 0, void 0, function* () {
110
-            this.saving = true;
111
-            if (typeof this.data.apiPort === "string")
112
-                this.data.apiPort = parseInt(this.data.apiPort);
113
-            if (this.checkData()) {
114
-                const conf = yield fb.ApiClient.setConfig(this.data);
115
-                console.log(conf);
116
-            }
117
-            else {
118
-                //show error in gui
119
-                console.error("bad data :(");
120
-            }
121
-            this.saving = false;
122
-        });
123
-    }
124
-};
125
-ApiclientFormComponent = __decorate([
126
-    Component({
127
-        selector: 'settings',
128
-        template: `
129
-    <div class="clr-row">
130
-        <div class="card clr-col-12 clr-col-sm-12 clr-col-md-12 clr-col-lg-auto clr-col-xl-auto">
131
-            <div class="card-header">
132
-            Settings
133
-            </div>
134
-            <div class="card-block">
135
-                <div class="card-text">
136
-                    <form clrForm clrLayout="horizontal">
137
-                        <div class="clr-row clr-form-control ng-star-inserted">
138
-                            <label class="clr-col-12 clr-col-md-4 clr-control-label">testnet</label>
139
-                            <div class="clr-col-12 clr-col-md-8">
140
-                                <input type="checkbox" [(ngModel)]="testnet"  (change)="updateTestnet($event)" name="testnetToggle" clrToggle  />
141
-                            </div>
142
-                        </div>
143
-                        
144
-                        <clr-input-container *ngIf="!testnet">
145
-                            <label class="clr-col-12 clr-col-md-4">API key</label>
146
-                            <input class="clr-col-12 clr-col-md-8" clrInput type="text" name="apiKey" required />
147
-                        </clr-input-container>
148
-                    
149
-                        <clr-input-container *ngIf="advanced" class="clr-row">
150
-                            <label class="clr-col-12 clr-col-md-4">API address</label>
151
-                            <input class="clr-col-12 clr-col-md-8" type="text" [(ngModel)]="data.apiHost" (change)="updatePort($event)" clrInput name="apiHost" required />
152
-                            <clr-control-error>This field is required!</clr-control-error>
153
-                        </clr-input-container>
154
-
155
-                        <div class="clr-row clr-form-control ng-star-inserted" *ngIf="advanced">
156
-                            <label class="clr-col-12 clr-col-md-4 clr-control-label">Use TLS</label>
157
-                            <div class="clr-col-12 clr-col-md-8">
158
-                                <input [(ngModel)]="data.tls" type="checkbox" clrCheckbox value="tls" name="options" />
159
-                            </div>
160
-                        </div>
161
-                        
162
-                        <clr-input-container class="clr-row" *ngIf="advanced">
163
-                            <label class="clr-col-12 clr-col-md-4">Port</label>
164
-                            <input class="clr-col-12 clr-col-md-8" [(ngModel)]="data.apiPort" clrInput type="number" name="lastName" required />
165
-                            <clr-control-error>Valid range 1024 - 65536 
166
-                            </clr-control-error>
167
-                        </clr-input-container>
168
-                    </form>
169
-                </div>
170
-            </div>
171
-            <div class="card-footer">
172
-                <button *ngIf="!saving" class="btn btn-success-outline" (click)="save()">
173
-                <span>Save</span>
174
-                </button>
175
-
176
-                <button *ngIf="saving" class="btn btn-disabled" (click)="save()" disabled>
177
-                <span class="spinner spinner-inline"></span>
178
-                </button>
179
-                <button *ngIf="!advanced" class="btn btn-sm btn-link" (click)="setAdvanced()">Advanced</button>
180
-            </div>
181
-        </div>
182
-    </div>
183
-  `
184
-    })
185
-], ApiclientFormComponent);
186
-
187
-let ApiclientConsumptionComponent = class ApiclientConsumptionComponent {
188
-    constructor() {
189
-        this.loading = false;
190
-        this.actionName = "load";
191
-        this.entries = [];
192
-        this.alerts = [];
193
-    }
194
-    ngOnInit() { }
195
-    load() {
196
-        return __awaiter(this, void 0, void 0, function* () {
197
-            this.loading = true;
198
-            this.entries = yield fb.ApiClient.getConsumptions();
199
-            if (this.entries.length === 0) {
200
-                this.alerts.push({ severity: "warning", message: "0 results were returned" });
201
-            }
202
-            this.loading = false;
203
-            this.actionName = "refresh";
204
-        });
205
-    }
206
-    quit(uid) {
207
-        return __awaiter(this, void 0, void 0, function* () {
208
-            const r = yield fb.ApiClient.quit(uid);
209
-            const res = parseResponse(r);
210
-            if (res instanceof SuccessResponse) {
211
-                this.alerts.push({ severity: "success", message: "Quit consuming " + uid });
212
-                this.load();
213
-            }
214
-            else {
215
-                this.alerts.push({ severity: "danger", message: "Error " + res.message });
216
-            }
217
-        });
218
-    }
219
-};
220
-ApiclientConsumptionComponent = __decorate([
221
-    Component({
222
-        selector: 'consumers',
223
-        template: `
224
-  <div class="clr-row">
225
-    <div class="card clr-col-12 clr-col-sm-12 clr-col-md-12 clr-col-lg-auto clr-col-xl-auto">
226
-        <div class="card-header">
227
-        Consumers
228
-        </div>
229
-        <clr-alert *ngFor="let entry of alerts" [clrAlertType]="entry.severity">
230
-            <clr-alert-item>
231
-                <span class="alert-text">
232
-                    {{entry.message}}
233
-                </span>
234
-            </clr-alert-item>
235
-        </clr-alert>
236
-
237
-        <div *ngIf="loading" class="card-block">
238
-        <span class="spinner spinner-inline"></span>
239
-        </div>
240
-        <div *ngIf="entries.length !== 0 && !loading" class="card-block limit-height">
241
-            <div class="card-text limit-height">
242
-                <clr-datagrid>
243
-                    <clr-dg-column>UUID</clr-dg-column>
244
-                    <clr-dg-column>Subscription UUID</clr-dg-column>
245
-                    <clr-dg-column>Expiry</clr-dg-column>
246
-                    <clr-dg-column>Creation</clr-dg-column>
247
-
248
-                    <clr-dg-row *clrDgItems="let line of entries">
249
-                        <clr-dg-cell>{{line.uid}}</clr-dg-cell>
250
-                        <clr-dg-cell>{{line.message}}</clr-dg-cell>
251
-                        <clr-dg-cell>{{line.expiry | date}}</clr-dg-cell>
252
-                        <clr-dg-cell>{{line.created | date}}</clr-dg-cell>
253
-                        
254
-                        <clr-dg-row-detail *clrIfExpanded>
255
-                            <button class="btn btn-icon btn-danger-outline" (click)="quit(line.uid)"><clr-icon shape="times"></clr-icon> Quit</button>
256
-                        </clr-dg-row-detail>
257
-                    </clr-dg-row>
258
-                    <clr-dg-footer>
259
-                        <clr-dg-pagination #pagination [clrDgPageSize]="10">
260
-                            <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
261
-                            {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
262
-                            of {{pagination.totalItems}} users
263
-                        </clr-dg-pagination>
264
-                    </clr-dg-footer>
265
-                </clr-datagrid>
266
-            </div>
267
-        </div>
268
-        <div class="card-footer">
269
-            <button *ngIf="!loading" class="btn btn-sm btn-link" (click)="load()">{{actionName}}</button>
270
-        </div>
271
-    </div>
272
-  `
273
-    })
274
-], ApiclientConsumptionComponent);
275
-
276
-let ApiclientSubscriptionComponent = class ApiclientSubscriptionComponent {
277
-    constructor() {
278
-        this.loading = false;
279
-        this.actionName = "load";
280
-        this.entries = [];
281
-        this.alerts = [];
282
-    }
283
-    ngOnInit() { }
284
-    load() {
285
-        return __awaiter(this, void 0, void 0, function* () {
286
-            this.loading = true;
287
-            this.entries = yield fb.ApiClient.getSubscriptions();
288
-            if (this.entries.length === 0) {
289
-                this.alerts.push({ severity: "warning", message: "0 results were returned" });
290
-            }
291
-            this.loading = false;
292
-            this.actionName = "refresh";
293
-        });
294
-    }
295
-    quit(uid) {
296
-        return __awaiter(this, void 0, void 0, function* () {
297
-            const r = yield fb.ApiClient.unsubscribe(uid);
298
-            const res = parseResponse(r);
299
-            if (res instanceof SuccessResponse) {
300
-                this.alerts.push({ severity: "success", message: "Stopped subscription " + uid });
301
-                this.load();
302
-            }
303
-            else {
304
-                this.alerts.push({ severity: "danger", message: "Error " + res.message });
305
-            }
306
-        });
307
-    }
308
-};
309
-ApiclientSubscriptionComponent = __decorate([
310
-    Component({
311
-        selector: 'subscriptions',
312
-        template: `
313
-    <div class="clr-row">
314
-        <div class="card clr-col-12 clr-col-sm-12 clr-col-md-12 clr-col-lg-12 clr-col-xl-12">
315
-            <div class="card-header">
316
-            Subscriptions
317
-            </div>
318
-            <clr-alert *ngFor="let entry of alerts" [clrAlertType]="entry.severity">
319
-                <clr-alert-item>
320
-                    <span class="alert-text">
321
-                        {{entry.message}}
322
-                    </span>
323
-                </clr-alert-item>
324
-            </clr-alert>
325
-        
326
-            <div *ngIf="loading" class="card-block">
327
-            <span class="spinner spinner-inline"></span>
328
-            </div>
329
-            <div *ngIf="entries.length !== 0 && !loading" class="card-block">
330
-                <div class="card-text">
331
-                    <clr-datagrid>
332
-                        <clr-dg-column>UUID</clr-dg-column>
333
-                    <!--
334
-                        <clr-dg-column>Currency</clr-dg-column>
335
-                        <clr-dg-column>Address</clr-dg-column>
336
-                        <clr-dg-column>Memo</clr-dg-column>
337
-                        <clr-dg-column>Expiry</clr-dg-column>
338
-                        <clr-dg-column>Creation</clr-dg-column>
339
-                    -->
340
-        
341
-                        <clr-dg-row *clrDgItems="let line of entries">
342
-                            <clr-dg-cell>{{line.uid}}</clr-dg-cell>
343
-                        <!-- 
344
-                            <clr-dg-cell>{{line.currency}}</clr-dg-cell> 
345
-                            <clr-dg-cell>{{line.address}}</clr-dg-cell> 
346
-                            <clr-dg-cell>{{line.memo}}</clr-dg-cell> 
347
-                            <clr-dg-cell>{{line.expiry | date}}</clr-dg-cell> 
348
-                            <clr-dg-cell>{{line.created | date}}</clr-dg-cell> 
349
-                        -->
350
-                            
351
-                            <clr-dg-row-detail *clrIfExpanded>
352
-                                <button class="btn btn-icon btn-danger-outline" (click)="quit(line.uid)"><clr-icon shape="times"></clr-icon> Unsubscribe</button>
353
-                            </clr-dg-row-detail>
354
-                        </clr-dg-row>
355
-                        <clr-dg-footer>
356
-                            <clr-dg-pagination #pagination [clrDgPageSize]="10">
357
-                                <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
358
-                                {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
359
-                                of {{pagination.totalItems}} users
360
-                            </clr-dg-pagination>
361
-                        </clr-dg-footer>
362
-                    </clr-datagrid>
363
-                </div>
364
-            </div>
365
-            <div class="card-footer">
366
-                <button *ngIf="!loading" class="btn btn-sm btn-link" (click)="load()">{{actionName}}</button>
367
-        
368
-            </div>
369
-        </div>
370
-    </div>
371
-`
372
-    })
373
-], ApiclientSubscriptionComponent);
374
-
375
-let PluginModule = exports('PluginModule', class PluginModule {
376
-    getSidebarEntry() {
377
-        return {
378
-            icon: "key",
379
-            parentRoute: "apiclient",
380
-            text: "Api client",
381
-            links: [{
382
-                    route: "settings",
383
-                    text: "Settings"
384
-                }, {
385
-                    route: "consumers",
386
-                    text: "Consumers"
387
-                }, {
388
-                    route: "subscriptions",
389
-                    text: "Subscriptions"
390
-                },]
391
-        };
392
-    }
393
-});
394
-PluginModule = exports('PluginModule', __decorate([
395
-    NgModule({
396
-        imports: [
397
-            FormsModule,
398
-            ClarityModule,
399
-            CommonModule,
400
-            RouterModule.forChild([
401
-                { path: "settings", component: ApiclientFormComponent },
402
-                { path: "subscriptions", component: ApiclientSubscriptionComponent },
403
-                { path: "consumers", component: ApiclientConsumptionComponent },
404
-            ]),
405
-        ],
406
-        exports: [RouterModule],
407
-        declarations: [
408
-            ApiclientFormComponent,
409
-            ApiclientConsumptionComponent,
410
-            ApiclientSubscriptionComponent
411
-        ]
412
-    })
413
-], PluginModule));
414
-
415
-}
416
-};
417
-});

+ 0
- 283
src/assets/pluginmanager.js Datei anzeigen

@@ -1,283 +0,0 @@
1
-System.register(['@angular/core', '@angular/common', '@angular/router', '@clr/angular', '@angular/forms'], function (exports, module) {
2
-'use strict';
3
-var Component, isDevMode, NgModule, CommonModule, RouterModule, ClarityModule, FormsModule;
4
-return {
5
-setters: [function (module) {
6
-Component = module.Component;
7
-isDevMode = module.isDevMode;
8
-NgModule = module.NgModule;
9
-}, function (module) {
10
-CommonModule = module.CommonModule;
11
-}, function (module) {
12
-RouterModule = module.RouterModule;
13
-}, function (module) {
14
-ClarityModule = module.ClarityModule;
15
-}, function (module) {
16
-FormsModule = module.FormsModule;
17
-}],
18
-execute: function () {
19
-
20
-/*! *****************************************************************************
21
-Copyright (c) Microsoft Corporation. All rights reserved.
22
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
23
-this file except in compliance with the License. You may obtain a copy of the
24
-License at http://www.apache.org/licenses/LICENSE-2.0
25
-
26
-THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
27
-KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
28
-WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
29
-MERCHANTABLITY OR NON-INFRINGEMENT.
30
-
31
-See the Apache Version 2.0 License for specific language governing permissions
32
-and limitations under the License.
33
-***************************************************************************** */
34
-/* global Reflect, Promise */
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-function __decorate(decorators, target, key, desc) {
43
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
44
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
45
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
46
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
47
-}
48
-
49
-
50
-
51
-
52
-
53
-function __awaiter(thisArg, _arguments, P, generator) {
54
-    return new (P || (P = Promise))(function (resolve, reject) {
55
-        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
56
-        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
57
-        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
58
-        step((generator = generator.apply(thisArg, _arguments || [])).next());
59
-    });
60
-}
61
-
62
-let PluginmanagerDEBUG = class PluginmanagerDEBUG {
63
-    constructor() { }
64
-    ngOnInit() { }
65
-};
66
-PluginmanagerDEBUG = __decorate([
67
-    Component({
68
-        selector: 'debug',
69
-        template: `
70
-  <div class="clr-row">
71
-    <div class="clr-col">
72
-        <div class="card">
73
-            <div class="card-header">
74
-                DEBUG
75
-            </div>
76
-            <div class="card-block">
77
-                <div class="card-title">
78
-                    SETUP
79
-                </div>
80
-                <div class="card-text">
81
-                  <p>
82
-                    Press this button to install all plugins.
83
-                    <br>
84
-                    Once the installation is done the page will refresh automatically
85
-                  </p>
86
-                </div>
87
-            </div>
88
-            <div class="card-footer">
89
-              <button class="btn btn-warning-outline" onclick="setup()">SETUP</button>
90
-            </div>
91
-        </div>
92
-    </div>
93
-  </div>
94
-  `
95
-    })
96
-], PluginmanagerDEBUG);
97
-
98
-let PluginsComponent = class PluginsComponent {
99
-    constructor() {
100
-        this.plugins = [{
101
-                name: "test",
102
-                available: "0.0.1",
103
-                installed: "0.0.1",
104
-                status: "Running"
105
-            }, {
106
-                name: "test II: Return of test",
107
-                available: "0.0.1",
108
-                installed: "0.0.1",
109
-                status: "Stopped"
110
-            }, {
111
-                name: "test 3",
112
-                available: "0.0.2",
113
-                installed: "",
114
-                status: "Available"
115
-            }, {
116
-                name: "test IV: minor bump",
117
-                available: "0.9.27",
118
-                installed: "0.0.11",
119
-                status: "Stopped"
120
-            },];
121
-        this.reloading = false;
122
-        this.updatepending = false;
123
-        this.updateCandidate = "";
124
-    }
125
-    start(name) {
126
-        this.plugins.find((el) => el.name === name).status = "Running";
127
-    }
128
-    stop(name) {
129
-        this.plugins.find((el) => el.name === name).status = "Stopped";
130
-    }
131
-    delete(name) {
132
-        let plugin = this.plugins.find((el) => el.name === name);
133
-        plugin.status = "Available";
134
-        plugin.installed = "";
135
-    }
136
-    showConfirmation(name) {
137
-        this.updateCandidate = name;
138
-        this.updatepending = !this.updatepending;
139
-    }
140
-    download(name) {
141
-        let plugin = this.plugins.find((el) => el.name === name);
142
-        plugin.status = "Stopped";
143
-        plugin.installed = plugin.available;
144
-        this.updatepending = !this.updatepending;
145
-    }
146
-    cancelModal() {
147
-        this.updateCandidate = "";
148
-        this.updatepending = !this.updatepending;
149
-    }
150
-    reload() {
151
-        return __awaiter(this, void 0, void 0, function* () {
152
-            this.reloading = true;
153
-            if (isDevMode()) {
154
-                yield new Promise((resolve, reject) => {
155
-                    setTimeout(resolve, 1000);
156
-                });
157
-                this.plugins = this.plugins.map(plugin => {
158
-                    const parts = plugin.available.split('.');
159
-                    plugin.available = parts[0] + "." + parts[1] + "." + (parseInt(parts[2]) + 1);
160
-                    return plugin;
161
-                });
162
-                this.reloading = false;
163
-            }
164
-        });
165
-    }
166
-    ngOnInit() { }
167
-};
168
-PluginsComponent = __decorate([
169
-    Component({
170
-        selector: 'plugins',
171
-        template: `
172
-  <clr-modal [(clrModalOpen)]="updatepending">
173
-    <h3 class="modal-title">Confirm installation</h3>
174
-    <div class="modal-body">
175
-        <p>{{updateCandidate}} But not much to say...</p>
176
-    </div>
177
-    <div class="modal-footer">
178
-        <button class="btn btn-icon btn-success" (click)="download(updateCandidate)"><clr-icon shape="check"></clr-icon></button>
179
-        <button class="btn btn-icon btn-danger" (click)="cancelModal()"><clr-icon shape="times"></clr-icon></button>
180
-    </div>
181
-  </clr-modal>
182
-
183
-  <div class="clr-row">
184
-    <div class="card clr-col-12 clr-col-sm-12 clr-col-md-12 clr-col-lg-12 clr-col-xl-12">
185
-        <div class="card-header">
186
-            Plugins
187
-        </div>
188
-        <clr-alert *ngFor="let entry of alerts" [clrAlertType]="line.severity">
189
-            <clr-alert-item>
190
-                <span class="alert-text">
191
-                    {{line.message}}
192
-                </span>
193
-            </clr-alert-item>
194
-        </clr-alert>
195
-    
196
-        <div *ngIf="loading" class="card-block">
197
-        <span class="spinner spinner-inline"></span>
198
-        </div>
199
-        <div *ngIf="plugins.length !== 0 && !loading" class="card-block">
200
-            <div class="card-text">
201
-                <clr-datagrid>
202
-                    <clr-dg-column>Name</clr-dg-column>
203
-                    <clr-dg-column>Available</clr-dg-column>
204
-                    <clr-dg-column>Installed</clr-dg-column>
205
-                    <clr-dg-column>Status</clr-dg-column>
206
-    
207
-                    <clr-dg-row *clrDgItems="let line of plugins">
208
-                        <clr-dg-cell>{{line.name}}</clr-dg-cell>
209
-                        <clr-dg-cell>
210
-                            <span *ngIf="line.installed != line.available" class="label info">{{line.available}}</span>
211
-                            <span *ngIf="line.installed == line.available">{{line.available}}</span>
212
-                        </clr-dg-cell>
213
-                        <clr-dg-cell>{{line.installed}}</clr-dg-cell>
214
-                        <clr-dg-cell>{{line.status}}</clr-dg-cell>
215
-                        
216
-                        <clr-dg-row-detail *clrIfExpanded>
217
-                            <button *ngIf="line.status === 'Stopped'" class="btn btn-icon btn-success-outline" (click)="start(line.name)"><clr-icon shape="play"></clr-icon></button>
218
-                            <button *ngIf="line.status === 'Running'" class="btn btn-icon btn-warning-outline" (click)="stop(line.name)"><clr-icon shape="pause"></clr-icon></button>
219
-                            <button *ngIf="line.status === 'Stopped'" class="btn btn-icon btn-danger-outline" (click)="delete(line.name)"><clr-icon shape="trash"></clr-icon></button>
220
-                            <button *ngIf="line.status === 'Available'" class="btn btn-icon btn-info-outline" (click)="showConfirmation(line.name)"><clr-icon shape="download"></clr-icon></button>
221
-                            <button *ngIf="line.available !== line.installed && line.status === 'Stopped'" class="btn btn-icon btn-outline " (click)="showConfirmation(line.name)">
222
-                                <clr-icon shape="sync"></clr-icon>
223
-                            </button>                        
224
-                        </clr-dg-row-detail>
225
-                    </clr-dg-row>
226
-                    <clr-dg-footer>
227
-                        <clr-dg-pagination #pagination [clrDgPageSize]="10">
228
-                            <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">per page</clr-dg-page-size>
229
-                            {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
230
-                            of {{pagination.totalItems}}
231
-                        </clr-dg-pagination>
232
-                    </clr-dg-footer>
233
-                </clr-datagrid>
234
-            </div>
235
-        </div>
236
-        <div class="card-footer">
237
-            <button *ngIf="!reloading" class="btn btn-sm btn-link" (click)="reload()">Check</button>
238
-    
239
-        </div>
240
-    </div>
241
-    </div>
242
-  `
243
-    })
244
-], PluginsComponent);
245
-
246
-let PluginModule = exports('PluginModule', class PluginModule {
247
-    getSidebarEntry() {
248
-        return {
249
-            icon: "plugin",
250
-            text: "Plugin manager",
251
-            parentRoute: "pluginmanager",
252
-            links: [{
253
-                    route: "debug",
254
-                    text: "DEBUG"
255
-                }, {
256
-                    route: "plugins",
257
-                    text: "Plugins"
258
-                }]
259
-        };
260
-    }
261
-});
262
-PluginModule = exports('PluginModule', __decorate([
263
-    NgModule({
264
-        imports: [
265
-            FormsModule,
266
-            ClarityModule,
267
-            CommonModule,
268
-            RouterModule.forChild([
269
-                { path: "debug", component: PluginmanagerDEBUG },
270
-                { path: "plugins", component: PluginsComponent }
271
-            ]),
272
-        ],
273
-        exports: [RouterModule],
274
-        declarations: [
275
-            PluginmanagerDEBUG,
276
-            PluginsComponent
277
-        ]
278
-    })
279
-], PluginModule));
280
-
281
-}
282
-};
283
-});

+ 0
- 1106
src/assets/wallet.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


Laden…
Abbrechen
Speichern