openshift-homeroom / workshop-dashboard

Adds content hosting to workshop terminals.
Apache License 2.0
47 stars 37 forks source link

Add feature to disable terminal tab. #50

Open jkupferer opened 4 years ago

jkupferer commented 4 years ago

This commit adds the ability to set TERMINAL_TAB=disable in order to disable the terminal tab for workshops that do not require it.

resolves #49

GrahamDumpleton commented 4 years ago

Variable corresponding to ENABLE_TERMINAL should be passed through and changes to UI should be based off that rather than TERMINAL_TAB. Changing TERMINAL_TAB wouldn't actually disable the terminal access and it could still be accessed if using the correct URL. So better to trigger of ENABLE_TERMINAL instead.

GrahamDumpleton commented 4 years ago

More changes would be needed than that also. The problem is that the terminal tab is the initially selected tab. If none of the tabs have the selected attribute you end up with a blank pane as bootstrap doesn't know which to show. So you need to somehow work out which would be the first tab and mark it as selected instead.

GrahamDumpleton commented 4 years ago

The alternative is that setting of ENABLE_TERMINAL to anything but true results in TERMINAL_TAB then being set which triggers UI changed. Thus have option of still having terminal active but no UI shown, as could set separately. Either way need to resolve issue with working out which tab to mark as enabled so bootstrap is happy.

GrahamDumpleton commented 4 years ago

Should still perhaps pass ENABLE_TERMINAL through as variable into page template as when the tab is disabled, you can still have "Open Terminal" menu item if know underlying terminal is not disabled.

jkupferer commented 4 years ago

Thanks for the quick response. I changed it to set terminal_tab based on the value of ENABLE_TERMINAL, but I'm not sure how to resolve the bootstrap issues.

GrahamDumpleton commented 4 years ago

Out of curiosity, what is the workshop you are creating going to cover, such that the terminal isn't needed?

jkupferer commented 4 years ago

@GrahamDumpleton The workshop I had in mind is a workshop for installing OpenShift on OpenStack. For the OpenStack setup we are considering using VNC access to the VMs and command should be entered through the VNC consoles. The presence of the terminal may cause confusion in places about where to run commands.

GrahamDumpleton commented 4 years ago

You know there is a workshop content only mode? Or do you really want slides as well. The OpenShift web console will be useless to you if not working with the same cluster as homeroom is deployed into.

Set WORKSHOP_ONLY=true environment variable. This will result in full screen workshop content only.

jkupferer commented 4 years ago

Right, and that is super helpful, but we're trying to leave open the possibility for workshops that don't want the terminal but may want slides or the console.

GrahamDumpleton commented 4 years ago

A way of fudging having the first tab be selected regardless, would be to add to the end of the last script section in the template:

$($('#workarea-nav>li>a')[0]).trigger("click");
jkupferer commented 4 years ago

Ah! That works great. I found and fixed another bug while testing this and was able to validate it working now without the terminal tab.