Skip to content

Commit

Permalink
fix for #268
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Oct 1, 2024
1 parent d62e807 commit a57d695
Showing 1 changed file with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,33 @@ import { CellRendererContext } from '@c8y/ngx-components';

@Component({
selector: 'd11r-mapping-renderer-qos',
template: `<div class="c8y-realtime p-l-8">
<span
class="c8y-pulse animated pulse animation-slow"
[ngClass]="{
active: (context.item?.status$ | async) === 'CONNECTED',
inactive: (context.item?.status$ | async) !== 'CONNECTED'
}"
></span
// template: `<div class="c8y-realtime p-l-8">
// <span
// class="c8y-pulse animated pulse animation-slow"
// [ngClass]="{
// active: (context.item?.status$ | async) === 'CONNECTED',
// inactive: (context.item?.status$ | async) !== 'CONNECTED'
// }"
// ></span
// >{{ context.item?.status$ | async }}
// </div>`

template: `<span
[class]="
'text-10 tag ' +
((context.item?.status$ | async) === 'CONNECTED'
? 'tag--success'
: (context.item?.status$ | async) === 'FAILED'
? 'tag--danger'
: 'tag--default')
"
>{{ context.item?.status$ | async }}
</div>`
</span> `
})
export class ConnectorStatusRendererComponent {
constructor(public context: CellRendererContext) {
// console.log(`Connector: ${context.item.name}`, context.item);
// const status$ = context.item?.status$;
// status$.subscribe( n => console.log(`Connector new status: ${n}`));
// console.log( `Connector: ${context.item.name}`, context.item?.status$ | async);
// const status$ = context.item?.status$;
// status$.subscribe( n => console.log(`Connector new status: ${n}`));
}
}
}

0 comments on commit a57d695

Please sign in to comment.