mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:41:56 +00:00
Extract demo page to 'dashboard' component
This commit is contained in:
parent
3178fcc7e6
commit
80de695fa1
@ -1,11 +1 @@
|
|||||||
<app-header></app-header>
|
<router-outlet></router-outlet>
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row tfw-first-row">
|
|
||||||
<div class="col-sm"><app-login></app-login></div>
|
|
||||||
<div class="col-sm-6"><app-webide></app-webide></div>
|
|
||||||
<div class="col-sm"><app-messages></app-messages></div>
|
|
||||||
</div>
|
|
||||||
<div class="row tfw-second-row">
|
|
||||||
<div class="col-sm"><app-terminal></app-terminal></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
.tfw-first-row {
|
|
||||||
height: 40vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tfw-second-row {}
|
|
@ -1,6 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { WebSocketService } from './websocket.service';
|
|
||||||
import { FSMUpdateService } from './fsmupdate.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@ -8,11 +6,6 @@ import { FSMUpdateService } from './fsmupdate.service';
|
|||||||
styleUrls: ['./app.component.scss']
|
styleUrls: ['./app.component.scss']
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent implements OnInit {
|
||||||
constructor(private webSocketService: WebSocketService, private fsmUpdateService: FSMUpdateService) {}
|
constructor() {}
|
||||||
|
ngOnInit() {}
|
||||||
ngOnInit() {
|
|
||||||
this.webSocketService.connect();
|
|
||||||
this.webSocketService.send('reset', '');
|
|
||||||
this.fsmUpdateService.init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import { AceEditorModule } from 'ng2-ace-editor';
|
|||||||
|
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
import { DashboardComponent } from './dashboard/dashboard.component';
|
||||||
import { HeaderComponent } from './header/header.component';
|
import { HeaderComponent } from './header/header.component';
|
||||||
import { LoginComponent } from './login/login.component';
|
import { LoginComponent } from './login/login.component';
|
||||||
import { MarkdownService } from './markdown.service';
|
import { MarkdownService } from './markdown.service';
|
||||||
@ -16,6 +17,7 @@ import { MessagesComponent } from './messages/messages.component';
|
|||||||
import { WebSocketService } from './websocket.service';
|
import { WebSocketService } from './websocket.service';
|
||||||
import { TerminalComponent } from './terminal/terminal.component';
|
import { TerminalComponent } from './terminal/terminal.component';
|
||||||
import { FSMUpdateService } from './fsmupdate.service';
|
import { FSMUpdateService } from './fsmupdate.service';
|
||||||
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@ -25,7 +27,8 @@ import { FSMUpdateService } from './fsmupdate.service';
|
|||||||
LoginComponent,
|
LoginComponent,
|
||||||
WebideComponent,
|
WebideComponent,
|
||||||
MessagesComponent,
|
MessagesComponent,
|
||||||
TerminalComponent
|
TerminalComponent,
|
||||||
|
DashboardComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
@ -33,6 +36,7 @@ import { FSMUpdateService } from './fsmupdate.service';
|
|||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
NgbModule.forRoot(),
|
NgbModule.forRoot(),
|
||||||
AceEditorModule,
|
AceEditorModule,
|
||||||
|
AppRoutingModule,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
MarkdownService,
|
MarkdownService,
|
||||||
|
11
src/app/dashboard/dashboard.component.html
Normal file
11
src/app/dashboard/dashboard.component.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<app-header></app-header>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row tfw-first-row">
|
||||||
|
<div class="col-sm"><app-login></app-login></div>
|
||||||
|
<div class="col-sm-6"><app-webide></app-webide></div>
|
||||||
|
<div class="col-sm"><app-messages></app-messages></div>
|
||||||
|
</div>
|
||||||
|
<div class="row tfw-second-row">
|
||||||
|
<div class="col-sm"><app-terminal></app-terminal></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
5
src/app/dashboard/dashboard.component.scss
Normal file
5
src/app/dashboard/dashboard.component.scss
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.tfw-first-row {
|
||||||
|
height: 40vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tfw-second-row {}
|
18
src/app/dashboard/dashboard.component.ts
Normal file
18
src/app/dashboard/dashboard.component.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { WebSocketService } from '../websocket.service';
|
||||||
|
import { FSMUpdateService } from '../fsmupdate.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dashboard',
|
||||||
|
templateUrl: './dashboard.component.html',
|
||||||
|
styleUrls: ['./dashboard.component.scss']
|
||||||
|
})
|
||||||
|
export class DashboardComponent implements OnInit {
|
||||||
|
constructor(private webSocketService: WebSocketService, private fsmUpdateService: FSMUpdateService) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.webSocketService.connect();
|
||||||
|
this.webSocketService.send('reset', '');
|
||||||
|
this.fsmUpdateService.init();
|
||||||
|
}
|
||||||
|
}
|
@ -41,6 +41,8 @@ export class WebideComponent implements OnInit {
|
|||||||
private changeDetectorRef: ChangeDetectorRef) { }
|
private changeDetectorRef: ChangeDetectorRef) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.webSocketService.connect();
|
||||||
|
this.webSocketService.send('reset', '');
|
||||||
this.subscribeWS();
|
this.subscribeWS();
|
||||||
this.requestCode();
|
this.requestCode();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user