perf: 硬件设备支持账号切换

pull/10036/head^2
ibuler 2023-03-22 16:43:00 +08:00 committed by Jiangjie.Bai
parent 463d54a4d8
commit 47c207ce13
3 changed files with 7 additions and 4 deletions

View File

@ -15,7 +15,10 @@ class DeviceTypes(BaseType):
'*': {
'charset_enabled': False,
'domain_enabled': True,
'su_enabled': False,
'su_enabled': True,
'su_methods': [
{'name': 'enable', 'id': 'enable'},
]
}
}

View File

@ -20,8 +20,8 @@ class HostTypes(BaseType):
'domain_enabled': True,
'su_enabled': True,
'su_methods': [
{'name': 'sudo su', 'id': 'sudo su'},
{'name': 'su -', 'id': 'su -'}
{'name': 'sudo su -', 'id': 'sudo'},
{'name': 'su -', 'id': 'su'}
],
},
cls.WINDOWS: {

View File

@ -95,7 +95,7 @@ class PlatformSerializer(WritableNestedModelSerializer):
)
automation = PlatformAutomationSerializer(label=_("Automation"), required=False)
su_method = LabeledChoiceField(
choices=[("sudo", "sudo su -"), ("su", "su - ")],
choices=[("sudo", "sudo su -"), ("su", "su - "), ("enable", "enable")],
label=_("Su method"), required=False, default="sudo", allow_null=True
)