perf: 修改为账号模版

pull/8023/head^2
ibuler 2022-07-17 13:57:13 +08:00
parent 0d46834fbf
commit 008b18eced
3 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class Migration(migrations.Migration):
), ),
migrations.AddField( migrations.AddField(
model_name='systemuser', model_name='systemuser',
name='auto_create_account', name='account_template_enabled',
field=models.BooleanField(default=False, verbose_name='Auto account if not exist'), field=models.BooleanField(default=False, verbose_name='Auto account if not exist'),
), ),
] ]

View File

@ -108,8 +108,8 @@ class SystemUser(ProtocolMixin, BaseUser):
protocol = models.CharField(max_length=16, choices=ProtocolMixin.Protocol.choices, default='ssh', verbose_name=_('Protocol')) protocol = models.CharField(max_length=16, choices=ProtocolMixin.Protocol.choices, default='ssh', verbose_name=_('Protocol'))
login_mode = models.CharField(choices=LOGIN_MODE_CHOICES, default=LOGIN_AUTO, max_length=10, verbose_name=_('Login mode')) login_mode = models.CharField(choices=LOGIN_MODE_CHOICES, default=LOGIN_AUTO, max_length=10, verbose_name=_('Login mode'))
auto_create_account = models.BooleanField(default=False, verbose_name=_("自动创建账号")) account_template_enabled = models.BooleanField(default=False, verbose_name=_("启用账号模版"))
auto_push_account = models.BooleanField(default=True, verbose_name=_('推送账号到资产')) auto_push_account = models.BooleanField(default=True, verbose_name=_('自动推送账号'))
type = models.CharField(max_length=16, choices=Type.choices, default=Type.common, verbose_name=_('Type')) type = models.CharField(max_length=16, choices=Type.choices, default=Type.common, verbose_name=_('Type'))
sudo = models.TextField(default='/bin/whoami', verbose_name=_('Sudo')) sudo = models.TextField(default='/bin/whoami', verbose_name=_('Sudo'))
shell = models.CharField(max_length=64, default='/bin/bash', verbose_name=_('Shell')) shell = models.CharField(max_length=64, default='/bin/bash', verbose_name=_('Shell'))

View File

@ -47,7 +47,7 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
fields_small = fields_mini + fields_write_only + [ fields_small = fields_mini + fields_write_only + [
'token', 'ssh_key_fingerprint', 'token', 'ssh_key_fingerprint',
'type', 'type_display', 'protocol', 'is_asset_protocol', 'type', 'type_display', 'protocol', 'is_asset_protocol',
'auto_create_account', 'login_mode', 'login_mode_display', 'priority', 'account_template_enabled', 'login_mode', 'login_mode_display', 'priority',
'sudo', 'shell', 'sftp_root', 'home', 'system_groups', 'ad_domain', 'sudo', 'shell', 'sftp_root', 'home', 'system_groups', 'ad_domain',
'username_same_with_user', 'auto_push_account', 'auto_generate_key', 'username_same_with_user', 'auto_push_account', 'auto_generate_key',
'su_enabled', 'su_from', 'su_enabled', 'su_from',