Disable "Restart/Shutdown System" buttons?

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
georgep
Posts: 13
Joined: Tuesday 01 December 2015 16:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Disable "Restart/Shutdown System" buttons?

Post by georgep »

Is there any way (short of me digging into the code and hacking it myself) of disabling or removing the two "More Options -> Shutdown System/Restart System" buttons in the web interface?

I have found them really useful on my RPi, but now that I'm setting up Domoticz on a server with lots of other functionality I've already accidentally shut down the server once :o :oops:

A compile-time option or maybe a command-line switch would be just perfect IMHO.

George
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Disable "Restart/Shutdown System" buttons?

Post by Egregius »

The buttons are created in www/index.html

Code: Select all

<li id="mRestart"><a id="cRestart" href="javascript:SwitchLayout('Restart')"><img src="images/restart.png"> <span data-i18n="Restart System">Restart System</span></a></li>
<li id="mShutdown"><a id="cShutdown" href="javascript:SwitchLayout('Shutdown')"><img src="images/shutdown.png"> <span data-i18n="Shutdown System">Shutdown System</span></a></li>
Looking at their structure I would say it's safe to just delete those lines or place them in comment by adding <!-- in front and --> after them.
georgep
Posts: 13
Joined: Tuesday 01 December 2015 16:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Re: Disable "Restart/Shutdown System" buttons?

Post by georgep »

Egregius wrote:The buttons are created in www/index.html
Looking at their structure I would say it's safe to just delete those lines or place them in comment by adding <!-- in front and --> after them.
Great! Thanks for that.
I don't have time to test it right now but that seems like a good solution.
George
User avatar
mbliek
Posts: 194
Joined: Friday 12 July 2013 14:08
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the Netherlands
Contact:

Re: Disable "Restart/Shutdown System" buttons?

Post by mbliek »

It works. Did it myself. I'm using a Domoticz system as demo for my webshop. But every time demo users at shutting the system down
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Disable "Restart/Shutdown System" buttons?

Post by leecollings »

Better still, change the functionality of the Shutdown system so that it just stops the Domoticz service rather than shutdown the entire Pi.

I thought it would just stop the Domoticz service...nope. :(
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest