mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-09 21:32:17 -06:00
Fixes #840: Correct API path resolution for secrets when BASE_PATH is configured
This commit is contained in:
@@ -550,7 +550,7 @@
|
||||
function toggleConnection(elem, api_url) {
|
||||
if (elem.hasClass('connected')) {
|
||||
$.ajax({
|
||||
url: api_url + elem.attr('data') + "/",
|
||||
url: netbox_api_path + api_url + elem.attr('data') + "/",
|
||||
method: 'PATCH',
|
||||
dataType: 'json',
|
||||
beforeSend: function(xhr, settings) {
|
||||
@@ -590,13 +590,13 @@ function toggleConnection(elem, api_url) {
|
||||
return false;
|
||||
}
|
||||
$(".consoleport-toggle").click(function() {
|
||||
return toggleConnection($(this), "/{{ settings.BASE_PATH }}api/dcim/console-ports/");
|
||||
return toggleConnection($(this), "dcim/console-ports/");
|
||||
});
|
||||
$(".powerport-toggle").click(function() {
|
||||
return toggleConnection($(this), "/{{ settings.BASE_PATH }}api/dcim/power-ports/");
|
||||
return toggleConnection($(this), "dcim/power-ports/");
|
||||
});
|
||||
$(".interface-toggle").click(function() {
|
||||
return toggleConnection($(this), "/{{ settings.BASE_PATH }}api/dcim/interface-connections/");
|
||||
return toggleConnection($(this), "dcim/interface-connections/");
|
||||
});
|
||||
</script>
|
||||
<script src="{% static 'js/graphs.js' %}"></script>
|
||||
|
||||
Reference in New Issue
Block a user