diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index d08e84e..b8d5a95 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from './dashboard/dashboard.component';
-import { WebideComponent } from './webide/webide.component';
+import { IdeComponent } from './ide/ide.component';
import { TerminalComponent } from './terminal/terminal.component';
import { MessagesComponent } from './messages/messages.component';
import { TestmessengerComponent } from './testmessenger/testmessenger.component';
@@ -11,7 +11,7 @@ import { config } from './config';
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full'},
{ path: config.dashboard.route, component: DashboardComponent},
- { path: config.webide.route, component: WebideComponent },
+ { path: config.ide.route, component: IdeComponent },
{ path: config.terminal.route, component: TerminalComponent },
{ path: config.messages.route, component: MessagesComponent },
{ path: config.testmessenger.route, component: TestmessengerComponent }
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index f250712..d829e55 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -9,10 +9,11 @@ import { AceEditorModule } from 'ng2-ace-editor';
import { AppComponent } from './app.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { HeaderComponent } from './header/header.component';
+import { SidebarComponent } from './sidebar/sidebar.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';
+import { IdeComponent } from './ide/ide.component';
import { MessagesComponent } from './messages/messages.component';
import { WebSocketService } from './services/websocket.service';
import { TerminalComponent } from './terminal/terminal.component';
@@ -27,8 +28,9 @@ import { DeploymentNotificationService } from './services/deployment-notificatio
declarations: [
AppComponent,
HeaderComponent,
+ SidebarComponent,
LoginComponent,
- WebideComponent,
+ IdeComponent,
MessagesComponent,
TerminalComponent,
DashboardComponent,
diff --git a/src/app/config.ts b/src/app/config.ts
index c6f135d..44b3ab7 100644
--- a/src/app/config.ts
+++ b/src/app/config.ts
@@ -1,24 +1,45 @@
export const config = {
dashboard: {
- 'route': 'dashboard',
- 'defaultLayout': 'vraw-open'
+ route: 'dashboard',
+ currentLayout: 'terminal-ide-web',
+ enabledLayouts: [
+ 'terminal-ide-web',
+ 'terminal-ide-vertical',
+ 'terminal-ide-horizontal',
+ 'terminal-only',
+ 'terminal-web',
+ 'ide-web-vertical',
+ 'ide-only',
+ 'web-only'
+ ],
+ allLayouts: [
+ 'terminal-ide-web',
+ 'terminal-ide-vertical',
+ 'terminal-ide-horizontal',
+ 'terminal-only',
+ 'terminal-web',
+ 'ide-web-vertical',
+ 'ide-only',
+ 'web-only'
+ ],
+ hide_messages: false
},
- webide: {
- 'route': 'webide',
- 'autoSaveInterval': 444,
- 'defaultCode': 'Loading your file...',
- 'defaultLanguage': 'text',
- 'deployProcessName': 'login',
- 'showDeployButton': true
+ ide: {
+ route: 'ide',
+ autoSaveInterval: 444,
+ defaultCode: 'Loading your file...',
+ defaultLanguage: 'text',
+ deployProcessName: 'login',
+ showDeployButton: true
},
terminal: {
- 'route': 'shell'
+ route: 'shell'
},
messages: {
- 'route': 'messages',
- 'showNextButton': false
+ route: 'messages',
+ showNextButton: true
},
testmessenger: {
- 'route': 'testmessenger'
+ route: 'testmessenger'
}
};
diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html
index b8c292c..677463a 100755
--- a/src/app/dashboard/dashboard.component.html
+++ b/src/app/dashboard/dashboard.component.html
@@ -1,17 +1,25 @@
-
-
-
-
-
-
+
diff --git a/src/app/dashboard/dashboard.component.scss b/src/app/dashboard/dashboard.component.scss
index e166d97..4fe625c 100755
--- a/src/app/dashboard/dashboard.component.scss
+++ b/src/app/dashboard/dashboard.component.scss
@@ -1,6 +1,23 @@
@import "../../assets/scss/variables.scss";
@import "../../assets/scss/mixins/layout.scss";
+@mixin set-tfw-web($layouts-key) {
+
+ .tfw-web {
+ .iframe-container {
+ display: flex;
+ overflow: hidden;
+ @include set-component-size($layouts-key, 'web');
+ }
+
+ .iframe {
+ flex-grow: 1;
+ border: none;
+ margin: 0;
+ padding: $small;
+ }
+ }
+}
.tfw-grid-main-components {
display: grid;
@@ -11,11 +28,11 @@
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-header,
.tfw-messages {
- @if ($layout-template == 'default') {
+
+ // Check whether the layout contains a web component
+ div[class*="web"] & {
border: 2px solid $tao-gray-100;
border-top: 0;
border-left: 0;
@@ -33,42 +50,35 @@
padding-top: $hair;
background-color: $tao-gray-50;
overflow-y: scroll;
+ max-height: 95vmin;
- @if ($layout-template != 'default') {
- max-height: 95vmin;
- }
- @else {
+ div[class="terminal-ide-web"] & {
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-ide {
+ background-color: $tao-plum-900;
}
- .tfw-webide {
- background-color: $tao-plum-900;
+ .tfw-sidebar {
+ background-color: $tao-gray-100;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding-top: 75px;
+ align-items: center;
+ box-shadow: -15px -5px 19px -11px rgba(0,0,0,0.75);
+ z-index: 999;
+
}
.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;
+ div[class*="web"] & {
+ border-top: 1px solid $tao-plum-100;
}
}
}
@@ -77,3 +87,38 @@
filter: blur(3px);
}
+.terminal-ide-web {
+ @include set-tfw-web('terminal-ide-web');
+ @include position-grid-items(map_get($layouts, 'terminal-ide-web'),'.tfw-');
+}
+
+.terminal-web {
+ @include set-tfw-web('terminal-web');
+ @include position-grid-items(map_get($layouts,'terminal-web'),'.tfw-');
+}
+
+.terminal-ide-vertical {
+ @include position-grid-items(map_get($layouts,'terminal-ide-vertical'),'.tfw-');
+}
+
+.terminal-ide-horizontal {
+ @include position-grid-items(map_get($layouts,'terminal-ide-horizontal'),'.tfw-');
+}
+
+.ide-web-vertical {
+ @include set-tfw-web('ide-web-vertical');
+ @include position-grid-items(map_get($layouts,'ide-web-vertical'),'.tfw-');
+}
+
+.terminal-only {
+ @include position-grid-items(map_get($layouts,'terminal-only'),'.tfw-');
+}
+
+.ide-only {
+ @include position-grid-items(map_get($layouts,'ide-only'),'.tfw-');
+}
+
+.web-only {
+ @include set-tfw-web('web-only');
+ @include position-grid-items(map_get($layouts,'web-only'),'.tfw-');
+}
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts
index ea2f7b5..716d6a9 100644
--- a/src/app/dashboard/dashboard.component.ts
+++ b/src/app/dashboard/dashboard.component.ts
@@ -4,6 +4,7 @@ import { Subscription } from 'rxjs/Subscription';
import { WebSocketService } from '../services/websocket.service';
import { LayoutCommand } from './layout-command';
import { config } from '../config';
+import { SidebarComponent } from '../sidebar/sidebar.component';
@Component({
selector: 'app-dashboard',
@@ -13,8 +14,10 @@ import { config } from '../config';
export class DashboardComponent implements OnInit, OnDestroy {
deploying = false;
deploymentNotificationSubscription: Subscription;
- layout: string = config.dashboard.defaultLayout;
- command_handlers = {'layout': this.layoutHandler.bind(this)};
+ layout: string = config.dashboard.currentLayout;
+ hide_messages: boolean = config.dashboard.hide_messages;
+ command_handlers = {'layout': this.layoutHandler.bind(this),
+ 'reload_frontend': this.reloadFrontendHandlder.bind(this)};
constructor(private deploymentNotificationService: DeploymentNotificationService,
private webSocketService: WebSocketService,
@@ -32,11 +35,25 @@ export class DashboardComponent implements OnInit, OnDestroy {
}
layoutHandler(data: LayoutCommand) {
- if (data.layout.match('vraw-open|vraw-closed|hraw|default-open|default-closed')) {
- this.layout = data.layout;
+ if (config.dashboard.enabledLayouts.includes(data.layout)) {
+ this.setLayout(data.layout);
} else {
- console.log('Invalid webide layout "' + data.layout + '" received!');
+ console.log('Invalid ide layout "' + data.layout + '" received!');
}
+ if (data.hide_messages != undefined) {
+ this.hide_messages = data.hide_messages;
+ }
+ }
+
+ reloadFrontendHandlder(data: LayoutCommand) {
+ setTimeout(() => window.location.reload(), 2000);
+ }
+
+ setLayout(layout: string) {
+ this.layout = layout;
+ // We need to trigger a 'resize' event manually, otherwise ace editor stays collapsed
+ // Ace editors 'resize' event listener requires a parameter of force=true
+ setTimeout(() => window.dispatchEvent(new Event('resize', {force: true} as any)), 0);
}
ngOnDestroy() {
diff --git a/src/app/dashboard/layout-command.ts b/src/app/dashboard/layout-command.ts
index 3d58db2..87aa41e 100644
--- a/src/app/dashboard/layout-command.ts
+++ b/src/app/dashboard/layout-command.ts
@@ -1,4 +1,5 @@
export class LayoutCommand {
command: string;
layout: string;
+ hide_messages?: boolean;
}
diff --git a/src/app/webide/webide.component.html b/src/app/ide/ide.component.html
similarity index 97%
rename from src/app/webide/webide.component.html
rename to src/app/ide/ide.component.html
index 937d2c1..c4e0e15 100644
--- a/src/app/webide/webide.component.html
+++ b/src/app/ide/ide.component.html
@@ -1,4 +1,4 @@
-
+