diff --git a/netbox/project-static/js/secrets.js b/netbox/project-static/js/secrets.js
index fadcc0d39..22710236b 100644
--- a/netbox/project-static/js/secrets.js
+++ b/netbox/project-static/js/secrets.js
@@ -48,7 +48,7 @@ $(document).ready(function() {
$('#generate_keypair').click(function() {
$('#new_keypair_modal').modal('show');
$.ajax({
- url: '/api/secrets/generate-keys/',
+ url: netbox_api_path + 'secrets/generate-keys/',
type: 'GET',
dataType: 'json',
success: function (response, status) {
@@ -75,7 +75,7 @@ $(document).ready(function() {
function unlock_secret(secret_id, private_key) {
var csrf_token = $('input[name=csrfmiddlewaretoken]').val();
$.ajax({
- url: '/api/secrets/secrets/' + secret_id + '/',
+ url: netbox_api_path + 'secrets/secrets/' + secret_id + '/',
type: 'POST',
data: {
private_key: private_key
diff --git a/netbox/templates/_base.html b/netbox/templates/_base.html
index 9ef5ef4eb..4e63cf337 100644
--- a/netbox/templates/_base.html
+++ b/netbox/templates/_base.html
@@ -296,6 +296,9 @@
+
diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html
index 53273da47..0ce898e01 100644
--- a/netbox/templates/dcim/device.html
+++ b/netbox/templates/dcim/device.html
@@ -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/");
});