Widget - Execute Operating System commands



  • Now it is possible to execute Operating System commands from MyController dashboard. This request created based on the input from https://github.com/mycontroller-org/mycontroller/issues/450

    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:
    • name - (Mandatory) Name of the button. can be in the form of HTML also. HTML or icons(recommended: font awesome icons)
    • os - (Optional) Operating System, supports, linux and common. If we leave, will be considered as common.
    • btnType - (Optional) can be any one of value in the list [default, primary, success, info, warning, danger] when we leave this field field as blank, default will be selected. Each value give
    • confirmation - (Optional) If you want to confirm before execute this command. Will be good to add on reboot, poweroff commands. Default: false.


  • This is excellent news - now even more control from within myc !!!

    There are so many uses for this flexibility - I only asked for a reboot/shutdown button as it would eliminate an ssh connection each time I need to work on the pi - but this is just way better than that!

    Thank you sooooo much 🙂


 

Suggested Topics

12
Online

406
Users

370
Topics

2.3k
Posts