mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
fix(dashboard): restructure components
This commit is contained in:
parent
43aaef8210
commit
422880dddf
15 changed files with 80 additions and 26 deletions
|
|
@ -8,3 +8,8 @@
|
|||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
//global styles for thw whole application
|
||||
[class^='col-'] {
|
||||
padding: 0 0.75rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,19 +3,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<nga-card size="xmedium">
|
||||
<nga-tabset fullWidth>
|
||||
<nga-tab tabTitle="Temperature">
|
||||
<ngx-temperature-dragger [arcThickness]="15" [knobRadius]="15" [(value)]="currentValue" [bottomAngle]="90"
|
||||
disableArcColor="#2c2961"
|
||||
[fillColors]="['#2ec6ff', '#31ffad', '#7bff24', '#fff024', '#ff6c00']">
|
||||
</ngx-temperature-dragger>
|
||||
</nga-tab>
|
||||
<nga-tab tabTitle="Humidity">
|
||||
<span>Content #2</span>
|
||||
</nga-tab>
|
||||
</nga-tabset>
|
||||
</nga-card>
|
||||
<ngx-temperature></ngx-temperature>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-9">
|
||||
|
|
@ -29,14 +17,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<nga-card size="xmedium">
|
||||
<nga-card-header>
|
||||
Room Management
|
||||
</nga-card-header>
|
||||
<nga-card-body>
|
||||
<ngx-room-selector></ngx-room-selector>
|
||||
</nga-card-body>
|
||||
</nga-card>
|
||||
<ngx-rooms></ngx-rooms>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
|
|
|
|||
|
|
@ -6,5 +6,4 @@ import { Component } from '@angular/core';
|
|||
templateUrl: './dashboard.component.html',
|
||||
})
|
||||
export class DashboardComponent {
|
||||
currentValue = 0.5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ import { NgaTabsetModule, NgaUserModule } from '@akveo/nga-theme';
|
|||
import { SharedModule } from '../../shared.module';
|
||||
import { DashboardComponent } from './dashboard.component';
|
||||
import { StatusCardsComponent } from './status-cards/status-cards.component';
|
||||
import { TemperatureDraggerComponent } from './temperature-dragger/temperature-dragger.component';
|
||||
import { ContactsComponent } from './contacts/contacts.component';
|
||||
import { RoomSelectorComponent } from './room-selector/room-selector.component';
|
||||
import { RoomsComponent } from './rooms/rooms.component';
|
||||
import { RoomSelectorComponent } from './rooms/room-selector/room-selector.component';
|
||||
import { TemperatureComponent } from './temperature/temperature.component';
|
||||
import { TemperatureDraggerComponent } from './temperature/temperature-dragger/temperature-dragger.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
@ -20,6 +22,8 @@ import { RoomSelectorComponent } from './room-selector/room-selector.component';
|
|||
TemperatureDraggerComponent,
|
||||
ContactsComponent,
|
||||
RoomSelectorComponent,
|
||||
TemperatureComponent,
|
||||
RoomsComponent,
|
||||
],
|
||||
})
|
||||
export class DashboardModule { }
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
|
@ -44,6 +44,7 @@ svg {
|
|||
.room-text {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.selected-room {
|
||||
9
src/app/pages/dashboard/rooms/rooms.component.scss
Normal file
9
src/app/pages/dashboard/rooms/rooms.component.scss
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
@import '../../../@theme/styles/variables';
|
||||
@import '~@akveo/nga-theme/styles/global/bootstrap/hero-buttons';
|
||||
|
||||
@include nga-install-component() {
|
||||
|
||||
ngx-room-selector {
|
||||
width: 65%;
|
||||
}
|
||||
}
|
||||
18
src/app/pages/dashboard/rooms/rooms.component.ts
Normal file
18
src/app/pages/dashboard/rooms/rooms.component.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-rooms',
|
||||
styleUrls: ['./rooms.component.scss'],
|
||||
template: `
|
||||
<nga-card size="xmedium">
|
||||
<nga-card-header>
|
||||
Room Management
|
||||
</nga-card-header>
|
||||
<nga-card-body>
|
||||
<ngx-room-selector></ngx-room-selector>
|
||||
</nga-card-body>
|
||||
</nga-card>
|
||||
`,
|
||||
})
|
||||
export class RoomsComponent {
|
||||
}
|
||||
|
|
@ -23,8 +23,8 @@ import { Component } from '@angular/core';
|
|||
export class StatusCardsComponent {
|
||||
statusCards = [
|
||||
{ title: 'Light', on: true, type: 'primary', icon: 'ion-ios-game-controller-b-outline' },
|
||||
{ title: 'RollerShades', on: false, type: 'success', icon: 'ion-ios-game-controller-b-outline' },
|
||||
{ title: 'RollerShades', on: true, type: 'success', icon: 'ion-ios-game-controller-b-outline' },
|
||||
{ title: 'Wireless Audio', on: true, type: 'info', icon: 'ion-ios-game-controller-b-outline' },
|
||||
{ title: 'Coffee Maker', on: false, type: 'warning', icon: 'ion-ios-game-controller-b-outline' },
|
||||
{ title: 'Coffee Maker', on: true, type: 'warning', icon: 'ion-ios-game-controller-b-outline' },
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
|
@ -0,0 +1,14 @@
|
|||
@import '../../../@theme/styles/variables';
|
||||
@import '~@akveo/nga-theme/styles/global/bootstrap/hero-buttons';
|
||||
|
||||
@include nga-install-component() {
|
||||
|
||||
nga-tab.content-active {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
ngx-temperature-dragger {
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
23
src/app/pages/dashboard/temperature/temperature.component.ts
Normal file
23
src/app/pages/dashboard/temperature/temperature.component.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-temperature',
|
||||
styleUrls: ['./temperature.component.scss'],
|
||||
template: `
|
||||
<nga-card size="xmedium">
|
||||
<nga-tabset fullWidth>
|
||||
<nga-tab tabTitle="Temperature">
|
||||
<ngx-temperature-dragger [(value)]="temperature" [arcThickness]="20" [knobRadius]="15" [bottomAngle]="90"
|
||||
disableArcColor="#2c2961" [fillColors]="['#2ec6ff', '#31ffad', '#7bff24', '#EAE75F']">
|
||||
</ngx-temperature-dragger>
|
||||
</nga-tab>
|
||||
<nga-tab tabTitle="Humidity">
|
||||
<span>Content #2</span>
|
||||
</nga-tab>
|
||||
</nga-tabset>
|
||||
</nga-card>
|
||||
`,
|
||||
})
|
||||
export class TemperatureComponent {
|
||||
temperature = 0.5;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue