1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Some minor fixes on generics, order of fields...

This commit is contained in:
Adolfo Gómez García 2024-04-07 05:43:48 +02:00
parent fb3945975c
commit 05c434eb8a
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
3 changed files with 16 additions and 15 deletions

View File

@ -303,7 +303,8 @@ class Services(DetailHandler): # pylint: disable=too-many-public-methods
'tooltip': _('Kind of service counting for calculating if MAX is reached'),
'type': types.ui.FieldType.CHOICE,
'readonly': False,
'order': 101,
'order': 110,
'tab': types.ui.Tab.ADVANCED,
},
)

View File

@ -85,10 +85,20 @@ class FixedService(services.Service, abc.ABC): # pylint: disable=too-many-publi
readonly=False,
)
# Keep name as "machine" so we can use VCHelpers.getMachines
machines = gui.MultiChoiceField(
label=_("Machines"),
order=30,
tooltip=_('Machines for this service'),
required=True,
tab=types.ui.Tab.MACHINE,
rows=10,
)
use_snapshots = gui.CheckBoxField(
label=_('Use snapshots'),
default=False,
order=30,
order=33,
tooltip=_(
'If active, UDS will try to create an snapshot (if one already does not exists) before accessing a machine, and restore it after usage.'
),
@ -99,7 +109,7 @@ class FixedService(services.Service, abc.ABC): # pylint: disable=too-many-publi
# This one replaces use_snapshots, and is used to select the snapshot type (No snapshot, recover snapshot and stop machine, recover snapshot and start machine)
snapshot_type = gui.ChoiceField(
label=_('Snapshot type'),
order=31,
order=36,
default='0',
tooltip=_(
'If active, UDS will try to create an snapshot (if one already does not exists) before accessing a machine, and restore it after usage.'
@ -112,16 +122,6 @@ class FixedService(services.Service, abc.ABC): # pylint: disable=too-many-publi
],
)
# Keep name as "machine" so we can use VCHelpers.getMachines
machines = gui.MultiChoiceField(
label=_("Machines"),
order=32,
tooltip=_('Machines for this service'),
required=True,
tab=types.ui.Tab.MACHINE,
rows=10,
)
# Randomize machine assignation isntead of linear
randomize = gui.CheckBoxField(
label=_('Randomize machine assignation'),
@ -131,7 +131,7 @@ class FixedService(services.Service, abc.ABC): # pylint: disable=too-many-publi
tab=types.ui.Tab.ADVANCED,
)
maintain_on_error = fields.maintain_on_error_field(
order=101,
order=103,
tab=types.ui.Tab.ADVANCED,
)

View File

@ -331,7 +331,7 @@ def remove_duplicates_field(
def soft_shutdown_field(
order: int = 103,
tab: 'types.ui.Tab|str|None' = None,
tab: 'types.ui.Tab|str|None' = types.ui.Tab.ADVANCED,
old_field_name: typing.Optional[str] = None,
) -> ui.gui.CheckBoxField:
return ui.gui.CheckBoxField(