mycontroller-org / mycontroller-v1-legacy

The Open Source Controller
http://www.MyController.org
Apache License 2.0
148 stars 90 forks source link

Implement Reboot/Poweroff of pi from within MYC #450

Closed coderpop closed 6 years ago

coderpop commented 6 years ago

As per forum post request.....

Implement this feature by executing direct Linux command. Add an API to execute OS commands and provide an example to add custom buttons on the dashboard.

jkandasa commented 6 years ago

@coderpop Support included in the SNAPSHOT version,

Add OS Reboot and Date button on the dashboard.

image

Select OS Commands from widget list, image

Update button details as follows, image

If we enabled confirmation for a button, will be displayed as follows, Here it is reboot button image

Button JSON content:

[
  {
    "name": "<i class='fa fa-power-off'></i>",
    "os": "linux",
    "command": "reboot",
    "btnType": "danger",
    "confirmation": true
  },
  {
    "name": "Date",
    "os": "linux",
    "command": "date"
  }
]
Supported fields: