Hello everyone, I am building a cloud IDE based on theia, the requirement background is that everyone has their own independent workspace. For the settings, it would be best to use code control, otherwise if someone changes the settings, it would affect everyone else. So I need to disable the settings menu entry. In the file dropdown menu, I have disabled the preferences, but its submenu settings and keyboard shortcuts have moved to the file menu, how can I disable them? My code is as follows:
Are you using a single Theia instance for all your users? Theia is not a multi-tenant framework/application, so it is heavily recommended to spawn a dedicated Theia instance for each of your users. There are a few other side effects of having users work on the same machine aside from the preferences. Frameworks such as theia-cloud can help you with that.
I’m not aware of all commands that start/open the preferences, but you can just call unbind(PreferencesWidget) in your module code, which should definitely prevent any users from opening the widget. Note that I wouldn’t recommend this solution.
For the actual question in the initial post: You can find where these menu entries are registered here and here.
I’m a bit at a loss. Can you explain a bit more in detail what you’re trying to do? Why would you want to remove the settings menu, if you still want users to access the settings widget?
Theia Cloud is not an API, but a kubernetes based tool/framework for deploying Theia instances for your users. I recommended that in the assumption that you’re using a single Theia web instance for all your users. Is that assumption correct?
I want to hide or remove perefences from the thiea based browser apps. Using unbind(PreferencesWidget)will also hide/remove File,View,Selection,too
Yes, your assumption is correct. I have only on theia instance or more behind loadbalance. For example, user A changes the theme to light, while user B likes dark theme. So I need to hide or remove preferences, user cannot access user preference or workspace preference.
I’ll dive into theia-cloud to see if it supports to build image with custom theia based browser app. If so, users can custom the preferences.
I see, yeah then you’ll need to remove the other entries manually, see my answer above. Note that I would definitely recommend to look into a dedicated hosting solution such as theia-cloud. Theia is not built for multi-tenant usage and you will likely run into a lot more issues than just the preferences. For example, it’s fairly difficult to prevent users to switch to workspaces of other users, thereby messing with their code.
Yes, that is the purpose of the tool. Otherwise it would be quite useless