var key = manifold.metadata.get_key(method);
if (!key)
continue;
- if (key.length > 1)
- continue;
- key = key[0];
var sq_keys = [];
var subrecords = record[method];
if (!subrecords)
continue
$.each(subrecords, function (i, subrecord) {
- sq_keys.push(subrecord[key]);
+ if (key.length == 1){
+ key = key[0];
+ sq_keys.push(subrecord[key]);
+ }else{
+ // more than what's necessary, but should work
+ sq_keys.push(subrecord);
+ }
});
update_query.params[method] = sq_keys;
update_query_orig.params[method] = sq_keys.slice();
var QueryUpdater = Plugin.extend({
init: function(options, element) {
- this.classname="queryupdater";
+ this.classname="queryupdater";
this._super(options, element);
var self = this;
+
+ this.initial = Array();
+
this.table = this.elmt('table').dataTable({
// the original querytable layout was
// sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
do_update: function(e) {
var self = e.data;
+
+ self.spin();
+ console.log("do_update");
+
// XXX check that the query is not disabled
manifold.raise_event(self.options.query_uuid, RUN_UPDATE);
+
+ // how to stop the spinning after the event?
+ // this should be triggered by some on_updatequery_done ?
},
// related buttons are also disabled in the html template
set_state: function(data)
{
+ console.log("function set_state");
var action;
var msg;
var button = '';
on_new_record: function(record)
{
+ console.log("query_updater on_new_record");
+ console.log(record);
+
// if (not and update) {
// initial['resource'], initial['lease'] ?
- this.initial.push(record.urn);
+ this.initial.push(record);
+ //this.set_record_state(record, RECORD_STATE_ATTACHED);
// We simply add to the table
// } else {
// \ this.initial_resources
on_query_in_progress: function()
{
- messages.debug("queryupdater.on_query_in_progress");
+ messages.debug("queryupdater.on_query_in_progress");
this.spin();
},
this.clear();
},
- on_new_record: function(record)
- {
- },
-
on_query_done: function()
{
+ console.log("on_query_done");
this.unspin();
},
// NOTE: record_key could be sufficient
on_added_record: function(record)
{
+ console.log("on_added_record = ",record);
this.set_record_state(record, RECORD_STATE_ADDED);
// update pending number
},
on_removed_record: function(record_key)
{
+ console.log("on_removed_record = ",record_key);
this.set_record_state(RECORD_STATE_REMOVED);
},
on_field_state_changed: function(result)
{
+ console.log("on_field_state_changed");
+ console.log(result);
messages.debug(result)
/* this.set_state(result.request, result.key, result.value, result.status); */
this.set_state(result);
if (!change)
return;
// ioi: Refubrished
- var initial = this.initial_resources;
+ var initial = this.initial;
//var r_removed = []; //
/*-----------------------------------------------------------------------
TODO: remove this dirty hack !!!
else:
messages.error(request, 'Account error: You need an account in myslice platform to perform this action')
return HttpResponseRedirect("/portal/account/")
+
+ # download identity for jfed
+ elif 'dl_identity' in request.POST:
+ for account_detail in account_details:
+ for platform_detail in platform_details:
+ if platform_detail['platform_id'] == account_detail['platform_id']:
+ if 'myslice' in platform_detail['platform']:
+ account_config = json.loads(account_detail['config'])
+ if 'user_private_key' in account_config:
+ private_key = account_config['user_private_key']
+ user_hrn = account_config.get('user_hrn','N/A')
+ registry = 'http://sfa-fed4fire.pl.sophia.inria.fr:12345/'
+ jfed_identity = user_hrn + '\n' + registry + '\n' + private_key
+ response = HttpResponse(jfed_identity, content_type='text/plain')
+ response['Content-Disposition'] = 'attachment; filename="jfed_identity.txt"'
+ return response
+ else:
+ messages.error(request, 'Download error: Private key is not stored in the server')
+ return HttpResponseRedirect("/portal/account/")
+
+ else:
+ messages.error(request, 'Account error: You need an account in myslice platform to perform this action')
+ return HttpResponseRedirect("/portal/account/")
#clear all creds
elif 'clear_cred' in request.POST:
# cc_myself = forms.BooleanField(required=False)
class ContactForm(forms.Form):
- first_name = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
- regex=r'^[\w.@+-]+$',
- max_length=30,
- label=_("First name"),
- error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
- last_name = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
- regex=r'^[\w.@+-]+$',
- max_length=30,
- label=_("Last name"),
- error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
- authority = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
- regex=r'^[\w.@+-]+$',
- max_length=30,
- label=_("authority"),
- error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
+ # first_name = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
+ # regex=r'^[\w.@+-]+$',
+ # max_length=30,
+ # label=_("First name"),
+ # error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
+ # last_name = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
+ # regex=r'^[\w.@+-]+$',
+ # max_length=30,
+ # label=_("Last name"),
+ # error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
+ # authority = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
+ # regex=r'^[\w.@+-]+$',
+ # max_length=30,
+ # label=_("authority"),
+ # error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
email = forms.EmailField(widget=forms.TextInput(attrs={'class':'form-control'}))
subject = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
regex=r'^[\w.@+-]+$',
from plugins.testbeds import TestbedsPlugin
from plugins.scheduler2 import Scheduler2
from plugins.columns_editor import ColumnsEditor
+from plugins.lists.simplelist import SimpleList
from myslice.theme import ThemeView
user_fields = ['user_hrn'] # [column['name'] for column in user_md['column']]
# TODO The query to run is embedded in the URL
+ # Example: select slice_hrn, resource.urn, lease.resource, lease.start_time, lease.end_time from slice where slice_hrn == "ple.upmc.myslicedemo"
main_query = Query.get('slice').filter_by('slice_hrn', '=', slicename)
main_query.select(
'slice_hrn',
'resource.urn',
'resource.hostname', 'resource.type',
'resource.network_hrn',
- 'lease.urn',
+ 'lease.resource',
+ 'lease.start_time',
+ 'lease.end_time',
#'user.user_hrn',
#'application.measurement_point.counter'
)
# RESERVED RESOURCES LIST
# resources as a list using datatable plugin
- list_reserved_resources = QueryTable(
- page = page,
- domid = 'resources-reserved-list',
- title = 'List view',
- query = sq_resource,
- query_all = sq_resource,
- init_key = "urn",
- checkboxes = True,
- datatables_options = {
- 'iDisplayLength': 25,
- 'bLengthChange' : True,
- 'bAutoWidth' : True,
- },
+ list_reserved_resources = SimpleList(
+ title = None,
+ page = page,
+ key = 'urn',
+ query = sq_resource,
)
+ list_reserved_leases = SimpleList(
+ title = None,
+ page = page,
+ key = 'resource',
+ query = sq_lease,
+ )
+
+# list_reserved_resources = QueryTable(
+# page = page,
+# domid = 'resources-reserved-list',
+# title = 'List view',
+# query = sq_resource,
+# query_all = sq_resource,
+# init_key = "urn",
+# checkboxes = True,
+# datatables_options = {
+# 'iDisplayLength': 25,
+# 'bLengthChange' : True,
+# 'bAutoWidth' : True,
+# },
+# )
+
# --------------------------------------------------------------------------
# COLUMNS EDITOR
# list of fields to be applied on the query
template_env = {}
template_env['list_resources'] = list_resources.render(self.request)
-# template_env['list_reserved_resources'] = list_reserved_resources.render(self.request)
+ template_env['list_reserved_resources'] = list_reserved_resources.render(self.request)
+ template_env['list_reserved_leases'] = list_reserved_leases.render(self.request)
template_env['columns_editor'] = filter_column_editor.render(self.request)
}
-div#secondary {
-
-}
-
-div#secondary ul {
- position:absolute;
- top:8px;
- right:0;
-}
-
-div#secondary li {
- font-size:9pt;
- float:left;
- list-style:none;
- margin-right:30px;
- color:gray;
-}
-div#secondary li a {
- color:gray;
-}
-div#secondary li a:hover {
- color:#270A5A;
- text-decoration:none;
-}
-div#secondary li:last-child {
- margin-right:0;
-}
-
div#navigation {
background-color:black;
width:100%;
position:relative;
cursor:pointer;
}
-div#navigation .dropdown-menu {
- color:white;
+div.navigation .dropdown-menu {
+ color:black;
padding:0 15px 15px 15px;
margin-top:5px;
margin-left:-16px;
- background-color:black;
}
-div#navigation .dropdown-menu a {
- color:white;
+div.navigation .dropdown-menu a {
+ color:black;
}
-div#menu-slice-list{
+div.menu-slice-list {
display:none;
position:absolute;
- background-color:black;
padding:15px;
left:-15px;
z-index:10;
}
-div#navigation .dropdown-menu li:first-child {
+div.navigation .dropdown-menu li:first-child {
border-bottom:1px solid white;
padding-bottom:5px;
}
/**/
+.header {
+ -moz-box-shadow: 0 0 1px rgba(82,82,82,0.6);
+ -webkit-box-shadow: 0 0 1px rgba(82,82,82,0.6);
+ box-shadow: 0 0 1px rgba(82,82,82,0.6);
+ height:61px;
+ background-color:white;
+}
div.navigation {
}
div.navigation li {
color:#0C0047;
font-family:open_sansbold, sans-serif;
- font-size:10pt;
+ font-size:9pt;
font-weight:normal;
line-height:0.8em;
letter-spacing:0.4pt;
div.navigation li:last-child {
margin-right:0;
}
+div.secondary {
+ text-align:right;
+}
+
+div.secondary ul {
+ margin:6px 0 0 0;
+ padding:0;
+}
+
+div.secondary li {
+ font-size:9pt;
+ display:inline;
+ list-style:none;
+ margin:0px;
+ padding:0;
+ margin-right:15px;
+ color:#747474;
+ letter-spacing:0.4px;
+}
+div.secondary li:last-child {
+ margin-right:0;
+}
+div.secondary li a {
+ color:#747474;
+}
+div.secondary li a:hover {
+ text-decoration:none;
+}
+div.secondary .button {
+ width:300px;
+ margin-top:15px;
+}
+div.secondary .account {
+ margin-top:10px;
+ padding:0;
+ font-size:9pt;
+ color:gray;
+ text-align:right;
+}
+div.secondary .account span {
+ font-size:8pt;
+}
+div.secondary .account a {
+ color:black;
+}
div.home {
font-size:11pt;
line-height:1.2em;
color:white;
line-height:1.4em;
}
+div.dashboard {
+ text-align:center;
+}
+div.dashboard div {
+ margin:25px 0;
+}
+div.dashboard ul {
+ text-align:left;
+ margin-left:24px;
+ list-style:none;
+}
div.registration-form {
padding-top:150px;
text-align:center;
<table class="profile">
<tr>
<td colspan="2">
- <div>Platform: Myslice</div>
+ <div>Platforms: Myslice</div>
</td>
</tr>
<tr>
<tr class="even" id="pkey_row">
{%if 'N/A' not in user_private_key%}
<td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
- <td class="value">********<a href="#">
+ <td class="value">********<a href="#"></a>
<button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
<span class="glyphicon glyphicon-download"></span> Download
</button>
</td>
{%else%}
<td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
- <td class="value">********<a href="#">
+ <td class="value">********<a href="#"></a>
<button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
<span class="glyphicon glyphicon-download"></span> Download
</button>
</td>
{%endif%}
</tr>
- <tr class="odd">
+ <tr class="odd">
+ {%if 'N/A' not in user_private_key%}
+ <td class="key">Identity</td>
+ <td>
+ <button type="submit" name="dl_identity" class="btn btn-default btn-xs" title="You will require it for using jfed" id="dl_pkey">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ </td>
+ {%else%}
+ <td class="key">Identity</td>
+ <td>
+ <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_pkey">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ </td>
+ {%endif%}
+ </tr>
+ <tr class="even">
<td colspan="2">
<p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
<b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
</div>
<div class="row">
- <div class="col-md-2"></div>
- <div class="col-md-8">
+ <div class="col-md-4">
<form role="form" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }} {{ field }}
</div>
{% endfor %}
- <button type="submit" class="btn btn-default">Create Ticket</button>
+ <button type="submit" class="btn btn-primary">Create Ticket</button>
</form>
</div>
</div>
--- /dev/null
+{% extends "layout_wide.html" %}
+{% block content %}
+
+
+{% if messages %}
+<ul class="messages">
+ {% for message in messages %}
+ <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+ {% endfor %}
+</ul>
+{% endif %}
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <ul class="nav nav-tabs nav-section">
+ <li class="active"><a href="#profile"><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Account" /> User Profile</a></li>
+ <li><a href="#account">Account</a></li>
+ <li><a href="#access">Testbed Access</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+<div class="container tab-content">
+ <div class="tab-pane active row" id="profile">
+
+ <div class="col-md-12">
+
+ <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
+ {% csrf_token %}
+ <table class="profile">
+ <tr>
+ <td colspan="2">
+ <div>Platforms: Myslice</div>
+ </td>
+ </tr>
+ <tr>
+ <td class="key">Email</td>
+ <td class="value">
+ <span id="emailval" class="value" >{{ person.email }}</span>
+ <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
+ <span class="glyphicon glyphicon-question-sign"></span> Edit
+ </button>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td class="key">Password</td>
+ <td class="value">
+ <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
+ <span class="glyphicon glyphicon-edit"></span> Edit
+ </button>
+ <span id="passval"class="value">******** </span>
+ <span class="hide_this" id="span_pass">
+ <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
+ <div style='display:none;' id="pass_form">
+ <input type='hidden' value='' /></div>
+ <table id="edit_password">
+ <tr>
+ <td>Enter password: </td>
+ <td class="field"> <input type="password" name="password" id="password" /> </td>
+ </tr>
+ <tr>
+ <td>Confirm password: </td>
+ <td class="field">
+ <input type="password" name="confirmpassword" id="confirmpassword" />
+ <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
+ </td>
+ </tr>
+ </table>
+ </span>
+ </td>
+ </tr>
+ <tr class="even">
+ <td class="key">Full Name</td>
+ <td class="value">
+ <span id="nameval" class="value" >{{ fullname }} </span>
+ <span class="hide_this" id="span_name">
+ <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
+ <div style='display:none;'><input type='hidden' name='nameform' /></div>
+ <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
+ <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
+ <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
+ </span>
+ <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
+ <span class="glyphicon glyphicon-edit"></span> Edit
+ </button>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td class="key">Authority</td>
+ <td class="value">
+ <span id="affval" class="value">{{ authority }}</span>
+ <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
+ <span class="glyphicon glyphicon-question-sign"></span> Edit
+ </button>
+ </td>
+ </tr>
+ {%if 'Enabled' in user_status %}
+ <tr class="even">
+ <td class="key">Generate Keys</td>
+ <td>
+ <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair"
+ onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
+ title="It will generate a new key Pair and your current credentials will be overwritten."/>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td class="key">Public Key</td>
+ <td class="value">
+ <span id="keyval" class="value">******** </span>
+ <span class="hide_this" id="span_upload">
+ <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
+ <div style='display:none;'>
+ <input type='hidden' name='upload' /></div>
+ <input type="file" name="pubkey" class="required" id="pubkey"/>
+ <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
+ onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
+ </span>
+ <div style='display:none;'> <input type='hidden' name='dload' /> </div>
+ <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
+ <span class="glyphicon glyphicon-upload"></span> Upload
+ </button>
+ </td>
+ </tr>
+ <tr class="even" id="pkey_row">
+ {%if 'N/A' not in user_private_key%}
+ <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
+ <td class="value">********<a href="#">
+ <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
+ onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
+ </td>
+ {%else%}
+ <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
+ <td class="value">********<a href="#">
+ <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
+ </td>
+ {%endif%}
+ </tr>
+ <tr class="odd">
+ <td colspan="2">
+ <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
+ <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
+ <b>Security:</b> Manual account delegation. Download & Delete private key.
+ </p>
+ </td>
+ </tr>
+ {%endif%}
+ </table>
+
+ </div>
+ </div>
+
+ <div class="tab-pane row" id="account">
+ <div class="col-md-12">
+
+ <h3>Principal Account <small>Account used for delegating credentials</small></h3>
+ <table class="table">
+ <tr class="odd">
+ <th>Platform</th>
+ <th>Account Type</th>
+ <th>Account Delegation</th>
+ <th>User hrn</th>
+ <th>User Status</th>
+ <!--<th>Pub Key</th> -->
+ </tr>
+ {% for row in principal_acc %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.platform_name }} </td>
+ <td class="odd"> {{ row.account_type }} </td>
+ <td class="odd"> {{ row.delegation_type }} </td>
+ <td class="odd"> {{ row.usr_hrn }} </td>
+ <td class="odd"> {{ row.user_status }} </td>
+ <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
+ </tr>
+ {%endfor%}
+ </table>
+
+ </div>
+
+
+ {%if 'Enabled' in user_status %}
+ <div class="col-md-12">
+ <h3>Credentials <small>Delegated to Principal Account</small></h3>
+ <table class="table">
+ <caption><b>Delegated User Credential</b></caption>
+ <tr class="odd">
+ <th>Expiration Date</th>
+ <th>Download</th>
+ </tr>
+ {% for row in my_users %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.cred_exp }} </td>
+ <td class="odd">
+ <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+ <p></p>
+ <table class="mytable table table-bordered table-hover">
+ <caption><b>Delegated Slice Credentials</b></caption>
+ <tr class="odd">
+ <th>Slice Name</th>
+ <th>Expiration Date</th>
+ <th>Download</th>
+ </tr>
+ {% for row in my_slices %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.slice_name }} </td>
+ <td class="odd"> {{ row.cred_exp }} </td>
+ <td class="odd">
+ <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+ <p></p>
+ <table class="mytable table table-bordered table-hover">
+ <caption><b>Delegated Authority Credentials</b></caption>
+ <tr class="odd">
+ <th>Authority Name</th>
+ <th>Expiration Date</th>
+ <th>Download</th>
+ </tr>
+ {% for row in my_auths %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.auth_name }} </td>
+ <td class="odd"> {{ row.cred_exp }} </td>
+ <td class="odd">
+ <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+ <p></p>
+ {%if '' not in my_users%}
+ <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
+ {%else%}
+ <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
+ {%endif%}
+ </div>
+ </div>
+
+ <div class="tab-pane row" id="access">
+ <div class="col-md-12">
+
+ <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
+ <table class="mytable table table-bordered table-hover">
+ <tr class="odd">
+ <th>Platform</th>
+ <th>Account Type</th>
+ <th>Reference to</th>
+ <th>Remove Account</th>
+ </tr>
+ {% for row in ref_acc %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.platform_name }} </td>
+ <td class="odd"> {{ row.account_type }} </td>
+ <td class="odd"> {{ row.account_reference }} </td>
+ <td class="odd">
+ <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
+ <span class="glyphicon glyphicon-minus"></span>
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+
+
+ <h3>Add reference account to the following testbeds</h3>
+ <table class="mytable table table-bordered table-hover">
+ <tr class="odd">
+ <th>Platforms</th>
+ <th>Add Account</th>
+ </tr>
+ {% for platform in platform_list %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ platform.platform_no_access }} </td>
+ <td class="odd">
+ <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
+ <span class="glyphicon glyphicon-plus"></span>
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+ </div>
+{%endif%}
+</div>
+</form>
+</div>
+
+<script>
+ $(document).ready(function() {
+ $('.nav-tabs a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ id = $(this).attr('href').substr(1);
+
+ });
+
+ $('button#createslice').click(function() {
+ window.location="/portal/slice_request/";
+ });
+ });
+</script>
+
+{% endblock %}
<!-- <div class="row">
{% widget '_widget-news.html' %}
</div> -->
+{% if username %}
+<div class="container dashboard">
+ <div class="row">
+ <div class="col-md-3">
+ <h3>
+ EXPERIMENT
+ </h3>
+ <div>
+ <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
+ </div>
+ <div>
+ <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
+ </div>
+ <div>
+ <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <h3>MANAGEMENT</h3>
+ <div>
+ <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
+ </div>
+ <div>
+ <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <h3>
+ SUPPORT
+ </h3>
+ <div>
+ <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
+ </div>
+ <div>
+ <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
+ </div>
+ </div>
+
+ <div class="col-md-3">
+ <h3>
+ ACCOUNT
+ </h3>
+ <div>
+ <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
+ </div>
+ <div>
+ <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+ </div>
+ <div>
+ {% if person.last_name %}
+ {{person.first_name}} {{person.last_name}}<br />
+ {% endif %}
+ <span class="label">Email:</span> <a href='/portal/account/'>{{person.email}}</a>
+ </div>
+ </div>
+ </div>
+</div>
+{% else %}
<div class="container-fluid home">
<div class="">
<div class="col-sm-2"></div>
</h3>
</div>
<div class="col-sm-5 col-sm-offset-1">
- {% if person %}
- <div class="logged-in">
- <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
- <div>
- {% if person.last_name %}
- {{person.first_name}} {{person.last_name}}<br />
- {% endif %}
- <span class="label">Email:</span> <a href='/portal/account/'>{{person.email}}</a>
- </div>
- </div>
- {% else %}
<div class="row">
{% widget '_widget-login-user.html' %}
</div>
- {% endif %}
-
- {% if person %}
- <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
- <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
- {% else %}
- {% endif %}
-
- <!-- <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button> -->
</div>
<div class="col-sm-1"></div>
</div>
</div>
+{% endif %}
+
<script type="text/javascript">
$(document).ready(function() {
<div class="tab-pane row" id="testbeds">...</div>
<div class="tab-pane row" id="resources">...</div>
<div class="tab-pane row" id="users">...</div>
- <div class="tab-pane row" id="statistics">...</div>
- <div class="tab-pane row" id="measurements">...</div>
+ <!-- <div class="tab-pane row" id="statistics">...</div> -->
+ <!-- <div class="tab-pane row" id="measurements">...</div> -->
<div class="tab-pane row" id="experiment">...</div>
</div>
{% endblock %}
{% if section == "resources" %}
<ul class="nav nav-tabs nav-section">
<li><a href="/slice/{{ slice }}#info"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About MySlice" /> {{ slice }}</a></li>
- <li><a href="/slice/{{ slice }}#testbeds">Testbeds</a></li>
+ <!-- <li><a href="/slice/{{ slice }}#testbeds">Testbeds</a></li> -->
<li class="active"><a class="link" href="/resources/{{ slice }}">Resources</a></li>
<li><a href="/slice/{{ slice }}#users">Users</a></li>
- <li><a href="/slice/{{ slice }}#experiment">Statistics</a></li>
- <li><a href="/slice/{{ slice }}#experiment">Measurements</a></li>
+ <!-- <li><a href="/slice/{{ slice }}#experiment">Statistics</a></li> -->
+ <!-- <li><a href="/slice/{{ slice }}#experiment">Measurements</a></li> -->
<li><a href="/slice/{{ slice }}#experiment" data-toggle="tab">Experiment</a></li>
</ul>
{% else %}
<ul class="nav nav-tabs nav-section">
<li class="active"><a href="#info"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About MySlice" /> {{ slice }}</a></li>
- <li class="testbeds"><a href="#testbeds">Testbeds</a></li>
+ <!-- <li class="testbeds"><a href="#testbeds">Testbeds</a></li> -->
<li><a class="link" href="/resources/{{ slice }}">Resources</a></li>
<li class="users"><a href="#users">Users</a></li>
- <li class="statistics"><a href="#experiment">Statistics</a></li>
- <li class="measurements"><a href="#experiment">Measurements</a></li>
+ <!-- <li class="statistics"><a href="#experiment">Statistics</a></li> -->
+ <!-- <li class="measurements"><a href="#experiment">Measurements</a></li> -->
<li class="experiment"><a href="#experiment" data-toggle="tab">Experiment</a></li>
</ul>
<script>
<a href="/"><img src="{{ STATIC_URL }}img/onelab-portal.png" alt="OneLab Portal - Future Internet Testbeds" /></a>
</div>
{% if username %}
- <div id="navigation" class="col-sm-4 col-md-5 navigation">
+ <div class="col-sm-5 col-md-5 navigation">
<ul>
- <li><a href="/portal/account/">{{ username }}</a></li>
<li>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
- SLICES <span class="caret"></span>
+ EXPERIMENT <span class="caret"></span>
</a>
<div class="dropdown-menu" style="z-index:99;">
<li><a href="/portal/slice_request/">Request Slice</a></li>
</ul>
</div>
- </li>
</li>
- <li><a href="/portal/support/">SUPPORT</a></li>
+ <li id="nav-institution" class=""><a href="/portal/institution">MANAGEMENT</a></li>
<li id="nav-request"><a href="/portal/validate">REQUESTS</a></li>
- <li id="nav-institution" class=""><a href="/portal/institution">INSTITUTION</a></li>
- <li id="nav-logout" style="margin-top: 10px;"><a id="logout" style="cursor:pointer;" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> LOGOUT</a></li>
+ <li><a href="/portal/support/">SUPPORT</a></li>
+
+
</ul>
</div>
<div class="col-sm-5 col-md-5 navigation">
</div>
{% endif %}
- <div class="col-sm-4 col-md-4" id="secondary">
+ <div class="col-sm-4 col-md-4 secondary">
<ul>
+
<li><a href="/news">News</a></li>
<li><a href="/portal/about">About</a></li>
<li><a target="_blank" href="http://www.onelab.eu">Public Website</a></li>
<li><a target="_blank" href="http://intranet.onelab.eu">Intranet</a></li>
</ul>
+ {% if username %}
+ <div class="account">You are logged in as <a href="/portal/account/">{{ username }}</a> | <a id="logout" style="cursor:pointer;" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</a></div>
+ {% endif %}
</div>
</div>
</div>
{% block content %}
-<div class="row"><div class="col-sm-12">
+<div class="row">
<h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Registration" />User sign-up</h1>
-</div></div>
-<div class="row"><div class="col-sm-12">
+</div>
+<div class="row">
<p></p>
<p><strong>Questions? <a href="/portal/contact" >Contact us.</a></strong></p>
-</div></div>
+</div>
{% if errors %}
<ul>
{% for error in errors %}
<!-- <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table> -->
</div>
<div id="reserved" class="panel" style="height:370px;display:none;">
- {{list_reserved_resources}}
+ <table width="80%">
+ <tr><th width="50%" style="text-align:center;">resources</th><th width="50%" style="text-align:center;">leases</th></tr>
+ <tr>
+ <td style="text-align:center">{{list_reserved_resources}}</td>
+ <td style="text-align:center">{{list_reserved_leases}}</td>
+ </tr>
+ </table>
</div>
<div id="pending" class="panel" style="height:370px;display:none;">
{{pending_resources}}
</div>
<script>
$(document).ready(function() {
+ // TODO: Add a filter based on the list of authorities
+ $.post("/rest/authority/",{'fields':['authority_hrn']}, function( data ) {
+ console.log(data);
+ }); // post rest/authority
+
var slice_users = [];
$.post("/rest/user/",{'filters':{'parent_authority': "{{user_details.parent_authority}}"}}, function( data ) {
var list_users = [];
table_users.push(user_row);
});
- console.log("slice users before");
- console.log(slice_users);
$("table#user-tab tr:last").after(table_users.join( "" ));
$("div#user-tab-loaded").css("display","block");
$("div#user-tab-loading").css("display","none");
$("input:checkbox.user").click(function() {
- console.log("user_hrn");
user_hrn = $(this).closest('tr').find('td:eq(2)').html();
- console.log(user_hrn);
- console.log(this.checked);
if(this.checked){
var record_id = this.id;
slice_users.push (user_hrn);
}else{
- console.log("not checked");
- slice_users = $.grep(slice_users, function( user, i ) {
- return user != user_hrn;
- });
+ console.log(slice_users);
}
- console.log(slice_users);
});
}); // post rest/user
$('button#addusers').click(function() {
$.post("/update/slice/",{'filters':{'slice_hrn':'{{slice}}'},'params':{'users':slice_users}}, function(data) {
- console.log(data);
if(data.success){
// TODO: highlight row after success
//$('tr[id="'+record_id+'"]').highlight();
<div class="tab-pane row" id="testbeds">...</div>
<div class="tab-pane row" id="resources">...</div>
<div class="tab-pane row" id="users">...</div>
- <div class="tab-pane row" id="statistics">...</div>
- <div class="tab-pane row" id="measurements">...</div>
+ <!-- <div class="tab-pane row" id="statistics">...</div> -->
+ <!-- <div class="tab-pane row" id="measurements">...</div> -->
<div class="tab-pane row" id="experiment">...</div>
</div>
{% endblock %}
{% block content %}
<div class="row">
- <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> Experimenter registration</h1>
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> User sign-up</h1>
</div>
<div class="row">
- <h3>User registration complete !</h3>
- <p>
- You will receive an email with further instructions.
- </p>
- </div>
+ <h3>Sign up information received.</h3>
+ <p>You can now log in to the portal. You will have limited access. </p>
+ <p>To gain full access, two steps are required:</p>
+ <ul>
+ <li>1. You confirm your signup request by clicking on the link in the email that we have sent to your email address.</li>
+ <li>2. A manager from your organization validates your request. Upon confirmation of your signup request,<br>
+ we will send an email to the managers at your organization with a validation request.</li>
+ </ul>
+</div>
{% endblock %}
self.filters['disabled'] = '0'
self.filters['gateway_type'] = 'sfa'
self.filters['platform'] = '!myslice'
- elif(self.type.startswith('local:')):
- # XXX TODO: find a generic Query to get the fields like
- # select column.name from local:object where table == local:user
+ #elif(self.type.startswith('local:')):
+ elif ':' in self.type:
table = self.type.split(':')
+ prefix = table[0]
table = table[1]
- if table == "user":
- self.id = table + '_id'
- self.fields = ['user_id', 'email', 'password', 'config','status'];
- elif table == "account":
- # XXX TODO: Multiple key for account = (platform_id, user_id)
- self.id = "platform_id, user_id"
- self.fields = ['platform_id', 'user_id', 'auth_type', 'config'];
- elif table == "platform":
- self.id = 'platform'
- self.fields = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
+
+ if prefix is 'local':
+ # XXX TODO: find a generic Query to get the fields like
+ # select column.name from local:object where table == local:user
+ table = self.type.split(':')
+ table = table[1]
+ if table == "user":
+ self.id = table + '_id'
+ self.fields = ['user_id', 'email', 'password', 'config','status'];
+ elif table == "account":
+ # XXX TODO: Multiple key for account = (platform_id, user_id)
+ self.id = "platform_id, user_id"
+ self.fields = ['platform_id', 'user_id', 'auth_type', 'config'];
+ elif table == "platform":
+ self.id = 'platform'
+ self.fields = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
+ else:
+ # If we use prefix, set the key without the prefix then add it again
+ self.type = table
+ self.setKey()
+ self.setLocalFields()
+ self.type = prefix + ':' + table
else :
self.setKey()
self.setLocalFields()