mirror of https://github.com/jumpserver/jumpserver
perf: Applet host provider add filterset (#13517)
Co-authored-by: feng <1304903146@qq.com>pull/13519/head
parent
9c8680d3f4
commit
cd39e20808
|
@ -29,7 +29,6 @@ class AccountTemplate(LabeledMixin, BaseAccount, SecretWithRandomMixin):
|
|||
)
|
||||
permissions = [
|
||||
('view_accounttemplatesecret', _('Can view asset account template secret')),
|
||||
('change_accounttemplatesecret', _('Can change asset account template secret')),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
@ -26,7 +26,8 @@ __all__ = ['AppletHostViewSet', 'AppletHostDeploymentViewSet']
|
|||
class AppletHostViewSet(JMSBulkModelViewSet):
|
||||
serializer_class = AppletHostSerializer
|
||||
queryset = AppletHost.objects.all()
|
||||
search_fields = ['asset_ptr__name', 'asset_ptr__address', ]
|
||||
filterset_fields = ['name', 'address']
|
||||
search_fields = ['name', 'address']
|
||||
rbac_perms = {
|
||||
'generate_accounts': 'terminal.change_applethost',
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ __all__ = ['AppProviderViewSet', ]
|
|||
class AppProviderViewSet(JMSBulkModelViewSet):
|
||||
serializer_class = AppProviderSerializer
|
||||
queryset = AppProvider.objects.all()
|
||||
filterset_fields = ['name', 'hostname']
|
||||
search_fields = ['name', 'hostname', ]
|
||||
rbac_perms = {
|
||||
'containers': 'terminal.view_appprovider',
|
||||
|
|
Loading…
Reference in New Issue