diff --git a/src/app/content/hemat-app/device/device.component.html b/src/app/content/hemat-app/device/device.component.html index 4b8205b..b651835 100644 --- a/src/app/content/hemat-app/device/device.component.html +++ b/src/app/content/hemat-app/device/device.component.html @@ -93,12 +93,12 @@ - Category + watt - Location + typeId - Location Room + roomBuildingId - Duration Use + voltageId @@ -164,7 +164,7 @@ ngx-datatable-cell-template let-value="value" > - {{ value }} + {{ value === 2 ? "Aktif" : "Tidak Aktif" }} { this.data = res; this.filteredRows = this.data.results.data; + console.log(this.filteredRows); + }); } diff --git a/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.html b/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.html index 87ac625..33629a0 100644 --- a/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.html +++ b/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.html @@ -3,94 +3,120 @@
-
+
-
+
- - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
+
+
+ +
+ +
- +
+ + +
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
- - - -
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
- -
-
-
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
-
-
-
-
-
-
-
- - -
-
-
- - -
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
- -
-
-
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
-
-
-
-
-
-
-
- - -
-
-
- - -
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
- -
-
-
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
-
-
-
-
-
-
-
- - -
-
-
- - -
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
- -
-
-
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
-
-
-
-
-
-
-
- - -
-
-
- +
+
+
+ + +
+
+ + + + + +
+
+
+ Profile Image +
+
diff --git a/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.ts b/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.ts index 74a2afa..26281eb 100644 --- a/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.ts +++ b/src/app/content/hemat-app/monitoring/add-new-building-room/add-new-building-room.component.ts @@ -11,39 +11,13 @@ import { BlockUI, NgBlockUI } from "ng-block-ui"; export class AddNewBuildingRoomComponent implements OnInit { public breadcrumb: any; mode: string; - numberTab: FormGroup; - stepOneForm: FormGroup; - stepTwoForm: FormGroup; - stepThreeForm: FormGroup; - stepFourForm: FormGroup; - isStepFourReached = false; - - repeatForm: FormGroup; - public repeatList: FormArray; - - get repeatFormGroup() { - return this.repeatForm.get("repeatArray") as FormArray; + userProfileForm: FormGroup; + public userList: FormArray; + submitted = false; + get userFormGroup() { + return this.userProfileForm.get('userArray') as FormArray; } - @BlockUI("numberTabs") blockUINumberTabs: NgBlockUI; - @BlockUI("iconTabs") blockUIIconTabs: NgBlockUI; - - countries = ["Amsterdam", "Berlin", "Frankfurt"]; - eventType = ["Banquet", "Fund Raiser", "Dinner Party", "Wedding"]; - eventLocation = ["Amsterdam", "Berlin", "Frankfurt"]; - eventStatus = ["Planning", "In Progress", "Finished"]; - requirements1 = [ - { id: 1, name: "Staffing" }, - { id: 2, name: "Catering" }, - ]; - agendaItems1 = [ - { id: 1, name: "1st item", idName: "item1" }, - { id: 2, name: "2st item", idName: "item2" }, - { id: 3, name: "3st item", idName: "item3" }, - { id: 4, name: "4st item", idName: "item4" }, - { id: 5, name: "5st item", idName: "item5" }, - ]; - constructor( private formBuilder: FormBuilder, private router: Router, @@ -51,90 +25,40 @@ export class AddNewBuildingRoomComponent implements OnInit { ) {} ngOnInit() { - this.numberTab = this.formBuilder.group({ - buildName: ["", Validators.required], - phone: ["", Validators.required], - phoneNumber: ["", [Validators.required]], - email: ["", [Validators.required, Validators.email]], - address: ["", [Validators.required]], - owned: ["", [Validators.required]], + this.breadcrumb = { + mainlabel: "Add building", + links: [ + { + name: "Add Building", + isLink: false, + }, + ], + }; + this.userProfileForm = this.formBuilder.group({ + buildingId: ['', Validators.required], + roomId: ['', Validators.required], + floorId: ['', Validators.required], + userArray: this.formBuilder.array([this.createPhone()]), }); - this.repeatForm = this.formBuilder.group({ - repeatArray: this.formBuilder.array([this.createRepeat()]), - }); - - this.repeatList = this.repeatForm.get("repeatArray") as FormArray; - - this.route.data.subscribe((data) => { - this.mode = data.mode; - }); + this.userList = this.userProfileForm.get('userArray') as FormArray; } - createRepeat(): FormGroup { + createPhone(): FormGroup { return this.formBuilder.group({ - roomName: ["", Validators.required], - room: ["", Validators.required], - floor: ["", Validators.required], - status: ["", Validators.required], + roomId: ['', Validators.required] }); } - addRepeat() { - this.repeatList.push(this.createRepeat()); + addPhone() { + this.userList.push(this.createPhone()); } - removeRepeat(index) { - this.repeatList.removeAt(index); - } - - getRepeatFormGroup(index): FormGroup { - const formGroup = this.repeatList.controls[index] as FormGroup; - return formGroup; - } - - public previousFourthStep() { - this.isStepFourReached = true; - } - get f() { - return this.stepOneForm.controls; - } - get i() { - return this.stepTwoForm.controls; - } - get j() { - return this.stepThreeForm.controls; - } - get k() { - return this.stepFourForm.controls; - } - - submit() { - window.alert("Form submitted."); + removePhone(index) { + this.userList.removeAt(index); } cancel() { - if (this.mode === "room") { - this.router.navigate(["/monitoring/monitoring-room"]); - } else { - this.router.navigate(["/monitoring"]); - } - - } - - reloadNumberTabs() { - this.blockUINumberTabs.start("Loading.."); - - setTimeout(() => { - this.blockUINumberTabs.stop(); - }, 2500); - } - - reloadIconTabs() { - this.blockUIIconTabs.start("Loading.."); - - setTimeout(() => { - this.blockUIIconTabs.stop(); - }, 2500); + this.router.navigate(["/monitoring"]); } } diff --git a/src/app/content/hemat-app/monitoring/building/building.component.html b/src/app/content/hemat-app/monitoring/building/building.component.html index 8e21085..e4caac9 100644 --- a/src/app/content/hemat-app/monitoring/building/building.component.html +++ b/src/app/content/hemat-app/monitoring/building/building.component.html @@ -88,17 +88,17 @@
{{ top.value[i] }}% - {{ top.label[i] }}{{ top.value }}% - {{ top.label }}
diff --git a/src/app/content/hemat-app/monitoring/building/building.component.ts b/src/app/content/hemat-app/monitoring/building/building.component.ts index fafc53f..7089e09 100644 --- a/src/app/content/hemat-app/monitoring/building/building.component.ts +++ b/src/app/content/hemat-app/monitoring/building/building.component.ts @@ -14,7 +14,7 @@ export class BuildingComponent { feedbacksdonutChart: any; donutChart1: any; filteredRows: any[]; - dataTop: any[]; + dataTop: any; searchTerm: string = ""; colorChart: string = ""; @@ -55,20 +55,6 @@ export class BuildingComponent { console.log(res.data); this.data = res.data; this.filteredRows = res.data; - - this.dataTop = []; - const maxItems = 4; - - res.data.forEach((item) => { - for (let i = 0; i < maxItems; i++) { - if (item.topUse.label[i] !== undefined) { - this.dataTop.push({ - label: item.topUse.label, - value: item.topUse.value, - }); - } - } - }); }); } @@ -104,7 +90,7 @@ export class BuildingComponent { this.router.navigate(["/monitoring/edit-new-building", row.id]); } - viewRoom(row){ + viewRoom(row) { console.log(row); this.router.navigate(["/monitoring/monitoring-room", row.id]); } diff --git a/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.css b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.html b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.html new file mode 100644 index 0000000..3c22b91 --- /dev/null +++ b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.html @@ -0,0 +1 @@ +

detail-room works!

diff --git a/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.spec.ts b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.spec.ts new file mode 100644 index 0000000..0a18f8f --- /dev/null +++ b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DetailRoomComponent } from './detail-room.component'; + +describe('DetailRoomComponent', () => { + let component: DetailRoomComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DetailRoomComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(DetailRoomComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.ts b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.ts new file mode 100644 index 0000000..e6e2fda --- /dev/null +++ b/src/app/content/hemat-app/monitoring/detail-room/detail-room.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-detail-room', + templateUrl: './detail-room.component.html', + styleUrls: ['./detail-room.component.css'] +}) +export class DetailRoomComponent { + +} diff --git a/src/app/content/hemat-app/monitoring/monitoring.module.ts b/src/app/content/hemat-app/monitoring/monitoring.module.ts index 75be901..16750ab 100644 --- a/src/app/content/hemat-app/monitoring/monitoring.module.ts +++ b/src/app/content/hemat-app/monitoring/monitoring.module.ts @@ -22,13 +22,15 @@ import { NgxEchartsModule } from 'ngx-echarts'; import { NgxPhotoswipeModule } from '@fnxone/ngx-photoswipe'; import { NgxMasonryModule } from 'ngx-masonry'; import { UiSwitchModule } from 'ngx-ui-switch'; +import { DetailRoomComponent } from './detail-room/detail-room.component'; @NgModule({ declarations: [ BuildingComponent, RoomComponent, AddNewBuildingRoomComponent, - DetailComponent + DetailComponent, + DetailRoomComponent ], imports: [ CommonModule, @@ -88,6 +90,11 @@ import { UiSwitchModule } from 'ngx-ui-switch'; component: DetailComponent, data: { mode: 'room' } }, + { + path: 'view-detail-room/:id', + component: DetailRoomComponent, + data: { mode: 'room' } + }, ]) ] }) diff --git a/src/app/content/hemat-app/monitoring/room/room.component.html b/src/app/content/hemat-app/monitoring/room/room.component.html index 72f9ade..5ae075f 100644 --- a/src/app/content/hemat-app/monitoring/room/room.component.html +++ b/src/app/content/hemat-app/monitoring/room/room.component.html @@ -73,7 +73,7 @@ type="button" class="btn btn-icon btn-outline-primary mr-1" triggers="hover:click:hover" - ngbTooltip="Edit" + ngbTooltip="Control" (click)="editRow(data)" > diff --git a/src/app/content/hemat-app/monitoring/room/room.component.ts b/src/app/content/hemat-app/monitoring/room/room.component.ts index 17216a3..6d868f6 100644 --- a/src/app/content/hemat-app/monitoring/room/room.component.ts +++ b/src/app/content/hemat-app/monitoring/room/room.component.ts @@ -87,7 +87,7 @@ export class RoomComponent implements OnInit { ); } viewRow(row) { - this.router.navigate(["/monitoring/view-new-room", row.id]); + this.router.navigate(["/monitoring/view-detail-room", row.id]); } editRow(row) { diff --git a/src/assets/images/backgrounds/smart3.jpg b/src/assets/images/backgrounds/smart3.jpg new file mode 100644 index 0000000..a40c7a5 Binary files /dev/null and b/src/assets/images/backgrounds/smart3.jpg differ