mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanel: add value
in options dict for config get --full
This commit is contained in:
parent
48f882ecd3
commit
d370cb0b24
1 changed files with 14 additions and 4 deletions
|
@ -363,7 +363,20 @@ class ConfigPanel:
|
||||||
# Format result in 'classic' or 'export' mode
|
# Format result in 'classic' or 'export' mode
|
||||||
self.config.translate()
|
self.config.translate()
|
||||||
logger.debug(f"Formating result in '{mode}' mode")
|
logger.debug(f"Formating result in '{mode}' mode")
|
||||||
|
|
||||||
|
if mode == "full":
|
||||||
|
result = self.config.dict(exclude_none=True)
|
||||||
|
|
||||||
|
for panel in result["panels"]:
|
||||||
|
for section in panel["sections"]:
|
||||||
|
for opt in section["options"]:
|
||||||
|
instance = self.config.get_option(opt["id"])
|
||||||
|
if isinstance(instance, BaseInputOption):
|
||||||
|
opt["value"] = instance.normalize(self.form[opt["id"]], instance)
|
||||||
|
return result
|
||||||
|
|
||||||
result = OrderedDict()
|
result = OrderedDict()
|
||||||
|
|
||||||
for panel in self.config.panels:
|
for panel in self.config.panels:
|
||||||
for section in panel.sections:
|
for section in panel.sections:
|
||||||
if section.is_action_section and mode != "full":
|
if section.is_action_section and mode != "full":
|
||||||
|
@ -388,9 +401,6 @@ class ConfigPanel:
|
||||||
"value"
|
"value"
|
||||||
] = "**************" # Prevent displaying password in `config get`
|
] = "**************" # Prevent displaying password in `config get`
|
||||||
|
|
||||||
if mode == "full":
|
|
||||||
return self.config.dict(exclude_none=True)
|
|
||||||
else:
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def set(
|
def set(
|
||||||
|
|
Loading…
Add table
Reference in a new issue