mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
reduce verbosity of dirs view buttons
This commit is contained in:
parent
7e006b8cc5
commit
05a0bf0efe
@ -1,5 +1,6 @@
|
||||
<button
|
||||
class='lg secondary gradio-button custom-button extra-network-dirs-view-button {extra_class}'
|
||||
title="{title}"
|
||||
onclick='extraNetworksBtnDirsViewItemOnClick(event, "{tabname_full}")'
|
||||
data-path="{path}"
|
||||
>{path}</button>
|
||||
>{label}</button>
|
||||
|
@ -250,8 +250,8 @@ options_templates.update(options_section(('interrogate', "Interrogate"), {
|
||||
}))
|
||||
|
||||
options_templates.update(options_section(('extra_networks', "Extra Networks", "sd"), {
|
||||
"extra_networks_show_hidden_directories": OptionInfo(True, "Show hidden directories").info("directory is hidden if its name starts with \".\"."),
|
||||
"extra_networks_hidden_models": OptionInfo("When searched", "Show cards for models in hidden directories", gr.Radio, {"choices": ["Always", "When searched", "Never"]}).info('"When searched" option will only show the item when the search string has 4 characters or more'),
|
||||
"extra_networks_show_hidden_directories": OptionInfo(True, "Show hidden directories").info("directory is hidden if its name starts with \".\".").needs_reload_ui(),
|
||||
"extra_networks_hidden_models": OptionInfo("When searched", "Show cards for models in hidden directories", gr.Radio, {"choices": ["Always", "When searched", "Never"]}).info('"When searched" option will only show the item when the search string has 4 characters or more').needs_reload_ui(),
|
||||
"extra_networks_default_multiplier": OptionInfo(1.0, "Default multiplier for extra networks", gr.Slider, {"minimum": 0.0, "maximum": 2.0, "step": 0.01}),
|
||||
"extra_networks_card_width": OptionInfo(0, "Card width for Extra Networks").info("in pixels"),
|
||||
"extra_networks_card_height": OptionInfo(0, "Card height for Extra Networks").info("in pixels"),
|
||||
|
@ -678,18 +678,25 @@ class ExtraNetworksPage:
|
||||
tree.values(),
|
||||
key=lambda x: shared.natural_sort_key(x.relpath),
|
||||
)
|
||||
dirs_html = "".join(
|
||||
[
|
||||
dirs_html = []
|
||||
for node in dir_nodes:
|
||||
if node.parent is None:
|
||||
label = node.relpath
|
||||
else:
|
||||
label = os.sep.join(node.relpath.split(os.sep)[1:])
|
||||
|
||||
dirs_html.append(
|
||||
self.btn_dirs_view_item_tpl.format(
|
||||
**{
|
||||
"extra_class": "search-all" if node.relpath == "" else "",
|
||||
"tabname_full": f"{tabname}_{self.extra_networks_tabname}",
|
||||
"title": html.escape(node.abspath),
|
||||
"path": html.escape(node.relpath),
|
||||
"label": html.escape(label),
|
||||
}
|
||||
)
|
||||
for node in dir_nodes
|
||||
]
|
||||
)
|
||||
)
|
||||
dirs_html = "".join(dirs_html)
|
||||
|
||||
return dirs_html
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user