Fixes #840: Correct API path resolution for secrets when BASE_PATH is configured

This commit is contained in:
Jeremy Stretch
2017-01-23 16:25:05 -05:00
parent d36923e47d
commit 1bddd038fe
3 changed files with 9 additions and 6 deletions

View File

@@ -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>