penambahan button new device
This commit is contained in:
parent
f04515fb41
commit
4630bd2265
|
@ -340,10 +340,10 @@
|
||||||
class="dropdown-menu dropdown-menu-right"
|
class="dropdown-menu dropdown-menu-right"
|
||||||
aria-labelledby="dropdownProfileMenu"
|
aria-labelledby="dropdownProfileMenu"
|
||||||
>
|
>
|
||||||
<a class="dropdown-item"
|
<a class="dropdown-item" [routerLink]="'/user-profil'"
|
||||||
><i class="feather ft-user"></i> Edit Profile
|
><i class="feather ft-user"></i> Edit Profile
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item"
|
<!-- <a class="dropdown-item"
|
||||||
><i class="feather ft-mail"></i> My Inbox
|
><i class="feather ft-mail"></i> My Inbox
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item"
|
<a class="dropdown-item"
|
||||||
|
@ -351,7 +351,7 @@
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item"
|
<a class="dropdown-item"
|
||||||
><i class="feather ft-message-square"></i> Chats
|
><i class="feather ft-message-square"></i> Chats
|
||||||
</a>
|
</a> -->
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" [routerLink]="" (click)="logout()"
|
<a class="dropdown-item" [routerLink]="" (click)="logout()"
|
||||||
><i class="feather ft-power"></i> Logout</a
|
><i class="feather ft-power"></i> Logout</a
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -76,6 +76,10 @@ const appRoutes: Routes = [
|
||||||
path: 'master', loadChildren: () => import('../app/content/hemat-app/master/master.module').then(m => m.MasterModule)
|
path: 'master', loadChildren: () => import('../app/content/hemat-app/master/master.module').then(m => m.MasterModule)
|
||||||
, canActivate: [AuthGuard]
|
, canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'user-profil', loadChildren: () => import('../app/content/hemat-app/user-profile/user-profile.module').then(m => m.UserProfileModule)
|
||||||
|
, canActivate: [AuthGuard]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'dashboard', loadChildren: () => import('../app/content/dashboard/dashboard.module').then(m => m.DashboardModule)
|
path: 'dashboard', loadChildren: () => import('../app/content/dashboard/dashboard.module').then(m => m.DashboardModule)
|
||||||
, canActivate: [AuthGuard]
|
, canActivate: [AuthGuard]
|
||||||
|
|
|
@ -43,10 +43,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<div
|
<div class="card" style="background-color: #252525 !important">
|
||||||
class="card"
|
|
||||||
style="background-color: #252525 !important"
|
|
||||||
>
|
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="media d-flex">
|
<div class="media d-flex">
|
||||||
|
@ -80,10 +77,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<div
|
<div class="card" style="background-color: #252525 !important">
|
||||||
class="card"
|
|
||||||
style="background-color: #252525 !important"
|
|
||||||
>
|
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="media d-flex">
|
<div class="media d-flex">
|
||||||
|
@ -132,6 +126,7 @@
|
||||||
class="select-custom"
|
class="select-custom"
|
||||||
[items]="dataBuildingList"
|
[items]="dataBuildingList"
|
||||||
[searchable]="true"
|
[searchable]="true"
|
||||||
|
[disabled]="newDeviceActive"
|
||||||
bindLabel="name"
|
bindLabel="name"
|
||||||
bindValue="id"
|
bindValue="id"
|
||||||
placeholder="Select Building"
|
placeholder="Select Building"
|
||||||
|
@ -146,6 +141,7 @@
|
||||||
class="select-custom"
|
class="select-custom"
|
||||||
[items]="dataMasterCategori"
|
[items]="dataMasterCategori"
|
||||||
[searchable]="true"
|
[searchable]="true"
|
||||||
|
[disabled]="newDeviceActive"
|
||||||
bindLabel="name"
|
bindLabel="name"
|
||||||
bindValue="id"
|
bindValue="id"
|
||||||
placeholder="Select Category"
|
placeholder="Select Category"
|
||||||
|
@ -160,6 +156,7 @@
|
||||||
class="select-custom"
|
class="select-custom"
|
||||||
[items]="dataMasterStatus"
|
[items]="dataMasterStatus"
|
||||||
[searchable]="true"
|
[searchable]="true"
|
||||||
|
[disabled]="newDeviceActive"
|
||||||
bindLabel="name"
|
bindLabel="name"
|
||||||
bindValue="id"
|
bindValue="id"
|
||||||
placeholder="Select Status"
|
placeholder="Select Status"
|
||||||
|
@ -179,7 +176,7 @@
|
||||||
border-color: #ffffff !important;
|
border-color: #ffffff !important;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
"
|
"
|
||||||
[disabled]="spinnerFilterActive"
|
[disabled]="spinnerFilterActive || newDeviceActive"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
class="la la-search"
|
class="la la-search"
|
||||||
|
@ -253,6 +250,52 @@
|
||||||
<span style="font-weight: 600">Export</span>
|
<span style="font-weight: 600">Export</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-6 col-md-3 mb-2">
|
||||||
|
<button
|
||||||
|
class="btn btn-secondary btn-block"
|
||||||
|
*ngIf="!newDeviceActive"
|
||||||
|
[disabled]="spinnerNewDeviceActive"
|
||||||
|
(click)="newDevice()"
|
||||||
|
style="
|
||||||
|
background-color: #bef264 !important;
|
||||||
|
border-color: #bef264 !important;
|
||||||
|
color: #000000 !important;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="la la-spinner spinner"
|
||||||
|
*ngIf="spinnerNewDeviceActive"
|
||||||
|
></i>
|
||||||
|
<i
|
||||||
|
class="ri-sticky-note-add-fill"
|
||||||
|
*ngIf="!spinnerNewDeviceActive"
|
||||||
|
></i>
|
||||||
|
|
||||||
|
<span style="font-weight: 600">New Device</span>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-secondary btn-block"
|
||||||
|
*ngIf="newDeviceActive"
|
||||||
|
[disabled]="spinnerNewDeviceActive"
|
||||||
|
(click)="allDevice()"
|
||||||
|
style="
|
||||||
|
background-color: #bef264 !important;
|
||||||
|
border-color: #bef264 !important;
|
||||||
|
color: #000000 !important;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="la la-spinner spinner"
|
||||||
|
*ngIf="spinnerNewDeviceActive"
|
||||||
|
></i>
|
||||||
|
<i
|
||||||
|
class="ri-arrow-left-circle-line"
|
||||||
|
*ngIf="!spinnerNewDeviceActive"
|
||||||
|
></i>
|
||||||
|
|
||||||
|
<span style="font-weight: 600">All Device</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-dashboard">
|
<div class="card-dashboard">
|
||||||
|
|
|
@ -35,7 +35,9 @@ export class DeviceComponent implements OnInit {
|
||||||
public breadcrumb: any;
|
public breadcrumb: any;
|
||||||
spinnerActive: boolean = false;
|
spinnerActive: boolean = false;
|
||||||
spinnerExportActive: boolean = false;
|
spinnerExportActive: boolean = false;
|
||||||
|
spinnerNewDeviceActive: boolean = false;
|
||||||
|
newDeviceActive: boolean = false;
|
||||||
|
|
||||||
singlebasicSelected: any;
|
singlebasicSelected: any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -64,6 +66,10 @@ export class DeviceComponent implements OnInit {
|
||||||
};
|
};
|
||||||
this.storedData = JSON.parse(localStorage.getItem("currentUser"));
|
this.storedData = JSON.parse(localStorage.getItem("currentUser"));
|
||||||
this.buildingSelected = this.storedData.buildingId;
|
this.buildingSelected = this.storedData.buildingId;
|
||||||
|
|
||||||
|
if (this.newDeviceActive === true) {
|
||||||
|
|
||||||
|
}
|
||||||
this.fetchData(
|
this.fetchData(
|
||||||
this.buildingSelected,
|
this.buildingSelected,
|
||||||
this.categorySelected,
|
this.categorySelected,
|
||||||
|
@ -74,6 +80,8 @@ export class DeviceComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchData(buildingSelected, categorySelected, statusSelected) {
|
fetchData(buildingSelected, categorySelected, statusSelected) {
|
||||||
|
this.newDeviceActive = false;
|
||||||
|
this.buildingSelected = buildingSelected;
|
||||||
this.deviceService
|
this.deviceService
|
||||||
.getDeviceData(buildingSelected, categorySelected, statusSelected)
|
.getDeviceData(buildingSelected, categorySelected, statusSelected)
|
||||||
.subscribe((res) => {
|
.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() {
|
dataListMaster() {
|
||||||
this.monitoringApiService.getMasterListData().subscribe((data) => {
|
this.monitoringApiService.getMasterListData().subscribe((data) => {
|
||||||
const dataCategory = data.data.find(
|
const dataCategory = data.data.find(
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
:host ::ng-deep .nav.nav-tabs .nav-item .nav-link {
|
||||||
|
padding: 1.5rem 0.7rem !important;
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="app-content content" style="background-color: #000000 !important">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="content-header row mb-1">
|
||||||
|
<app-breadcrumb class="col-12" [breadcrumb]="breadcrumb"></app-breadcrumb>
|
||||||
|
</div>
|
||||||
|
<div class="content-body">
|
||||||
|
<section id="user-profile">
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -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<UserProfileComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ UserProfileComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(UserProfileComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -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;
|
||||||
|
}
|
|
@ -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 { }
|
Loading…
Reference in New Issue