Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified UI #421

Open
nerodark opened this issue Apr 2, 2014 · 3 comments
Open

Simplified UI #421

nerodark opened this issue Apr 2, 2014 · 3 comments

Comments

@nerodark
Copy link

nerodark commented Apr 2, 2014

is it possible in a near future, via a configurable option, to have a mode where it only loads 1 shell (like in shellinabox) without all the toolbars and buttons?

@liftoff
Copy link
Owner

liftoff commented Apr 9, 2014

You can already do this! Just set your "js_init" setting in 10server.conf like this:

"js_init": "{showToolbar: false, showTitle: false}",

That will completely disable Gate One's toolbar and hide the side title bar but the keyboard shortcuts to open new terminals will still work. To prevent that (enforce only one terminal at a time) you can add this to your 50terminal.conf:

"max_terms": 1,

Then if a user tries a keystroke like Ctrl-Alt-N they'll get a message saying they're only allowed to open one terminal.

NOTE: You can have per-user "max_terms" settings if you want too.

@nerodark
Copy link
Author

is it possible to auto-open a default app with an existing config (ex. the default app named "SSH") ?

@liftoff
Copy link
Owner

liftoff commented Apr 12, 2014

Sure, there's two (easy) ways:

  1. Just set the end of your Gate One server's URL to "?terminal_cmd=your_command" and it will automatically open when the page is loaded. Full example:
https://your-gateone-server/?terminal_cmd=nethack

That would run the command defined in your 50terminal.conf as 'nethack'. Pretty straightforward.

  1. Auto-open a terminal with a specific command with some very simple JavaScript:
GateOne.Events.on("go:js_loaded", function() {
    if (GateOne.Terminal.terminals.length) { return; }
    GateOne.Terminal.newTerminal(null, {'command': 'nethack'});
});

Put that in a file named 'run_command.js' (or whatever-you-want.js) and drop it in /path/to/gateone/static/extra/. Once there you can reload Gate One and it should automatically be minified, sent to your browser (and permanently cached there until you make a change to the file), and called when the page is loaded. The "go:js_loaded" event may fire multiple times (if things go slow) hence the check for existing terminals.

For reference, there's also lots of really sophisticated ways you could do the same thing but why bother with that stuff when I made a mechanism (the 'extra' directory) just for simple stuff like that 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants