Build a button with which you can trigger a system shutdown or restart.

This devblog entry describes how to create a button in the editor to trigger a system restart or shutdown.

Note that this feature is only supported in SiteKiosk Online 1.2 and higher. For Android the device must be rooted.

 

1. For this example we create a project with the template Empty. 

2. Activate the Expert mode by entering "&expert" in the URL address line and reload the page. 

3. Insert an image element into the page and double-click on the element to open the element's properties dialog. 

4. In the properties dialog go to the Actions section and activate "Execute script".

5. In the input area add the following line:

try{siteKiosk.system.shutdown()}catch(e){console.log('Shutdown machine not possible or in preview')};

To trigger the restart of a client via a button you can use the following line:

try{siteKiosk.system.reboot()}catch(e){console.log('Shutdown machine not possible or in preview')};

6. Save the setting

7. Publish the project to a client to test the function of the button.