Commit e0c9361b authored by AUTOMATIC1111's avatar AUTOMATIC1111

performance optimization for extra networks

parent 8b96f3d0
...@@ -489,15 +489,15 @@ class ExtraNetworksPage: ...@@ -489,15 +489,15 @@ class ExtraNetworksPage:
Returns: Returns:
HTML formatted string. HTML formatted string.
""" """
res = "" res = []
for item in self.items.values(): for item in self.items.values():
res += self.create_item_html(tabname, item, self.card_tpl) res.append(self.create_item_html(tabname, item, self.card_tpl))
if res == "": if not res:
dirs = "".join([f"<li>{x}</li>" for x in self.allowed_directories_for_previews()]) dirs = "".join([f"<li>{x}</li>" for x in self.allowed_directories_for_previews()])
res = none_message or shared.html("extra-networks-no-cards.html").format(dirs=dirs) res = [none_message or shared.html("extra-networks-no-cards.html").format(dirs=dirs)]
return res return "".join(res)
def create_html(self, tabname, *, empty=False): def create_html(self, tabname, *, empty=False):
"""Generates an HTML string for the current pane. """Generates an HTML string for the current pane.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment