mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanel: add bind
prop to SectionModel + PanelModel
This commit is contained in:
parent
bfba939927
commit
004f44ed2d
1 changed files with 6 additions and 1 deletions
|
@ -119,6 +119,7 @@ class SectionModel(ContainerModel, OptionsModel):
|
||||||
visible: Union[bool, str] = True
|
visible: Union[bool, str] = True
|
||||||
optional: bool = True
|
optional: bool = True
|
||||||
is_action_section: bool = False
|
is_action_section: bool = False
|
||||||
|
bind: Union[str, None] = None
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -137,6 +138,7 @@ class SectionModel(ContainerModel, OptionsModel):
|
||||||
help: Union[Translation, None] = None,
|
help: Union[Translation, None] = None,
|
||||||
visible: Union[bool, str] = True,
|
visible: Union[bool, str] = True,
|
||||||
optional: bool = True,
|
optional: bool = True,
|
||||||
|
bind: Union[str, None] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> None:
|
) -> None:
|
||||||
options = self.options_dict_to_list(kwargs, optional=optional)
|
options = self.options_dict_to_list(kwargs, optional=optional)
|
||||||
|
@ -150,6 +152,7 @@ class SectionModel(ContainerModel, OptionsModel):
|
||||||
services=services,
|
services=services,
|
||||||
help=help,
|
help=help,
|
||||||
visible=visible,
|
visible=visible,
|
||||||
|
bind=bind,
|
||||||
options=options,
|
options=options,
|
||||||
is_action_section=is_action_section,
|
is_action_section=is_action_section,
|
||||||
)
|
)
|
||||||
|
@ -194,6 +197,7 @@ class PanelModel(ContainerModel):
|
||||||
|
|
||||||
# FIXME what to do with `actions?
|
# FIXME what to do with `actions?
|
||||||
actions: dict[str, Translation] = {"apply": {"en": "Apply"}}
|
actions: dict[str, Translation] = {"apply": {"en": "Apply"}}
|
||||||
|
bind: Union[str, None] = None
|
||||||
sections: list[SectionModel]
|
sections: list[SectionModel]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
@ -213,11 +217,12 @@ class PanelModel(ContainerModel):
|
||||||
name: Union[Translation, None] = None,
|
name: Union[Translation, None] = None,
|
||||||
services: list[str] = [],
|
services: list[str] = [],
|
||||||
help: Union[Translation, None] = None,
|
help: Union[Translation, None] = None,
|
||||||
|
bind: Union[str, None] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> None:
|
) -> None:
|
||||||
sections = [data | {"id": name} for name, data in kwargs.items()]
|
sections = [data | {"id": name} for name, data in kwargs.items()]
|
||||||
super().__init__(
|
super().__init__(
|
||||||
id=id, name=name, services=services, help=help, sections=sections
|
id=id, name=name, services=services, help=help, bind=bind, sections=sections
|
||||||
)
|
)
|
||||||
|
|
||||||
def translate(self, i18n_key: Union[str, None] = None) -> None:
|
def translate(self, i18n_key: Union[str, None] = None) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue