pref: 修改 applet

pull/8997/head
ibuler 2022-10-27 20:20:40 +08:00
parent 097ebc2362
commit a9eb4fa7dd
4 changed files with 13 additions and 36 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:5d945fc6151d6f6354052a0a09706a52e7a2fa2f9e02254965cf26b134d78c3a oid sha256:97b2aa050b5846dd3399d45286d34f282acb55dca3e2b18a79c16b9d34ec938f
size 103377 size 103818

View File

@ -658,8 +658,6 @@ msgid "Script"
msgstr "" msgstr ""
#: assets/models/asset/web.py:13 #: assets/models/asset/web.py:13
#, fuzzy
#| msgid "Auto fill"
msgid "Autofill" msgid "Autofill"
msgstr "自动填充" msgstr "自动填充"
@ -1990,10 +1988,8 @@ msgid "Asset display"
msgstr "资产名称" msgstr "资产名称"
#: authentication/models.py:85 #: authentication/models.py:85
#, fuzzy
#| msgid "Action display"
msgid "Account display" msgid "Account display"
msgstr "动作名称" msgstr "账号显示"
#: authentication/models.py:89 #: authentication/models.py:89
msgid "Connection token" msgid "Connection token"
@ -4698,52 +4694,38 @@ msgid "Storage is invalid"
msgstr "存储无效" msgstr "存储无效"
#: terminal/models/applet/applet.py:21 #: terminal/models/applet/applet.py:21
#, fuzzy
#| msgid "Manually input"
msgid "Manual" msgid "Manual"
msgstr "手动输入" msgstr "手动"
#: terminal/models/applet/applet.py:22 #: terminal/models/applet/applet.py:22
msgid "Git" msgid "Git"
msgstr "" msgstr ""
#: terminal/models/applet/applet.py:23 #: terminal/models/applet/applet.py:23
#, fuzzy
#| msgid "Remote app"
msgid "Remote gzip" msgid "Remote gzip"
msgstr "远程应用" msgstr "远程应用"
#: terminal/models/applet/applet.py:28 #: terminal/models/applet/applet.py:28
#, fuzzy
#| msgid "Auth url"
msgid "Author" msgid "Author"
msgstr "认证地址" msgstr "作者"
#: terminal/models/applet/applet.py:32 #: terminal/models/applet/applet.py:32
msgid "Tags" msgid "Tags"
msgstr "" msgstr "标签"
#: terminal/models/applet/applet.py:59 terminal/models/applet/host.py:17 #: terminal/models/applet/applet.py:59 terminal/models/applet/host.py:17
#, fuzzy
#| msgid "Apply assets"
msgid "Applet" msgid "Applet"
msgstr "申请资产" msgstr "远程应用"
#: terminal/models/applet/host.py:13 #: terminal/models/applet/host.py:13
#, fuzzy
#| msgid "Verify account automation"
msgid "Account automation" msgid "Account automation"
msgstr "账号校验自动化" msgstr "账号自动化"
#: terminal/models/applet/host.py:14 #: terminal/models/applet/host.py:14
#, fuzzy
#| msgid "Date sync"
msgid "Date synced" msgid "Date synced"
msgstr "同步日期" msgstr "最后同步日期"
#: terminal/models/applet/host.py:26 #: terminal/models/applet/host.py:26
#, fuzzy
#| msgid "Host"
msgid "Hosting" msgid "Hosting"
msgstr "主机" msgstr "主机"

View File

@ -17,11 +17,6 @@ class Applet(JMSBaseModel):
general = 'general', _('General') general = 'general', _('General')
web = 'web', _('Web') web = 'web', _('Web')
class VCSType(models.TextChoices):
manual = 'manual', _('Manual')
git = 'git', _('Git')
archive = 'archive', _('Remote gzip')
name = models.CharField(max_length=128, verbose_name=_('Name'), unique=True) name = models.CharField(max_length=128, verbose_name=_('Name'), unique=True)
display_name = models.CharField(max_length=128, verbose_name=_('Display name')) display_name = models.CharField(max_length=128, verbose_name=_('Display name'))
version = models.CharField(max_length=16, verbose_name=_('Version')) version = models.CharField(max_length=16, verbose_name=_('Version'))

View File

@ -60,13 +60,13 @@ class AppletHostSerializer(HostSerializer):
} }
def __init__(self, *args, data=None, **kwargs): def __init__(self, *args, data=None, **kwargs):
self.set_initial_data(data) if data:
super().__init__(*args, data=data, **kwargs) self.set_initial_data(data)
kwargs['data'] = data
super().__init__(*args, **kwargs)
@staticmethod @staticmethod
def set_initial_data(data): def set_initial_data(data):
if not data:
return
platform = Platform.objects.get(name='RemoteAppHost') platform = Platform.objects.get(name='RemoteAppHost')
data.update({ data.update({
'platform': platform.id, 'platform': platform.id,