hemat_solution/src/app/content/hemat-app/device/device.component.html
2024-07-10 16:38:19 +07:00

516 lines
21 KiB
HTML

<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="configuration">
<div class="row">
<div class="col-lg-4 col-12">
<div class="card" style="background-color: #252525 !important">
<div class="card-content">
<div class="card-body">
<div class="media d-flex">
<div class="media-body text-left">
<h6 class="text-muted" style="color: #ffffff !important">
Total Device
</h6>
<h3 style="color: #ffffff !important">
{{ summaryTotal?.length }}
</h3>
</div>
<div class="align-self-center">
<div
style="
background-color: #414f2b;
border-radius: 50%;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
"
>
<i
class="ri-device-line primary font-large-1 float-right"
style="color: #bef264 !important"
></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-12">
<div class="card" style="background-color: #252525 !important">
<div class="card-content">
<div class="card-body">
<div class="media d-flex">
<div class="media-body text-left">
<h6 class="text-light" style="color: #ffffff !important">
Total Device Active
</h6>
<h3 style="color: #ffffff !important">{{ totalOn }}</h3>
</div>
<div class="align-self-center">
<div
style="
background-color: #414f2b;
border-radius: 50%;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
"
>
<i
class="feather ft-wifi primary font-large-1 float-right"
style="color: #bef264 !important"
></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-12">
<div class="card" style="background-color: #252525 !important">
<div class="card-content">
<div class="card-body">
<div class="media d-flex">
<div class="media-body text-left">
<h6 class="text-muted" style="color: #ffffff !important">
Total Device Non-Active
</h6>
<h3 style="color: #ffffff !important">{{ totalOff }}</h3>
</div>
<div class="align-self-center">
<div
style="
background-color: #414f2b;
border-radius: 50%;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
"
>
<i
class="feather ft-wifi-off primary font-large-1 float-right"
style="color: #bef264 !important"
></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="configuration">
<div class="row">
<div class="col-12">
<div class="card" style="background-color: #252525 !important">
<div class="card-content">
<div class="card-body">
<div class="row mb-2">
<div class="col-3">
<div class="form-group">
<ng-select
class="select-custom"
[items]="dataBuildingList"
[searchable]="true"
[disabled]="newDeviceActive"
bindLabel="name"
bindValue="id"
placeholder="Select Building"
[(ngModel)]="buildingSelected"
>
</ng-select>
</div>
</div>
<div class="col-3">
<div class="form-group">
<ng-select
class="select-custom"
[items]="dataMasterCategori"
[searchable]="true"
[disabled]="newDeviceActive"
bindLabel="name"
bindValue="id"
placeholder="Select Category"
[(ngModel)]="categorySelected"
>
</ng-select>
</div>
</div>
<div class="col-3">
<div class="form-group">
<ng-select
class="select-custom"
[items]="dataMasterStatus"
[searchable]="true"
[disabled]="newDeviceActive"
bindLabel="name"
bindValue="id"
placeholder="Select Status"
[(ngModel)]="statusSelected"
>
</ng-select>
</div>
</div>
<div class="col-3 text-left">
<div class="d-flex">
<button
type="button"
class="btn btn-outline-success ml-2"
(click)="doFilter()"
style="
background-color: #252525 !important;
border-color: #ffffff !important;
border-radius: 12px;
"
[disabled]="spinnerFilterActive || newDeviceActive"
>
<i
class="la la-search"
style="color: #ffffff !important"
*ngIf="!spinnerFilterActive"
></i>
<i
class="la la-spinner spinner"
style="color: #ffffff !important"
*ngIf="spinnerFilterActive"
></i>
</button>
<button
type="button"
class="btn btn-outline-success ml-2"
(click)="doCancelFilter()"
style="
background-color: #252525 !important;
border-color: #ffffff !important;
color: #ffffff;
border-radius: 12px;
"
>
Cancel
</button>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-6 col-md-3 mb-2">
<button
class="btn btn-secondary btn-block"
[disabled]="spinnerActive"
(click)="addDevice()"
style="
background-color: #bef264 !important;
border-color: #bef264 !important;
color: #000000 !important;
"
>
<i
class="la la-spinner spinner"
*ngIf="spinnerActive"
></i>
<i class="feather ft-plus" *ngIf="!spinnerActive"></i>
&nbsp;
<span style="font-weight: 600">Synchronization</span>
</button>
</div>
<div class="col-6 col-md-3 mb-2">
<button
class="btn btn-secondary btn-block"
[disabled]="spinnerExportActive"
(click)="exportDevice()"
style="
background-color: #bef264 !important;
border-color: #bef264 !important;
color: #000000 !important;
"
>
<i
class="la la-spinner spinner"
*ngIf="spinnerExportActive"
></i>
<i
class="ri-export-fill"
*ngIf="!spinnerExportActive"
></i>
&nbsp;
<span style="font-weight: 600">Export</span>
</button>
</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>
&nbsp;
<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>
&nbsp;
<span style="font-weight: 600">All Device</span>
</button>
</div>
</div>
<div class="card-dashboard">
<ngx-datatable
class="bootstrap table-bordered"
[limit]="5"
[rows]="data_device"
[columnMode]="'force'"
[headerHeight]="50"
[footerHeight]="50"
[rowHeight]="50"
fxFlex="auto"
[scrollbarH]="true"
>
<ngx-datatable-column
name="#"
[flexGrow]="1"
[minWidth]="10"
>
<ng-template
ngx-datatable-cell-template
let-rowIndex="rowIndex"
>
{{ rowIndex + 1 }}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="icon"
[flexGrow]="1"
[minWidth]="20"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important">Image</span>
</ng-template>
<ng-template ngx-datatable-cell-template let-row="row">
<span class="avatar avatar-sm rounded-circle">
<img [src]="row.icon" /><i></i
></span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="Name"
[flexGrow]="1"
[minWidth]="150"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important"
>Device Name</span
>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
<p style="color: #ffffff !important">{{ value }}</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="buildingName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important"
>Building</span
>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
<p style="color: #ffffff !important">{{ value }}</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="categoryName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important"
>Category</span
>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-value="value"
>
<p style="color: #ffffff !important">
{{ value }}
</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="watt"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important">Watt</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-value="value"
>
<p style="color: #ffffff !important">{{ value }}</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="typeName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important">Type</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-value="value"
>
<p style="color: #ffffff !important">
{{ value }}
</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="voltageName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important">Voltage</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-value="value"
>
<p style="color: #ffffff !important">
{{ value }}
</p>
</ng-template>
</ngx-datatable-column>
<!-- <ngx-datatable-column
name="statusName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important">Status</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-value="value"
>
<p style="color: #ffffff !important">
{{ value }}
</p>
</ng-template>
</ngx-datatable-column> -->
<ngx-datatable-column
name="Actions"
[flexGrow]="1"
[minWidth]="150"
>
<ng-template ngx-datatable-header-template>
<span style="color: #ffffff !important">Actions</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-rowIndex="rowIndex"
let-row="row"
>
<button
class="btn btn-sm btn-info mr-1"
style="
background-color: #000000 !important;
border-color: #bef264 !important;
"
(click)="viewRow(row)"
>
<i
class="ficon feather ft-eye"
style="color: #bef264 !important"
></i>
</button>
<button
class="btn btn-sm btn-warning mr-1"
style="
background-color: #000000 !important;
border-color: #bef264 !important;
"
(click)="editRow(row)"
>
<i
class="ficon feather ft-edit"
style="color: #bef264 !important"
></i>
</button>
<!-- <button
class="btn btn-sm btn-danger"
(click)="deleteRow(row)"
>
<i class="ficon feather ft-trash-2"></i>
</button> -->
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>