1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 03:54:15 +00:00

add details for local socket

This commit is contained in:
andrem 2016-03-18 15:21:44 -03:00
parent fc56e66555
commit b6350e134e
6 changed files with 24 additions and 4 deletions

View file

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

View file

@ -45,6 +45,11 @@
{% else %}
<p>{% trans "Not Connected" %}</p>
{% endif %}
{% if compute.details %}
<p>{% trans compute.details %}</p>
{% else %}
<p>{% trans "No details available" %}</p>
{% endif %}
</div>
</div>

View file

@ -141,6 +141,14 @@
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Details" %}</label>
<div class="col-sm-6">
<input type="text" name="details" class="form-control" placeholder="{% trans "Details" %}">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">

View file

@ -40,6 +40,7 @@
<p>{% trans "Logical CPUs" %}</p>
<p>{% trans "Processor" %}</p>
<p>{% trans "Connection" %}</p>
<p>{% trans "Details" %}</p>
</div>
<div class="col-xs-8 col-sm-7">
<p>{{ hostname }}</p>
@ -49,6 +50,7 @@
<p>{{ logical_cpu }}</p>
<p>{{ model_cpu }}</p>
<p>{{ uri_conn }}</p>
<p>{{ compute.details }}</p>
</div>
</div>
<div class="row">

View file

@ -36,7 +36,8 @@ 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
@ -104,6 +105,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='',
@ -122,6 +124,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:

View file

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