mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -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 %}
|
{% block javascript %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function toggleConnection(elem, api_url) {
|
function toggleConnection(elem, api_url) {
|
||||||
|
var url = netbox_api_path + api_url + elem.attr('data') + "/";
|
||||||
if (elem.hasClass('connected')) {
|
if (elem.hasClass('connected')) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: netbox_api_path + api_url + elem.attr('data') + "/",
|
url: url,
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
beforeSend: function(xhr, settings) {
|
beforeSend: function(xhr, settings) {
|
||||||
@ -569,7 +570,7 @@ function toggleConnection(elem, api_url) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: api_url + elem.attr('data') + "/",
|
url: url,
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
beforeSend: function(xhr, settings) {
|
beforeSend: function(xhr, settings) {
|
||||||
|
Loading…
Reference in New Issue
Block a user