diff --git a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.html b/ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.html
similarity index 87%
rename from ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.html
rename to ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.html
index 1064e2c35f..58cbc142ca 100644
--- a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.html
+++ b/ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.html
@@ -15,4 +15,4 @@
limitations under the License.
-->
-
+
diff --git a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.scss b/ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.scss
rename to ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.scss
diff --git a/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.ts
similarity index 80%
rename from ui-ngx/src/app/modules/home/pages/gateways/gateways.component.ts
rename to ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.ts
index 9e8d6e4c7c..4dd68aadc0 100644
--- a/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.ts
+++ b/ui-ngx/src/app/modules/home/components/dashboard-view/dashboard-view.component.ts
@@ -22,13 +22,13 @@ import { Dashboard } from '@shared/models/dashboard.models';
import { ActivatedRoute } from '@angular/router';
@Component({
- selector: 'tb-gateways',
- templateUrl: './gateways.component.html',
- styleUrls: ['./gateways.component.scss']
+ selector: 'tb-dashboard-view',
+ templateUrl: './dashboard-view.component.html',
+ styleUrls: ['./dashboard-view.component.scss']
})
-export class GatewaysComponent extends PageComponent {
+export class DashboardViewComponent extends PageComponent {
- gatewaysDashboard: Dashboard = this.route.snapshot.data.gatewaysDashboard;
+ dashboard: Dashboard = this.route.snapshot.data.dashboard;
constructor(protected store: Store,
private route: ActivatedRoute) {
diff --git a/ui-ngx/src/app/modules/home/components/home-components.module.ts b/ui-ngx/src/app/modules/home/components/home-components.module.ts
index a562002ac1..32e509e842 100644
--- a/ui-ngx/src/app/modules/home/components/home-components.module.ts
+++ b/ui-ngx/src/app/modules/home/components/home-components.module.ts
@@ -182,6 +182,7 @@ import {
SelectDashboardBreakpointComponent
} from '@home/components/dashboard-page/layout/select-dashboard-breakpoint.component';
import { EntityChipsComponent } from '@home/components/entity/entity-chips.component';
+import { DashboardViewComponent } from '@home/components/dashboard-view/dashboard-view.component';
@NgModule({
declarations:
@@ -324,7 +325,8 @@ import { EntityChipsComponent } from '@home/components/entity/entity-chips.compo
RateLimitsTextComponent,
RateLimitsDetailsDialogComponent,
SendNotificationButtonComponent,
- EntityChipsComponent
+ EntityChipsComponent,
+ DashboardViewComponent
],
imports: [
CommonModule,
@@ -460,7 +462,8 @@ import { EntityChipsComponent } from '@home/components/entity/entity-chips.compo
RateLimitsTextComponent,
RateLimitsDetailsDialogComponent,
SendNotificationButtonComponent,
- EntityChipsComponent
+ EntityChipsComponent,
+ DashboardViewComponent
],
providers: [
WidgetComponentService,
diff --git a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage-routing.module.ts b/ui-ngx/src/app/modules/home/pages/api-usage/api-usage-routing.module.ts
index f76ceb86bc..43b46575dd 100644
--- a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage-routing.module.ts
+++ b/ui-ngx/src/app/modules/home/pages/api-usage/api-usage-routing.module.ts
@@ -17,11 +17,11 @@
import { inject, NgModule } from '@angular/core';
import { ActivatedRouteSnapshot, ResolveFn, RouterModule, RouterStateSnapshot, Routes } from '@angular/router';
import { Authority } from '@shared/models/authority.enum';
-import { ApiUsageComponent } from '@home/pages/api-usage/api-usage.component';
import { Dashboard } from '@shared/models/dashboard.models';
import { ResourcesService } from '@core/services/resources.service';
import { Observable } from 'rxjs';
import { MenuId } from '@core/services/menu.models';
+import { DashboardViewComponent } from '@home/components/dashboard-view/dashboard-view.component';
const apiUsageDashboardJson = '/assets/dashboard/api_usage.json';
@@ -34,7 +34,7 @@ export const apiUsageDashboardResolver: ResolveFn = (
const routes: Routes = [
{
path: 'usage',
- component: ApiUsageComponent,
+ component: DashboardViewComponent,
data: {
auth: [Authority.TENANT_ADMIN],
title: 'api-usage.api-usage',
@@ -43,7 +43,7 @@ const routes: Routes = [
}
},
resolve: {
- apiUsageDashboard: apiUsageDashboardResolver
+ dashboard: apiUsageDashboardResolver
}
}
];
diff --git a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.ts b/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.ts
deleted file mode 100644
index a313a98b85..0000000000
--- a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.component.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-///
-/// Copyright © 2016-2024 The Thingsboard Authors
-///
-/// Licensed under the Apache License, Version 2.0 (the "License");
-/// you may not use this file except in compliance with the License.
-/// You may obtain a copy of the License at
-///
-/// http://www.apache.org/licenses/LICENSE-2.0
-///
-/// Unless required by applicable law or agreed to in writing, software
-/// distributed under the License is distributed on an "AS IS" BASIS,
-/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and
-/// limitations under the License.
-///
-
-import { Component } from '@angular/core';
-import { Store } from '@ngrx/store';
-import { AppState } from '@core/core.state';
-import { PageComponent } from '@shared/components/page.component';
-import { Dashboard } from '@shared/models/dashboard.models';
-import { ActivatedRoute } from '@angular/router';
-
-@Component({
- selector: 'tb-api-usage',
- templateUrl: './api-usage.component.html',
- styleUrls: ['./api-usage.component.scss']
-})
-export class ApiUsageComponent extends PageComponent {
-
- apiUsageDashboard: Dashboard = this.route.snapshot.data.apiUsageDashboard;
-
- constructor(protected store: Store,
- private route: ActivatedRoute) {
- super(store);
- }
-}
diff --git a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.module.ts b/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.module.ts
index 11666f28ad..0bd4e35ea8 100644
--- a/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.module.ts
+++ b/ui-ngx/src/app/modules/home/pages/api-usage/api-usage.module.ts
@@ -18,14 +18,9 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@app/shared/shared.module';
import { HomeComponentsModule } from '@modules/home/components/home-components.module';
-import { ApiUsageComponent } from '@home/pages/api-usage/api-usage.component';
import { ApiUsageRoutingModule } from '@home/pages/api-usage/api-usage-routing.module';
@NgModule({
- declarations:
- [
- ApiUsageComponent
- ],
imports: [
CommonModule,
SharedModule,
diff --git a/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts b/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts
index 01b4370e55..4f1a5d0d2b 100644
--- a/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts
+++ b/ui-ngx/src/app/modules/home/pages/device/device-routing.module.ts
@@ -24,8 +24,6 @@ import { EntityDetailsPageComponent } from '@home/components/entity/entity-detai
import { ConfirmOnExitGuard } from '@core/guards/confirm-on-exit.guard';
import { entityDetailsPageBreadcrumbLabelFunction } from '@home/pages/home-pages.models';
import { BreadCrumbConfig } from '@shared/components/breadcrumb';
-import { assetRoutes } from '@home/pages/asset/asset-routing.module';
-import { entityViewRoutes } from '@home/pages/entity-view/entity-view-routing.module';
import { MenuId } from '@core/services/menu.models';
export const deviceRoutes: Routes = [
diff --git a/ui-ngx/src/app/modules/home/pages/entities/entities-routing.module.ts b/ui-ngx/src/app/modules/home/pages/entities/entities-routing.module.ts
index 6589af9f10..77e711c504 100644
--- a/ui-ngx/src/app/modules/home/pages/entities/entities-routing.module.ts
+++ b/ui-ngx/src/app/modules/home/pages/entities/entities-routing.module.ts
@@ -20,6 +20,7 @@ import { NgModule } from '@angular/core';
import { deviceRoutes } from '@home/pages/device/device-routing.module';
import { assetRoutes } from '@home/pages/asset/asset-routing.module';
import { entityViewRoutes } from '@home/pages/entity-view/entity-view-routing.module';
+import { gatewaysRoutes } from '@home/pages/gateways/gateways-routing.module';
const routes: Routes = [
{
@@ -41,7 +42,8 @@ const routes: Routes = [
},
...deviceRoutes,
...assetRoutes,
- ...entityViewRoutes
+ ...entityViewRoutes,
+ ...gatewaysRoutes
]
}
];
diff --git a/ui-ngx/src/app/modules/home/pages/gateways/gateways-routing.module.ts b/ui-ngx/src/app/modules/home/pages/gateways/gateways-routing.module.ts
index 3c823ce66d..f2c3c951cd 100644
--- a/ui-ngx/src/app/modules/home/pages/gateways/gateways-routing.module.ts
+++ b/ui-ngx/src/app/modules/home/pages/gateways/gateways-routing.module.ts
@@ -21,7 +21,7 @@ import { Dashboard } from '@shared/models/dashboard.models';
import { ResourcesService } from '@core/services/resources.service';
import { Observable } from 'rxjs';
import { MenuId } from '@core/services/menu.models';
-import { GatewaysComponent } from '@home/pages/gateways/gateways.component';
+import { DashboardViewComponent } from '@home/components/dashboard-view/dashboard-view.component';
const gatewaysDashboardJson = '/api/resource/dashboard/system/gateways_dashboard.json';
@@ -31,10 +31,10 @@ export const gatewaysDashboardResolver: ResolveFn = (
resourcesService = inject(ResourcesService)
): Observable => resourcesService.loadJsonResource(gatewaysDashboardJson);
-const routes: Routes = [
+export const gatewaysRoutes: Routes = [
{
path: 'entities/gateways',
- component: GatewaysComponent,
+ component: DashboardViewComponent,
data: {
auth: [Authority.TENANT_ADMIN],
title: 'gateway.gateways',
@@ -49,7 +49,7 @@ const routes: Routes = [
];
@NgModule({
- imports: [RouterModule.forChild(routes)],
+ imports: [RouterModule.forChild(gatewaysRoutes)],
exports: [RouterModule]
})
export class GatewaysRoutingModule { }
diff --git a/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.html b/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.html
deleted file mode 100644
index 13e0375c02..0000000000
--- a/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
diff --git a/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.scss b/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.scss
deleted file mode 100644
index 96eb1b3ac5..0000000000
--- a/ui-ngx/src/app/modules/home/pages/gateways/gateways.component.scss
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright © 2016-2024 The Thingsboard Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-:host {
- width: 100%;
- height: 100%;
-}
diff --git a/ui-ngx/src/app/modules/home/pages/gateways/gateways.module.ts b/ui-ngx/src/app/modules/home/pages/gateways/gateways.module.ts
index 4d452b9641..6dd8688338 100644
--- a/ui-ngx/src/app/modules/home/pages/gateways/gateways.module.ts
+++ b/ui-ngx/src/app/modules/home/pages/gateways/gateways.module.ts
@@ -18,14 +18,9 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@app/shared/shared.module';
import { HomeComponentsModule } from '@modules/home/components/home-components.module';
-import { GatewaysComponent } from '@home/pages/gateways/gateways.component';
import { GatewaysRoutingModule } from '@home/pages/gateways/gateways-routing.module';
@NgModule({
- declarations:
- [
- GatewaysComponent
- ],
imports: [
CommonModule,
SharedModule,