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

Question: Disable stop of running script #749

Open
xprntb3 opened this issue May 23, 2024 · 7 comments
Open

Question: Disable stop of running script #749

xprntb3 opened this issue May 23, 2024 · 7 comments

Comments

@xprntb3
Copy link

xprntb3 commented May 23, 2024

Hello,

firstly, i deeply want to thank you for this amazing software and the work you guys are putting into it.
This perfectly fits the use case i have and i have been looking for something like this for a long time.

I have a question about script execution, is it possible to prevent the user from doing that?
I looked through the server config and script config documentation, and haven't found anything in this direction.
The only thing i found:

https://github.com/bugy/script-server/wiki/Script-config#--shared_access

But this seems to only control which users/groups can generally run/stop/view this script, but not the actions they
can do inside it. I want some scripts to manipulate data, and if, whyever a user would do that, i dont know, the
user cancels the script, the data would be broken. Is there some way to deny this possibility to users?
If not, is there maybe some workaround, like removing a line of code or removing the stop-button from the Web-UI?

Many thanks in advance.

@bugy
Copy link
Owner

bugy commented May 23, 2024

Hi @xprntb3. Unfortunately there is no supported way to hide the button (or prohibit stop).
You can hide the button via custom CSS. But it will be hidden for everyone.

@xprntb3
Copy link
Author

xprntb3 commented May 23, 2024

Hi @xprntb3. Unfortunately there is no supported way to hide the button (or prohibit stop). You can hide the button via custom CSS. But it will be hidden for everyone.

Hey, thanks for the quick reply!
That's no problem, it can be hidden completely and for everyone.
Is there a documentation on editing custom css? I haven't found one yet.

Once i got it working, i will write another comment in this issue explaining how, so that others
that maybe need it aswell can apply it.

If you guys also take feature requests, maybe the ability to prevent stopping of scripts would be a good idea,
i can imagine others might find this useful aswell

@MNeill73
Copy link

MNeill73 commented May 23, 2024 via email

@bugy
Copy link
Owner

bugy commented May 23, 2024

@MNeill73 this won't work I think. Because STOP button will transform into KILL button after 5 seconds. And you cannot "trap" kill command.

@MNeill73
Copy link

MNeill73 commented May 23, 2024 via email

@xprntb3
Copy link
Author

xprntb3 commented May 23, 2024

Hello guys, found the solution!

first, go to your conf/theme/theme.css file (doesn't exist from the getgo, but you can download one of the custom themes for example)

Then edit the file and add the above css code to that file above the html:root definition:


.button-stop.btn.red.lighten-1 {
    display: none;
}

.button-stop.btn.disabled.red.lighten-1 {
    display: none;
}

html:root {
    --hover-color: rgba(255, 255, 255, 0.04);_
....

This will hide the stop-button.

Again, thanks to everyone!

@bugy
Copy link
Owner

bugy commented May 23, 2024

Cool, yes, this is the right place to define your custom styles

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

3 participants