mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-18 13:06:30 -06:00
commit
f731900e2f
@ -976,7 +976,7 @@ class ConsolePortConnectionForm(BootstrapMixin, forms.ModelForm):
|
|||||||
queryset=ConsoleServerPort.objects.all(),
|
queryset=ConsoleServerPort.objects.all(),
|
||||||
label='Port',
|
label='Port',
|
||||||
widget=APISelect(
|
widget=APISelect(
|
||||||
api_url='/api/dcim/console-server-ports/?device_id={{device}}',
|
api_url='/api/dcim/console-server-ports/?device_id={{console_server}}',
|
||||||
disabled_indicator='connected_console',
|
disabled_indicator='connected_console',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -1244,7 +1244,7 @@ class PowerPortConnectionForm(BootstrapMixin, forms.ModelForm):
|
|||||||
queryset=PowerOutlet.objects.all(),
|
queryset=PowerOutlet.objects.all(),
|
||||||
label='Outlet',
|
label='Outlet',
|
||||||
widget=APISelect(
|
widget=APISelect(
|
||||||
api_url='/api/dcim/power-outlets/?device_id={{device}}',
|
api_url='/api/dcim/power-outlets/?device_id={{pdu}}',
|
||||||
disabled_indicator='connected_port'
|
disabled_indicator='connected_port'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,7 @@ from django.db.models import Count
|
|||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
from django.utils.html import escape
|
||||||
from django.utils.http import urlencode
|
from django.utils.http import urlencode
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.views.generic import View
|
from django.views.generic import View
|
||||||
|
@ -383,7 +383,7 @@ def image_upload(instance, filename):
|
|||||||
elif instance.name:
|
elif instance.name:
|
||||||
filename = instance.name
|
filename = instance.name
|
||||||
|
|
||||||
return '{}{}_{}_{}'.format(path, instance.content_type.name, instance.object_id, filename)
|
return u'{}{}_{}_{}'.format(path, instance.content_type.name, instance.object_id, filename)
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
|
@ -13,7 +13,7 @@ except ImportError:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
VERSION = '2.0.0'
|
VERSION = '2.0.1'
|
||||||
|
|
||||||
# Import local configuration
|
# Import local configuration
|
||||||
ALLOWED_HOSTS = DATABASE = SECRET_KEY = None
|
ALLOWED_HOSTS = DATABASE = SECRET_KEY = None
|
||||||
|
@ -191,7 +191,7 @@ class SearchView(View):
|
|||||||
results.append({
|
results.append({
|
||||||
'name': queryset.model._meta.verbose_name_plural,
|
'name': queryset.model._meta.verbose_name_plural,
|
||||||
'table': table,
|
'table': table,
|
||||||
'url': '{}?q={}'.format(reverse(url), form.cleaned_data['q'])
|
'url': u'{}?q={}'.format(reverse(url), form.cleaned_data['q'])
|
||||||
})
|
})
|
||||||
|
|
||||||
return render(request, 'search.html', {
|
return render(request, 'search.html', {
|
||||||
|
@ -16,13 +16,14 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Adding/editing a secret
|
// Adding/editing a secret
|
||||||
$('form').submit(function(event) {
|
$('form').submit(function(event) {
|
||||||
if (
|
$(this).find('input.requires-session-key').each(function() {
|
||||||
$(this).find('input.requires-session-key').filter(function() {return this.value == ""}) &&
|
if (this.value && document.cookie.indexOf('session_key') == -1) {
|
||||||
document.cookie.indexOf('session_key') == -1
|
console.log('Field ' + this.value + ' requires a session key');
|
||||||
) {
|
$('#privkey_modal').modal('show');
|
||||||
$('#privkey_modal').modal('show');
|
event.preventDefault();
|
||||||
event.preventDefault();
|
return false;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Retrieve a session key
|
// Retrieve a session key
|
||||||
|
Loading…
Reference in New Issue
Block a user