return reqs
def json_settings_list (self):
- return ['plugin_uuid', 'domid', 'query_uuid']
+ return ['plugin_uuid', 'domid', 'query_uuid', 'slicename', 'o']
def export_json_settings (self):
return True
-iframe#slicestat_resource {
+iframe.slicestat-iframe {
width:100%;
height:400px;
border:0;
// Call the parent constructor, see FAQ when forgotten
this._super(options, element);
-
+
/* Member variables */
/* Plugin events */
// What happens when we don't define some events ?
// Some can be less efficient
this.listen_query(options.query_uuid);
-
+
/* GUI setup and event binding */
// call function
-
+ if (typeof options.slicename != 'undefined') {
+ options.slicename = options.slicename.replace("ple.","").replace(".","_");
+ }
+ if (typeof options.o == 'undefined') {
+ //options.o = 'cpu';
+ }
+
+ this.elmt().on('show', options, this.on_show);
},
/* PLUGIN EVENTS */
// this.id, this.el, this.cl, this.elts
// same output as a jquery selector with some guarantees
},
-
+
+ on_show: function(ev)
+ {
+ $('iframe#' + ev.target.id + '-iframe').attr('src','http://plestats.planet-lab.eu/nodes.php?slice='+ev.data.slicename+'&order='+ev.data.o);
+ },
/* TEMPLATES */
// see in the html template
/* RECORD HANDLERS */
on_new_record: function(record)
{
- console.log(record);
-
- $('iframe#slicestat_resource').attr('src','http://plestats.planet-lab.eu/node.php?node='+record.hostname);
-
+ $('iframe#' + this.elmt().attr('id') + '-iframe').attr('src','http://plestats.planet-lab.eu/node.php?node='+record.hostname);
},
/* INTERNAL FUNCTIONS */
<div id={{ domid }}>
-<iframe id="slicestat_resource" src=""></iframe>
+<iframe class="slicestat-iframe" id="{{ domid }}-iframe" src=""></iframe>
</div>
def get_context_data(self, **kwargs):
page = Page(self.request)
-
+ page.add_js_files ( [ "js/common.functions.js" ] )
platform_query = Query().get('local:platform').filter_by('disabled', '==', '0').select('platform','platform_longname','gateway_type')
#platform_query = Query().get('local:platform').select('platform','platform_longname','gateway_type')
page.enqueue_query(platform_query)
def get_context_data(self, **kwargs):
page = Page(self.request)
-
+ page.add_js_files ( [ "js/common.functions.js" ] )
for key, value in kwargs.iteritems():
print "%s = %s" % (key, value)
if key == "platformname":
from plugins.active_filters import ActiveFilters
from plugins.quickfilter import QuickFilter
from plugins.messages import Messages
+from plugins.slicestat import SliceStat
from myslice.config import Config
},
)
+ resources_stats_cpu = SliceStat(
+ title = "CPU Usage",
+ domid = 'resources-stats-cpu',
+ page = page,
+ stats = 'slice',
+ key = 'hrn',
+ query = 'none',
+ slicename = slicename,
+ o = 'cpu'
+ )
+
+ resources_stats_mem = SliceStat(
+ title = "Memory Usage",
+ domid = 'resources-stats-mem',
+ page = page,
+ stats = 'slice',
+ key = 'hrn',
+ query = 'none',
+ slicename = slicename,
+ o = 'mem'
+ )
+
+ resources_stats_asb = SliceStat(
+ title = "Traffic Sent",
+ domid = 'resources-stats-asb',
+ page = page,
+ stats = 'slice',
+ key = 'hrn',
+ query = 'none',
+ slicename = slicename,
+ o = 'asb'
+ )
+
+ resources_stats_arb = SliceStat(
+ title = "Traffic Received",
+ domid = 'resources-stats-arb',
+ page = page,
+ stats = 'slice',
+ key = 'hrn',
+ query = 'none',
+ slicename = slicename,
+ o = 'arb'
+ )
+
# with the new 'Filter' stuff on top, no need for anything but the hazelnut
resources_as_list_area = resources_as_list
togglable=True,
title="Resources",
outline_complete=True,
- sons=[ resources_as_map, resources_as_list_area, ],
+ sons=[ resources_as_map, resources_as_list_area, resources_stats_cpu, resources_stats_mem, resources_stats_asb, resources_stats_arb ],
active_domid = 'resources-map',
)
main_stack.insert (resources_area)
-
# --------------------------------------------------------------------------
# USERS
-# if do_query_users:
-# tab_users = Tabs(
-# page = page,
-# domid = 'users',
-# outline_complete = True,
-# togglable = True,
-# title = 'Users',
-# active_domid = 'users-list',
-# )
-# main_stack.insert(tab_users)
-#
-# tab_users.insert(Hazelnut(
-# page = page,
-# title = 'Users List',
-# domid = 'users-list',
-# # tab's sons preferably turn this off
-# togglable = False,
-# # this is the query at the core of the slice list
-# query = sq_user,
-# query_all = query_user_all,
-# checkboxes = True,
-# datatables_options = {
-# 'iDisplayLength' : 25,
-# 'bLengthChange' : True,
-# 'bAutoWidth' : True,
-# },
-# ))
+ if do_query_users:
+ tab_users = Tabs(
+ page = page,
+ domid = 'users',
+ outline_complete = True,
+ togglable = True,
+ title = 'Users',
+ active_domid = 'users-list',
+ )
+ main_stack.insert(tab_users)
+
+ tab_users.insert(Hazelnut(
+ page = page,
+ title = 'Users List',
+ domid = 'users-list',
+ # tab's sons preferably turn this off
+ togglable = False,
+ # this is the query at the core of the slice list
+ query = sq_user,
+ query_all = query_user_all,
+ checkboxes = True,
+ datatables_options = {
+ 'iDisplayLength' : 25,
+ 'bLengthChange' : True,
+ 'bAutoWidth' : True,
+ },
+ ))
+
# DEMO
# --------------------------------------------------------------------------
# MEASUREMENTS
{% extends "layout-unfold1.html" %}
{% block head %}
-<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
{% endblock %}
{% block unfold1_main %}
template_env [ 'unfold2_margin' ] = related_plugin.render (request)
# add our own css in the mix
- page.add_css_files ( 'css/dashboard.css')
+ #page.add_css_files ( 'css/dashboard.css')
# don't forget to run the requests
page.expose_queries ()
<ul class="nav navbar-nav">
{% for d in topmenu_items %}
{% if d.dropdown %}
- <li class="dropdown">
+ <li class="other">
<a class="dropdown-toggle" data-toggle="dropdown" href="{{ d.href }}">{{ d.label }}<b class="caret"></b></a>
<ul class="dropdown-menu">
{% for dd in d.contents %}
/*-------------------------------- MARKO'S STYLES -----*/
-
/* GENERAL */
.container {
border-radius:0;
border: 0;
font-family: Ubuntu, arial, sans-serif;
- text-transform: ;
+ /* text-transform: ; */
font-weight: normal;
font-size: 40px;
/* color: #30196d; */
color: white;
margin-bottom: 0px;
margin-top: 0;
- padding: 30px;
+ padding: 40px;
opacity: 1;
text-align: center;
background-color: #30196d;
/* background-color: #ff7394 !important; */
background-color: #add7ff !important;
}
-
+/*
#complete-measurements {
background-color: !important;
}
-
+*/
#complete-pending {
/* background-color: #add7ff !important; */
background-color: #B8B2FF !important;
padding-top: 0px;
font-family: Ubuntu, Arial, sans-serif;
font-weight: bold;
- text-transform: ;
+ /* text-transform: ; */
background: #fff;
-webkit-box-shadow: 0px 10px 10px rgba(50, 50, 50, 0.44);
-moz-box-shadow: 0px 10px 10px rgba(50, 50, 50, 0.44);
color: #572bc9 !important;
}
-.navbar-nav li.active a {
.navbar-nav li.active a {
background: #eee !important;
}
}
button.logged-in:hover {
- background: #4af25d;
- border: 2px solid #4af25d;
+ /* background: #4af25d; */
+ background: #ff7394;
+ border: 2px solid #ff7394;
color: #333;
}
li.username {
ul.pagination li a {
- background: ;
+ /* background: ; */
color: #572bc9;
font-family: Ubuntu, Arial, sans-serif;
}
}
.btn.btn-default:hover {
- background: #4af25d;
+ /* background: #4af25d; */
+ background: #ff7394;
color: #333;
font-family: Ubuntu, Arial, sans-serif;
font-weight: bold;
text-align: left;
padding: 8px 12px 4px 20px;
vertical-align:middle;
- background: # url(../img/tablesort-header.jpg) no-repeat !important;
+ background: url('../img/tablesort-header.jpg') no-repeat !important;
}
div.Hazelnut table.dataTable td, div.Hazelnut table.dataTable textarea, div.Hazelnut table.dataTable input [type="text"] {
div.Hazelnut table.dataTable tfoot {
background: url('../img/tablesort-header.png') repeat-x !important;
- background-color: # !important;
+ /* background-color: # !important; */
}
#ms-dashboard-profile {
background: url("../img/icon_users_color.png") top center no-repeat;
-
}
#ms-dashboard-testbeds {
}
.ms-dashboard-content a {
- color: /*#572bc9*/ #ff7394 !important;
+ color: #ff7394 !important;
+ /* color: #ff0099 !important; */
}
+.ms-dashboard-content a:hover {
+ color: white !important;
+}
.ms-dashboard-caption h2 {
font-family: Ubuntu, Arial, sans-serif;
border-bottom: 0 !important;