jumpserver/apps/assets/serializers/asset/web.py

31 lines
820 B
Python
Raw Normal View History

2022-09-01 06:46:31 +00:00
from assets.models import Web
from .common import AssetSerializer
__all__ = ['WebSerializer']
class WebSerializer(AssetSerializer):
class Meta(AssetSerializer.Meta):
model = Web
2022-09-09 11:17:25 +00:00
fields = AssetSerializer.Meta.fields + [
2022-09-21 03:17:14 +00:00
'autofill', 'username_selector',
2022-10-20 08:39:11 +00:00
'password_selector', 'submit_selector',
'script'
2022-09-09 11:17:25 +00:00
]
2022-09-21 03:17:14 +00:00
extra_kwargs = {
**AssetSerializer.Meta.extra_kwargs,
'address': {
'label': 'URL'
2022-10-19 06:56:27 +00:00
},
'username_selector': {
'default': 'input[type=text]'
},
'password_selector': {
'default': 'input[type=password]'
},
'submit_selector': {
'default': 'button[type=submit]',
2022-10-20 08:39:11 +00:00
},
2022-09-21 03:17:14 +00:00
}