diff --git a/computes/forms.py b/computes/forms.py index a626106..7dfcbe6 100644 --- a/computes/forms.py +++ b/computes/forms.py @@ -149,6 +149,8 @@ class ComputeEditHostForm(forms.Form): class ComputeAddSocketForm(forms.Form): name = forms.CharField(error_messages={'required': _('No hostname has been entered')}, max_length=20) + details = forms.CharField(error_messages={'required': _('No details has been entred')}, + max_length=50) def clean_name(self): name = self.cleaned_data['name'] diff --git a/computes/migrations/0002_compute_details.py b/computes/migrations/0002_compute_details.py new file mode 100644 index 0000000..1e0fdf5 --- /dev/null +++ b/computes/migrations/0002_compute_details.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + +class Migration(migrations.Migration): + + dependencies = [ + ('computes', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='Compute', + name='details', + field=models.CharField(max_length=50, null=True, blank=True), + ), + ] diff --git a/computes/models.py b/computes/models.py index 6ee7de8..df9bf02 100644 --- a/computes/models.py +++ b/computes/models.py @@ -6,6 +6,7 @@ class Compute(models.Model): hostname = models.CharField(max_length=20) login = models.CharField(max_length=20) password = models.CharField(max_length=14, blank=True, null=True) + details = models.CharField(max_length=50, null=True, blank=True) type = models.IntegerField() def __unicode__(self): diff --git a/computes/templates/computes.html b/computes/templates/computes.html index 7c1c28f..2ffc6f4 100644 --- a/computes/templates/computes.html +++ b/computes/templates/computes.html @@ -45,6 +45,11 @@ {% else %}

{% trans "Not Connected" %}

{% endif %} + {% if compute.details %} +

{% trans compute.details %}

+ {% else %} +

{% trans "No details available" %}

+ {% endif %} diff --git a/computes/templates/create_comp_block.html b/computes/templates/create_comp_block.html index 57e327a..9e9a965 100644 --- a/computes/templates/create_comp_block.html +++ b/computes/templates/create_comp_block.html @@ -141,6 +141,14 @@ + +
+ +
+ +
+
+ -{% endif %} \ No newline at end of file +{% endif %} diff --git a/computes/templates/overview.html b/computes/templates/overview.html index 09d5d83..8bfad6e 100644 --- a/computes/templates/overview.html +++ b/computes/templates/overview.html @@ -40,6 +40,7 @@

{% trans "Logical CPUs" %}

{% trans "Processor" %}

{% trans "Connection" %}

+

{% trans "Details" %}

{{ hostname }}

@@ -49,6 +50,7 @@

{{ logical_cpu }}

{{ model_cpu }}

{{ uri_conn }}

+

{{ compute.details }}

diff --git a/computes/views.py b/computes/views.py index e293107..13fb70d 100644 --- a/computes/views.py +++ b/computes/views.py @@ -35,14 +35,15 @@ def computes(request): 'status': connection_manager.host_is_up(compute.type, compute.hostname), 'type': compute.type, 'login': compute.login, - 'password': compute.password + 'password': compute.password, + 'details': compute.details }) return compute_data error_messages = [] computes = Compute.objects.filter().order_by('name') computes_info = get_hosts_status(computes) - + if request.method == 'POST': if 'host_del' in request.POST: compute_id = request.POST.get('host_id', '') @@ -103,6 +104,7 @@ def computes(request): if form.is_valid(): data = form.cleaned_data new_socket_host = Compute(name=data['name'], + details=data['details'], hostname='localhost', type=CONN_SOCKET, login='', @@ -121,6 +123,7 @@ def computes(request): compute_edit.hostname = data['hostname'] compute_edit.login = data['login'] compute_edit.password = data['password'] + compute.edit_details = data['details'] compute_edit.save() return HttpResponseRedirect(request.get_full_path()) else: diff --git a/webvirtcloud/settings.py b/webvirtcloud/settings.py index 9181cf6..052be0c 100644 --- a/webvirtcloud/settings.py +++ b/webvirtcloud/settings.py @@ -8,7 +8,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '4y(f4rfqc6f2!i8_vfuu)kav6tdv5#sc=n%o451dm+th0&3uci' -DEBUG = False +DEBUG = True TEMPLATE_DEBUG = DEBUG diff --git a/webvirtcloud/urls.py b/webvirtcloud/urls.py index 6cb32e7..8cfa9d9 100644 --- a/webvirtcloud/urls.py +++ b/webvirtcloud/urls.py @@ -12,7 +12,7 @@ urlpatterns = patterns('', url(r'^compute/(?P[0-9]+)/storages/$', 'storages.views.storages', name='storages'), - url(r'^compute/(?P[0-9]+)/storage/(?P[\w\-\.]+)/$', + url(r'^compute/(?P[0-9]+)/storage/(?P[\w\-\.\/]+)/$', 'storages.views.storage', name='storage'), url(r'^compute/(?P[0-9]+)/networks/$', 'networks.views.networks', name='networks'),