Allow to also list connecting site with siteList API command
This commit is contained in:
parent
046b95d5b1
commit
2518867d50
1 changed files with 4 additions and 4 deletions
|
@ -275,7 +275,7 @@ class UiWebsocket(object):
|
||||||
|
|
||||||
# Format site info
|
# Format site info
|
||||||
def formatSiteInfo(self, site, create_user=True):
|
def formatSiteInfo(self, site, create_user=True):
|
||||||
content = site.content_manager.contents.get("content.json")
|
content = site.content_manager.contents.get("content.json", {})
|
||||||
if content: # Remove unnecessary data transfer
|
if content: # Remove unnecessary data transfer
|
||||||
content = content.copy()
|
content = content.copy()
|
||||||
content["files"] = len(content.get("files", {}))
|
content["files"] = len(content.get("files", {}))
|
||||||
|
@ -844,12 +844,12 @@ class UiWebsocket(object):
|
||||||
self.response(to, "ok")
|
self.response(to, "ok")
|
||||||
|
|
||||||
# List all site info
|
# List all site info
|
||||||
def actionSiteList(self, to):
|
def actionSiteList(self, to, connecting_sites=False):
|
||||||
ret = []
|
ret = []
|
||||||
SiteManager.site_manager.load() # Reload sites
|
SiteManager.site_manager.load() # Reload sites
|
||||||
for site in self.server.sites.values():
|
for site in self.server.sites.values():
|
||||||
if not site.content_manager.contents.get("content.json"):
|
if not site.content_manager.contents.get("content.json") and not connecting_sites:
|
||||||
continue # Broken site
|
continue # Incomplete site
|
||||||
ret.append(self.formatSiteInfo(site, create_user=False)) # Dont generate the auth_address on listing
|
ret.append(self.formatSiteInfo(site, create_user=False)) # Dont generate the auth_address on listing
|
||||||
self.response(to, ret)
|
self.response(to, ret)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue