Skip to content

Commit 477a62d

Browse files
committed
[chores] Requested changes
- Minor changes in device.js - Revert changes in old migrations
1 parent 7e3f770 commit 477a62d

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

openwisp_controller/config/migrations/0013_last_ip_management_ip_and_status_applied.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ class Migration(migrations.Migration):
6464
name='management_ip',
6565
field=models.GenericIPAddressField(
6666
blank=True,
67-
help_text='IP address used by OpenWISP to reach the device when '
68-
'performing any type of push operation or active check. The value '
69-
'of this field is generally sent by the device and hence does not '
70-
'need to be changed, but can be changed or cleared manually if needed.',
67+
help_text='ip address of the management interface, if available',
7168
null=True,
7269
),
7370
),

openwisp_controller/config/migrations/0027_add_indexes_on_ip_fields.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ class Migration(migrations.Migration):
2727
field=models.GenericIPAddressField(
2828
blank=True,
2929
db_index=True,
30-
help_text='This is the IP address used by OpenWISP to reach the '
31-
'device when performing any type of push operation or active '
32-
'check. The value of this field is generally sent by the device '
33-
'and hence does not need to be changed, but can be changed or '
34-
'cleared manually if needed.',
30+
help_text='ip address of the management interface, if available',
3531
null=True,
3632
),
3733
),

openwisp_controller/config/static/config/css/admin.css

+4
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ button.show-sc{
310310
#main .form-row.field-location .item-label {
311311
bottom: -7px
312312
}
313+
#edit_management_ip {
314+
margin-left: 7px;
315+
opacity: 0.8;
316+
}
313317

314318
@media (max-width: 767px) {
315319
ul.tabs li {

openwisp_controller/config/static/config/js/device.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ django.jQuery(function ($) {
66

77
// replaces the management ip field with text with the option to edit it
88
var ip_input = $(".field-management_ip > div > input");
9-
var initial_ip = ip_input.prop("value");
9+
var initial_ip = ip_input.val();
1010
ip_input.after(function () {
1111
ip_input.hide();
1212
return (
1313
'<span class="readonly" id="management_ip_text">' +
14-
(initial_ip === "" ? "-n/a-" : initial_ip) +
14+
(initial_ip === "" ? "-" : initial_ip) +
1515
"</span>"
1616
);
1717
});
1818
$("#management_ip_text").after(
19-
'<a id="edit_management_ip"> <img src="/static/admin/img/icon-changelink.svg" alt="Edit"></a>'
19+
'<a id="edit_management_ip"><img src="/static/admin/img/icon-changelink.svg" alt="Edit"></a>'
2020
);
2121
$("#edit_management_ip").click(function () {
2222
var ip_text = $("#management_ip_text");

0 commit comments

Comments
 (0)