Manger page interact with shell command
When you click an action on manage page, the backend react to this action and return a result actions.
The UI is a table
ID | Name | Cat | Action | Actions | Data |
---|---|---|---|---|---|
{{id}} | {{name}} | {{cat}} | {{action}} | {{#actions}} {{.}}, {{/actions}} |
|
docker-ps | docker ps | docker | ps | ps,stop,start,rm | {"name":"ak"} |
docker-imgs | docker images | image | delete | delete, | {"name":"cc"} |
The data format is fixed
When user clicked an action on the table, the data bellow will send to the runner server.
{
"runner": {
"settingsstr": "string value",
"settings": {}
},
"items": [
{
"id": "str",
"name": "name",
"cat": "category",
"action": "current action",
"actions": ["start", "stop", "rm"],
"data": {
"any": "kvs"
}
}
]
}
The shell script will receive envs:
name | descriptio | link |
---|---|---|
INSTRUCTOR | the data struct shown above. | |
SCRIPTS_DIR | the script directory so that you can call the other script beside runner.sh | |
ALL_ENV_NAMES | print out all env names. |