diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 19d3923..f250712 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -9,7 +9,7 @@ import { AceEditorModule } from 'ng2-ace-editor'; import { AppComponent } from './app.component'; import { DashboardComponent } from './dashboard/dashboard.component'; import { HeaderComponent } from './header/header.component'; -import { LoginComponent } from './login/login.component'; +import { LoginComponent } from './web/web.component'; import { MarkdownService } from './services/markdown.service'; import { TerminadoService } from './services/terminado.service'; import { WebideComponent } from './webide/webide.component'; @@ -20,6 +20,7 @@ import { FSMUpdateService } from './services/fsmupdate.service'; import { ProcessManagerService } from './services/processmanager.service'; import { AppRoutingModule } from './app-routing.module'; import { TestmessengerComponent } from './testmessenger/testmessenger.component'; +import { DeploymentNotificationService } from './services/deployment-notification.service'; @NgModule({ @@ -46,7 +47,8 @@ import { TestmessengerComponent } from './testmessenger/testmessenger.component' WebSocketService, TerminadoService, FSMUpdateService, - ProcessManagerService + ProcessManagerService, + DeploymentNotificationService ], bootstrap: [ AppComponent diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 8522578..b8c292c 100755 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -1,7 +1,17 @@ -
+
-
+
+
+ +
+
-
+
+ +
+
diff --git a/src/app/dashboard/dashboard.component.scss b/src/app/dashboard/dashboard.component.scss index 54934be..e166d97 100755 --- a/src/app/dashboard/dashboard.component.scss +++ b/src/app/dashboard/dashboard.component.scss @@ -1,72 +1,60 @@ -$space: 24px; +@import "../../assets/scss/variables.scss"; +@import "../../assets/scss/mixins/layout.scss"; -$tao-plum-900: #272F4C; -$tao-gray-50: #FAFAFA; - -$tao-navbar-height: 67px; - -$layout-template: "default"; // Change this to switch template - -$default-layout: ( - 'messages': (1, 2, 1, 4), - 'webide': (4, -1, 1, -1), - 'terminal': (1, 4, 4, -1), - 'web': (2, 4, 1, 4) -); - -$raw-layout: ( - 'messages': (1, 2, 1, -1), - 'webide': (4, -1, 1, -1), - 'terminal': (2, 4, 1, -1), - 'web': (), -); - -$layout: ( - "default": $default-layout, - "raw": $raw-layout -); - -@mixin position-grid-items($map, $sel) { - $sel: if($sel == '' and &, &, $sel); - @debug $sel; - - #{$sel} { - @each $k, $v in $map { - @at-root #{$sel}#{$k} { - @if (length($v) == 0) { - display: none - } - @else { - grid-column-start: nth($v, 1); - grid-column-end: nth($v, 2); - grid-row-start: nth($v, 3); - grid-row-end: nth($v, 4); - } - } - } - } -} .tfw-grid-main-components { - overflow-y: hidden; display: grid; - padding-top: $tao-navbar-height; width: 100vw; height: 100vh; justify-content: center; align-content: center; - grid-template-columns: repeat(5, 1fr); - grid-template-rows: repeat(5, 1fr); + grid-template-columns: repeat($grid-columns-count, 1fr); + grid-template-rows: repeat($grid-rows-count, 1fr); @include position-grid-items(map_get($layout,$layout-template),'.tfw-'); - .tfw-web { - padding: $space; + .tfw-header, + .tfw-messages { + @if ($layout-template == 'default') { + border: 2px solid $tao-gray-100; + border-top: 0; + border-left: 0; + border-bottom: 0; + } + } + + .tfw-header { + padding: $small; + background-color: $tao-gray-50; } .tfw-messages { padding: $space; + padding-top: $hair; background-color: $tao-gray-50; + overflow-y: scroll; + + @if ($layout-template != 'default') { + max-height: 95vmin; + } + @else { + max-height: 55vmin; + } + } + + .tfw-web { + .iframe-container { + display: flex; + overflow: hidden; + @include set-component-size('web'); + } + + .iframe { + flex-grow: 1; + border: none; + margin: 0; + padding: $small; + } } .tfw-webide { @@ -74,6 +62,18 @@ $layout: ( } .tfw-terminal { - } + overflow-y: hidden; + border: 1px solid $tao-plum-100; + border-bottom: 0; + background-color: $tao-gray-800; + @if ($layout-template != 'vraw') { + border-left: 0; + } + } } + +.deploy-blur { + filter: blur(3px); +} + diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index c6740c4..5ae03b9 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -1,10 +1,28 @@ -import { Component } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { DeploymentNotificationService } from '../services/deployment-notification.service'; +import { Subscription } from 'rxjs/Subscription'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.scss'] }) -export class DashboardComponent { - constructor() {} +export class DashboardComponent implements OnInit, OnDestroy { + + deploying = false; + deploymentNotificationSubscription: Subscription; + + constructor(private deploymentNotificationService: DeploymentNotificationService) {} + + ngOnInit() { + this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe( + (deploying) => this.deploying = deploying + ); + } + + ngOnDestroy() { + if (this.deploymentNotificationSubscription) { + this.deploymentNotificationSubscription.unsubscribe(); + } + } } diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index 51cec9c..069490e 100755 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -1,11 +1,4 @@ - +
+ + Tutorials +
diff --git a/src/app/header/header.component.scss b/src/app/header/header.component.scss index 81d80bb..675dad1 100755 --- a/src/app/header/header.component.scss +++ b/src/app/header/header.component.scss @@ -1,24 +1,10 @@ -$tao-blue-500: #277EEC; -$font-size-base: 14px; -$font-size-h3: floor(($font-size-base * 1.3)); - -$tao-navbar-height: 67px; - -$company-logo-width: 130px; +@import "../../assets/scss/variables.scss"; .tfw-header-title { color: $tao-blue-500; font-size: $font-size-h3; } -.tfw-navbar { - background-color: rgba(255, 255, 255, 0.96); - min-height: $tao-navbar-height; - box-shadow: 0px 1px 6px 0px #888; - margin-bottom: 12px; - border: 1px solid #e7e7e7; -} - .tfw-grid-navbar { display: grid; grid-template-columns: $company-logo-width 1fr; @@ -31,29 +17,3 @@ $company-logo-width: 130px; width: $company-logo-width; } -.tfw-company-logo-mobile { - display: none; - width: 130px; -} - -@media (max-width: 767px) { - .tfw-grid-navbar { - grid-template-columns: 1fr; - } - - .tfw-company-logo { - display: none; - } - - .tfw-company-logo-mobile { - display: block; - } - - .tfw-navbar-links { - justify-self: left !important; - } -} - -.jumbotron { - padding: 2vh; -} diff --git a/src/app/messages/messages.component.html b/src/app/messages/messages.component.html index 0be46f1..893907b 100755 --- a/src/app/messages/messages.component.html +++ b/src/app/messages/messages.component.html @@ -1,5 +1,8 @@
-
Instructions
+
+
Instructions
+
+
@@ -9,3 +12,4 @@
+ diff --git a/src/app/messages/messages.component.scss b/src/app/messages/messages.component.scss index 90c889f..2a3aedd 100755 --- a/src/app/messages/messages.component.scss +++ b/src/app/messages/messages.component.scss @@ -1,28 +1,21 @@ -$space: 24px; - -$small: 0.75 * $space; -$tiny: 0.5 * $space; -$hair: 0.25 * $space; - - -$tao-blue-500: #277EEC; -$tao-gray-100: #F2F2F2; - -$tao-panel-border-radius-sm: 8px; - -$font-size-tiny: 12px; -$font-size-base: 14px; - +@import "../../assets/scss/variables.scss"; .tfw-messages-main { - max-height: 50vmin; - overflow-y: scroll; - h5 { + + .tfw-grid-messages-header { + display: grid; + grid-template-columns: 1fr 1fr; margin-bottom: $small; - color: $tao-blue-500; - font-weight: 500; + + + span { + color: $tao-blue-500; + font-weight: 500; + font-size: $font-size-h3; + } } + } .tfw-grid-message { diff --git a/src/app/services/deployment-notification.service.ts b/src/app/services/deployment-notification.service.ts new file mode 100644 index 0000000..3403634 --- /dev/null +++ b/src/app/services/deployment-notification.service.ts @@ -0,0 +1,11 @@ +import { Injectable } from '@angular/core'; +import { Subject } from 'rxjs/Subject'; + +@Injectable() +export class DeploymentNotificationService { + + deploying: Subject = new Subject(); + + constructor() { } + +} diff --git a/src/app/services/terminado.service.ts b/src/app/services/terminado.service.ts index c197ef0..ed65e34 100644 --- a/src/app/services/terminado.service.ts +++ b/src/app/services/terminado.service.ts @@ -11,7 +11,32 @@ export class TerminadoService { constructor() { Terminal.applyAddon(fit); Terminal.applyAddon(terminado); - this.xterm = new Terminal(); + this.xterm = new Terminal({ + theme: { + foreground: '#ffffff', + background: '#0C0C0C', // $tao-gray-800 + cursor: '#ffffff', + selection: 'rgba(255, 255, 255, 0.3)', + black: '#000000', + red: '#FF5252', // $tao-red-500 + brightRed: '#FF7171', // $tao-red-400 + green: '#2fd19f', // $tao-bright-green-500 + brightGreen: '#2fd19f', // $tao-bright-green-500 + brightYellow: '#FFD283', // $tao-warm-yellow-300 + yellow: '#FFB83B', // $tao-warm-yellow-500 + magenta: '#FF8FC6', // $tao-pink-200 + brightMagenta: '#FF8FC6', // $tao-pink-200 + cyan: '#277EEC', // $tao-blue-500 + blue: '#277EEC', // $tao-blue-500 + brightCyan: '#42B7DF', // $tao-sky-400 + brightBlue: '#19A7D8', // $tao-sky-500 + white: '#FAFAFA', // $tao-gray-50 + brightBlack: '#808080', + brightWhite: '#ffffff' + }, + fontSize: 14 + }); + const wsproto = (location.protocol === 'https:') ? 'wss://' : 'ws://'; this.ws = new WebSocket(wsproto + window.location.host + '/terminal'); } diff --git a/src/app/terminal/terminal.component.html b/src/app/terminal/terminal.component.html index 8788452..26e795b 100644 --- a/src/app/terminal/terminal.component.html +++ b/src/app/terminal/terminal.component.html @@ -1 +1 @@ -
+
diff --git a/src/app/terminal/terminal.component.scss b/src/app/terminal/terminal.component.scss index e69de29..43d03af 100644 --- a/src/app/terminal/terminal.component.scss +++ b/src/app/terminal/terminal.component.scss @@ -0,0 +1,14 @@ +@import "../../assets/scss/mixins/layout.scss"; +@import "../../app/dashboard/dashboard.component.scss"; + + + + +.tfw-xterm { + max-height: 100%; + height: 100%; + min-height: 100%; +} + + + diff --git a/src/app/login/login.component.html b/src/app/web/web.component.html similarity index 87% rename from src/app/login/login.component.html rename to src/app/web/web.component.html index 3bf09e8..c85a8c4 100644 --- a/src/app/login/login.component.html +++ b/src/app/web/web.component.html @@ -1,3 +1,4 @@ + +
- diff --git a/src/app/login/login.component.scss b/src/app/web/web.component.scss similarity index 100% rename from src/app/login/login.component.scss rename to src/app/web/web.component.scss diff --git a/src/app/login/login.component.ts b/src/app/web/web.component.ts similarity index 55% rename from src/app/login/login.component.ts rename to src/app/web/web.component.ts index cb75932..dd136b0 100644 --- a/src/app/login/login.component.ts +++ b/src/app/web/web.component.ts @@ -1,21 +1,25 @@ import { HttpClient } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { Observable } from 'rxjs/Observable'; -import { Login } from './login'; +import { Login } from './web'; +import { DeploymentNotificationService } from '../services/deployment-notification.service'; +import { Subscription } from 'rxjs/Subscription'; @Component({ - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.scss'] + selector: 'app-web', + templateUrl: './web.component.html', + styleUrls: ['./web.component.scss'] }) -export class LoginComponent implements OnInit { +export class LoginComponent { model = new Login('', ''); submitted = false; is_admin: boolean; logged_in_email: string; + constructor( private http: HttpClient ) {} + onSubmit() { this.postLogin(this.model).subscribe( res => { @@ -27,8 +31,6 @@ export class LoginComponent implements OnInit { } postLogin(login: Login): Observable { - return this.http.post('/login', login); + return this.http.post('/web', login); } - - ngOnInit() {} } diff --git a/src/app/login/login.ts b/src/app/web/web.ts similarity index 100% rename from src/app/login/login.ts rename to src/app/web/web.ts diff --git a/src/app/webide/webide.component.html b/src/app/webide/webide.component.html index 6bbb1b3..69547d9 100644 --- a/src/app/webide/webide.component.html +++ b/src/app/webide/webide.component.html @@ -1,4 +1,4 @@ -
+