mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
820 B
31 lines
820 B
|
|
from assets.models import Web
|
|
from .common import AssetSerializer
|
|
|
|
__all__ = ['WebSerializer']
|
|
|
|
|
|
class WebSerializer(AssetSerializer):
|
|
class Meta(AssetSerializer.Meta):
|
|
model = Web
|
|
fields = AssetSerializer.Meta.fields + [
|
|
'autofill', 'username_selector',
|
|
'password_selector', 'submit_selector',
|
|
'script'
|
|
]
|
|
extra_kwargs = {
|
|
**AssetSerializer.Meta.extra_kwargs,
|
|
'address': {
|
|
'label': 'URL'
|
|
},
|
|
'username_selector': {
|
|
'default': 'input[type=text]'
|
|
},
|
|
'password_selector': {
|
|
'default': 'input[type=password]'
|
|
},
|
|
'submit_selector': {
|
|
'default': 'button[type=submit]',
|
|
},
|
|
}
|