Commit 08473bcf authored by Olga Brani's avatar Olga Brani
Browse files

Helpdesk improvements (VM connected to network)

parent 0c361f06
...@@ -1537,7 +1537,8 @@ ...@@ -1537,7 +1537,8 @@
}) })
}) })
}(window.jQuery);/* ============================================================= }(window.jQuery);
/* =============================================================
* bootstrap-typeahead.js v2.0.3 * bootstrap-typeahead.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#typeahead * http://twitter.github.com/bootstrap/javascript.html#typeahead
* ============================================================= * =============================================================
......
...@@ -24,9 +24,42 @@ ...@@ -24,9 +24,42 @@
</dl> </dl>
</div> </div>
<div class="tab-pane" id="vms{{ network.pk }}"> <div class="tab-pane" id="vms{{ network.pk }}">
<div class="well">
{% for vm in network|network_vms:account %}<a href="#vm-{{ vm.pk }}">{{ vm.name }}</a><br />{% endfor %} <table class="table well">
</div> <thead>
<td>ID</td>
<td>VM (ID)</td>
<td>Created</td>
<td>Updated</td>
<td>Index</td>
<td>MAC</td>
<td>IPv4</td>
<td>IPv6</td>
<td>Firewall</td>
</thead>
<tbody>
{% for nic in network|network_nics:account %}
<tr>
<td>{{ nic.pk }}</td>
<td>{{ nic.machine }} ({{ nic.machine.pk }})</td>
<td>{{ nic.created }}</td>
<td>{{ nic.updated }}</td>
<td>{{ nic.index }}</td>
<td>{{ nic.mac }}</td>
<td>{{ nic.ipv4 }}</td>
<td>{{ nic.ipv6 }}</td>
<td>{{ nic.get_firewall_profile_display }} ({{nic.firewall_profile}})</td>
</tr>
{% empty %}
<tr>
<td colspan=9>No network interface available</td>
</tr>
{% endfor %}
</tbody>
</table>
</div> </div>
</div> </div>
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<dt>Backend job id</dt><dd>{{ vm.backendjobid }}</dd> <dt>Backend job id</dt><dd>{{ vm.backendjobid }}</dd>
<dt>Backend op code</dt><dd>{{ vm.get_backendopcode_display }} ({{ vm.backendopcode }})</dd> <dt>Backend op code</dt><dd>{{ vm.get_backendopcode_display }} ({{ vm.backendopcode }})</dd>
<dt>Backend log msg</dt><dd>{{ vm.backendlogmsg }}</dd> <dt>Backend log msg</dt><dd>{{ vm.backendlogmsg }}</dd>
<dt>Build backendjobstatus</dt><dd>{{ vm.backendjobstatus }}</dd>
<dt>Build percentage</dt><dd>{{ vm.buildpercentage }}</dd> <dt>Build percentage</dt><dd>{{ vm.buildpercentage }}</dd>
</dl> </dl>
</div> </div>
......
...@@ -66,3 +66,12 @@ def network_vms(network, account): ...@@ -66,3 +66,12 @@ def network_vms(network, account):
return vms return vms
network_vms.is_safe = True network_vms.is_safe = True
@register.filter(name="network_nics")
def network_nics(network, account):
vms = []
for nic in network.nics.filter(machine__userid=account):
vms.append(nic)
return vms
network_nics.is_safe = True
\ No newline at end of file
// Copyright 2011 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// conditions are met:
//
// 1. Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// The views and conclusions contained in the software and
// documentation are those of the authors and should not be
// interpreted as representing official policies, either expressed
// or implied, of GRNET S.A.
//
;(function(root){
// root
var root = root;
// setup namepsaces
var snf = root.synnefo = root.synnefo || {};
var models = snf.models = snf.models || {}
var storage = snf.storage = snf.storage || {};
var ui = snf.ui = snf.ui || {};
var util = snf.util || {};
var views = snf.views = snf.views || {}
// shortcuts
var bb = root.Backbone;
// logging
var logger = new snf.logging.logger("SNF-VIEWS");
var debug = _.bind(logger.debug, logger);
views.DisksView = views.View.extend({
view_id: "disks",
pane: "#disks-pane",
el: "#disks-pane",
initialize: function() {
},
__update_layout: function() {
}
});
})(this);
...@@ -388,10 +388,10 @@ ...@@ -388,10 +388,10 @@
// views classes registry // views classes registry
views_classes: {'icon': views.IconView, 'single': views.SingleView, views_classes: {'icon': views.IconView, 'single': views.SingleView,
'list': views.ListView, 'networks': views.NetworksView}, 'list': views.ListView, 'networks': views.NetworksView, 'disks': views.DisksView},
// view ids // view ids
views_ids: {'icon':0, 'single':2, 'list':1, 'networks':3}, views_ids: {'icon':0, 'single':2, 'list':1, 'networks':3, 'disks':4},
// on which pane id each view exists // on which pane id each view exists
// machine views (icon,single,list) are all on first pane // machine views (icon,single,list) are all on first pane
...@@ -679,6 +679,7 @@ ...@@ -679,6 +679,7 @@
this.add_view("list"); this.add_view("list");
this.add_view("single"); this.add_view("single");
this.add_view("networks"); this.add_view("networks");
this.add_view("disks");
this.init_menu(); this.init_menu();
}, },
......
...@@ -64,7 +64,9 @@ ...@@ -64,7 +64,9 @@
"machines/single/": "vms_single_view", "machines/single/": "vms_single_view",
// network views // network views
"networks/": "networks_view" "networks/": "networks_view",
// network views
"disks/": "disks_view"
}, },
show_welcome: function() { show_welcome: function() {
...@@ -123,6 +125,11 @@ ...@@ -123,6 +125,11 @@
networks_view: function() { networks_view: function() {
this.navigate("networks/"); this.navigate("networks/");
ui.main.show_view("networks"); ui.main.show_view("networks");
},
disks_view: function() {
this.navigate("disks/");
ui.main.show_view("disks");
} }
}); });
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_single_view.js"></script> <script src="{{ SYNNEFO_JS_WEB_URL }}ui_single_view.js"></script>
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_list_view.js"></script> <script src="{{ SYNNEFO_JS_WEB_URL }}ui_list_view.js"></script>
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_networks_view.js"></script> <script src="{{ SYNNEFO_JS_WEB_URL }}ui_networks_view.js"></script>
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_disks_view.js"></script>
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_metadata_view.js"></script> <script src="{{ SYNNEFO_JS_WEB_URL }}ui_metadata_view.js"></script>
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_feedback_view.js"></script> <script src="{{ SYNNEFO_JS_WEB_URL }}ui_feedback_view.js"></script>
<script src="{{ SYNNEFO_JS_WEB_URL }}ui_create_view.js"></script> <script src="{{ SYNNEFO_JS_WEB_URL }}ui_create_view.js"></script>
...@@ -238,7 +239,7 @@ ...@@ -238,7 +239,7 @@
<li><a href="networks" title="{% trans "configure networking" %}" <li><a href="networks" title="{% trans "configure networking" %}"
class="primary" id="networks_view_link"> class="primary" id="networks_view_link">
<img src="{{ SYNNEFO_IMAGES_URL }}networks-icon.png" /></a></li> <img src="{{ SYNNEFO_IMAGES_URL }}networks-icon.png" /></a></li>
<li class="hidden"><a href="disks" title="{% trans "manage your storage volumes" %}" <li><a href="disks" title="{% trans "manage your storage volumes" %}"
class="primary" id="disks_view_link"> class="primary" id="disks_view_link">
<img src="{{ SYNNEFO_IMAGES_URL }}disks-icon.png" /></a></li> <img src="{{ SYNNEFO_IMAGES_URL }}disks-icon.png" /></a></li>
</ul> </ul>
...@@ -250,7 +251,9 @@ ...@@ -250,7 +251,9 @@
<div id="networks-pane" class="pane"> <div id="networks-pane" class="pane">
{% include "partials/networks.html" %} {% include "partials/networks.html" %}
</div> </div>
<div id="disks-pane" class="pane"></div> <div id="disks-pane" class="pane">
{% include "partials/disks.html" %}
</div>
<div class="confirm_multiple clearfix" id="multiple_actions_container"> <div class="confirm_multiple clearfix" id="multiple_actions_container">
<div class="confirm_multiple_actions confirm-all-cont global hidden confirm_multiple_cont clearfix"> <div class="confirm_multiple_actions confirm-all-cont global hidden confirm_multiple_cont clearfix">
......
{% load i18n %}
<!-- the create button -->
<div id="machines-pane-top" class="pane-top">
<div id="createcontainer" class="create-container">
<a id="create" rel="#wizard" href="#" class="createbutton" >{% trans "New Machine +" %}</a>
</div>
<!-- changing between standard/list view -->
<div id="view-select" class="clearfix">
<a class="machines_view_link" id="machines_view_icon_link" href="" title="{% trans "Icon view" %}">
<span class="ico"></span><span class="title">{% trans "icon" %}</span>
</a>
<a class="machines_view_link" id="machines_view_list_link" href="" title="{% trans "List view" %}">
<span class="ico"></span><span class="title">{% trans "list" %}</span>
</a>
<a class="machines_view_link" id="machines_view_single_link" href="" title="{% trans "Single view" %}">
<span class="ico"></span><span class="title">{% trans "single" %}</span>
</a>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment