-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforms.py
30 lines (26 loc) · 993 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from eNMS.forms import BaseForm
from eNMS.fields import (
BooleanField,
HiddenField,
InstanceField,
IntegerField,
MultipleInstanceField,
PasswordField,
SelectField,
StringField,
)
class Form(BaseForm):
form_type = HiddenField(default="custom")
address = SelectField(choices=[("ipv4", "IPv4"), ("ipv6", "IPv6")])
connected_links = MultipleInstanceField("Links", model="link")
hostname = StringField("Username", default="admin")
ip_address = StringField("IP address")
neighbor = InstanceField("Devices", model="device")
ports = MultipleInstanceField("Port", model="port")
password = PasswordField("Password")
carry_customer_traffic = BooleanField("Carry Customer Traffic", default=False)
class PanelForm(BaseForm):
form_type = HiddenField(default="panel")
action = "eNMS.plugins.submitPanelForm"
ip_address = StringField("IP address", render_kw={"help": "ip_address"})
router_id = IntegerField("Router ID")