+
diff --git a/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.scss b/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.scss
index bd979f9..eb6ce56 100644
--- a/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.scss
+++ b/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.scss
@@ -1,8 +1,9 @@
:host {
display: block;
+ width: calc(var(--group-holder-width, 100) * 1%);
- &:not(:first-of-type) {
- margin-top: 0.5rem;
+ &:not(:last-of-type) {
+ margin-bottom: 0.5rem;
}
}
@@ -14,9 +15,14 @@
width: 100%;
display: block;
margin-bottom: 0.5rem;
+ height: 1.3rem;
&:empty {
- display: none;
+ opacity: 0;
}
}
+.inner-padding {
+ margin: 5px;
+}
+
diff --git a/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.ts b/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.ts
index 61e437e..f703d80 100644
--- a/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.ts
+++ b/apps/senstate-dashboard/src/app/components/shared/group-holder/group-holder.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
+import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core';
@Component({
selector: 'senstate-group-holder',
@@ -8,6 +8,9 @@ import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
})
export class GroupHolderComponent implements OnInit {
+ @Input()
+ public showGroupName = false;
+
constructor() { }
ngOnInit() {
diff --git a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.html b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.html
index 90667c4..829fec6 100644
--- a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.html
+++ b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.html
@@ -1,23 +1,50 @@
-
-
+
+
No watchers yet :)
-
-
- {{group.key}} - Watchers: {{group.watchers.length}}
-
-
-
- {{ tag.tag }}:
- {{tag.watchId}}
-
-
-
-
+ 1 ? groupedColumnWidth : 100 }">
+
+
+
+
+ {{group.key}} - Watchers: {{group.watchers.length}}
+
+
+ 1 ? watcherColumnWidth : 100 }">
+
+ {{ tag.tag }}:
+ {{tag.watchId}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Columns
+ 3 Columns
+ 4 Columns
+
+
+
+
+
+ 2 Columns
+ 3 Columns
+ 4 Columns
+
+
diff --git a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.scss b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.scss
index eb9a5d7..82b415a 100644
--- a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.scss
+++ b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.scss
@@ -1,6 +1,3 @@
-.watcher-entry {
- margin-left: 0.5rem;
-}
code {
background: #444;
@@ -8,4 +5,31 @@ code {
padding: 6px;
margin-bottom: 0.5rem;
display: inline-block;
+ margin-left: -0.4rem;
+}
+
+.groups {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+}
+
+.divider {
+
+}
+
+.watcher-holder {
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+}
+
+.watcher-entry {
+ padding-left: 0.5rem;
+ margin-bottom: 0.5rem;
+ width: calc((var(--watcher-holder-width, 50) * 1%) - 8px);
+
+ &:not(:last-of-type) {
+ margin-bottom: 0.5rem;
+ }
}
diff --git a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.ts b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.ts
index 853745f..4c89386 100644
--- a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.ts
+++ b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.component.ts
@@ -1,8 +1,9 @@
-import {Component, OnInit, ChangeDetectionStrategy, Input, TrackByFunction} from '@angular/core';
+import {ChangeDetectionStrategy, Component, Input, OnInit, TrackByFunction} from '@angular/core';
import {Observable} from "rxjs";
import {WatcherMeta} from "@senstate/client";
import {GroupedWatchers, HubService} from "../../../state/hub.service";
import {DebugToggleService} from "../../../services/debug-toggle.service";
+import {map} from "rxjs/operators";
@Component({
selector: 'senstate-watchers-list',
@@ -12,10 +13,16 @@ import {DebugToggleService} from "../../../services/debug-toggle.service";
})
export class WatchersListComponent implements OnInit {
+ @Input()
+ public groupedColumnWidth: number = 50;
+
+ @Input()
+ public watcherColumnWidth: number = 50;
+
@Input()
public appId: string;
- public watchers$: Observable;
+ public groupedWatchers$: Observable;
public trackByWatcherFunc: TrackByFunction = (index, item) => {
return item.watchId;
@@ -29,6 +36,21 @@ export class WatchersListComponent implements OnInit {
public debugToggle: DebugToggleService) { }
ngOnInit() {
- this.watchers$ = this.hub.getGroupedWatchersByApp$(this.appId);
+ this.groupedWatchers$ = this.hub.getGroupedWatchersByApp$(this.appId).pipe(
+ map(groupedWatchers => {
+ const hasGroupName = groupedWatchers.some(group => this.hasName(group));
+
+ groupedWatchers.forEach(group => {
+ group.haveGroups = hasGroupName;
+ group.hasName = this.hasName(group);
+ });
+
+ return groupedWatchers;
+ })
+ );
+ }
+
+ private hasName(group: GroupedWatchers) {
+ return group.key && group.key !== 'undefined';
}
}
diff --git a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.module.ts b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.module.ts
index 5c370b1..577023e 100644
--- a/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.module.ts
+++ b/apps/senstate-dashboard/src/app/components/tab-content/watchers-list/watchers-list.module.ts
@@ -1,9 +1,12 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {WatchersListComponent} from "./watchers-list.component";
-import { ListJsonValueComponent } from './list-json-value/list-json-value.component';
+import {ListJsonValueComponent} from './list-json-value/list-json-value.component';
import {JsonViewerModule} from "../../json-viewer/json-viewer.module";
import {SharedModule} from "../../shared/shared.module";
+import {DynamicPortalModule} from "@gewd/ng-utils/dynamic-portal";
+import {MatSelectModule} from "@angular/material/select";
+import {CssPropsModule} from "../../../directives/css-props/css-props.module";
@NgModule({
@@ -18,6 +21,9 @@ import {SharedModule} from "../../shared/shared.module";
CommonModule,
JsonViewerModule,
SharedModule,
+ DynamicPortalModule,
+ MatSelectModule,
+ CssPropsModule,
]
})
export class WatchersListModule {
diff --git a/apps/senstate-dashboard/src/app/components/tab-content/watchers-masonry/watcher-card/watcher-card.component.html b/apps/senstate-dashboard/src/app/components/tab-content/watchers-masonry/watcher-card/watcher-card.component.html
index 91f47ce..c50248e 100644
--- a/apps/senstate-dashboard/src/app/components/tab-content/watchers-masonry/watcher-card/watcher-card.component.html
+++ b/apps/senstate-dashboard/src/app/components/tab-content/watchers-masonry/watcher-card/watcher-card.component.html
@@ -14,11 +14,11 @@
+