added arbitrary target path selection

This commit is contained in:
Natan Keddem
2023-11-16 19:05:53 -05:00
parent 3b13ca89bd
commit 566fb9442c
2 changed files with 12 additions and 10 deletions

View File

@@ -162,16 +162,17 @@ class FInput(ui.input):
class DSelect(ui.select):
def __init__(
self,
options: List | Dict,
options: Union[List, Dict],
*,
label: str | None = None,
label: Optional[str] = None,
value: Any = None,
on_change: Callable[..., Any] | None = None,
on_change: Optional[Callable[..., Any]] = None,
with_input: bool = False,
new_value_mode: Optional[Literal["add", "add-unique", "toggle"]] = None,
multiple: bool = False,
clearable: bool = False,
) -> None:
super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, multiple=multiple, clearable=clearable)
super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, new_value_mode=new_value_mode, multiple=multiple, clearable=clearable)
self.tailwind.width("full")
if multiple is True:
self.props("use-chips")
@@ -180,16 +181,17 @@ class DSelect(ui.select):
class FSelect(ui.select):
def __init__(
self,
options: List | Dict,
options: Union[List, Dict],
*,
label: str | None = None,
label: Optional[str] = None,
value: Any = None,
on_change: Callable[..., Any] | None = None,
on_change: Optional[Callable[..., Any]] = None,
with_input: bool = False,
new_value_mode: Optional[Literal["add", "add-unique", "toggle"]] = None,
multiple: bool = False,
clearable: bool = False,
) -> None:
super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, multiple=multiple, clearable=clearable)
super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, new_value_mode=new_value_mode, multiple=multiple, clearable=clearable)
self.tailwind.width("64")

View File

@@ -491,10 +491,10 @@ class Automation(Tab):
row.tailwind.width("[860px]").justify_content("center")
with ui.column() as col:
col.tailwind.height("full").width("[420px]")
self.hosts = el.DSelect(source_hosts, label="Source Host(s)", multiple=True, with_input=True)
self.target_host = el.DSelect(target_host, label="Target Host", on_change=target_host_selected)
self.target_paths = [""]
self.target_path = el.DSelect(self.target_paths, value="", label="Target Path", on_change=target_path_selected)
self.target_path = el.DSelect(self.target_paths, value="", label="Target Path", new_value_mode="add-unique", on_change=target_path_selected)
self.hosts = el.DSelect(source_hosts, label="Source Host(s)", multiple=True, with_input=True)
all_fs_to_lists()
with ui.scroll_area().classes("col"):
self.parentchildren = el.DSelect(