perf: Applet host provider add filterset (#13517)

Co-authored-by: feng <1304903146@qq.com>
pull/13519/head
fit2bot 2024-06-26 19:07:28 +08:00 committed by GitHub
parent 9c8680d3f4
commit cd39e20808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,6 @@ class AccountTemplate(LabeledMixin, BaseAccount, SecretWithRandomMixin):
) )
permissions = [ permissions = [
('view_accounttemplatesecret', _('Can view asset account template secret')), ('view_accounttemplatesecret', _('Can view asset account template secret')),
('change_accounttemplatesecret', _('Can change asset account template secret')),
] ]
def __str__(self): def __str__(self):

View File

@ -26,7 +26,8 @@ __all__ = ['AppletHostViewSet', 'AppletHostDeploymentViewSet']
class AppletHostViewSet(JMSBulkModelViewSet): class AppletHostViewSet(JMSBulkModelViewSet):
serializer_class = AppletHostSerializer serializer_class = AppletHostSerializer
queryset = AppletHost.objects.all() queryset = AppletHost.objects.all()
search_fields = ['asset_ptr__name', 'asset_ptr__address', ] filterset_fields = ['name', 'address']
search_fields = ['name', 'address']
rbac_perms = { rbac_perms = {
'generate_accounts': 'terminal.change_applethost', 'generate_accounts': 'terminal.change_applethost',
} }

View File

@ -17,6 +17,7 @@ __all__ = ['AppProviderViewSet', ]
class AppProviderViewSet(JMSBulkModelViewSet): class AppProviderViewSet(JMSBulkModelViewSet):
serializer_class = AppProviderSerializer serializer_class = AppProviderSerializer
queryset = AppProvider.objects.all() queryset = AppProvider.objects.all()
filterset_fields = ['name', 'hostname']
search_fields = ['name', 'hostname', ] search_fields = ['name', 'hostname', ]
rbac_perms = { rbac_perms = {
'containers': 'terminal.view_appprovider', 'containers': 'terminal.view_appprovider',