-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: add status component for each edge #1162
Conversation
fabianfnc
commented
Jun 10, 2020
Es gibt leider noch den Fall, dass eine Komponente einen Fehler anzeigt, die nicht im Anlagenprofil aufgelistet wird. Z. B. hier für fems1:
Hier kommt die INFO von Du wist wohl oder übel diese anderen Komponenten auch durchlaufen müssen und falls sie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte noch die kleinen Änderungen machen, dann kannst du es mergen. Danke!
ui/src/app/app.component.ts
Outdated
@@ -18,20 +19,21 @@ export class AppComponent { | |||
public env = environment; | |||
public backUrl: string | boolean = '/'; | |||
public enableSideMenu: boolean; | |||
public currentPage: 'Other' | 'IndexLive' | 'IndexHistory' = 'Other'; | |||
public currentPage: 'FemsSettings' | 'Other' | 'IndexLive' | 'IndexHistory' = 'Other'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Der OpenEMS-Quellcode sollte unabhängig von FEMS bleiben... bitte "EdgeSettings"
ui/src/app/app.component.ts
Outdated
// Enable Segment Navigation for Edge-Index-Page | ||
if ((file == 'history' || file == 'live') && urlArray.length == 3) { | ||
if (file == 'history') { | ||
this.currentPage = 'IndexHistory'; | ||
} else { | ||
this.currentPage = 'IndexLive'; | ||
} | ||
} else { | ||
} else if ((file == 'settings' && urlArray.length == 3) || (urlArray.length == 4 && (urlArray[urlArray.length - 1] == 'settings') | ||
|| (urlArray.length == 5 && urlArray[urlArray.length - 2] == 'settings'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warum so kompliziert?
(urlArray.length == 4 && (urlArray[urlArray.length - 1]
damit weißt du doch, dass urlArray.length - 1
= 3 ist.
Was machst du, wenn eine neue Ebene dazu kommt? Ich vermute, du solltest die Definition von file
ändern. Wenn du statt urlArray.pop();
urlArray[3]
nimmst (natürlich nach Prüfung, dass das Array wirklich so lange ist), dann bekommst du immer live
, history
oder settings
. Das reicht für die Prüfung.
/* | ||
* State | ||
*/ | ||
result.system.state = c['_sum/State']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alle anderen "result.system" properties setzt du unter "Total". Warum dann hierfür einen extra Punkt?
<ion-item lines="full"> | ||
<ion-icon color="primary" name="analytics-outline"></ion-icon> | ||
<ion-label class="ion-padding-start"> | ||
Gesamtstatus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Übersetzung
<ion-text color="primary"> | ||
<h3>{{ item.alias }} | ||
<span *ngIf="item.id != item.alias"> ({{ item.id }})</span> | ||
<small *ngIf="!item.isEnabled"> (Komponente ist inaktiv!)</small> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Übersetzung
</ng-container> | ||
</ion-label> | ||
<ion-icon style="cursor: pointer" | ||
*ngIf="currentData.channel[item.id+'/State'] != 0 && currentData.channel[item.id+'/State'] != null && !item['showProperties']" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Java würdest du hier currentData.channel[item.id+'/State'] != 0
eine NullPointerException bekommen, d.h. wenn dann müsste man diese beiden Anweisungen tauschen. Wenn das in Typescript geht, dann wäre vermutlich currentData.channel[item.id+'/State'] > 0
einfacher