@@ -132,6 +126,7 @@
class="select-custom"
[items]="dataBuildingList"
[searchable]="true"
+ [disabled]="newDeviceActive"
bindLabel="name"
bindValue="id"
placeholder="Select Building"
@@ -146,6 +141,7 @@
class="select-custom"
[items]="dataMasterCategori"
[searchable]="true"
+ [disabled]="newDeviceActive"
bindLabel="name"
bindValue="id"
placeholder="Select Category"
@@ -160,6 +156,7 @@
class="select-custom"
[items]="dataMasterStatus"
[searchable]="true"
+ [disabled]="newDeviceActive"
bindLabel="name"
bindValue="id"
placeholder="Select Status"
@@ -179,7 +176,7 @@
border-color: #ffffff !important;
border-radius: 12px;
"
- [disabled]="spinnerFilterActive"
+ [disabled]="spinnerFilterActive || newDeviceActive"
>
Export
+
+
+
+
diff --git a/src/app/content/hemat-app/device/device.component.ts b/src/app/content/hemat-app/device/device.component.ts
index 4500849..baf91c3 100644
--- a/src/app/content/hemat-app/device/device.component.ts
+++ b/src/app/content/hemat-app/device/device.component.ts
@@ -35,7 +35,9 @@ export class DeviceComponent implements OnInit {
public breadcrumb: any;
spinnerActive: boolean = false;
spinnerExportActive: boolean = false;
-
+ spinnerNewDeviceActive: boolean = false;
+ newDeviceActive: boolean = false;
+
singlebasicSelected: any;
constructor(
@@ -64,6 +66,10 @@ export class DeviceComponent implements OnInit {
};
this.storedData = JSON.parse(localStorage.getItem("currentUser"));
this.buildingSelected = this.storedData.buildingId;
+
+ if (this.newDeviceActive === true) {
+
+ }
this.fetchData(
this.buildingSelected,
this.categorySelected,
@@ -74,6 +80,8 @@ export class DeviceComponent implements OnInit {
}
fetchData(buildingSelected, categorySelected, statusSelected) {
+ this.newDeviceActive = false;
+ this.buildingSelected = buildingSelected;
this.deviceService
.getDeviceData(buildingSelected, categorySelected, statusSelected)
.subscribe((res) => {
@@ -99,6 +107,35 @@ export class DeviceComponent implements OnInit {
});
}
+ newDevice() {
+ this.spinnerNewDeviceActive = true;
+ this.newDeviceActive = true;
+ this.deviceService.getDeviceData(0, 0, 0).subscribe((res) => {
+ this.data = res;
+ this.filteredRows = this.data.results.data;
+ this.spinnerNewDeviceActive = false;
+ this.data_device = this.filteredRows.map((item) => ({
+ buildingName: item.building_name,
+ id: item.id,
+ name: item.name,
+ icon: item.icon,
+ watt: item.watt,
+ categoryName: item.category_name,
+ typeName: item.type_name,
+ voltageName: item.voltage_name,
+ statusName: item.status_name,
+ }));
+ });
+ }
+
+ allDevice(){
+ this.fetchData(
+ this.buildingSelected,
+ this.categorySelected,
+ this.statusSelected
+ );
+ }
+
dataListMaster() {
this.monitoringApiService.getMasterListData().subscribe((data) => {
const dataCategory = data.data.find(
diff --git a/src/app/content/hemat-app/user-profile/user-profile.component.css b/src/app/content/hemat-app/user-profile/user-profile.component.css
new file mode 100644
index 0000000..cef2f54
--- /dev/null
+++ b/src/app/content/hemat-app/user-profile/user-profile.component.css
@@ -0,0 +1,4 @@
+:host ::ng-deep .nav.nav-tabs .nav-item .nav-link {
+ padding: 1.5rem 0.7rem !important;
+ display: inline-flex;
+}
\ No newline at end of file
diff --git a/src/app/content/hemat-app/user-profile/user-profile.component.html b/src/app/content/hemat-app/user-profile/user-profile.component.html
new file mode 100644
index 0000000..811879e
--- /dev/null
+++ b/src/app/content/hemat-app/user-profile/user-profile.component.html
@@ -0,0 +1,12 @@
+
diff --git a/src/app/content/hemat-app/user-profile/user-profile.component.spec.ts b/src/app/content/hemat-app/user-profile/user-profile.component.spec.ts
new file mode 100644
index 0000000..f4ff0ad
--- /dev/null
+++ b/src/app/content/hemat-app/user-profile/user-profile.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UserProfileComponent } from './user-profile.component';
+
+describe('UserProfileComponent', () => {
+ let component: UserProfileComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ UserProfileComponent ]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(UserProfileComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/content/hemat-app/user-profile/user-profile.component.ts b/src/app/content/hemat-app/user-profile/user-profile.component.ts
new file mode 100644
index 0000000..49f8d71
--- /dev/null
+++ b/src/app/content/hemat-app/user-profile/user-profile.component.ts
@@ -0,0 +1,10 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-user-profile',
+ templateUrl: './user-profile.component.html',
+ styleUrls: ['./user-profile.component.css']
+})
+export class UserProfileComponent {
+ public breadcrumb: any;
+}
diff --git a/src/app/content/hemat-app/user-profile/user-profile.module.ts b/src/app/content/hemat-app/user-profile/user-profile.module.ts
new file mode 100644
index 0000000..b1265ff
--- /dev/null
+++ b/src/app/content/hemat-app/user-profile/user-profile.module.ts
@@ -0,0 +1,24 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { UserProfileComponent } from './user-profile.component';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { BreadcrumbModule } from 'src/app/_layout/breadcrumb/breadcrumb.module';
+import { RouterModule } from '@angular/router';
+
+
+
+@NgModule({
+ declarations: [UserProfileComponent],
+ imports: [
+ CommonModule,
+ NgbModule,
+ BreadcrumbModule,
+ RouterModule.forChild([
+ {
+ path: '',
+ component: UserProfileComponent
+ },
+ ])
+ ]
+})
+export class UserProfileModule { }