Skip to content

Commit ea8aa65

Browse files
authored
Frontend - Added non-BP web node + Dashboard improvements and fixes #989
Frontend - Added non-BP web node + Dashboard improvements and fixes
2 parents f372b39 + ca74caa commit ea8aa65

19 files changed

+383
-52
lines changed

frontend/package-lock.json

Lines changed: 258 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.0.66",
3+
"version": "1.0.70",
44
"scripts": {
55
"install:deps": "npm install",
66
"start": "npm install && ng serve --configuration local --open",
@@ -77,6 +77,7 @@
7777
"browser-sync": "^3.0.0",
7878
"cypress": "^13.3.2",
7979
"cypress-real-events": "^1.10.0",
80+
"http-server": "^14.1.1",
8081
"jasmine-core": "~4.6.0",
8182
"karma": "~6.4.0",
8283
"karma-chrome-launcher": "~3.2.0",
@@ -88,4 +89,4 @@
8889
"webpack": "^5.88.2",
8990
"webpack-bundle-analyzer": "^4.9.0"
9091
}
91-
}
92+
}

frontend/src/app/core/services/web-node.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class WebNodeService {
3131

3232
memory: WebAssembly.MemoryDescriptor;
3333
privateStake: PrivateStake;
34+
noBlockProduction: boolean = false;
3435

3536
constructor(private http: HttpClient) {
3637
FileProgressHelper.initDownloadProgress();
@@ -119,7 +120,10 @@ export class WebNodeService {
119120
}
120121
})();
121122
console.log('webnode config:', !!this.webNodeKeyPair.privateKey, this.webNodeNetwork, urls);
122-
const privateKey = this.privateStake ? [this.privateStake.stake, this.privateStake.password] : this.webNodeKeyPair.privateKey;
123+
let privateKey = this.privateStake ? [this.privateStake.stake, this.privateStake.password] : this.webNodeKeyPair.privateKey;
124+
if (this.noBlockProduction) {
125+
privateKey = null;
126+
}
123127

124128
return from(wasm.run(privateKey, urls.seeds, urls.genesisConfig));
125129
}),

frontend/src/app/features/dashboard/dashboard-blocks-sync/dashboard-blocks-sync.component.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
<div class="flex-column w-100 border-rad-6" [ngClass]="appliedPercentage === 100 ? 'bg-surface' : 'border'">
1+
<div class="flex-column w-100 border-rad-6 background-gradient" [ngClass]="appliedPercentage === 100 ? 'complete' : 'border'">
22
<div class="h-xl lh-xl fx-row-vert-cent flex-between f-600 pl-12 pr-12 border-bottom">
33
<div class="fx-row-vert-cent">
44
@if (appliedPercentage === 100) {
55
<span class="mina-icon f-20 success-primary">check_circle</span>
66
} @else {
77
<mina-loading-spinner></mina-loading-spinner>
88
}
9-
<div class="ml-8" [class.success-primary]="appliedPercentage === 100">Last 290 blocks</div>
9+
<div class="ml-8" [class.success-primary]="appliedPercentage === 100">
10+
@if (lengthWithoutRoot) {
11+
{{ appliedPercentage < 100 ? 'Syncing Last' : 'Last' }} {{ lengthWithoutRoot }} blocks
12+
} @else {
13+
Waiting to sync ledgers
14+
}
15+
</div>
1016
</div>
1117
<div class="f-400 tertiary">{{ remaining ? 'ETA ~' + remaining + 's' : syncProgress }}</div>
1218
</div>

0 commit comments

Comments
 (0)