Skip to content
New issue

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

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

Already on GitHub? # to your account

Option to disable actions #254

Closed
rahulvrane opened this issue Aug 26, 2020 · 8 comments
Closed

Option to disable actions #254

rahulvrane opened this issue Aug 26, 2020 · 8 comments

Comments

@rahulvrane
Copy link

Hello

Thanks for the package! It is very helpful from an end user point. I had a qs however - are we able to turn off buttons such as 'Shutdown' etc? If yes, how can we do it?

Cheers

@aschonfeld
Copy link
Collaborator

@rahulvrane Glad to hear D-Tale is helping 👍 As for your question about hiding the "Shutdown" button. There is a way but it's not easily accessible at the moment. What I can do is make it a global variable or an environment variable if that would help. For example:

import dtale

dtale.HIDE_SHUTDOWN = True

dtale.show(df)

That would be how to hide the shutdown button. Currently I have a flag for turning off cell editing dtale.ALLOW_CELL_EDITS = False.

The other option I can work on providing is through the use of an environment variable. Say from your command line you ran export DTALE_HIDE_SHUTDOWN=True, that would turn off the shutdown button on any D-Tale instance opened in that command line terminal.

Let me know if those sound like good options? Thanks

@rahulvrane
Copy link
Author

@aschonfeld thanks for your response! The idea of having a global variable is probably more usable.
Also if multiple people are accessing it at the same time- does that change anything or need any special setup if edits and shut-downs are turned off?

Thanks again!

@aschonfeld
Copy link
Collaborator

aschonfeld commented Aug 27, 2020

@rahulvrane if you started sessions with these:

  • dtale.HIDE_SHUTDOWN = True or dtale.show(df, hide_shutdown=True)
  • dtale.ALLOW_CELL_EDITS = False or dtale.show(df, allow_cell_edits=False)

And of course you can also specify both those properties at the same time

Then any one accessing those sessions will have those features turned off. You can turn it back on by taking the data_id (the number on the end of your URL) of the session and doing:
dtale.global_state.get_settings(data_id)['hide_shutdown' or 'allow_cell_edits'] = True or False

aschonfeld added a commit that referenced this issue Aug 27, 2020
aschonfeld added a commit that referenced this issue Aug 28, 2020
aschonfeld added a commit that referenced this issue Aug 28, 2020
aschonfeld added a commit that referenced this issue Sep 4, 2020
@aschonfeld
Copy link
Collaborator

Added in v1.15.2

@sk1802
Copy link

sk1802 commented Jun 10, 2022

@aschonfeld Is there another way to hide the shutdown button in jupyter notebook because the above mentioned way not working for me.

@aschonfeld
Copy link
Collaborator

@sk1802 sorry looks like there is a bug where it's not picking up whether hide_shutdown or allow_cell_edits has been set on an individual instance. So the way around that would be to do dtale.global_state.get_app_settings()['hide_shutdown'] = True

I'll work on fixing the issue in the meantime

aschonfeld pushed a commit that referenced this issue Jun 14, 2022
aschonfeld pushed a commit that referenced this issue Jun 15, 2022
aschonfeld pushed a commit that referenced this issue Jun 15, 2022
aschonfeld pushed a commit that referenced this issue Jun 15, 2022
aschonfeld pushed a commit that referenced this issue Jun 15, 2022
aschonfeld pushed a commit that referenced this issue Jun 16, 2022
@aschonfeld
Copy link
Collaborator

@sk1802 just released v2.6.0 with these updates. Let me know if you have any other issues. Also, if you haven't done so already, please toss your ⭐ on the repo. Thanks 🙏

@sk1802
Copy link

sk1802 commented Jun 17, 2022

Thank you for the update @aschonfeld it really helped ☺️. The repo is starred.(i still need to work using dtale 🔥 so why not ).

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

No branches or pull requests

3 participants