feature: entities wip (#226)
This commit is contained in:
parent
759e747f54
commit
5b0cfb5c33
20
config.yaml
20
config.yaml
|
|
@ -8,6 +8,18 @@ listenAddressSingleHTTPFrontend: 0.0.0.0:1337
|
||||||
# Choose from INFO (default), WARN and DEBUG
|
# Choose from INFO (default), WARN and DEBUG
|
||||||
logLevel: "INFO"
|
logLevel: "INFO"
|
||||||
|
|
||||||
|
entities:
|
||||||
|
- name: container
|
||||||
|
file: /etc/OliveTin/entities/containers.yaml
|
||||||
|
icon: container
|
||||||
|
|
||||||
|
helpers:
|
||||||
|
- title: refresh container file
|
||||||
|
shell: "docker ps --format '{{ .state }}' > /etc/OliveTin/entities/containers.yaml"
|
||||||
|
execOnStartup: true
|
||||||
|
execOnCron:
|
||||||
|
- "*/1 * * * * *"
|
||||||
|
|
||||||
# Actions (buttons) to show up on the WebUI:
|
# Actions (buttons) to show up on the WebUI:
|
||||||
actions:
|
actions:
|
||||||
- title: date
|
- title: date
|
||||||
|
|
@ -15,15 +27,17 @@ actions:
|
||||||
icon: clock
|
icon: clock
|
||||||
popupOnStart: true
|
popupOnStart: true
|
||||||
|
|
||||||
|
- title: start
|
||||||
|
shell: docker start {{ container.name }}
|
||||||
|
icon: start
|
||||||
|
entity: container
|
||||||
|
|
||||||
# This will run a simple script that you create.
|
# This will run a simple script that you create.
|
||||||
- title: Run backup script
|
- title: Run backup script
|
||||||
shell: /opt/backupScript.sh
|
shell: /opt/backupScript.sh
|
||||||
shellAfterCompleted: "apprise -t 'Notification: Backup script completed' -b 'The backup script completed with code {{ exitCode}}. The log is: \n {{ stdout }} '"
|
shellAfterCompleted: "apprise -t 'Notification: Backup script completed' -b 'The backup script completed with code {{ exitCode}}. The log is: \n {{ stdout }} '"
|
||||||
maxConcurrent: 1
|
maxConcurrent: 1
|
||||||
icon: backup
|
icon: backup
|
||||||
execOnCron: # https://docs.olivetin.app/exec-cron.html
|
|
||||||
- "@monthly" # Once per month
|
|
||||||
- "0 12 25 12 *" # And on Christmas day!
|
|
||||||
|
|
||||||
# This will send 1 ping (-c 1)
|
# This will send 1 ping (-c 1)
|
||||||
# Docs: https://docs.olivetin.app/action-ping.html
|
# Docs: https://docs.olivetin.app/action-ping.html
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ type Action struct {
|
||||||
CSS map[string]string `mapstructure:"omitempty"`
|
CSS map[string]string `mapstructure:"omitempty"`
|
||||||
Timeout int
|
Timeout int
|
||||||
Acls []string
|
Acls []string
|
||||||
|
Entity []string
|
||||||
ExecOnStartup bool
|
ExecOnStartup bool
|
||||||
ExecOnCron []string
|
ExecOnCron []string
|
||||||
ExecOnFileCreatedInDir []string
|
ExecOnFileCreatedInDir []string
|
||||||
|
|
@ -37,12 +38,22 @@ type ActionArgumentChoice struct {
|
||||||
Title string
|
Title string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HelperAction is an action that is used normally to generate entities, it cannot be started manually.
|
||||||
|
type HelperAction struct {
|
||||||
|
Title string
|
||||||
|
Shell string
|
||||||
|
ExecOnStartup bool
|
||||||
|
ExecOnCron []string
|
||||||
|
ExecOnFileCreatedInDir []string
|
||||||
|
ExecOnFileChangedInDir []string
|
||||||
|
}
|
||||||
|
|
||||||
// Entity represents a "thing" that can have multiple actions associated with it.
|
// Entity represents a "thing" that can have multiple actions associated with it.
|
||||||
// for example, a media player with a start and stop action.
|
// for example, a media player with a start and stop action.
|
||||||
type Entity struct {
|
type EntityFile struct {
|
||||||
Title string
|
File string
|
||||||
|
Name string
|
||||||
Icon string
|
Icon string
|
||||||
Actions []Action `mapstructure:"actions"`
|
|
||||||
CSS map[string]string
|
CSS map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,8 +83,8 @@ type Config struct {
|
||||||
ExternalRestAddress string
|
ExternalRestAddress string
|
||||||
LogLevel string
|
LogLevel string
|
||||||
Actions []Action `mapstructure:"actions"`
|
Actions []Action `mapstructure:"actions"`
|
||||||
|
Entities []EntityFile `mapstructure:"entities"`
|
||||||
Dashboards []DashboardItem `mapstructure:"dashboards"`
|
Dashboards []DashboardItem `mapstructure:"dashboards"`
|
||||||
Entities []Entity `mapstructure:"entities"`
|
|
||||||
CheckForUpdates bool
|
CheckForUpdates bool
|
||||||
PageTitle string
|
PageTitle string
|
||||||
ShowFooter bool
|
ShowFooter bool
|
||||||
|
|
@ -89,6 +100,7 @@ type Config struct {
|
||||||
DefaultPermissions PermissionsList
|
DefaultPermissions PermissionsList
|
||||||
AccessControlLists []AccessControlList
|
AccessControlLists []AccessControlList
|
||||||
WebUIDir string
|
WebUIDir string
|
||||||
|
HelperActions []HelperAction `mapstructure:"helperActions"`
|
||||||
CronSupportForSeconds bool
|
CronSupportForSeconds bool
|
||||||
SectionNavigationStyle string
|
SectionNavigationStyle string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
sonarr:
|
||||||
|
state: started
|
||||||
|
plex:
|
||||||
|
state: started
|
||||||
|
sabnzbd:
|
||||||
|
state: stopped
|
||||||
Loading…
Reference in New Issue