Skip to content

Commit

Permalink
add new pages
Browse files Browse the repository at this point in the history
Signed-off-by: Jeeva Kandasamy <jkandasa@gmail.com>
  • Loading branch information
jkandasa committed May 13, 2021
1 parent 0b66952 commit f8016b7
Show file tree
Hide file tree
Showing 22 changed files with 218 additions and 7 deletions.
8 changes: 8 additions & 0 deletions assets/scss/_variables_project.scss
Expand Up @@ -34,3 +34,11 @@ $google_font_family: "Montserrat:300,300i,400,400i,700,700i";
.btn {
border-radius: 5px !important;
}

.td-content {
img {
border: 1px solid #dfdfdf !important;
border-radius: 3px !important;
// padding: 3px !important;
}
}
6 changes: 2 additions & 4 deletions content/en/docs/user-interface/operations/load_variables.md
Expand Up @@ -8,14 +8,13 @@ You can load any number of variables for the further operations.<br>

##### Form View
![load variables](/doc-images/load_variables.png)
* `Variable Name` is used a internal reference for further operations
* `Variable Name` is used a internal reference for further operations. should be unique.
* Add new variable click `+` icon
* To delete a variable click `-` icon
* Entering the value on the value box itself considered as [String](#string) value.
* By clicking edit icon of a value, can offer to select different [data types](#data-types).

##### YAML View
In YAML view, the data is encoded with [base64](https://en.wikipedia.org/wiki/Base64) format
In YAML view, the data is encoded with [base64](https://en.wikipedia.org/wiki/Base64) format to avoid syntax issues.
```yaml
variables:
water_level: >-
Expand Down Expand Up @@ -75,7 +74,6 @@ data:
selector: current.value
```


## Selector
Selector is dot(`.`) separated path used to select a value on the given resource.<br>
If the path not found returns empty value.<br>
Expand Down
18 changes: 17 additions & 1 deletion content/en/docs/user-interface/operations/notify_handlers.md
Expand Up @@ -3,4 +3,20 @@ title: "Notify Handlers"
linkTitle: "Notify Handlers"
weight: 22
---
TBD
Handlers should be created prior to this section. Follow [Handlers Guide](/docs/user-interface/operations/handlers/) to create a handler.<br>

Notify handlers holds a list of handler ids.
Sends all the parameters to the specified handler services.<br>
Based on the [Parameters type](/docs/user-interface/operations/parameters_to_handler/#parameter-types) a particular [Handler service](/docs/user-interface/operations/handlers/#type-of-handlers) can filters supported type(s) and executes it.<br>

##### Form View
![notify handlers](/doc-images/notify_handlers.png)
* Click `+` icon to add new handler id
* Click `-` icon to delete a handler id

##### YAML View
```yaml
handlers:
- telegram_home_group
- resource_handler
```
176 changes: 175 additions & 1 deletion content/en/docs/user-interface/operations/parameters_to_handler.md
Expand Up @@ -3,4 +3,178 @@ title: "Parameters to Handler"
linkTitle: "Parameters to Handler"
weight: 21
---
TBD
Parameters used to send a configuration to [handlers](/docs/user-interface/operations/handlers/).<br>
Based on the the given configuration(via parameter) handler reacts<br>

##### Form View
![parameters to handler](/doc-images/parameters_to_handler.png)

Parameter has two fields,
* to add new parameter click `+` icon
* to remove a parameter click `-` icon
* `Name` of the field should be unique. There is no special meaning for the name. use it as your reference.
* `Value` - value can be one of the [type mentioned here](#parameter-types). To update a value click on edit icon

##### YAML View
In YAML view, the data is encoded with [base64](https://en.wikipedia.org/wiki/Base64) format to avoid syntax issues.
```yaml
handlerParameters:
run_backup: >-
{"type":"backup","disabled":"","data":"cHJvdmlkZXJUeXBlOiBkaXNrCnNwZWM6CiAgc3RvcmFnZUV4cG9ydFR5cGU6IHlhbWwKICByZXRlbnRpb25Db3VudDogNQogIHRhcmdldERpcmVjdG9yeTogJycKICBwcmVmaXg6ICcnCg=="}
turn_on_light: >-
{"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiB0YXNtb3RhLnRhc21vdGFfODg3NDIxLkNvbnRyb2wuUE9XRVIKcGF5bG9hZDogJ29uJwpwcmVEZWxheTogMTBzCg=="}
```

## Parameter Types
Parameter types are based on the supported handlers.

* [Resource By Quick ID](#resource-by-quick-id)
* [Resource By Labels](#resource-by-labels)
* [Webhook](#webhook)
* [Email](#email)
* [Telegram](#telegram)
* [Backup](#backup)

**Disabled** is a common field across all type of parameters.
* a parameter can be enabled or disabled dynamically.
* can be disabled by setting this field as `true`
* default value for this field is `false`

{{< alert title="Note" >}}
All the parameter values supports template.<br>
With template we can update the value or part of the value dynamically.<br>
[Template Guide](/docs/user-interface/operations/template/)
{{< /alert >}}


### Resource By Quick ID
Resource can be selected by their [QuickID](/docs/getting-started/hints/#quick-id).<br>

##### Form View
![resource by quick id](/doc-images/parameter_resource_by_quick_id.png)
* Select a `Resource Type`
* enter the `id` of the resource, you will get a list of matching resources. Select a resource.
* on the payload update the action or value you want to set to the selected resource
* `Pre Delay` is used to wait some time and perform the action.
`10s` - Resource handler waits 10 seconds and sets this value.

{{< alert title="Note" >}}
Pre delay parameters will be lost on the intermediate restart of the MyController server.<br>
*Example:*
* You passed a resource parameter with pre delay as 1 hour.
* The parameter passed to resource handler service and this handler can perform the resource action exactly after 1 hour.
* This data is in resource handler service memory.
* If you restart your MyController service, that particular action will be lost and will not be executed.
{{< /alert >}}


##### YAML View
```yaml
disabled: ''
type: resource_by_quick_id
data:
resourceType: field
quickId: tasmota.tasmota_887421.Control.POWER
payload: 'on'
preDelay: 10s
```

### Resource By Labels
* This is exactly same as [Resource By Quick ID](#resource-by-quick-id).
* The only different is, selecting resources by [Labels](/docs/getting-started/hints/#labels)
* When filtering with labels it possible to get more than on resource.
* Particular action will be applied to all the resources filter by labels.

##### Form View
![resource by labels](/doc-images/parameter_resource_by_labels.png)

##### YAML View
```yaml
disabled: ''
type: resource_by_labels
data:
resourceType: field
labels:
group: lights
payload: 'on'
preDelay: 0s
```

### Webhook
TBD

### Email
* All the fields in email parameter is optional.
* If non of the fields entered here, taking all the fields from the [Email Handler](/docs/user-interface/operations/handlers/#email-handler)
* The field enter here is taken, for empty values updates from the [Email Handler](/docs/user-interface/operations/handlers/#email-handler)

##### Form View
![resource by quick id](/doc-images/parameter_email.png)

##### YAML View
```yaml
disabled: ''
type: email
data:
from: example@example.com
to:
- example1@example.com
- example2@example.com
subject: 'Alert: Overheat detected on CPU'
body: |-
Alert: Overheat detected on CPU.
Check the status of the CPU Fan.
```

### Telegram
* other than the `Text` all the fields are optional
* empty values are taken from [Telegram Handler](/docs/user-interface/operations/handlers/#telegram-handler)
* telegram supports different `Text` parse modes, `Text`, `Markdown`, `Markdown V2`, `HTML`.

{{< alert title="Important" color="warning" >}}
All the syntax are supported from `Markdown`, `Markdown V2`, `HTML`.<br>
Refer [Telegram API Guide](https://core.telegram.org/bots/api#formatting-options) for the detailed format options.<br>
{{< /alert >}}

##### Form View
![resource by quick id](/doc-images/parameter_telegram.png)

##### YAML View
```yaml
disabled: ''
type: telegram
data:
chatIds:
- '20000000'
- '-4000000'
parseMode: Text
text: |-
Alert: Overheat detected on CPU.
Check the status of the CPU Fan.
```

### Backup
Backup parameter used to execute a backup via a schedule or from a task.<br>
* Other than the `Provider` and `Retention Count`, all other inputs are optional
* empty values are taken from the [Backup Handler](/docs/user-interface/operations/handlers/#backup-handler)
* If you enter `Retention Count` as `0`, the value will be taken from the [Backup Handler](/docs/user-interface/operations/handlers/#backup-handler)

{{< alert title="Restore" >}}
To restore a backup follow the [Restore Guide](/docs/user-interface/settings/backup_and_restore/#restore)
{{< /alert >}}

##### Form View
![resource by quick id](/doc-images/parameter_backup.png)

##### YAML View
```yaml
disabled: ''
type: backup
data:
providerType: disk
spec:
storageExportType: yaml
targetDirectory: /mc_home/backups
prefix: scheduled
retentionCount: 10
```
6 changes: 6 additions & 0 deletions content/en/docs/user-interface/operations/template.md
@@ -0,0 +1,6 @@
---
title: "Template"
linkTitle: "Template"
weight: 32
---
TBD
9 changes: 9 additions & 0 deletions content/en/docs/user-interface/settings/backup_and_restore.md
@@ -0,0 +1,9 @@
---
title: "Backup and Restore"
linkTitle: "Backup and Restore"
weight: 3
---

## Backup

## Restore
2 changes: 1 addition & 1 deletion content/en/docs/user-interface/settings/system.md
@@ -1,7 +1,7 @@
---
title: "System"
linkTitle: "system"
weight: 1
weight: 2
---
The system settings has the following configurations
* [GEO Location](#geo-location)
Expand Down
Binary file modified static/doc-images/load_variables.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/notify_handlers.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/parameter_backup.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/parameter_email.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/parameter_telegram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/parameters_to_handler.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_bot_get_chat_id.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_bot_search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_group_add_mc_bot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_group_id.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_group_mc_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_mc_bot_info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_mc_bot_start.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f8016b7

Please sign in to comment.