mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Added a --full option to domain list
This commit is contained in:
parent
0b5c96e249
commit
ba061a49e4
2 changed files with 10 additions and 19 deletions
|
@ -446,6 +446,10 @@ domain:
|
|||
--auto-push:
|
||||
help: Only display domains that are pushed automatically
|
||||
action: store_true
|
||||
-f:
|
||||
full: --full
|
||||
action: store_true
|
||||
help: Display more information
|
||||
|
||||
### domain_add()
|
||||
add:
|
||||
|
@ -586,15 +590,6 @@ domain:
|
|||
path:
|
||||
help: The path to check (e.g. /coffee)
|
||||
|
||||
### domain_isdyndns()
|
||||
isdyndns:
|
||||
action_help: Check if a domain is a dyndns one
|
||||
api: GET /domain/<domain>/isdyndns
|
||||
arguments:
|
||||
domain:
|
||||
help: The domain to test (e.g. your.domain.tld)
|
||||
extra:
|
||||
pattern: *pattern_domain
|
||||
|
||||
subcategories:
|
||||
dyndns:
|
||||
|
|
|
@ -52,7 +52,7 @@ DOMAIN_SETTINGS_DIR = "/etc/yunohost/domains"
|
|||
domain_list_cache: Dict[str, Any] = {}
|
||||
|
||||
|
||||
def domain_list(exclude_subdomains=False,auto_push=False):
|
||||
def domain_list(exclude_subdomains=False,auto_push=False,full=False):
|
||||
"""
|
||||
List domains
|
||||
|
||||
|
@ -97,6 +97,11 @@ def domain_list(exclude_subdomains=False,auto_push=False):
|
|||
if exclude_subdomains:
|
||||
return {"domains": result_list, "main": _get_maindomain()}
|
||||
|
||||
if full:
|
||||
for i in range(len(result_list)):
|
||||
domain = result_list[i]
|
||||
result_list[i] = {'name':domain,'isdyndns': is_yunohost_dyndns_domain(domain)}
|
||||
|
||||
domain_list_cache = {"domains": result_list, "main": _get_maindomain()}
|
||||
return domain_list_cache
|
||||
|
||||
|
@ -458,15 +463,6 @@ def domain_url_available(domain, path):
|
|||
|
||||
return len(_get_conflicting_apps(domain, path)) == 0
|
||||
|
||||
def domain_isdyndns(domain):
|
||||
"""
|
||||
Returns if a domain is a DynDNS one ( used via the web API )
|
||||
|
||||
Arguments:
|
||||
domain -- the domain to check
|
||||
"""
|
||||
return is_yunohost_dyndns_domain(domain)
|
||||
|
||||
def _get_maindomain():
|
||||
with open("/etc/yunohost/current_host", "r") as f:
|
||||
maindomain = f.readline().rstrip()
|
||||
|
|
Loading…
Add table
Reference in a new issue