mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixes #859: Fix Javascript for connection status toggle button
This commit is contained in:
parent
af3c9eaec1
commit
f4f41a5985
@ -548,9 +548,10 @@
|
||||
{% block javascript %}
|
||||
<script type="text/javascript">
|
||||
function toggleConnection(elem, api_url) {
|
||||
var url = netbox_api_path + api_url + elem.attr('data') + "/";
|
||||
if (elem.hasClass('connected')) {
|
||||
$.ajax({
|
||||
url: netbox_api_path + api_url + elem.attr('data') + "/",
|
||||
url: url,
|
||||
method: 'PATCH',
|
||||
dataType: 'json',
|
||||
beforeSend: function(xhr, settings) {
|
||||
@ -569,7 +570,7 @@ function toggleConnection(elem, api_url) {
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
url: api_url + elem.attr('data') + "/",
|
||||
url: url,
|
||||
method: 'PATCH',
|
||||
dataType: 'json',
|
||||
beforeSend: function(xhr, settings) {
|
||||
|
Loading…
Reference in New Issue
Block a user