Init console settings

This commit is contained in:
ziajka 2019-03-05 15:12:47 +01:00
parent 0c2fff6ac1
commit 267c88032f
8 changed files with 96 additions and 1 deletions

View File

@ -51,6 +51,7 @@ import { CopyIosTemplateComponent } from './components/preferences/dynamips/copy
import { CopyDockerTemplateComponent } from './components/preferences/docker/copy-docker-template/copy-docker-template.component';
import { CopyIouTemplateComponent } from './components/preferences/ios-on-unix/copy-iou-template/copy-iou-template.component';
import { ListOfSnapshotsComponent } from './components/snapshots/list-of-snapshots/list-of-snapshots.component';
import { ConsoleComponent } from './components/settings/console/console.component';
const routes: Routes = [
{
@ -62,6 +63,7 @@ const routes: Routes = [
{ path: 'local', component: LocalServerComponent },
{ path: 'server/:server_id/projects', component: ProjectsComponent },
{ path: 'settings', component: SettingsComponent },
{ path: 'settings/console', component: ConsoleComponent },
{ path: 'installed-software', component: InstalledSoftwareComponent },
{ path: 'server/:server_id/project/:project_id/snapshots', component: ListOfSnapshotsComponent },
{ path: 'server/:server_id/preferences', component: PreferencesComponent },

View File

@ -169,6 +169,7 @@ import { DateFilter } from './filters/dateFilter.pipe';
import { NameFilter } from './filters/nameFilter.pipe';
import { CustomAdaptersComponent } from './components/preferences/common/custom-adapters/custom-adapters.component';
import { ConsoleDeviceActionComponent } from './components/project-map/context-menu/actions/console-device-action/console-device-action.component';
import { ConsoleComponent } from './components/settings/console/console.component';
if (environment.production) {
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
@ -275,7 +276,8 @@ if (environment.production) {
NameFilter,
ListOfSnapshotsComponent,
CustomAdaptersComponent,
ConsoleDeviceActionComponent
ConsoleDeviceActionComponent,
ConsoleComponent
],
imports: [
BrowserModule,

View File

@ -0,0 +1,26 @@
<div class="content">
<div class="default-header">
<div class="row">
<h1 class="col">Console settings</h1>
</div>
</div>
<div class="default-content">
<mat-card>
<form [formGroup]="consoleForm">
<mat-form-field class="form-field">
<input
matInput type="text"
formControlName="runner"
placeholder="Predefined command">
</mat-form-field>
<mat-form-field class="form-field">
<textarea matInput formControlName="command" placeholder="Command"></textarea>
</mat-form-field>
</form>
</mat-card>
<div class="buttons-bar">
<button class="cancel-button" (click)="goBack()" mat-button>Cancel</button>
<button mat-raised-button color="primary" (click)="onSave()">Save</button><br/>
</div>
</div>
</div>

View File

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

View File

@ -0,0 +1,21 @@
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
@Component({
selector: 'app-console',
templateUrl: './console.component.html',
styleUrls: ['./console.component.scss']
})
export class ConsoleComponent implements OnInit {
consoleForm = new FormGroup({
'runner': new FormControl('', [ Validators.required ]),
'command': new FormControl(''),
});
constructor() { }
ngOnInit() {
}
}

View File

@ -27,6 +27,21 @@
>
</div>
</mat-expansion-panel>
<mat-expansion-panel [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title> Console settings </mat-panel-title>
<mat-panel-description> Customize console settings </mat-panel-description>
</mat-expansion-panel-header>
<div>
<mat-form-field class="example-full-width">
<input matInput placeholder="console">
<a mat-icon-button matSuffix routerLink="/settings/console"><mat-icon>mode_edit</mat-icon></a>
</mat-form-field>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>

View File

@ -0,0 +1,4 @@
.example-full-width {
width: 100%;
}