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 Apr 17, 2019
1 parent 70c6563 commit 87983c6
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ import "./attrs_monitor_view.js";
import "./device_monitor_view.js";
import "./scripting_console.js";
import "./svg.js";
import "./terminal_view.js";

22 changes: 22 additions & 0 deletions resources/webix_widgets/terminal_view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
*
* @author Igor Khokhriakov <[email protected]>
* @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
Original file line number Diff line number Diff line change
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 87983c6

Please sign in to comment.