Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ francesco.ini
dist/
uwsgiit_console.egg-info/
build/
fabfile.py
fabfile.py
demo/db.sqlite3
6 changes: 3 additions & 3 deletions console/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@


class ContainerMetricAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'container', 'year', 'month', 'day')
list_display = ('__str__', 'container', 'year', 'month', 'day')
list_filter = ('year', 'month', 'day')


class DomainMetricAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'container', 'year', 'month', 'day')
list_display = ('__str__', 'container', 'year', 'month', 'day')
list_filter = ('year', 'month', 'day')


class UwsgiItApiAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'name', 'url')
list_display = ('__str__', 'name', 'url')
list_filter = ('name', 'url')


Expand Down
11 changes: 3 additions & 8 deletions console/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from django.core.urlresolvers import resolve, Resolver404

from uwsgiit.api import UwsgiItClient
from select2.widgets import SelectMultipleAutocomplete, SelectAutocomplete

from .models import UwsgiItApi

Expand Down Expand Up @@ -38,7 +37,6 @@ def clean(self, value):

class TagsForm(forms.Form):
tags = forms.MultipleChoiceField(
widget=SelectMultipleAutocomplete(plugin_options={"width": "300px"}),
choices=(),
required=False)

Expand All @@ -53,8 +51,7 @@ class BootstrapForm(forms.Form):
def __init__(self, *args, **kwargs):
super(BootstrapForm, self).__init__(*args, **kwargs)
for field in self.fields.keys():
if not isinstance(self.fields[field].widget, (SelectAutocomplete, SelectMultipleAutocomplete)):
self.fields[field].widget.attrs['class'] = 'form-control'
self.fields[field].widget.attrs['class'] = 'form-control'


class LoginForm(forms.Form):
Expand All @@ -71,7 +68,8 @@ def __init__(self, *args, **kwargs):
super(LoginForm, self).__init__(*args, **kwargs)
self.fields['api_url'].queryset = UwsgiItApi.objects.all()
self.fields['api_url'].initial = UwsgiItApi.objects.get_or_create(
url=settings.DEFAULT_API_URL)[0]
url=settings.DEFAULT_API_URL, name=settings.CONSOLE_SUBTITLE
)[0]

def clean(self):
cd = super(LoginForm, self).clean()
Expand Down Expand Up @@ -144,7 +142,6 @@ class ContainerForm(TagsForm):
nofollow = forms.BooleanField(label='NoFollow', required=False)
distro = forms.IntegerField(label='Distro', widget=forms.Select(choices=()))
linked_to = forms.MultipleChoiceField(
widget=SelectMultipleAutocomplete(plugin_options={"width": "300px"}),
choices=(),
required=False)
jid = forms.CharField(label='Jabber ID', required=False)
Expand Down Expand Up @@ -195,7 +192,6 @@ class CalendarForm(forms.Form):
year = forms.IntegerField()
month = forms.ChoiceField(
required=False,
widget=SelectAutocomplete(plugin_options={"width": "200px"}),
choices=[('', '')] + [(k, v) for k, v in MONTHS.items()])
day = forms.IntegerField(required=False)

Expand Down Expand Up @@ -301,7 +297,6 @@ class AlarmForm(BootstrapForm):
color = forms.CharField(max_length=7, required=False)
level = forms.ChoiceField(
required=False,
widget=SelectAutocomplete(plugin_options={"width": "100%"}),
choices=(
('', ' '), (0, 'System'), (1, 'User'),
(2, 'Exception'), (3, 'Traceback'), (4, 'Log')
Expand Down
4 changes: 2 additions & 2 deletions console/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UwsgiItApi(models.Model):
url = models.CharField(max_length=512, unique=True)
name = models.CharField(max_length=255, blank=True)

def __unicode__(self):
def __str__(self):
return self.url


Expand All @@ -40,7 +40,7 @@ class GenericMetric(models.Model):
# this ia blob containing raw metrics
json = models.TextField(null=True)

def __unicode__(self):
def __str__(self):
return '{year}-{month}-{day}'.format(
year=self.year, month=self.month, day=self.day)

Expand Down
12 changes: 12 additions & 0 deletions console/static/console/bootstrap-3.1.1-dist/css/theme.min.css

Large diffs are not rendered by default.

Loading