Skip to content

Commit

Permalink
change formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Feb 25, 2024
1 parent f740b42 commit cecc5fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
10 changes: 0 additions & 10 deletions analytics-ui/src/status/engine-status.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ <h3>Safe Mode</h3>
</div>
<div class="inner-scroll">
<div class="card-block separator">
<!-- <pre class="m-t-16 inner-scroll small">{{cepCtrlStatus | json}}</pre> -->
<!-- <c8y-properties-list
[title]="'Application properties'"
[data]="archiveManifest"
[emptyLabel]="'--'"
[properties]="packageVersionProperties"
>
</c8y-properties-list> -->
<c8y-properties-list *ngIf="(cepCtrlStatusLabels$ | async).length > 0"
[title]="'CEP Engine Status'"
[emptyLabel]="'--'"
Expand All @@ -69,6 +61,4 @@ <h3>Safe Mode</h3>
</c8y-properties-list>
</div>
</div>

<!-- <div class="card-footer separator"></div> -->
</div>
28 changes: 16 additions & 12 deletions analytics-ui/src/status/engine-status.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BsModalRef } from "ngx-bootstrap/modal";
import { AnalyticsService } from "../shared";
import { HumanizePipe, PropertiesListItem, gettext } from "@c8y/ngx-components";
import { IManifest } from "@c8y/client";
import { BehaviorSubject, Subject } from 'rxjs';
import { BehaviorSubject, Subject } from "rxjs";

@Component({
selector: "engine-status",
Expand All @@ -12,9 +12,9 @@ import { BehaviorSubject, Subject } from 'rxjs';
})
export class EngineStatusComponent implements OnInit {
cepId: string;
cepCtrlStatus$: Subject<any> = new Subject<any> ();
cepCtrlStatusLabels$: BehaviorSubject<PropertiesListItem[]> = new BehaviorSubject<PropertiesListItem[]> ([]);

cepCtrlStatus$: Subject<any> = new Subject<any>();
cepCtrlStatusLabels$: BehaviorSubject<PropertiesListItem[]> =
new BehaviorSubject<PropertiesListItem[]>([]);

constructor(
private analyticsService: AnalyticsService,
Expand All @@ -28,17 +28,21 @@ export class EngineStatusComponent implements OnInit {
this.cepId = await this.analyticsService.getCEP_Id();
const cepCtrlStatus = await this.analyticsService.getCEP_Status();
const cepCtrlStatusLabels = [];
Object.keys(cepCtrlStatus).forEach (key => {
cepCtrlStatusLabels.push ( {
label: humanize.transform(key),
type: 'string',
value: cepCtrlStatus[key]
})
Object.keys(cepCtrlStatus).forEach((key) => {
if (
["number_extensions", "is_safe_mode", "microservice_name"].includes(key)
) {
cepCtrlStatusLabels.push({
label: humanize.transform(key),
type: "string",
value: cepCtrlStatus[key],
});
}
});
this.cepCtrlStatusLabels$.next(cepCtrlStatusLabels);

console.log("Labels:", cepCtrlStatusLabels);
console.log("Objects:", cepCtrlStatus);
// console.log("Labels:", cepCtrlStatusLabels);
// console.log("Objects:", cepCtrlStatus);
}

private async init() {
Expand Down

0 comments on commit cecc5fc

Please sign in to comment.