diff --git a/changes/243.changed b/changes/243.changed new file mode 100644 index 00000000..3b9ae3d8 --- /dev/null +++ b/changes/243.changed @@ -0,0 +1 @@ +Sync Devices From Network job form now highlights required fields. diff --git a/nautobot_device_onboarding/jobs.py b/nautobot_device_onboarding/jobs.py index 6ed3b70f..90155f7d 100755 --- a/nautobot_device_onboarding/jobs.py +++ b/nautobot_device_onboarding/jobs.py @@ -275,7 +275,7 @@ class Meta: csv_file = FileVar( label="CSV File", required=False, - description="If a file is provided all the options below will be ignored.", + description="If a file is provided, all the options in the manual input tab will be disabled.", ) location = ObjectVar( model=Location, @@ -337,6 +337,8 @@ class Meta: description="Device platform. Define ONLY to override auto-recognition of platform.", ) + template_name = "nautobot_device_onboarding/ssot_sync_devices.html" + def load_source_adapter(self): """Load onboarding network adapter.""" self.source_adapter = SyncDevicesNetworkAdapter(job=self, sync=self.sync) @@ -502,7 +504,7 @@ def run( raise ValidationError(message="CSV check failed. No devices will be synced.") else: - # Verify that all requried form inputs have been provided + # Verify that all required form inputs have been provided, this is here in case the form is not used required_inputs = { "location": location, "namespace": namespace, diff --git a/nautobot_device_onboarding/templates/nautobot_device_onboarding/ssot_sync_devices.html b/nautobot_device_onboarding/templates/nautobot_device_onboarding/ssot_sync_devices.html new file mode 100644 index 00000000..afae37b0 --- /dev/null +++ b/nautobot_device_onboarding/templates/nautobot_device_onboarding/ssot_sync_devices.html @@ -0,0 +1,77 @@ +{% extends 'extras/job.html' %} +{% load form_helpers %} + +{% block job_form %} + +{% render_form job_form excluded_fields="['location', 'namespace', 'ip_addresses', 'device_role', 'device_status', 'interface_status', 'ip_address_status', 'port', 'timeout', 'secrets_group', 'platform', 'set_mgmt_only', 'update_devices_without_primary_ip', 'csv_file']" %} + + {% with csv_tab_active=form.initial.csv_input %} +
+