adding devices layout added

This commit is contained in:
Dawid Kubicki 2019-01-13 11:50:57 +01:00
parent 3aa2d784b5
commit ac24169069
7 changed files with 134 additions and 7 deletions

View File

@ -0,0 +1,25 @@
<div class="container">
<div class="row">
<h3>Dodawanie nowych urządzeń</h3>
<form class="admin-form">
<div class="input-wrapper">
<mat-form-field class="admin-full-width">
<input matInput #message maxlength="256" placeholder="Message" />
<mat-hint align="start"
><strong>Don't disclose personal info</strong>
</mat-hint>
<mat-hint align="end">{{ message.value.length }} / 256</mat-hint>
</mat-form-field>
</div>
<div class="input-wrapper">
<mat-form-field class="admin-full-width">
<input matInput #message maxlength="256" placeholder="Message" />
<mat-hint align="start"
><strong>Don't disclose personal info</strong>
</mat-hint>
<mat-hint align="end">{{ message.value.length }} / 256</mat-hint>
</mat-form-field>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,19 @@
.container {
.row {
margin-top: 40px;
.admin-form {
min-width: 150px;
max-width: 500px;
width: 100%;
margin-top: 50px;
.input-wrapper {
margin-bottom: 30px;
}
.admin-full-width {
width: 100%;
}
}
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AdminComponent } from './admin.component';
describe('AdminComponent', () => {
let component: AdminComponent;
let fixture: ComponentFixture<AdminComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdminComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AdminComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,19 @@
import { Component, OnInit } from "@angular/core";
import {
FormControl,
FormGroupDirective,
NgForm,
Validators
} from "@angular/forms";
import { ErrorStateMatcher } from "@angular/material/core";
@Component({
selector: "app-admin",
templateUrl: "./admin.component.html",
styleUrls: ["./admin.component.less"]
})
export class AdminComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@ -1,5 +1,6 @@
<div class="container"> <div class="container">
<router-outlet></router-outlet> <router-outlet></router-outlet>
<app-header></app-header> <app-header></app-header>
<app-status-list> </app-status-list> <!--<app-status-list> </app-status-list>-->
<app-admin></app-admin>
</div> </div>

View File

@ -9,17 +9,51 @@ import { StatusListComponent } from "./status-list/status-list.component";
import { HeaderComponent } from "./header/header.component"; import { HeaderComponent } from "./header/header.component";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { import {
MatAutocompleteModule,
MatButtonModule, MatButtonModule,
MatButtonToggleModule,
MatCardModule, MatCardModule,
MatMenuModule, MatCheckboxModule,
MatToolbarModule, MatChipsModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule, MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule, MatSidenavModule,
MatListModule MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatStepperModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatFormFieldModule,
MatFormFieldControl
} from "@angular/material"; } from "@angular/material";
import { AdminComponent } from "./admin/admin.component";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
@NgModule({ @NgModule({
declarations: [AppComponent, StatusListComponent, HeaderComponent], declarations: [
AppComponent,
StatusListComponent,
HeaderComponent,
AdminComponent
],
imports: [ imports: [
BrowserModule, BrowserModule,
AppRoutingModule, AppRoutingModule,
@ -33,7 +67,11 @@ import {
MatToolbarModule, MatToolbarModule,
MatIconModule, MatIconModule,
MatSidenavModule, MatSidenavModule,
MatListModule MatListModule,
FormsModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule
], ],
providers: [StatusService], providers: [StatusService],
bootstrap: [AppComponent] bootstrap: [AppComponent]

View File

@ -11,7 +11,7 @@
> >
{{ device.name }} {{ device.name }}
</button> </button>
{{ device.lastStatus == 1 ? "Zajęte" : "Wolne" }} <b>{{ device.lastStatus == 1 ? "Zajęte" : "Wolne" }}</b>
</div> </div>
</div> </div>
</div> </div>