docs: screenshot for checklist
This commit is contained in:
parent
5f0d7d2392
commit
1708cf15ad
|
|
@ -0,0 +1,2 @@
|
||||||
|
custom-webui/
|
||||||
|
__pycache__/
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
CONFIGDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
include ../../screenshots.mk
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
|
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
listenAddressSingleHTTPFrontend: 0.0.0.0:11337
|
||||||
|
|
||||||
|
logLevel: "WARN"
|
||||||
|
checkForUpdates: false
|
||||||
|
showFooter: false
|
||||||
|
|
||||||
|
actions:
|
||||||
|
- title: Backup selected directories
|
||||||
|
shell: echo "Backing up {{ directories }}"
|
||||||
|
arguments:
|
||||||
|
- name: directories
|
||||||
|
title: Directories to back up
|
||||||
|
type: checklist
|
||||||
|
choices:
|
||||||
|
- title: Documents
|
||||||
|
value: documents
|
||||||
|
- title: Photos
|
||||||
|
value: photos
|
||||||
|
- title: Music
|
||||||
|
value: music
|
||||||
|
default: '["documents","photos"]'
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[DEFAULT]
|
||||||
|
base_url = http://localhost:11337/
|
||||||
|
dir = .
|
||||||
|
width = 800
|
||||||
|
height = 520
|
||||||
|
post_script_sleep = 0.5
|
||||||
|
|
||||||
|
[checklist]
|
||||||
|
url = .
|
||||||
|
name = checklist
|
||||||
|
script = setup_checklist.py
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Prepare the checklist argument form screenshot."""
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
from selenium.webdriver.support.ui import WebDriverWait
|
||||||
|
|
||||||
|
|
||||||
|
def _wait_for_body_attr(driver, attr, timeout=15):
|
||||||
|
WebDriverWait(driver, timeout).until(
|
||||||
|
lambda d: bool(d.find_element(By.TAG_NAME, "body").get_attribute(attr))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def run(driver):
|
||||||
|
_wait_for_body_attr(driver, "loaded-dashboard")
|
||||||
|
|
||||||
|
driver.find_element(
|
||||||
|
By.CSS_SELECTOR, '[title="Backup selected directories"]'
|
||||||
|
).click()
|
||||||
|
|
||||||
|
_wait_for_body_attr(driver, "loaded-argument-form")
|
||||||
|
|
||||||
|
WebDriverWait(driver, 15).until(
|
||||||
|
lambda d: len(
|
||||||
|
d.find_elements(By.CSS_SELECTOR, ".choice-checklist-item input[type='checkbox']")
|
||||||
|
)
|
||||||
|
>= 3
|
||||||
|
)
|
||||||
|
time.sleep(0.2)
|
||||||
|
|
@ -19,14 +19,17 @@ actions:
|
||||||
value: photos
|
value: photos
|
||||||
- title: Music
|
- title: Music
|
||||||
value: music
|
value: music
|
||||||
default: documents,photos
|
default: '["documents","photos"]'
|
||||||
----
|
----
|
||||||
|
|
||||||
|
.Checklist argument form with Documents and Photos selected by default.
|
||||||
|
image::args/checklist/checklist.png[]
|
||||||
|
|
||||||
When the example above runs with Documents and Photos selected, the shell command becomes:
|
When the example above runs with Documents and Photos selected, the shell command becomes:
|
||||||
|
|
||||||
[source,shell]
|
[source,shell]
|
||||||
----
|
----
|
||||||
echo "Backing up: documents,photos"
|
echo "Backing up: [\"documents\",\"photos\"]"
|
||||||
----
|
----
|
||||||
|
|
||||||
== Select all / Select none
|
== Select all / Select none
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue