Skip to content

Commit

Permalink
Fixed some bugs and redesigned html
Browse files Browse the repository at this point in the history
  • Loading branch information
retspen committed Apr 21, 2015
1 parent 2aa5558 commit 86e1915
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 376 deletions.
6 changes: 3 additions & 3 deletions computes/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h3 class="page-header">{% trans "Basic details" %}</h3>
<p>{{ uri_conn }}</p>
</div>
</div>
<div class="row" id="max-width-page">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">{% trans "Performance" %}</h3>
<div class="panel panel-success">
Expand All @@ -61,7 +61,7 @@ <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "CPU usa
<div class="panel-body">
<div class="flot-chart">
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
<canvas id="cpuChart" width="735" height="250"></canvas>
<canvas id="cpuChart" width="735" height="160"></canvas>
</div>
</div>
</div>
Expand All @@ -73,7 +73,7 @@ <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "RAM usa
<div class="panel-body">
<div class="flot-chart">
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
<canvas id="memChart" width="735" height="250"></canvas>
<canvas id="memChart" width="735" height="160"></canvas>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions computes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def get_hosts_status(computes):
if 'host_del' in request.POST:
compute_id = request.POST.get('host_id', '')
try:
del_user_inst_on_host = UserInstance.objects.filter(compute_id=compute_id)
del_user_inst_on_host.save()
del_user_inst_on_host = UserInstance.objects.filter(instance__compute_id=compute_id)
del_user_inst_on_host.delete()
finally:
try:
del_inst_on_host = Instance.objects.filter(compute_id=compute_id)
Expand Down
40 changes: 24 additions & 16 deletions instances/templates/instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{% block title %}{% trans "Instance" %} - {{ vname }}{% endblock %}
{% block content %}
<!-- Page Heading -->
<div class="row">
<h2 class="page-header">{{ vname }}</h2>
</div>
<!--
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">{{ vname }}</h1>
</div>
<h4 class="page-header">
{% trans "Status:" %}
<div class="col-sm-1 pull-right">
{% ifequal status 5 %}
<span class="text-danger">{% trans "Off" %}</span>
{% endifequal %}
Expand All @@ -18,16 +18,24 @@ <h4 class="page-header">
{% ifequal status 3 %}
<span class="text-warning">{% trans "Suspend" %}</span>
{% endifequal %}
{% trans "Vcpu:" %}
{% if cur_vcpu %}{{ cur_vcpu }}{% else %}{{ vcpu }}{% endif %}
{% trans "Ram:" %}
{{ cur_memory }}{% trans "MB" %}
{% trans "Disk:" %}
</div>
<div class="col-sm-1 pull-right">
{% if cur_vcpu %}
{{ cur_vcpu }} {% trans "Vcpu" %}
{% else %}
{{ vcpu }} {% trans "Vcpu" %}
{% endif %}
</div>
<div class="col-sm-2 pull-right">
{{ cur_memory }} {% trans "MB" %} {% trans "Ram" %}
</div>
<div class="col-sm-2 pull-right">
{% for disk in disks %}
{{ disk.size|filesizeformat }}
{{ disk.size|filesizeformat }} {% trans "Disk" %}
{% endfor %}
</h4>
</div>
</div>
-->
<!-- /.row -->

{% include 'errors_block.html' %}
Expand Down Expand Up @@ -328,7 +336,7 @@ <h4 class="page-header">
<p>{% trans "This may take more than an hour, depending on how much content is on your droplet and how large the disk is." %}</p>
<form class="form-inline" method="post" role="form">{% csrf_token %}
<div class="form-group">
<div class="col-sm-6">
<div class="col-sm-12">
<input type="text" class="form-control input-lg" name="name" placeholder="{% trans "Enter Snapshot Name" %}" maxlength="14">
</div>
</div>
Expand Down Expand Up @@ -716,7 +724,7 @@ <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "CPU usa
<div class="panel-body">
<div class="flot-chart">
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
<canvas id="cpuChart" width="735" height="250"></canvas>
<canvas id="cpuChart" width="735" height="160"></canvas>
</div>
</div>
</div>
Expand All @@ -729,7 +737,7 @@ <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "Bandwid
<div class="panel-body">
<div class="flot-chart">
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
<canvas id="netEth{{ forloop.counter0 }}Chart" width="735" height="250"></canvas>
<canvas id="netEth{{ forloop.counter0 }}Chart" width="735" height="160"></canvas>
<span class="netIN">{% trans "In" %}</span>
<span class="netOUT">{% trans "Out" %}</span>
</div>
Expand All @@ -745,7 +753,7 @@ <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "Disk I/
<div class="panel-body">
<div class="flot-chart">
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
<canvas id="blk{{ disk.dev }}Chart" width="735" height="250"></canvas>
<canvas id="blk{{ disk.dev }}Chart" width="735" height="160"></canvas>
<span class="diskRD">{% trans "Read" %}</span>
<span class="diskWR">{% trans "Write" %}</span>
</div>
Expand Down
10 changes: 6 additions & 4 deletions instances/templates/instances.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_inst_block.html' %}
<div class="pull-right search">
<input id="filter" class="form-control" type="text" placeholder="Search">
</div>
{% if all_host_vms %}
{% include 'create_inst_block.html' %}
<div class="pull-right search">
<input id="filter" class="form-control" type="text" placeholder="Search">
</div>
{% endif %}
<h1 class="page-header">{% trans "Instances" %}</h1>
</div>
</div>
Expand Down
224 changes: 0 additions & 224 deletions static/css/sb-admin.css

This file was deleted.

Loading

0 comments on commit 86e1915

Please sign in to comment.