Browse Source

feat: the Home Dashboards card on the recent dashboards widget's APIs: Last viewed lists the recently viewed dashboards first and then the rest, newest first, under the count of all dashboards; Starred with its star picker that suggests recent dashboards and searches all of them; star and unstar in the rows, Show more, View all and Add dashboard; empty states for a tenant and a customer user. The Home lists share their toggle, footer, row rule and short times (the Alarms card uses them too). A user keeps up to 50 visited and 50 starred dashboards (was 10)

pull/16848/head
Igor Kulikov 2 weeks ago
parent
commit
262de60668
  1. 5
      application/src/main/java/org/thingsboard/server/service/entitiy/user/DefaultTbUserSettingsService.java
  2. 6
      ui-ngx/src/app/modules/home/pages/home-links/home-links.module.ts
  3. 24
      ui-ngx/src/app/modules/home/pages/home-links/home/components/alarms-home.component.html
  4. 97
      ui-ngx/src/app/modules/home/pages/home-links/home/components/alarms-home.component.scss
  5. 54
      ui-ngx/src/app/modules/home/pages/home-links/home/components/alarms-home.component.ts
  6. 109
      ui-ngx/src/app/modules/home/pages/home-links/home/components/dashboards-home.component.html
  7. 439
      ui-ngx/src/app/modules/home/pages/home-links/home/components/dashboards-home.component.scss
  8. 273
      ui-ngx/src/app/modules/home/pages/home-links/home/components/dashboards-home.component.ts
  9. 66
      ui-ngx/src/app/modules/home/pages/home-links/home/components/home-list-footer.component.scss
  10. 54
      ui-ngx/src/app/modules/home/pages/home-links/home/components/home-list-footer.component.ts
  11. 44
      ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toggle.component.scss
  12. 33
      ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toggle.component.ts
  13. 2
      ui-ngx/src/app/modules/home/pages/home-links/home/home-cards.models.ts
  14. 37
      ui-ngx/src/app/modules/home/pages/home-links/home/home-list.models.ts
  15. 43
      ui-ngx/src/assets/locale/locale.constant-en_US.json

5
application/src/main/java/org/thingsboard/server/service/entitiy/user/DefaultTbUserSettingsService.java

@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
package org.thingsboard.server.service.entitiy.user;
import com.fasterxml.jackson.databind.JsonNode;
@ -39,7 +40,7 @@ import java.util.stream.Collectors;
@Slf4j
public class DefaultTbUserSettingsService implements TbUserSettingsService {
private static final int MAX_DASHBOARD_INFO_LIST_SIZE = 10;
private static final int MAX_DASHBOARD_INFO_LIST_SIZE = 50;
private static final Predicate<HasTitle> EMPTY_TITLE = i -> StringUtils.isEmpty(i.getTitle());
private final UserSettingsService settingsService;

6
ui-ngx/src/app/modules/home/pages/home-links/home-links.module.ts

@ -31,6 +31,8 @@ import { MobileAppHomeComponent } from '@home/pages/home-links/home/components/m
import { HomeCardsFooterComponent } from '@home/pages/home-links/home/components/home-cards-footer.component';
import { CustomizeHomeDialogComponent } from '@home/pages/home-links/home/components/customize-home-dialog.component';
import { HomeHscrollComponent } from '@home/pages/home-links/home/components/home-hscroll.component';
import { HomeToggleComponent } from '@home/pages/home-links/home/components/home-toggle.component';
import { HomeListFooterComponent } from '@home/pages/home-links/home/components/home-list-footer.component';
import { AiModule } from '@home/components/ai/ai.module';
@NgModule({
@ -58,7 +60,9 @@ import { AiModule } from '@home/components/ai/ai.module';
MobileAppHomeComponent,
HomeCardsFooterComponent,
CustomizeHomeDialogComponent,
HomeHscrollComponent
HomeHscrollComponent,
HomeToggleComponent,
HomeListFooterComponent
],
imports: [
CommonModule,

24
ui-ngx/src/app/modules/home/pages/home-links/home/components/alarms-home.component.html

@ -7,10 +7,7 @@
<tb-home-card [card]="card" [count]="total()">
<ng-container homeCardActions>
@if (total()) {
<div class="tb-toggle-header" role="group" [attr.aria-label]="'home.alarms.whose' | translate">
<button type="button" class="tb-toggle-option" [attr.aria-pressed]="!mine()" (click)="setMine(false)">{{ 'home.alarms.all' | translate }}</button>
<button type="button" class="tb-toggle-option" [attr.aria-pressed]="mine()" (click)="setMine(true)">{{ 'home.alarms.mine' | translate }}</button>
</div>
<tb-home-toggle [options]="whoseOptions" [value]="mine()" [label]="'home.alarms.whose' | translate" (valueChange)="setMine($event)"></tb-home-toggle>
}
@if (tenantAdmin) {
<button mat-button color="primary" type="button" class="tb-alarms-add" (click)="addAlarmRule()">
@ -132,23 +129,8 @@
} @else if (alarmsLoaded()) {
<div class="tb-alarms-empty-note">{{ emptyNote().key | translate: emptyNote().params }}</div>
}
@if (!few() || listed()) {
<div class="tb-alarms-footer">
@if (!few()) {
<button mat-button type="button" class="tb-alarms-toggle" (click)="toggleExpanded()">
<mat-icon>{{ expanded() ? 'expand_less' : 'expand_more' }}</mat-icon>
{{ toggleLabel() | translate }}
</button>
}
<span class="tb-alarms-spacer"></span>
@if (shown() < listed()) {
<span class="tb-alarms-footer-count">{{ 'home.alarms.shown-of' | translate: {shown: shown(), total: (listed() | shortNumber)} }}</span>
}
@if (listed()) {
<a class="tb-alarms-view-all" routerLink="/alarms/alarms" [queryParams]="viewAllParams()">{{ 'home.alarms.view-all' | translate }}<mat-icon>chevron_right</mat-icon></a>
}
</div>
}
<tb-home-list-footer [total]="listed()" [expanded]="expanded()" link="/alarms/alarms" [params]="viewAllParams()"
(expandedChange)="expanded.set($event)"></tb-home-list-footer>
}
</tb-home-card>

97
ui-ngx/src/app/modules/home/pages/home-links/home/components/alarms-home.component.scss

@ -6,44 +6,6 @@
container: tb-alarms-home / inline-size;
}
.tb-toggle-header {
display: inline-flex;
box-sizing: border-box;
height: 32px;
max-width: 100%;
padding: 2px;
border-radius: 100px;
background: rgba(0, 0, 0, 0.06);
}
.tb-toggle-option {
flex: 1 1 auto;
height: 28px;
margin: 0;
padding: 0 12px;
border: 1px solid transparent;
border-radius: 20px;
background: none;
font: 400 14px/26px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.2px;
white-space: nowrap;
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
cursor: pointer;
&[aria-pressed="true"] {
background: #fff;
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), 0 1px 4px rgba(16, 24, 40, 0.06);
font-weight: 500;
line-height: 24px;
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: -2px;
}
}
.tb-alarms-add.mat-mdc-button {
.mat-icon {
margin-right: 6px;
@ -79,7 +41,7 @@
}
}
.tb-alarms-clear-link, .tb-alarms-link, .tb-alarms-view-all {
.tb-alarms-clear-link, .tb-alarms-link {
&, &:hover, &:focus, &:active {
border-bottom: none;
}
@ -473,63 +435,6 @@
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
.tb-alarms-footer {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
min-height: 36px;
padding-top: 8px;
border-top: 1px solid rgba(0, 0, 0, 0.05);
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
.tb-alarms-toggle.mat-mdc-button {
margin-left: -8px;
color: var(--tb-ink-76, rgba(0, 0, 0, 0.76));
}
}
.tb-alarms-spacer {
flex: 1 1 auto;
}
.tb-alarms-footer-count {
font-variant-numeric: tabular-nums;
}
.tb-alarms-view-all {
display: inline-flex;
align-items: center;
height: 36px;
margin-right: -8px;
padding: 0 4px 0 8px;
border-radius: 4px;
font-weight: 500;
font-size: 14px;
letter-spacing: 0.03125em;
white-space: nowrap;
text-decoration: none;
color: var(--tb-ink-76, rgba(0, 0, 0, 0.76));
transition: background-color .15s ease;
.mat-icon {
width: 18px;
height: 18px;
font-size: 18px;
}
&:hover {
background: rgba(0, 0, 0, 0.04);
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: -2px;
}
}
@container tb-alarms-home (max-width: 599px) {
.tb-alarms-table {
.col-origin {

54
ui-ngx/src/app/modules/home/pages/home-links/home/components/alarms-home.component.ts

@ -32,10 +32,9 @@ import { HomeCardId } from '@shared/models/user-settings.models';
import { getEntityDetailsPageURL } from '@core/utils';
import { HOME_CARDS } from '@home/pages/home-links/home/home-cards.models';
import { AlarmDetailsDialogComponent, AlarmDetailsDialogData } from '@home/components/alarm/alarm-details-dialog.component';
import { homeAgo, homeListPageSize, homeListShown } from '@home/pages/home-links/home/home-list.models';
import { HomeToggleOption } from '@home/pages/home-links/home/components/home-toggle.component';
const PREVIEW = 5;
const SLACK = 2;
const ROW_LIMIT = 10;
const MINUTE = 60000;
const MINE_KEY = 'tb-home-alarms-mine';
const SEVERITIES = [AlarmSeverity.CRITICAL, AlarmSeverity.MAJOR, AlarmSeverity.MINOR, AlarmSeverity.WARNING];
@ -89,6 +88,11 @@ export class AlarmsHomeComponent {
readonly card = HOME_CARDS[HomeCardId.ALARMS];
readonly whoseOptions: HomeToggleOption<boolean>[] = [
{value: false, label: 'home.alarms.all'},
{value: true, label: 'home.alarms.mine'}
];
private telemetryWsService = inject(TelemetryWebsocketService);
private zone = inject(NgZone);
private store = inject(Store<AppState>);
@ -131,26 +135,9 @@ export class AlarmsHomeComponent {
}).filter(tile => tile.severity === AlarmSeverity.CRITICAL || tile.count > 0 || tile.pressed);
});
readonly few = computed(() => this.listed() <= PREVIEW + SLACK);
readonly shown = computed(() => {
const listed = this.listed();
if (this.few()) {
return listed;
}
return this.expanded() ? Math.min(listed, ROW_LIMIT) : PREVIEW;
});
readonly toggleLabel = computed(() => {
if (this.expanded()) {
return 'home.alarms.show-less';
}
return this.listed() <= ROW_LIMIT ? 'home.alarms.show-all' : 'home.alarms.show-more';
});
readonly rows = computed<AlarmHomeRow[]>(() => {
const now = this.now();
return (this.alarms() ?? []).slice(0, this.shown()).map(alarm => this.toRow(alarm, now));
return (this.alarms() ?? []).slice(0, homeListShown(this.listed(), this.expanded())).map(alarm => this.toRow(alarm, now));
});
readonly emptyNote = computed<{key: string; params: Record<string, string>}>(() => {
@ -179,7 +166,7 @@ export class AlarmsHomeComponent {
const desc = this.sortDesc();
return {
page: 0,
pageSize: this.expanded() ? ROW_LIMIT : PREVIEW + SLACK,
pageSize: homeListPageSize(this.expanded()),
sortOrder: {
key: {type: EntityKeyType.ALARM_FIELD, key},
direction: key === 'severity' ? (desc ? Direction.ASC : Direction.DESC) : (desc ? Direction.DESC : Direction.ASC)
@ -242,10 +229,6 @@ export class AlarmsHomeComponent {
return this.sortDesc() ? 'descending' : 'ascending';
}
toggleExpanded(): void {
this.expanded.set(!this.expanded());
}
addAlarmRule(): void {
this.router.navigate(['/alarms/alarm-rules'], {queryParams: {action: 'add'}});
}
@ -400,28 +383,11 @@ export class AlarmsHomeComponent {
const originator = alarm.originator;
return {
alarm,
ago: this.ago(now - (alarm.createdTime ?? now)),
ago: homeAgo(this.translate, now - (alarm.createdTime ?? now)),
originatorLink: originator ? getEntityDetailsPageURL(originator.id, originator.entityType as EntityType) : null,
assigneeName,
initials,
mine: !!alarm.assigneeId && alarm.assigneeId.id === this.userId
};
}
private ago(ms: number): string {
const min = ms / MINUTE;
if (min < 1) {
return this.translate.instant('home.alarms.ago.now');
}
if (min < 60) {
return this.translate.instant('home.alarms.ago.min', {count: Math.round(min)});
}
if (min < 24 * 60) {
return this.translate.instant('home.alarms.ago.hour', {count: Math.floor(min / 60)});
}
if (min < 7 * 24 * 60) {
return this.translate.instant('home.alarms.ago.day', {count: Math.floor(min / (24 * 60))});
}
return this.translate.instant('home.alarms.ago.week', {count: Math.floor(min / (7 * 24 * 60))});
}
}

109
ui-ngx/src/app/modules/home/pages/home-links/home/components/dashboards-home.component.html

@ -0,0 +1,109 @@
<!--
SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
SPDX-License-Identifier: BUSL-1.1
-->
<tb-home-card [card]="card" [count]="total()">
<ng-container homeCardActions>
@if (total()) {
<tb-home-toggle [options]="tabOptions" [value]="tab()" [label]="'home.dashboards.view' | translate" (valueChange)="setTab($event)"></tb-home-toggle>
}
@if (canAdd) {
<a mat-button color="primary" class="tb-dashboards-add" routerLink="/dashboards/all" [queryParams]="{action: 'add'}">
<mat-icon>add</mat-icon>
<span class="tb-dashboards-add-label">{{ 'home.dashboards.add' | translate }}</span>
</a>
}
</ng-container>
@if (loaded()) {
@if (!total()) {
<div class="tb-dashboards-empty">
<span class="tb-dashboards-empty-glyph" aria-hidden="true"><mat-icon>{{ tenantAdmin ? 'dashboard_customize' : 'dashboard' }}</mat-icon></span>
@if (tenantAdmin) {
<div class="tb-dashboards-empty-text">
<p>{{ 'home.dashboards.none' | translate }}</p>
<div class="tb-dashboards-empty-actions">
<a routerLink="/iot-hub/solution-templates">{{ 'home.dashboards.from-template' | translate }}</a>
<a [href]="howToLink" target="_blank" rel="noopener">{{ 'home.dashboards.how-to' | translate }}<mat-icon class="tb-dashboards-ext" aria-hidden="true">north_east</mat-icon><span class="tb-dashboards-sr">{{ 'home.dashboards.opens-new-tab' | translate }}</span></a>
</div>
</div>
} @else {
<div class="tb-dashboards-empty-title">{{ 'home.dashboards.none-assigned' | translate }}</div>
}
</div>
} @else {
@if (rows().length) {
<table class="tb-dashboards-table">
<thead>
<tr>
<th class="col-star"></th>
<th class="col-title">{{ 'home.dashboards.name' | translate }}</th>
<th class="col-time">{{ 'home.dashboards.last-viewed' | translate }}</th>
</tr>
</thead>
<tbody>
@for (row of rows(); track row.id) {
<tr (click)="open(row)">
<td class="col-star">
<button type="button" class="tb-dashboards-star" [class.starred]="row.starred"
[matTooltip]="(row.starred ? 'home.dashboards.unstar-tip' : 'home.dashboards.star-tip') | translate"
[attr.aria-label]="(row.starred ? 'home.dashboards.unstar' : 'home.dashboards.star') | translate: {title: row.title}"
(click)="toggleStar(row, $event)">
<mat-icon>{{ row.starred ? 'star' : 'star_border' }}</mat-icon>
</button>
</td>
<td class="col-title"><a [routerLink]="row.url" (click)="$event.stopPropagation()">{{ row.title | customTranslate }}</a></td>
<td class="col-time">{{ row.ago }}</td>
</tr>
}
</tbody>
</table>
} @else {
<div class="tb-dashboards-empty-note">{{ (tab() === 'last' ? 'home.dashboards.none-viewed' : 'home.dashboards.none-starred') | translate }}</div>
}
@if (tab() === 'starred') {
<div class="tb-dashboards-picker">
@if (picking()) {
<label class="tb-dashboards-search">
<mat-icon aria-hidden="true">search</mat-icon>
<input #searchInput type="text" autocomplete="off" spellcheck="false" role="combobox" aria-expanded="true"
aria-controls="tb-dashboards-star-options" aria-autocomplete="list"
[attr.aria-activedescendant]="candidates().length ? 'tb-dashboards-star-option-' + active() : null"
[placeholder]="'home.dashboards.search-to-star' | translate" [attr.aria-label]="'home.dashboards.search-to-star' | translate"
[value]="query()" (input)="onQuery($any($event.target).value)" (keydown)="onPickerKeydown($event)" (blur)="onPickerBlur()">
<button mat-icon-button type="button" class="tb-dashboards-search-close" [attr.aria-label]="'action.close' | translate"
(mousedown)="$event.preventDefault()" (click)="closePicker()">
<mat-icon>close</mat-icon>
</button>
</label>
<div class="tb-dashboards-options" id="tb-dashboards-star-options" role="listbox">
@for (candidate of candidates(); track candidate.id; let i = $index) {
<div class="tb-dashboards-option" role="option" [id]="'tb-dashboards-star-option-' + i" [class.active]="i === active()"
[attr.aria-selected]="i === active()" tabindex="-1" (mousedown)="$event.preventDefault()" (mousemove)="active.set(i)"
(click)="pick(candidate)" (keydown.enter)="pick(candidate)">
<mat-icon>star_border</mat-icon>
<span class="tb-dashboards-option-label">{{ candidate.title | customTranslate }}</span>
@if (candidate.ago) {
<small>{{ candidate.ago }}</small>
}
</div>
} @empty {
@if (query().trim()) {
<div class="tb-dashboards-options-empty">{{ 'home.dashboards.no-match' | translate: {query: query().trim()} }}</div>
}
}
</div>
} @else {
<button type="button" class="tb-dashboards-picker-add" [disabled]="allStarred()" (click)="openPicker()">
<mat-icon>{{ allStarred() ? 'star' : 'star_border' }}</mat-icon>
{{ (allStarred() ? 'home.dashboards.all-starred' : 'home.dashboards.star-a-dashboard') | translate }}
</button>
}
</div>
}
<tb-home-list-footer [total]="listed()" [expanded]="expanded()" [link]="dashboardsLink"
(expandedChange)="expanded.set($event)"></tb-home-list-footer>
}
}
</tb-home-card>

439
ui-ngx/src/app/modules/home/pages/home-links/home/components/dashboards-home.component.scss

@ -0,0 +1,439 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
:host {
display: block;
min-width: 0;
container: tb-dashboards-home / inline-size;
}
.tb-dashboards-add.mat-mdc-button {
&, &:hover, &:focus, &:active {
border-bottom: none;
}
.mat-icon {
margin-right: 6px;
}
}
.tb-dashboards-table {
width: 100%;
border-collapse: collapse;
table-layout: auto;
th {
height: 28px;
padding: 0 12px 0 0;
font: 400 12px/16px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.25px;
text-align: left;
white-space: nowrap;
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
}
td {
height: 36px;
padding: 0 12px 0 0;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.2px;
vertical-align: middle;
font-variant-numeric: tabular-nums;
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
}
tbody tr {
cursor: pointer;
&:hover td {
background: rgba(0, 0, 0, 0.02);
}
&:hover .col-title a {
text-decoration: underline;
}
}
.col-star {
width: 40px;
min-width: 40px;
}
td.col-title {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
a {
&, &:hover, &:focus, &:active {
border-bottom: none;
}
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
.col-time {
width: 96px;
text-align: right;
white-space: nowrap;
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
}
.tb-dashboards-star {
position: relative;
display: inline-flex;
margin: 0;
padding: 0;
border: 0;
background: none;
vertical-align: middle;
color: var(--tb-ink-12, rgba(0, 0, 0, 0.12));
cursor: pointer;
&::after {
content: '';
position: absolute;
inset: -4px;
border-radius: 50%;
}
&:hover {
color: rgba(0, 0, 0, 0.18);
}
&.starred {
color: var(--tb-primary-500);
&:hover {
color: var(--tb-primary-700);
}
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: 2px;
border-radius: 50%;
}
.mat-icon {
color: inherit;
}
}
.tb-dashboards-empty-note {
padding: 4px 0;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.2px;
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
.tb-dashboards-picker {
position: relative;
}
.tb-dashboards-picker-add {
display: flex;
align-items: center;
gap: 8px;
box-sizing: border-box;
width: 100%;
height: 40px;
margin: 0;
padding: 0 12px;
border: 1px dashed rgba(0, 0, 0, 0.2);
border-radius: 8px;
background: none;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.2px;
text-align: left;
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
cursor: pointer;
transition: border-color .15s ease, color .15s ease, background-color .15s ease;
.mat-icon {
width: 18px;
height: 18px;
font-size: 18px;
color: inherit;
}
&:hover {
border-color: var(--tb-primary-500);
background: color-mix(in srgb, var(--tb-primary-500) 4%, #fff);
color: var(--tb-primary-500);
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: 2px;
}
&:disabled {
border-style: solid;
border-color: rgba(0, 0, 0, 0.06);
background: none;
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
cursor: default;
}
}
.tb-dashboards-search {
display: flex;
align-items: center;
gap: 8px;
box-sizing: border-box;
height: 40px;
padding: 0 4px 0 12px;
border-radius: 8px;
background: rgba(0, 0, 0, 0.04);
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
cursor: text;
&:focus-within {
background: #fff;
box-shadow: 0 0 0 2px var(--tb-primary-500), 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 4px rgba(16, 24, 40, 0.04);
color: var(--tb-primary-500);
}
> .mat-icon {
flex: none;
width: 20px;
height: 20px;
font-size: 20px;
color: inherit;
}
input {
flex: 1;
min-width: 0;
border: 0;
outline: 0;
background: transparent;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
caret-color: var(--tb-primary-500);
&::placeholder {
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
}
}
}
.tb-dashboards-search-close.mat-mdc-icon-button {
--mdc-icon-button-state-layer-size: 32px;
--mat-icon-button-state-layer-size: 32px;
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
padding: 0;
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
.mat-icon {
width: 20px;
height: 20px;
font-size: 20px;
}
.mat-mdc-button-touch-target {
width: 32px;
height: 32px;
}
}
.tb-dashboards-options {
position: absolute;
top: calc(100% + 4px);
left: 0;
right: 0;
z-index: 5;
display: flex;
flex-direction: column;
max-height: 248px;
overflow-y: auto;
padding: 4px;
border-radius: 8px;
background: #fff;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
&:empty {
display: none;
}
}
.tb-dashboards-option {
display: flex;
align-items: center;
gap: 10px;
min-height: 40px;
padding: 0 10px;
border-radius: 6px;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
cursor: pointer;
.mat-icon {
flex: none;
width: 18px;
height: 18px;
font-size: 18px;
color: var(--tb-ink-38, rgba(0, 0, 0, 0.38));
}
small {
font-size: 12px;
white-space: nowrap;
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
}
&.active {
background: rgba(0, 0, 0, 0.04);
.mat-icon {
color: var(--tb-primary-500);
}
}
}
.tb-dashboards-option-label {
flex: 1;
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tb-dashboards-options-empty {
padding: 10px;
font-size: 13px;
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
.tb-dashboards-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
padding: 8px 16px 12px;
text-align: center;
}
.tb-dashboards-empty-glyph {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border-radius: 50%;
background: color-mix(in srgb, var(--tb-primary-500) 10%, transparent);
color: var(--tb-primary-500);
.mat-icon {
width: 20px;
height: 20px;
font-size: 20px;
color: inherit;
}
}
.tb-dashboards-empty-text {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
p {
max-width: 36em;
margin: 0;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.2px;
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
}
.tb-dashboards-empty-title {
font: 500 14px/20px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.25px;
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
.tb-dashboards-empty-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 4px 16px;
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
a {
&, &:hover, &:focus, &:active {
border-bottom: none;
}
border-radius: 4px;
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 3px;
text-decoration-color: transparent;
color: var(--tb-primary-500);
transition: text-decoration-color .15s ease;
&:hover {
text-decoration-color: currentColor;
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: 2px;
}
}
}
.tb-dashboards-ext {
width: 14px;
height: 14px;
margin-left: 2px;
font-size: 14px;
line-height: 14px;
vertical-align: -2px;
opacity: .7;
}
.tb-dashboards-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
@container tb-dashboards-home (max-width: 459px) {
.tb-dashboards-add.mat-mdc-button {
min-width: 40px;
padding: 0 8px;
.mat-icon {
margin: 0;
}
}
.tb-dashboards-add-label {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
}

273
ui-ngx/src/app/modules/home/pages/home-links/home/components/dashboards-home.component.ts

@ -1,16 +1,283 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { HomeCardId } from '@shared/models/user-settings.models';
import { ChangeDetectionStrategy, Component, computed, DestroyRef, ElementRef, inject, signal, viewChild } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core';
import { of, Subject } from 'rxjs';
import { catchError, debounceTime, map, switchMap } from 'rxjs/operators';
import { AppState } from '@core/core.state';
import { getCurrentAuthState, getCurrentAuthUser } from '@core/auth/auth.selectors';
import { UserSettingsService } from '@core/http/user-settings.service';
import { DashboardService } from '@core/http/dashboard.service';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { ToastNotificationService } from '@core/services/toast-notification.service';
import { Authority } from '@shared/models/authority.enum';
import { EntityType } from '@shared/models/entity-type.models';
import { Operation, Resource } from '@shared/models/security.models';
import { HelpLinks } from '@shared/models/constants';
import { PageLink } from '@shared/models/page/page-link';
import { Direction } from '@shared/models/page/sort-order';
import { HomeCardId, UserDashboardAction, UserDashboardsInfo } from '@shared/models/user-settings.models';
import { HOME_CARDS } from '@home/pages/home-links/home/home-cards.models';
import { homeAgo, homeListShown } from '@home/pages/home-links/home/home-list.models';
import { HomeToggleOption } from '@home/pages/home-links/home/components/home-toggle.component';
type DashboardsTab = 'last' | 'starred';
const MINUTE = 60000;
const SEARCH_SIZE = 10;
const FILL_SIZE = 20;
export interface DashboardHomeRow {
id: string;
title: string;
starred: boolean;
lastVisited: number | null;
ago: string;
url: string;
}
interface StarCandidate {
id: string;
title: string;
ago: string | null;
}
@Component({
selector: 'tb-dashboards-home',
template: `<tb-home-card [card]="card"></tb-home-card>`,
templateUrl: './dashboards-home.component.html',
styleUrls: ['./dashboards-home.component.scss'],
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DashboardsHomeComponent {
readonly card = HOME_CARDS[HomeCardId.DASHBOARDS];
readonly tabOptions: HomeToggleOption<DashboardsTab>[] = [
{value: 'last', label: 'home.dashboards.last-viewed'},
{value: 'starred', label: 'home.dashboards.starred'}
];
readonly howToLink = HelpLinks.linksMap.dashboards;
private store = inject(Store<AppState>);
private router = inject(Router);
private translate = inject(TranslateService);
private userSettingsService = inject(UserSettingsService);
private dashboardService = inject(DashboardService);
private userPermissions = inject(UserPermissionsService);
private toast = inject(ToastNotificationService);
private readonly authUser = getCurrentAuthUser(this.store);
private readonly fullscreen = getCurrentAuthState(this.store).forceFullscreen;
readonly tenantAdmin = this.authUser?.authority === Authority.TENANT_ADMIN;
readonly canAdd = this.tenantAdmin && this.userPermissions.hasGenericPermission(Resource.DASHBOARD, Operation.CREATE);
readonly dashboardsLink = this.userPermissions.hasReadGenericPermission(Resource.DASHBOARD) ? '/dashboards/all'
: this.userPermissions.hasSharedReadGroupsPermission(EntityType.DASHBOARD) ? '/dashboards/shared' : null;
readonly tab = signal<DashboardsTab>('last');
readonly expanded = signal(false);
readonly total = signal<number | null>(null);
private readonly info = signal<UserDashboardsInfo | null>(null);
private readonly others = signal<{id: string; title: string}[]>([]);
private readonly now = signal(Date.now());
readonly picking = signal(false);
readonly query = signal('');
readonly active = signal(0);
private readonly searchResults = signal<StarCandidate[]>([]);
private readonly search$ = new Subject<string>();
private readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput');
readonly loaded = computed(() => this.total() !== null && this.info() !== null);
private readonly starredIds = computed(() => new Set((this.info()?.starred ?? []).map(dashboard => dashboard.id)));
private readonly visits = computed(() => new Map((this.info()?.last ?? []).map(dashboard => [dashboard.id, dashboard.lastVisited])));
private readonly allRows = computed<DashboardHomeRow[]>(() => {
const info = this.info();
if (!info) {
return [];
}
const now = this.now();
const starred = this.starredIds();
const visits = this.visits();
if (this.tab() === 'last') {
const viewed = [...info.last]
.sort((a, b) => b.lastVisited - a.lastVisited)
.map(dashboard => this.toRow(dashboard.id, dashboard.title, starred.has(dashboard.id), dashboard.lastVisited, now));
const rest = this.others()
.filter(dashboard => !visits.has(dashboard.id))
.map(dashboard => this.toRow(dashboard.id, dashboard.title, starred.has(dashboard.id), null, now));
return [...viewed, ...rest];
}
return [...info.starred]
.sort((a, b) => (visits.get(b.id) ?? 0) - (visits.get(a.id) ?? 0) || b.starredAt - a.starredAt)
.map(dashboard => this.toRow(dashboard.id, dashboard.title, true, visits.get(dashboard.id) ?? null, now));
});
readonly listed = computed(() => this.tab() === 'last' ? Math.max(this.total() ?? 0, this.allRows().length) : this.allRows().length);
readonly rows = computed(() => this.allRows().slice(0, homeListShown(this.listed(), this.expanded())));
readonly allStarred = computed(() => {
const total = this.total();
return total !== null && total > 0 && this.starredIds().size >= total;
});
readonly candidates = computed<StarCandidate[]>(() => {
const starred = this.starredIds();
if (this.query().trim()) {
return this.searchResults().filter(candidate => !starred.has(candidate.id));
}
const now = this.now();
return [...(this.info()?.last ?? [])]
.filter(dashboard => !starred.has(dashboard.id))
.sort((a, b) => b.lastVisited - a.lastVisited)
.slice(0, SEARCH_SIZE)
.map(dashboard => ({id: dashboard.id, title: dashboard.title, ago: homeAgo(this.translate, now - dashboard.lastVisited)}));
});
constructor() {
if (this.dashboardsLink && this.authUser?.authority !== Authority.SYS_ADMIN) {
this.userSettingsService.getUserDashboardsInfo({ignoreLoading: true}).subscribe(info => {
this.info.set({last: info?.last ?? [], starred: info?.starred ?? []});
});
this.dashboardService.getUserDashboards(this.authUser.userId, null,
new PageLink(FILL_SIZE, 0, null, {property: 'createdTime', direction: Direction.DESC}), {ignoreLoading: true}).pipe(
catchError(() => of(null))
).subscribe(page => {
this.others.set((page?.data ?? []).map(dashboard => ({id: dashboard.id.id, title: dashboard.title})));
this.total.set(page?.totalElements ?? 0);
});
} else {
this.info.set({last: [], starred: []});
this.total.set(0);
}
this.search$.pipe(
debounceTime(200),
switchMap(query => query
? this.dashboardService.getUserDashboards(this.authUser.userId, null,
new PageLink(SEARCH_SIZE + this.starredIds().size, 0, query, {property: 'title', direction: Direction.ASC}), {ignoreLoading: true}).pipe(
map(page => page.data.map(dashboard => {
const visited = this.visits().get(dashboard.id.id);
return {id: dashboard.id.id, title: dashboard.title, ago: visited ? homeAgo(this.translate, Date.now() - visited) : null};
})),
catchError(() => of([]))
)
: of([])),
takeUntilDestroyed()
).subscribe(results => {
this.searchResults.set(results);
this.active.set(0);
});
const tick = setInterval(() => this.now.set(Date.now()), MINUTE);
inject(DestroyRef).onDestroy(() => clearInterval(tick));
}
setTab(tab: DashboardsTab): void {
this.tab.set(tab);
this.closePicker();
}
open(row: DashboardHomeRow): void {
this.router.navigateByUrl(row.url);
}
toggleStar(row: DashboardHomeRow, $event: Event): void {
$event.stopPropagation();
const info = this.info();
if (!info) {
return;
}
if (row.starred) {
this.info.set({...info, starred: info.starred.filter(dashboard => dashboard.id !== row.id)});
this.userSettingsService.reportUserDashboardAction(row.id, UserDashboardAction.UNSTAR, {ignoreLoading: true}).subscribe();
} else {
this.star(row.id, row.title);
}
}
openPicker(): void {
this.query.set('');
this.searchResults.set([]);
this.active.set(0);
this.picking.set(true);
setTimeout(() => this.searchInput()?.nativeElement.focus());
}
closePicker(): void {
this.picking.set(false);
}
onQuery(value: string): void {
this.query.set(value);
this.active.set(0);
this.search$.next(value.trim());
}
onPickerKeydown(event: KeyboardEvent): void {
const count = this.candidates().length;
if (event.key === 'ArrowDown' && count) {
event.preventDefault();
this.active.set((this.active() + 1) % count);
} else if (event.key === 'ArrowUp' && count) {
event.preventDefault();
this.active.set((this.active() - 1 + count) % count);
} else if (event.key === 'Enter') {
event.preventDefault();
const candidate = this.candidates()[this.active()];
if (candidate) {
this.pick(candidate);
}
} else if (event.key === 'Escape') {
event.preventDefault();
this.closePicker();
}
}
onPickerBlur(): void {
if (document.hasFocus()) {
this.closePicker();
}
}
pick(candidate: StarCandidate): void {
this.closePicker();
this.star(candidate.id, candidate.title);
this.toast.dispatchNotification({
message: this.translate.instant('home.dashboards.starred-toast', {title: candidate.title}),
type: 'info',
duration: 4000,
horizontalPosition: 'right',
verticalPosition: 'bottom',
panelClass: 'tb-home-toast'
});
}
private star(id: string, title: string): void {
const info = this.info();
if (!info || this.starredIds().has(id)) {
return;
}
this.info.set({...info, starred: [...info.starred, {id, title, starred: true, starredAt: Date.now()}]});
this.userSettingsService.reportUserDashboardAction(id, UserDashboardAction.STAR, {ignoreLoading: true}).subscribe();
}
private toRow(id: string, title: string, starred: boolean, lastVisited: number | null, now: number): DashboardHomeRow {
return {
id,
title,
starred,
lastVisited,
ago: lastVisited ? homeAgo(this.translate, now - lastVisited) : '',
url: (this.fullscreen ? '/dashboard/' : '/dashboards/all/') + id
};
}
}

66
ui-ngx/src/app/modules/home/pages/home-links/home/components/home-list-footer.component.scss

@ -0,0 +1,66 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
:host {
display: block;
}
.tb-home-list-footer {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
min-height: 36px;
padding-top: 8px;
border-top: 1px solid rgba(0, 0, 0, 0.05);
font: 400 14px/20px var(--tb-font, Roboto, sans-serif);
color: var(--tb-text-secondary, rgba(0, 0, 0, 0.6));
}
.tb-home-list-toggle.mat-mdc-button {
margin-left: -8px;
color: var(--tb-ink-76, rgba(0, 0, 0, 0.76));
}
.tb-home-list-spacer {
flex: 1 1 auto;
}
.tb-home-list-count {
font-variant-numeric: tabular-nums;
}
.tb-home-list-view-all {
&, &:hover, &:focus, &:active {
border-bottom: none;
}
display: inline-flex;
align-items: center;
height: 36px;
margin-right: -8px;
padding: 0 4px 0 8px;
border-radius: 4px;
font-weight: 500;
font-size: 14px;
letter-spacing: 0.03125em;
white-space: nowrap;
text-decoration: none;
color: var(--tb-ink-76, rgba(0, 0, 0, 0.76));
transition: background-color .15s ease;
.mat-icon {
width: 18px;
height: 18px;
font-size: 18px;
}
&:hover {
background: rgba(0, 0, 0, 0.04);
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: -2px;
}
}

54
ui-ngx/src/app/modules/home/pages/home-links/home/components/home-list-footer.component.ts

@ -0,0 +1,54 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
import { Params } from '@angular/router';
import { HOME_LIST_LIMIT, homeListFew, homeListShown } from '@home/pages/home-links/home/home-list.models';
@Component({
selector: 'tb-home-list-footer',
template: `
@if (!few() || (total() && link())) {
<div class="tb-home-list-footer">
@if (!few()) {
<button mat-button type="button" class="tb-home-list-toggle" (click)="expandedChange.emit(!expanded())">
<mat-icon>{{ expanded() ? 'expand_less' : 'expand_more' }}</mat-icon>
{{ toggleLabel() | translate }}
</button>
}
<span class="tb-home-list-spacer"></span>
@if (shown() < total()) {
<span class="tb-home-list-count">{{ 'home.list.shown-of' | translate: {shown: shown(), total: (total() | shortNumber)} }}</span>
}
@if (total() && link()) {
<a class="tb-home-list-view-all" [routerLink]="link()" [queryParams]="params()">{{ 'home.list.view-all' | translate }}<mat-icon>chevron_right</mat-icon></a>
}
</div>
}
`,
styleUrls: ['./home-list-footer.component.scss'],
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HomeListFooterComponent {
total = input(0);
expanded = input(false);
link = input<string | null>(null);
params = input<Params | null>(null);
expandedChange = output<boolean>();
readonly few = computed(() => homeListFew(this.total()));
readonly shown = computed(() => homeListShown(this.total(), this.expanded()));
readonly toggleLabel = computed(() => {
if (this.expanded()) {
return 'home.list.show-less';
}
return this.total() <= HOME_LIST_LIMIT ? 'home.list.show-all' : 'home.list.show-more';
});
}

44
ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toggle.component.scss

@ -0,0 +1,44 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
:host {
display: inline-flex;
max-width: 100%;
}
.tb-home-toggle {
display: inline-flex;
box-sizing: border-box;
height: 32px;
max-width: 100%;
padding: 2px;
border-radius: 100px;
background: rgba(0, 0, 0, 0.06);
}
.tb-home-toggle-option {
flex: 1 1 auto;
height: 28px;
margin: 0;
padding: 0 12px;
border: 1px solid transparent;
border-radius: 20px;
background: none;
font: 400 14px/26px var(--tb-font, Roboto, sans-serif);
letter-spacing: 0.2px;
white-space: nowrap;
color: var(--tb-text-muted, rgba(0, 0, 0, 0.56));
cursor: pointer;
&[aria-pressed="true"] {
background: #fff;
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), 0 1px 4px rgba(16, 24, 40, 0.06);
font-weight: 500;
line-height: 24px;
color: var(--tb-ink, rgba(0, 0, 0, 0.87));
}
&:focus-visible {
outline: 2px solid var(--tb-primary-500);
outline-offset: -2px;
}
}

33
ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toggle.component.ts

@ -0,0 +1,33 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
export interface HomeToggleOption<T> {
value: T;
label: string;
}
@Component({
selector: 'tb-home-toggle',
template: `
<div class="tb-home-toggle" role="group" [attr.aria-label]="label()">
@for (option of options(); track option.value) {
<button type="button" class="tb-home-toggle-option" [attr.aria-pressed]="option.value === value()"
(click)="option.value !== value() && valueChange.emit(option.value)">{{ option.label | translate }}</button>
}
</div>
`,
styleUrls: ['./home-toggle.component.scss'],
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HomeToggleComponent<T = string> {
options = input.required<HomeToggleOption<T>[]>();
value = input.required<T>();
label = input<string>();
valueChange = output<T>();
}

2
ui-ngx/src/app/modules/home/pages/home-links/home/home-cards.models.ts

@ -13,7 +13,7 @@ export interface HomeCardDefinition {
export const HOME_CARDS: Record<HomeCardId, HomeCardDefinition> = {
[HomeCardId.IOT_HUB]: {id: HomeCardId.IOT_HUB, icon: 'hub', name: 'home.cards.iot-hub', link: '/iot-hub', height: 500},
[HomeCardId.ALARMS]: {id: HomeCardId.ALARMS, icon: 'warning', name: 'home.cards.alarms', link: '/alarms'},
[HomeCardId.DASHBOARDS]: {id: HomeCardId.DASHBOARDS, icon: 'dashboard', name: 'home.cards.dashboards', link: '/dashboards', height: 357},
[HomeCardId.DASHBOARDS]: {id: HomeCardId.DASHBOARDS, icon: 'dashboard', name: 'home.cards.dashboards', link: '/dashboards'},
[HomeCardId.DEVICES]: {id: HomeCardId.DEVICES, icon: 'memory', name: 'home.cards.devices', link: '/entities/devices', height: 430},
[HomeCardId.ACTIVITY]: {id: HomeCardId.ACTIVITY, icon: 'show_chart', name: 'home.cards.activity', height: 250},
[HomeCardId.GET_STARTED]: {id: HomeCardId.GET_STARTED, icon: 'rocket_launch', name: 'home.cards.get-started', height: 405},

37
ui-ngx/src/app/modules/home/pages/home-links/home/home-list.models.ts

@ -0,0 +1,37 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import { TranslateService } from '@ngx-translate/core';
export const HOME_LIST_PREVIEW = 5;
export const HOME_LIST_SLACK = 2;
export const HOME_LIST_LIMIT = 10;
const MINUTE = 60000;
export const homeListPageSize = (expanded: boolean): number => expanded ? HOME_LIST_LIMIT : HOME_LIST_PREVIEW + HOME_LIST_SLACK;
export const homeListFew = (total: number): boolean => total <= HOME_LIST_PREVIEW + HOME_LIST_SLACK;
export const homeListShown = (total: number, expanded: boolean): number => {
if (homeListFew(total)) {
return total;
}
return expanded ? Math.min(total, HOME_LIST_LIMIT) : HOME_LIST_PREVIEW;
};
export const homeAgo = (translate: TranslateService, ms: number): string => {
const min = ms / MINUTE;
if (min < 1) {
return translate.instant('home.ago.now');
}
if (min < 60) {
return translate.instant('home.ago.min', {count: Math.round(min)});
}
if (min < 24 * 60) {
return translate.instant('home.ago.hour', {count: Math.floor(min / 60)});
}
if (min < 7 * 24 * 60) {
return translate.instant('home.ago.day', {count: Math.floor(min / (24 * 60))});
}
return translate.instant('home.ago.week', {count: Math.floor(min / (7 * 24 * 60))});
};

43
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -8603,19 +8603,44 @@
"none-active": "No active alarms.",
"none-mine": "No alarms assigned to you.",
"none-severity": "No {{severity}} alarms.",
"none-severity-mine": "No {{severity}} alarms assigned to you.",
"none-severity-mine": "No {{severity}} alarms assigned to you."
},
"dashboards": {
"view": "Dashboards view",
"last-viewed": "Last viewed",
"starred": "Starred",
"add": "Add dashboard",
"name": "Name",
"star": "Star {{title}}",
"unstar": "Unstar {{title}}",
"star-tip": "Star",
"unstar-tip": "Unstar",
"none": "No dashboards yet. Add a dashboard to open it from here.",
"none-assigned": "No dashboards assigned to you yet",
"from-template": "Start from a template",
"how-to": "How to build dashboards",
"none-viewed": "No dashboards viewed yet.",
"none-starred": "No starred dashboards yet.",
"star-a-dashboard": "Star a dashboard",
"all-starred": "Every dashboard is starred",
"search-to-star": "Search dashboards to star",
"no-match": "No dashboards match “{{query}}”.",
"starred-toast": "“{{title}}” starred",
"opens-new-tab": "(opens in a new tab)"
},
"list": {
"show-more": "Show more",
"show-all": "Show all",
"show-less": "Show less",
"shown-of": "{{shown}} of {{total}}",
"view-all": "View all",
"ago": {
"now": "now",
"min": "{{count}} min ago",
"hour": "{{count}}h ago",
"day": "{{count}}d ago",
"week": "{{count}}w ago"
}
"view-all": "View all"
},
"ago": {
"now": "now",
"min": "{{count}} min ago",
"hour": "{{count}}h ago",
"day": "{{count}}d ago",
"week": "{{count}}w ago"
},
"ai": {
"placeholder": "Ask the AI Assistant…",

Loading…
Cancel
Save