Skip to content

Commit

Permalink
Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvord authored and Ingvord committed Mar 27, 2019
1 parent c720abb commit 50a5733
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
14 changes: 14 additions & 0 deletions controllers/platform/ui/ui_controller.js
Expand Up @@ -74,6 +74,20 @@ TangoWebappPlatform.UIController = class extends MVC.Controller {

return $$('scripting_console');
}
/**
* Opens terminal tab
*
*/
openTerminalTab() {
if($$('terminal') === undefined){
$$("main-tabview").addView(
TangoWebapp.ui.newTerminalViewTab()
);
}
$$('terminal').show();

return $$('terminal');
}
/**
*
* @param {TangoHost} tango_host
Expand Down
1 change: 1 addition & 0 deletions resources/constants.js
Expand Up @@ -18,6 +18,7 @@ TangoWebappPlatform.consts = {
TANGO_PORT: /*@*/TANGO_PORT/*@*/,
VERSION:/*@*/VERSION/*@*/,
USER_CONTEXT_URL:/*@*/USER_CONTEXT_URL/*@*/,
TERMINAL_URL:/*@*/TERMINAL_URL/*@*/,
NAME_COLUMN_WIDTH: 250,
TABS_DELIMITER_HEIGHT: 3,
DATABASE: 'sys/database/2',
Expand Down
3 changes: 2 additions & 1 deletion resources/platform/defaults.js
Expand Up @@ -5,4 +5,5 @@ REST_API_VERSION = "rc4";
TANGO_HOST = "localhost";
TANGO_PORT = 10000;
VERSION = "development";
USER_CONTEXT_URL = MVC.mvc_root + "/../apps/platform/user_context.jsp";
USER_CONTEXT_URL = MVC.mvc_root + "/../apps/platform/user_context.jsp";
TERMINAL_URL = 'http://ec2-35-156-104-8.eu-central-1.compute.amazonaws.com:8010/index.html';
1 change: 1 addition & 0 deletions resources/webix_widgets/import.js
Expand Up @@ -21,4 +21,5 @@ import "./attrs_monitor_toolbar.js"
import "./attrs_monitor_view.js";
import "./device_monitor_view.js";
import "./scripting_console.js";
import "./terminal_view.js";

22 changes: 22 additions & 0 deletions resources/webix_widgets/terminal_view.js
@@ -0,0 +1,22 @@
/**
*
* @author Igor Khokhriakov <igor.khokhriakov@hzg.de>
* @since 5/1/18
*/
(function(){
TangoWebapp.ui.newTerminalView = function(config){
return webix.extend({
view: 'iframe',
src: TangoWebappPlatform.consts.TERMINAL_URL
}, config)
};

TangoWebapp.ui.newTerminalViewTab = function(){
return {
header: "<span class='webix_icon fa-terminal'></span> Terminal",
close: true,
borderless: true,
body: TangoWebapp.ui.newTerminalView({id: 'terminal'})
}
}
})();
5 changes: 2 additions & 3 deletions resources/webix_widgets/toolbar.js
Expand Up @@ -37,8 +37,7 @@
view: "list",
data: [
{id: "toolsScripting", value: "Scripting"},
//TODO uncomment after terminal has been merged
// {id: "toolsTerminal", value: "Terminal"}
{id: "toolsTerminal", value: "Terminal"}
],
autoheight: true,
borderless: true,
Expand All @@ -48,7 +47,7 @@
PlatformApi.PlatformUIController().openScriptingTab();
}
if (id === "toolsTerminal") {
webix.message("Submenu click: " + id);
PlatformApi.PlatformUIController().openTerminalTab();
}
$$("toolsMenu").hide();
}
Expand Down

0 comments on commit 50a5733

Please sign in to comment.