cd $DIRNAME/..
# default port : if hostname starts with z -> use 8080 ; otherwise take 80
-hostname | grep -q '^z' && port=8080 || port=8080
-#hostname | grep -q '^z' && port=8080 || port=80
+#hostname | grep -q '^z' && port=8080 || port=8080
+hostname | grep -q '^z' && port=8080 || port=80
[[ -n "$@" ]] && port=$1
while true; do
import portal.testbedlist
import portal.sliceview
import portal.sliceresourceview
+from portal.sliceuserview import SliceUserView
#### high level choices
(r'^rest/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.dispatch'),
(r'^table/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.dispatch'),
(r'^datatable/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.dispatch'),
+ (r'^update/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.update.dispatch'),
+ (r'^create/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.create.dispatch'),
+ (r'^delete/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.delete.dispatch'),
#
#
#(r'^view/?', include('view.urls')),
# Portal
(r'^testbeds/(?P<slicename>[^/]+)/?$', portal.testbedlist.TestbedList.as_view()),
(r'^resources/(?P<slicename>[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()),
+ (r'^users/(?P<slicename>[^/]+)/?$', SliceUserView.as_view()),
(r'^slice/(?P<slicename>[^/]+)/?$', portal.sliceview.SliceView.as_view()),
url(r'^portal/', include('portal.urls')),
]
from portal.models import PendingUser, PendingSlice, PendingAuthority
import json
-from portal.models import PendingSlice
+from django.contrib.auth.models import User
from django.template.loader import render_to_string
from django.core.mail import send_mail
return ['support@myslice.info']
else:
pi_user_hrns = [ hrn for x in pi_users for hrn in x['pi_users'] ]
- query = Query.get('user').filter_by('user_hrn', 'included', pi_user_hrns).select('email')
+ query = Query.get('user').filter_by('user_hrn', 'included', pi_user_hrns).select('user_email')
results = execute_admin_query(request, query)
- print "mails", [result['email'] for result in results]
- return [result['email'] for result in results]
+ return [result['user_email'] for result in results]
def is_pi(wsgi_request, user_hrn, authority_hrn):
# XXX could be done in a single query !
request['last_name'] = user.last_name
request['email'] = user.email
request['login'] = user.login
- request['keypair'] = user.keypair
+ request['user_hrn'] = user.user_hrn
+ request['public_key'] = user.public_key
+ request['private_key'] = user.private_key
return request
def make_request_slice(slice):
'enabled' : True
}
- query = Query.create('user').set(user_params).select('user_hrn')
+ query = Query.create('user').set(sfa_user_params).select('user_hrn')
results = execute_query(wsgi_request, query)
if not results:
raise Exception, "Could not create %s. Already exists ?" % user_params['user_hrn']
# we would have to perform the steps in create_pending_user too
# Add the user to the SFA registry
- sfa_add_user(wsgi_request, request)
+ sfa_create_user(wsgi_request, request)
# Update Manifold user status
manifold_update_user(wsgi_request, request['email'], {'status': USER_STATUS_ENABLED})
# Add reference accounts for platforms
manifold_add_reference_user_accounts(wsgi_request, request)
-def create_pending_user(wgsi_request, request, user_detail):
+def create_pending_user(wsgi_request, request, user_detail):
"""
"""
authority_hrn = request['authority_hrn'],
email = request['email'],
password = request['password'],
- keypair = request['account_config'], # XXX REMOVE
- public_key = request['public_key'], # TODO NEW
- private_key = request['private_key'], # TODO NEW
- user_hrn = request['user_hrn'], # TODO NEW
+ public_key = request['public_key'],
+ private_key = request['private_key'],
+ user_hrn = request['user_hrn'],
pi = '', # XXX Why not None ?
)
b.save()
manifold_add_account(wsgi_request, account_params)
# Send an email: the recipients are the PI of the authority
- recipients = authority_get_pi_emails(wsgi_request, authority_hrn)
+ recipients = authority_get_pi_emails(wsgi_request, request['authority_hrn'])
msg = render_to_string('user_request_email.txt', request)
send_mail("Onelab New User request for %(email)s submitted" % request, msg, 'support@myslice.info', recipients)
# We might have slices on different registries with different user accounts
# We note that this portal could be specific to a given registry, to which we register users, but i'm not sure that simplifies things
# Different registries mean different identities, unless we identify via SFA HRN or have associated the user email to a single hrn
- print self.request
#messages.info(self.request, 'You have logged in')
page = Page(self.request)
# root_authority = sub_authority[0]
# slice_query = Query().get(root_authority+':user').filter_by('user_hrn', '==', '$user_hrn').select('user_hrn', 'slice.slice_hrn')
# else:
+ print "SLICE QUERY"
+ print "-" * 80
slice_query = Query().get('user').filter_by('user_hrn', '==', '$user_hrn').select('slices.slice_hrn')
page.enqueue_query(slice_query)
page.enqueue_query(testbed_query)
manifoldresult = auth_result
# let's use ManifoldResult.__repr__
env['state']="%s"%manifoldresult
- env['layout_1_or_2']="layout-unfold2.html"
return render_to_response(self.template,env, context_instance=RequestContext(request))
# user was authenticated at the backend
if request.user.is_authenticated():
env['person'] = self.request.user
+ env['username'] = self.request.user
else:
env['person'] = None
return render_to_response(self.template,env, context_instance=RequestContext(request))
# otherwise
else:
env['state'] = "Your username and/or password were incorrect."
- env['layout_1_or_2']="layout-unfold2.html"
return render_to_response(self.template, env, context_instance=RequestContext(request))
if state: env['state'] = state
elif not env['username']: env['state'] = None
# use one or two columns for the layout - not logged in users will see the login prompt
- env['layout_1_or_2']="layout-unfold2.html" if not env['username'] else "layout-unfold1.html"
return render_to_response(self.template, env, context_instance=RequestContext(request))
from random import randint
from django.core.mail import send_mail
-from django.contrib.auth.models import User
from django.views.generic import View
from django.template.loader import render_to_string
from django.shortcuts import render
from manifold.core.query import Query
from portal.models import PendingUser
-from portal.actions import authority_get_pi_emails, manifold_add_user,manifold_add_account
+from portal.actions import create_pending_user
from theme import ThemeView
}
# Construct user_hrn from email (XXX Should use common code)
- split_email = reg_email.split("@")[0]
+ split_email = user_request['email'].split("@")[0]
split_email = split_email.replace(".", "_")
user_request['user_hrn'] = user_request['authority_hrn'] \
+ '.' + split_email + str(randint(1,1000000))
# Example: private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIC...'
# Example: public_key = 'ssh-rsa AAAAB3...'
user_request['private_key'] = private.exportKey()
- user_request['public_key'] = private.public_key().exportKey(format='OpenSSH')
+ user_request['public_key'] = private.publickey().exportKey(format='OpenSSH')
else:
user_request['auth_type'] = 'user'
self.template_name = 'user_register_complete.html'
return render(wsgi_request, self.template, {'theme': self.theme})
-
- # Backlashed \n => \\n but no surrounding " "
- public_key_formatted = request['public_key'].replace('"', '');
+ else:
+ user_request = {}
template_env = {
'topmenu_items': topmenu_items_live('Register', page),
--- /dev/null
+from django.template import RequestContext
+from django.shortcuts import render_to_response
+
+from manifold.core.query import Query, AnalyzedQuery
+from manifoldapi.manifoldapi import execute_query
+
+from django.views.generic.base import TemplateView
+
+from unfold.loginrequired import LoginRequiredView
+from django.http import HttpResponse
+from django.shortcuts import render
+
+from unfold.page import Page
+from manifold.core.query import Query, AnalyzedQuery
+from manifoldapi.manifoldapi import execute_query
+
+from theme import ThemeView
+
+class SliceUserView (LoginRequiredView, ThemeView):
+ template_name = "slice-user-view.html"
+
+ def get(self, request, slicename):
+ return render_to_response(self.template, {"slice": slicename, "theme": self.theme, "username": request.user, "section":"resources"}, context_instance=RequestContext(request))
-/*****************************************************************
-Motivated from Geni clearing house
-********************/
-
-* {
- margin: 0;
- padding: 0;
-}
-
-fieldset, img {
- border: 0;
-}
-
-
-
-/************************
-* GENERAL
-************************/
-
-body {
- background-color: #fff;
- /* font-family: "Segoe UI", "Lucida Grande", "Helvetica" , sans-serif;
- font-size: 12pt; */
- min-width: 1000px; /* ADDED July 2012 */
- margin: 0px auto; /* ADDED Aug 14, 2012 */
-}
-
-ol {
- list-style-position: inside;
-}
-
-a {
- text-decoration: none;
- color: #0066FF;
-}
-
-code {
- font-family: "Consolas", "Lucida Console", "Monaco", "Courier New";
-}
-
-.odd {
- background-color: #fff;
-}
-
-.even {
- background-color: #eee;
-}
-
-
-/************************
-* LAYOUT
-************************/
-
-/***** Header *****/
-
-#header {
- width: 900px; /* Edited Aug 14, 2012 prev width:70%*/
- margin: 30px auto 20px auto;
-}
-
-#header #logo {
- font-size: 42px; /* Edited Sept 28, 2012 prev value :36pt*/
- font-weight: bold;
-}
-
-#header #logo a {
- color: #000;
-}
-
-#header #caption {
- margin-left: 20px;
- font-size: 13.3333px;
-}
-
-#header #caption a {
- color: #0066FF;
-}
-
-
-/***** Navigator *****/
-
-#navigator {
- border-bottom: 3px solid #222;
- width: 100%;
- margin: 0 auto; /* ADDED Aug 14, 2012 */
-}
-
-#tabs {
- margin: 0 auto;
- width: 900px; /* Editied Aug 14, 2012 prev width: 70% */
-}
-
-#meta {
- float: right;
- font-size: 13pt;
- margin: 5px 0;
-}
-
-#meta a.logout {
- color: red;
-}
-
-#tabs table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-#tabs table tr td {
- padding: 5px 15px;
- font-size: 14pt;
- border-top: 1px solid #222;
- border-right: 2px solid #222;
- border-left: 2px solid #222;
-}
-
-#tabs table tr td a {
- color: #000;
-}
-
-#tabs table tr td.active {
- background-color: #222;
- color: #fff;
-}
-
-#tabs table tr td.active a {
- color: #fff;
-}
-
-
-/***** Main *****/
-
-#main {
- width: 100%;
- height: 400px;
- padding: 40px 0;
- background-image: url(../images/bg.png);
- background-repeat: repeat-x;
-}
-
-#middle {
- margin: 0 auto;
- width: 900px; /* Edited Aug 14, 2012 prev width:70% */
- padding-bottom: 60px;
-}
-
-
-/***** Notifications *****/
-
-.warning2 {
- border: 1px solid red;
- margin: 20px 60px;
- padding: 10px 20px;
- color: red;
- background-color: #f2dbdb;
- text-align: center;
-}
-.message {
- border: 1px solid green;
- max-width : 682px; /* ADDED July 2012 */
- margin: 20px 60px;
- padding: 10px 20px;
- color: green;
- font-weight: normal;
- background-color: #CCFFCC;
- text-align: center;
-}
-
-.tooltip {
- background-color: #efefef;
- color: #333;
- font-size: 10pt;
- padding: 3px;
- border: solid 1px #333;
- z-index:100;
-}
-
-ul.errorlist li {
- color: red;
- font-weight: normal;
- font-size: 10pt;
- background-color: #f2dbdb;
- padding: 3px;
- list-style-position: inside;
-}
-
-#learn-about-seattle {
- /* max-width : 70%;*/
- text-align : center;
- background-color : #ded;
- border : 1px solid #0a0;
- padding : 1em;
- margin-top : 1em;
- margin-bottom : 1em;
- font-size : 1.3em;
-}
* STYLE FOR PERSONAL DETAILS TABLE
*******************************/
-h1 {
- font-size: 1.8em;
- border-bottom: 1px solid #bbb;
- width: 70%;
- min-width: 688px;
-}
#info {
background-color : #839E99;
-/* @override unfold/static/css/plugin.css */
-
-/*-------------------------------- MARKO'S STYLES -----*/
-
-
-
-
-/*** NEW CSS STYLES FOR ONLEAB ***/
-
body {
background-color:white;
color:black;
h1 {
border-bottom:1px solid #DDDDDD;
- padding:0 0 15px 0;
+ padding:0 0 5px 0;
margin:0 0 15px 0;
+ font-size:18pt;
}
h1 img {
- vertical-align:top;
+ vertical-align:middle;
+ margin-bottom:4px;
+}
+h2 {
+ font-size:14pt;
+ color:#333333;
+}
+h3 {
+ font-size:13pt;
+ color:#201E62;
}
div.wrapper {
width:980px;
margin:0 auto;
position:relative;
}
+div.container {
+ width:980px;
+ margin:25px auto;
+}
+div.wide {
+ margin:25px auto;
+ padding:0 25px;
+}
span.label {
font-size:11pt;
}
/* HEADER */
div#header {
- height:85px;
+ height:100px;
background-color:white;
}
/* HOME DASHBOARD */
div#home-dashboard {
color:black;
- margin:25px auto;
+ margin:0 auto 25px auto;
}
div#home-dashboard table {
margin:25px;
/* NAV TABS */
.nav.nav-tabs {
+ margin-bottom:25px;
}
.nav.nav-tabs li.active a {
/* INSTITUTION */
div#institution {
color:black;
- margin:25px auto;
}
.form-hint {
font-size:11pt;
color:gray;
}
-/* SLICE REQUEST */
-div#slice-request {
- color:black;
- margin:25px auto;
-}
+
.form-hint {
font-size:11pt;
font-style:italic;
/* TICKET REQUEST */
div#ticket-request {
color:black;
- margin:25px auto;
}
.form-hint {
font-size:11pt;
/* SLICE VIEW */
div#slice-view {
- width:100%;
- margin:25px auto;
+ margin:0;
}
-div#slice-view div.list-group-item {
+div.list-group-item {
border:0;
background-color:white;
font-weight:bold;
padding-left:0;
}
-div#slice-view a.list-group-item {
+a.list-group-item {
border:0;
background-color:white;
padding:3px 0 3px 10px;
border-left:2pt white solid;
}
-div#slice-view a.list-group-item.active, div#slice-view a.list-group-item:hover {
+a.list-group-item.active, a.list-group-item:hover {
border-left:2pt blue solid;
}
-div#slice-view a.list-group-item p.list-group-item-text {
+a.list-group-item p.list-group-item-text {
font-size:9pt;
font-style:italic;
}
font-size:14px;
color:black;
padding:0;
- margin-top:10px;
}
.slice-sections li.active a, .slice-pending li.active a {
color:#201E62;
}
.slice-pending button {
font-size:9pt;
- margin:8px 0 0 0;
+ margin:-2px 0 0 0;
padding:3px 5px;
}
.slice-pending button.apply {
}
.slice-pending button.clear {
}
-
-/* */
-
-/* TESTBED LIST */
-div#testbed-list {
- margin:25px auto;
-}
-
--- /dev/null
+$(document).ready(function() {
+ $('a.home-tab').click(function() {
+ $('ul.nav-tabs li').removeClass('active');
+ $(this).parent().addClass('active');
+ $('div.home-panel').hide();
+ $('div#'+$(this).data('panel')).show();
+ });
+ var url = window.location;
+ if(url.hash) {
+ // Fragment exists
+ tab = url.href.split("#")[1];
+ tab_exists = $('div#'+tab).length;
+ if (tab_exists) {
+ $('ul.nav-tabs li').removeClass('active');
+ $('li#'+tab+'-tab').addClass('active');
+ $('div.home-panel').hide();
+ $('div#'+tab).show();
+ }
+ }
+
+ /* TODO: factorize into functions */
+ $('button#deleteusers').click(function() {
+ $('input:checkbox.user').each(function (index) {
+ if(this.checked){
+ var record_id = this.id;
+ $.post("/delete/user/",{'filters':{'user_hrn':this.id}}, function(data) {
+ if(data.success){
+ $('tr[id="'+record_id+'"]').fadeOut("slow");
+ $('tr[id="'+record_id+'"]').remove();
+ }else{
+ alert("Rest Error for "+record_id+": "+data.error);
+ }
+ });
+
+ }
+ });
+ });
+ $('button#deleteslices').click(function() {
+ $('input:checkbox.slice').each(function (index) {
+ if(this.checked){
+ var record_id = this.id;
+ $.post("/delete/slice/",{'filters':{'slice_hrn':this.id}}, function(data) {
+ if(data.success){
+ $('tr[id="'+record_id+'"]').fadeOut("slow");
+ $('tr[id="'+record_id+'"]').remove();
+ }else{
+ alert("Rest Error for "+record_id+": "+data.error);
+ }
+ });
+
+ }
+ });
+ });
+
+ $('button#createslice').click(function() {
+ window.location="/portal/slice_request/";
+ });
+ $('button#slicerequestbtn').click(function() {
+ /*
+ window.location="/portal/slice_request/";
+ */
+ });
+});
});
});
-
- oTable.load("/table/resource/", {'columns' : ['hostname','country','type'], 'filters' : { 'country' : 'France' } }, function(data) {
+ //{'columns' : ['hostname','country','type'], 'filters' : { 'country' : 'France' } }
+ oTable.load("/table/resource/", {'columns' : ['hostname','country','type'] }, function(data) {
$(this).dataTable( {
"sScrollY": window.innerHeight - 275,
"sDom": "frtiS",
class SupportView (FreeAccessView, ThemeView):
template_name = 'supportview.html'
- # expose this so we can mention the backend URL on the welcome page
- def default_env (self):
- return {
- 'MANIFOLD_URL':ConfigEngine().manifold_url(),
- }
+
def post (self,request):
- env = self.default_env()
+ env = {}
env['theme'] = self.theme
return render_to_response(self.template, env, context_instance=RequestContext(request))
def get (self, request, state=None):
- env = self.default_env()
+ env = {}
if request.user.is_authenticated():
env['person'] = self.request.user
env['username']=the_user(request)
- env['topmenu_items'] = topmenu_items(None, request)
+
if state: env['state'] = state
elif not env['username']: env['state'] = None
# use one or two columns for the layout - not logged in users will see the login prompt
- env['layout_1_or_2']="layout-unfold2.html" if not env['username'] else "layout-unfold1.html"
-
-
+
return render_to_response(self.template, env, context_instance=RequestContext(request))
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
-<div class="wrapper" id="ticket-request">
+{% block content %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="About MySlice" /> About</h1>
</div>
-<h1>This portal is powered by MySlice</h1>
-<a href ="http://myslice.info">More info</a>
+<div class="row">
+ <h3>A ready-made and easily customisable user interface for your testbed.</h3>
+
+ <p>
+ MySlice is an ambitious project aiming to support researchers throughout the lifecycle of experiments that can run on a variety
+ of testbeds spanning different administrative domains and networking technologies. Its basic principle is to bring together
+ available resources with useful information (characteristics, performance, network measurements).
+ </p>
+ <p>
+ MySlice inititiave started in Janury 2011 by offering annotation services for the first ederated experimental resources. Today,
+ MySlice has taken a big step toward becoming a tand-alone web framework, which will present all available resources from testbeds
+ across the world, interconnected through the Slice-based Facility Architecture (SFA) and annotated by the TopHat measurement system.
+ </p>
+ <p>
+ Our framework is built with standard programming tools (php and javascript for the front-end and python for the back-end)
+ and has a modular structure based on the concept of plugins for implementing different core functionalities (query editing,
+ data display, and resource allocation).
+ </p>
+ <p>
+ The goal is to enable developers with expertise on different testbed technologies and different experimental
+ practices to work in parallel for optimizing the tools presented to the users allowing them for a wide range of choices
+ according to their own requirements. Opening in this way the development of web-based user tools for experimentation and
+ sharing effort and information can increase significantly the chances for the achievement of our challenging objective.
+ </p>
+ <p>
+ You can access the code at git.myslice.info. If you need write access to the git repository you need first to send
+ your public key to <a href="mailto:support@myslice.info">support@myslice.info</a>.
+ </p>
+ <p>
+ Go to the <a href ="http://myslice.info">MySlice web site</a> or the <a href ="http://onelab.eu">OneLab public web site</a>
+ </p>
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
-{% block unfold_main %}
+{% extends "layout.html" %}
+{% block content %}
{% if messages %}
</ul>
{% endif %}
-<div class="wrapper" id="institution">
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="" /> User Account</h1>
+</div>
+
+<div class="row">
<ul class="nav nav-tabs">
- <li class="active"><a class="home-tab" data-panel="user_profile" href="#">User Profile</a></li>
- <li><a class="home-tab" data-panel="principal_acc" href="#">User Account</a></li>
- <li><a class="home-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
+ <li class="active"><a class="account-tab" data-panel="user_profile" href="#">User Profile</a></li>
+ <li><a class="account-tab" data-panel="principal_acc" href="#">User Account</a></li>
+ <li><a class="account-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
</ul>
-<div class="home-panel" id="user_profile">
-<p></p>
-<form id="editForm" method="POST" action="account_process" enctype="multipart/form-data">
-<div id="middle" align="center">
- <div class="well">
+
+ <div class="account-panel" id="user_profile">
+ <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
+ <div>
{% csrf_token %}
<table class="profile">
- <tr class="odd">
+ <tr>
<td colspan="2">
- <div id="info">Platform: Myslice</div>
+ <div>Platform: Myslice</div>
</td>
</tr>
- <tr class="even">
+ <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">
+ <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>
<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" />
+ <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>
{%endif%}
</table>
+ </div>
</div>
-</div>
-</div>
-<div class="home-panel" id="principal_acc" style="display:none;">
+ <div class="account-panel" id="principal_acc" style="display:none;">
-<h3>Principal Account <small>Account used for delegating credentials</small></h3>
-<div id="middle" align="center">
- <div class="well">
- <table class="table table-bordered table-hover mytable">
+ <h3>Principal Account <small>Account used for delegating credentials</small></h3>
+ <div class="raw">
+ <table class="table">
<tr class="odd">
<th>Platform</th>
<th>Account Type</th>
{%endfor%}
</table>
</div>
-</div>
-{%if 'Enabled' in user_status %}
-<h3>Credentials <small>Delegated to Principal Account</small></h3>
-<div id="middle" align="center">
- <div class="well">
- <table class="mytable table table-bordered table-hover">
- <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>
-
-
-<div class="home-panel" id="ref_acc" style="display:none;">
-<h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
-<div id="middle" align="center">
- <div class="well">
- <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>
- </div>
-</div>
-
+ {%if 'Enabled' in user_status %}
+ <div class="row">
+ <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>
+
-<h3>Add reference account to the following testbeds</h3>
-<div id="middle" align="center">
- <div class="well">
- <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>
-</div>
-</div>
+ <div class="account-panel" id="ref_acc" style="display:none;">
+ <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
+ <div class="row">
+ <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>
+ </div>
+
+
+
+ <h3>Add reference account to the following testbeds</h3>
+ <div class="row">
+ <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>
+ </div>
{%endif%}
-</div>
</form>
</div>
<script>
$(document).ready(function() {
- $('a.home-tab').click(function() {
+ $('a.account-tab').click(function() {
$('ul.nav-tabs li').removeClass('active');
$(this).parent().addClass('active');
- $('div.home-panel').hide();
+ $('div.account-panel').hide();
$('div#'+$(this).data('panel')).show();
});
$('button#createslice').click(function() {
window.location="/portal/slice_request/";
- })
- ;$('button#slicerequestbtn').click(function() {
- /*
- window.location="/portal/slice_request/";
- */
});
});
</script>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% block head %}
{{ wizard.form.media }}
{% endblock %}
-{% block unfold_main %}
-
-
-<div class="wrapper" id="ticket-request">
-<h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
-
-<p>
+{% block content %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
+</div>
+<div class="row">
+ <p>
If you have any diffculties using the portal, please contact us by filling this form below.<br />
- You can also <a href="mailto:support@myslice.info">e-mail</a> us directly or consult to our <a href="http://trac.myslice.info/" >documentation</a>
-</p>
+ You can also <a href="mailto:support@myslice.info">e-mail</a> us directly or consult to our <a target="_blank" href="http://trac.myslice.info/" >documentation</a>
+ </p>
+</div>
-<div>
+<div class="row">
<form class="cmxform form-horizontal" id="commentForm" action="#" method="post" role="form">{% csrf_token %}
<fieldset>
{% for field in form %}
-{% extends "layout-unfold1.html" %}
-
-{% block unfold_main %}
-
- <h1>Query Received !</h1>
-
-We will study your problem and get back to you as soon as possible.
+{% extends "layout.html" %}
+
+{% block content %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
+</div>
+<div class="row">
+ <h2>Query Received !</h2>
+ <p>
+ We will study your problem and get back to you as soon as possible.
+ </p>
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
-
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
-
-<h1>OneLab Portal Documentation<h1>
+{% extends "layout.html" %}
+{% block content %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Portal Documentation</h1>
+</div>
+<div class="row">
<h2>Portal Components</h2>
<h3>Myslice (Web Frontend)</h3>
<p>
<h2>FAQ<h2>
<h3>Users</h3>
<h3>Managers</h3>
-
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
+{% block content %}
-
-<h1> Experiment Tools </h1>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="Experiment Tools" /> Experiment Tools</h1>
+</div>
+<div class="row">
<h2>Secure Shell (SSH)</h2>
<p>
<p>More Info: <a href="http://mytestbed.net/projects/omf" target="_blank">http://mytestbed.net/projects/omf</a></p>
-
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
+{% block content %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/registration.css" />
<div id="home-dashboard">
<ul class="nav nav-tabs">
</table>
</div>
</div>
-{% endblock unfold_main %}
+{% endblock %}
-{% extends "layout-unfold1.html" %}
-
-{% block unfold_main %}
-<div class="wrapper" id="institution">
+{% extends "layout.html" %}
+{% block head %}
+<script type="text/javascript" src="{{STATIC_URL}}/js/institution.js"></script>
+{% endblock head %}
+{% block content %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Institution: {{user_details.parent_authority}}</h1>
+</div>
+<div class="row" id="institution">
<ul class="nav nav-tabs">
- <li class="active"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
- <li><a class="home-tab" data-panel="users" href="#">USERS</a></li>
- <li><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
+ <li class="active" id="authority-tab"><a class="home-tab" data-panel="institution" href="#">INFO</a></li>
+ <li id="users-tab"><a class="home-tab" data-panel="users" href="#">USERS</a></li>
+ <li id="slices-tab"><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
</ul>
<div class="home-panel" id="institution">
- <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Affiliation to an Institution</h1>
- <br>
<div id="authority-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Authority" /></div>
<div id="authority-tab-loaded" style="display:none;">
- <div id="onelab_membership" style="float:left; width:30%;">
+ <div id="authority-data" style="float:left; width:50%;"></div>
+ <div id="onelab_membership" style="float:right; width:50%;">
<img src="{{ STATIC_URL }}img/onelab-logo.png" alt="" /><br>
<div id="onelab-data"></div>
</div>
- <div id="authority-data" style="float:right; width:70%;">
- </div>
</div>
</div>
<div class="home-panel" id="users" style="display:none;">
- <br>
- <h1>Users: {{user_details.parent_authority}}</button></h1>
<div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
<div id="user-tab-loaded" style="display:none;">
<table id="user-tab">
</div>
</div>
<div class="home-panel" id="slices" style="display:none;">
- <br>
- <h1>Slices: {{user_details.parent_authority}} <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button></h1>
<div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
<div id="slice-tab-loaded" style="display:none;">
<table id="slice-tab">
</div>
<script>
$(document).ready(function() {
- $('a.home-tab').click(function() {
- $('ul.nav-tabs li').removeClass('active');
- $(this).parent().addClass('active');
- $('div.home-panel').hide();
- $('div#'+$(this).data('panel')).show();
- });
- $('button#createslice').click(function() {
- window.location="/portal/slice_request/";
- })
- ;$('button#slicerequestbtn').click(function() {
- /*
- window.location="/portal/slice_request/";
- */
- });
{% if person %}
{% if user_details.parent_authority %}
$.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
*/
authority_row += val.scientific+"<br>";
//}
- onelab_membership = "<b>Membership:</b> "+val.onelab_membership;
+ onelab_membership = "<b>Status: </b>"+val.onelab_membership;
onelab_data.push(onelab_membership);
authority_data.push(authority_row);
});
slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
}
- slice_row = "<tr>";
- slice_row += "<td><input type='checkbox'></td>";
- slice_row += "<td><a href=\"/portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
+ slice_row = "<tr id='"+val.slice_hrn+"'>";
+ slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
+ slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
slice_row += "<td>"+user_length+"</td>";
slice_row += "<td>"+slice_url+"</td>";
slice_row += "<td>"+nodes_length+"</td>";
*/
$.each( data, function( key, val ) {
list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
- user_row = "<tr>";
- user_row += "<td><input type='checkbox'></td>";
+
+ user_row = "<tr id='"+val.user_hrn+"'>";
+ user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
user_row += "<td>"+val.user_email+"</td>";
user_row += "<td>"+val.user_hrn+"</td>";
user_row += "<td>"+val.user_first_name+"</td>";
{% endif %}
});
</script>
-{% endblock unfold_main %}
+{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
+{% block content %}
-<div class="onelab-title well-lg">
- <h2>Join the OneLab Federation</h2>
-</div>
-<div class="well">
-OneLab welcomes companies, universities, and research laboratories to join the OneLab Federation of Testbeds. <br>
-We are supported by the European Commision through its 7th Framework Programs and FIRE initiative (Future Internet Research and Experimentation), as well as by other national and international funding initiatives.
-<br>
-<br>
-If you wish to become a new member of OneLab Federation, you should first consult the Membership Agreement.
-<br>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_testbed_small.png" alt="Join Federation" /> Join the OneLab Federation</h1>
+</div>
+<div class="row">
+
+ <p>
+ OneLab welcomes companies, universities, and research laboratories to join the OneLab Federation of Testbeds. <br>
+ We are supported by the European Commision through its 7th Framework Programs and FIRE initiative (Future Internet Research and Experimentation), as well as by other national and international funding initiatives.
+ </p>
+ <p>
+ If you wish to become a new member of OneLab Federation, you should first consult the Membership Agreement.
+ </p>
</div>
{% if errors %}
-<div class="well">
+<div class="row">
<ul class="error">
{% for error in errors %}
<li>{{ error }}</li>
</div>
{% endif %}
-<div class="well">
+<div class="row">
<form action="" id="joinForm" method="post">
{% csrf_token %}
<fieldset>
</form>
</div>
-<div class="well">
+<div class="row">
+ <p>
A membership agreement document will be sent to your email address as a PDF file.
-<br>
+</p><p>
Please print and sign a copy of the agreement and send it to:
-<br>
-<br>
+</p><p>
Ciro Scognamiglio<br>
UPMC - LIP6<br>
Campus Jussieu<br>
Boite courrier 169<br>
4 place Jussieu<br>
F-75252 PARIS cedex 05 - FRANCE<br>
-<br>
+</p><p>
Once your membership has been processed we will contact you to welcome you as a member.
-<br>
+</p><p>
If you have any questions about membership, contact the <a href="/portal/contact" >OneLab Support team</a>.
+</p>
</div>
<script>
/*
--- /dev/null
+{% extends "base.html" %}
+
+{% block base_content %}
+<div class="container">
+ {% block content %}
+ {% endblock %}
+</div>
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block base_content %}
+<div class="wide">
+ {% block content %}
+ {% endblock %}
+</div>
+{% endblock %}
-{% extends "layout-unfold1.html" %}
-{% block unfold_main %}
+{% extends "layout.html" %}
+{% block content %}
+
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_users_small.png" alt="Manage Users" /> Manage Users</h1>
+</div>
{% if messages %}
</ul>
{% endif %}
-<div class="wrapper" id="institution">
+<div class="row">
<ul class="nav nav-tabs">
<li class="active"><a class="home-tab" data-panel="user_profile" href="#">User Profile</a></li>
<li><a class="home-tab" data-panel="principal_acc" href="#">User Account</a></li>
<li><a class="home-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
</ul>
-<div class="home-panel" id="user_profile">
-<p></p>
-<form id="editForm" method="POST" action="{{user_email}}/user_process" enctype="multipart/form-data">
-<div id="middle" align="center">
- <div class="well">
- {% csrf_token %}
- <table class="profile">
- <tr class="odd">
- <td colspan="2">
- <div id="info">Platform: Myslice</div>
- </td>
- </tr>
- <tr class="even">
- <td class="key">Email</td>
- <td class="value"> <span id="emailval" class="value" >{{ user_email }}</span> </td>
- </tr>
- <tr class="odd">
- <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="even">
- <td class="key">Authority</td>
- <td class="value">
- <span id="authval" class="value" >{{ authority }} </span>
- <span class="hide_this" id="span_auth">
- <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_auth_change"> Cancel </button>
- <div style='display:none;'><input type='hidden' name='authform' /></div>
- <input id="authority" type="text" name="authority" class="required" maxlength="200" value="{{authority}}" />
- <input type="submit" class="btn btn-default btn-xs" name="submit_auth" value="Save"/>
- </span>
- <button class="btn btn-default btn-xs" type="button"title="auth" id="edit_auth">
- <span class="glyphicon glyphicon-edit"></span> Edit
- </button>
- </td>
- </tr>
- <tr class="odd">
- <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="even">
- <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>
- </table>
+ <div class="home-panel" id="user_profile">
+ <form id="editForm" method="POST" action="{{user_email}}/user_process" enctype="multipart/form-data">
+ <div id="middle" align="center">
+ <div class="well">
+ {% csrf_token %}
+ <table class="profile">
+ <tr class="odd">
+ <td colspan="2">
+ <div id="info">Platform: Myslice</div>
+ </td>
+ </tr>
+ <tr class="even">
+ <td class="key">Email</td>
+ <td class="value"> <span id="emailval" class="value" >{{ user_email }}</span> </td>
+ </tr>
+ <tr class="odd">
+ <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="even">
+ <td class="key">Authority</td>
+ <td class="value">
+ <span id="authval" class="value" >{{ authority }} </span>
+ <span class="hide_this" id="span_auth">
+ <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_auth_change"> Cancel </button>
+ <div style='display:none;'><input type='hidden' name='authform' /></div>
+ <input id="authority" type="text" name="authority" class="required" maxlength="200" value="{{authority}}" />
+ <input type="submit" class="btn btn-default btn-xs" name="submit_auth" value="Save"/>
+ </span>
+ <button class="btn btn-default btn-xs" type="button"title="auth" id="edit_auth">
+ <span class="glyphicon glyphicon-edit"></span> Edit
+ </button>
+ </td>
+ </tr>
+ <tr class="odd">
+ <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="even">
+ <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>
+ </table>
+ </div>
+ </div>
</div>
-</div>
-</div>
-
-
-<div class="home-panel" id="principal_acc" style="display:none;">
-<h3>Principal Account <small>Account used for delegating credentials</small></h3>
-<div id="middle" align="center">
- <div class="well">
- <table class="table table-bordered table-hover mytable">
- <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 class="home-panel" id="principal_acc" style="display:none;">
+ <div class="row">
+
+ <h3>Principal Account <small>Account used for delegating credentials</small></h3>
+
+ <table class="table table-bordered table-hover mytable">
+ <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>
-</div>
{%if 'Enabled' in user_status %}
-<h3>Credentials <small>Delegated to Principal Account</small></h3>
-<div id="middle" align="center">
- <div class="well">
- <table class="mytable table table-bordered table-hover">
- <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="row">
+ <h3>Credentials <small>Delegated to Principal Account</small></h3>
+ <table class="mytable table table-bordered table-hover">
+ <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="home-panel" id="ref_acc" style="display:none;">
-<h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
-<div id="middle" align="center">
- <div class="well">
+ <div class="home-panel" id="ref_acc" style="display:none;">
+ <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>
</tr>
{%endfor%}
</table>
- </div>
-</div>
-<h3>Add reference account to the following testbeds</h3>
-<div id="middle" align="center">
- <div class="well">
+ <h3>Add reference account to the following testbeds</h3>
+
<table class="mytable table table-bordered table-hover">
<tr class="odd">
<th>Platforms</th>
</tr>
{%endfor%}
</table>
- </div>
-</div>
-</div>
+
+ </div>
{%endif%}
</div>
</form>
</div>
{% endif %}
</div>
+<script>
+ $(document).ready(function() {
+ // var slices = localStorage.getItem('slices');
+ // if (slices.length == 0) {
+ // $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+ // var items = [];
+ // localStorage.setItem('slices', data[0].slice);
+ // });
+ // }
+ // $.each(slices, function( key, val ) {
+ // items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+ // });
+ // $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+ });
+</script>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
-<div class="wrapper" id="home-dashboard">
+{% block content %}
+<div class="row" id="home-dashboard">
<ul class="nav nav-tabs">
<li class="active"><a class="home-tab" data-panel="user" href="#">USER</a></li>
<li><a class="home-tab" data-panel="manager" href="#">MANAGER</a></li>
</tr>
<tr>
<td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
- <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
+ <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
<td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
</tr>
<tr>
{% endif %}
</td>
<td>
+ {% if person %}
<button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button>
+ {% endif %}
</td>
<td class="support">
+ {% if person %}
<button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+ {% endif %}
</td>
</tr>
</table>
{% if person %}
$.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
var items = [];
- $.each( data[0].slice, function( key, val ) {
- items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+ $.each( data[0].slices, function(i, val) {
+ items.push( "<li><a href=\"/slice/"+val+"\">" + val + "</a></li>" );
});
$("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
{% endif %}
});
</script>
-{% endblock unfold_main %}
+{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout_wide.html" %}
-{% block unfold_main %}
-<div id="slice-view">
+{% block content %}
<div class="col-md-2">
- <div id="select-platform" class="list-group">
- </div>
+ <div id="select-platform" class="list-group">
+ </div>
<ul class="list-group">
<li class="list-group-item">Filter: CPU</li>
<li class="list-group-item">...</li>
<li class="list-group-item">...</li>
</ul>
-
- </div>
+
+ </div>
<div class="col-md-10">
<div class="row">
{% include theme|add:"_widget-slice-sections.html" %}
</div>
<table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table>
</div>
-</div>
-{% endblock unfold_main %}
\ No newline at end of file
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "layout_wide.html" %}
+
+
+{% block content %}
+ <div class="col-md-2">
+ <div id="select-platform" class="list-group">
+ </div>
+
+ <ul class="list-group">
+ <li class="list-group-item">Filter: authority</li>
+ <li class="list-group-item">Filter: slice</li>
+ <li class="list-group-item">...</li>
+ <li class="list-group-item">...</li>
+ <li class="list-group-item">...</li>
+ </ul>
+
+ </div>
+ <div class="col-md-10">
+ <div class="row">
+ {% include theme|add:"_widget-slice-sections.html" %}
+ </div>
+ <div class="row slice-pending">
+ <ul class="nav nav-pills">
+ <li><a href="">All users</a></li>
+ <li><a href="">Users in Slice</a></li>
+ <li><a href="">Pending<span class="badge">42</span></a></li>
+ <li>
+ <button type="button" class="btn btn-primary apply">Apply</button>
+ <button type="button" class="btn btn-default clear">Clear</button>
+ </li>
+ </ul>
+ </div>
+ <div class="row">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#">Users</a></li>
+ <li><a href="#"></a></li>
+ <li><a href="#"></a></li>
+ </ul>
+ </div>
+ <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Useres" /></div>
+ <div id="user-tab-loaded" style="display:none;">
+ <table id="user-tab">
+ <tr>
+ <th>+/-</th>
+ <th>Email</th>
+ <th>user_hrn</th>
+ <th>First name</th>
+ <th>Last name</th>
+ <th>Enabled</th>
+ </tr>
+ </table>
+ </div>
+<script>
+ $(document).ready(function() {
+ $.post("/rest/user/",{'filters':{'parent_authority':'ple.upmc'}}, function( data ) {
+ var list_users = [];
+ var table_users = [];
+ /*
+ "enabled", "keys", "parent_authority", "user_first_name", "user_last_name", "user_phone", "user_hrn", "slice", "user_email"
+ */
+ $.each( data, function( key, val ) {
+ list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
+ user_row = "<tr>";
+ user_row += "<td><input type='checkbox'></td>";
+ user_row += "<td>"+val.user_email+"</td>";
+ user_row += "<td>"+val.user_hrn+"</td>";
+ user_row += "<td>"+val.user_first_name+"</td>";
+ user_row += "<td>"+val.user_last_name+"</td>";
+ user_row += "<td>"+val.enabled+"</td>";
+ user_row += "</tr>";
+ table_users.push(user_row);
+
+ });
+ $("table#user-tab tr:last").after(table_users.join( "" ));
+ $("div#user-tab-loaded").css("display","block");
+ $("div#user-tab-loading").css("display","none");
+ });
+ });
+</script>
+
+{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout_wide.html" %}
-{% block unfold_main %}
-<div id="slice-view">
+{% block content %}
<div class="col-md-2"></div>
<div class="col-md-10">
<div class="row">
<div class="col-md-10">
<br>
<br>
- <table>
- <tr>
- <td><b>Description:</b></td>
- <td>this slice is dedicated to debug the myslice software...</td>
- </tr>
- <tr>
- <td><b>url:</b></td>
- <td><a href="http://myslice.info" target="_blank">http://myslice.info</a></td>
- </tr>
- <tr>
- <td><b>users:</b></td>
- <td>3</td>
- </tr>
- <tr>
- <td><b>resources:</b></td>
- <td>8</td>
- </tr>
- <tr>
- <td><b>created:</b></td>
- <td>2012-06-21 10:00</td>
- </tr>
- <tr>
- <td><b>last update:</b></td>
- <td>2014-02-25 14:00</td>
- </tr>
- <tr>
- <td><b>expires:</b></td>
- <td>2014-04-01 12:00</td>
- </tr>
- </table>
+ <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+ <div id="slice-tab-loaded" style="display:none;">
+ <table id="slice-tab">
+ </table>
+ </div>
</div>
-
-</div>
-{% endblock unfold_main %}
+
+<script>
+ $(document).ready(function() {
+ $.post("/rest/slice/",{'filters':{'slice_hrn':'{{slice}}'}}, function( data ) {
+ var table_slices = [];
+ /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
+ $.each( data, function( key, val ) {
+ if(val.nodes=="undefined" || val.nodes==null){
+ nodes_length=0;
+ }else{
+ nodes_length=val.nodes.length;
+ }
+
+ if(val.user=="undefined" || val.user==null){
+ user_length=0;
+ }else{
+ user_length=val.user.length;
+ }
+
+ if(val.slice_url=="undefined" || val.slice_url==null){
+ slice_url="";
+ }else{
+ slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
+ }
+
+ slice_row = "<tr><td><b>Description:</b></td><td>"+val.slice_description+"</td></tr>";
+ slice_row += "<tr><td><b>url:</b></td><td><a href='"+val.slice_url+" target='_blank'>"+val.slice_url+"</a></td></tr>";
+ slice_row += "<tr><td><b>users:</b></td><td>"+user_length+"</td></tr>";
+ slice_row += "<tr><td><b>resources:</b></td><td>"+nodes_length+"</td></tr>";
+ slice_row += "<tr><td><b>created:</b></td><td>"+val.created+"</td></tr>";
+ slice_row += "<tr><td><b>last update:</b></td><td>"+val.last_updated+"</td></tr>";
+ slice_row += "<tr><td><b>expires:</b></td><td>"+val.slice_expires+"</td></tr>";
+ table_slices.push(slice_row);
+ });
+ $("table#slice-tab").html(table_slices.join( "" ));
+ $("div#slice-tab-loaded").css("display","block");
+ $("div#slice-tab-loading").css("display","none");
+ });
+ });
+</script>
+{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout_wide.html" %}
-{% block unfold_main %}
-<div id="testbed-list">
+{% block content %}
<div class="col-md-2"></div>
<div class="col-md-10">
<div class="row">
</div>
<table cellpadding="0" cellspacing="0" border="0" class="table" id="testbedList"></table>
</div>
-</div>
-{% endblock unfold_main %}
\ No newline at end of file
+{% endblock %}
\ No newline at end of file
<li {% if section == 'slice' %}class="active"{% endif %}><a href="/slice/{{ slice }}/">{{ slice }}</a></li>
<li {% if section == 'testbeds' %}class="active"{% endif %}><a href="/testbeds/{{ slice }}/">Testbeds</a></li>
<li {% if section == 'resources' %}class="active"{% endif %}><a href="/resources/{{ slice }}/">Resources</a></li>
- <li {% if section == 'users' %}class="active">{% endif %}><a href="/users/{{ slice }}/">Users</a></li>
+ <li {% if section == 'users' %}class="active"{% endif %}><a href="/users/{{ slice }}/">Users</a></li>
<li><a href="">Statistics</a></li>
<li><a href="">Measurements</a></li>
</ul>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% load i18n %}
-{% block unfold_main %}
-
-
{% block content %}
-<h2>{% trans 'OneLab secured Password reset wizard' %}</h2>
-<h3>{% trans 'Password reset successful' %}</h3>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+ <h3>Onelab secured Password reset wizard</h3>
+ <p>Password reset successful</p>
-<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
+ <p>Your password has been set. You may go ahead and log in now.</p>
-<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
-
-{% endblock %}
+ <p><a href="/">Log in</a></p>
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
-
-{% block unfold_main %}
-
-
+{% extends "layout.html" %}
{% block content %}
{% if validlink %}
-<h2>{% trans 'OneLab secured Password reset wizard' %}</h2>
-<h3>{% trans 'Enter new password' %}</h3>
-
-<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
-
-<form action="" method="post">{% csrf_token %}
-{{ form.new_password1.errors }}
-<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
-{{ form.new_password2.errors }}
-<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
-<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
-</form>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+ <h3>Onelab secured Password reset wizard</h3>
+
+ <p>Please enter your new password twice so we can verify you typed it in correctly.</p>
+
+ <form action="" method="post">{% csrf_token %}
+ {{ form.new_password1.errors }}
+ <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
+ {{ form.new_password2.errors }}
+ <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
+ <p><input type="submit" value="{% trans 'Change my password' %}" /></p>
+ </form>
{% else %}
+
+ <h3>Onelab secured Password reset wizard</h3>
-<h2>{% trans 'OneLab secured Password reset wizard' %}</h2>
-<h3>{% trans 'Password reset unsuccessful!' %}</h3>
-
-<p> The password reset link was invalid, possibly because it has already been used. Please request a new <a href="/portal/pass_reset/">password reset.</a></p>
+ <p> The password reset link was invalid, possibly because it has already been used. Please request a new <a href="/portal/pass_reset/">password reset.</a></p>
-<p>If you still encounter problem please <a href="/portal/contact/">Contact Support</a> for password recovery.</p>
+ <p>If you still encounter problem please <a href="/portal/contact/">Contact Support</a> for password recovery.</p>
+</div>
{% endif %}
{% endblock %}
-{% endblock %}
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
-
-{% block unfold_main %}
-
+{% extends "layout.html" %}
{% block content %}
-
-<h2>{% trans 'Onelab secured Password reset wizard' %}</h2>
-
-<p>{% trans "We've emailed you instructions for setting your password to the email address you submitted. You should be receiving it shortly." %}</p>
-
-{% endblock %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+ <h3>Onelab secured Password reset wizard</h3>
+
+ <p>We've emailed you instructions for setting your password to the email address you submitted. You should be receiving it shortly.</p>
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
-
-{% block unfold_main %}
-
-
-
+{% extends "layout.html" %}
{% block content %}
-
-<h2>{% trans "Welcome to Onelab secured Password reset wizard" %}</h2>
-
-<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>
-
-<form action="" method="post">{% csrf_token %}
-{{ form.email.errors }}
-<p><label for="id_email">{% trans 'Email address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
-</form>
-
-{% endblock %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+ <h3>Welcome to Onelab secured Password reset wizard</h3>
+
+ <p>Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one.</p>
+
+ <form action="/portal/pass_reset/" method="post">{% csrf_token %}
+ {{ form.email.errors }}
+ <p><label for="id_email">Email address:</label> {{ form.email }} <input type="submit" value="Reset my password" /></p>
+ </form>
+</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
{% endblock %}
-{% block unfold_main %}
+{% block content %}
<h1>Platform</h1>
{{networks}}
<br>
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
+{% extends "layout.html" %}
{% load crispy_forms_tags %}
-
{% block head %}
{{ wizard.form.media }}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
{% endblock %}
-{% block unfold_main %}
+{% block content %}
<h1>User registration</h1>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
+{% block content %}
-<div class="onelab-title well-lg">
- <h2>OneLab Experimenter Registration</h2>
- <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
</div>
+<div class="row">
+
+ <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
{% if errors %}
<ul>
</ul>
{% endif %}
-<div class="well">
<form class="cmxform form-horizontal" id="registrationForm" method="post" action="" enctype="multipart/form-data" role="form">
<fieldset>
{% csrf_token %}
<div class="form-group" id="register">
<button class="submit btn btn-default col-xs-12" type="submit">Register</button>
</div>
- </div>
</fieldset>
</form>
</div>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
+{% block content %}
<h1>Slice request Received !</h1>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% load i18n %}
{% block head %}
{{ wizard.form.media }}
{% endblock %}
-{% block unfold_main %}
+{% block content %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
<!-- xxx ideally only onelab.css but ... xxx -->
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% load i18n %}
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
-
-<div class="wrapper" id="slice-request">
-<h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="Request a Slice" /> Request a new Slice</h1>
+{% block content %}
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="Request a Slice" /> Request a new Slice</h1>
+</div>
{% if errors %}
<ul>
{% for error in errors %}
</ul>
{% endif %}
-<div>
+<div class="row">
<form id="commentForm" class="form-horizontal" method="post">
{% csrf_token %}
<fieldset>
</fieldset>
</form>
</div>
-</div>
<script>
jQuery(document).ready(function(){
var availableTags = [
];
$( "#authority_hrn" ).autocomplete({
source: availableTags,
+ minLength: 0,
select: function( event, ui ) {console.log(jQuery(this))}
});
});
-{% extends "layout-unfold1.html" %}
-
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
-
-<h1>OneLab Portal Support</h1>
-
-<h2>Report a Bug</h2>
-<p>If you have found a bug or having difficulties accesing some features or found some anomalies, please report it using our ticketing system.</p>
-<button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
-<h3>Unresolved Tickets</h3>
-
-
-<div id="middle" align="center">
- <div class="well">
- <table class="mytable table table-bordered table-hover">
- <tr>
- <th>Ticket No</th>
+{% extends "layout.html" %}
+
+{% block content %}
+ <div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Request a Slice" /> OneLab Portal Support</h1>
+ </div>
+
+
+ <div class="row">
+ <h2>Report a Bug</h2>
+ <p>If you have found a bug or having difficulties accesing some features or found some anomalies, please report it using our ticketing system.</p>
+ <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
+ <h3>Unresolved Tickets</h3>
+ </div>
+
+ <div class="row">
+ <table class="mytable table table-bordered table-hover">
+ <tr>
+ <th>Ticket No</th>
<th>Reported By</th>
<th>Description</th>
- <th>Status</th>
- </tr>
- <tr>
- <td>1</td>
+ <th>Status</th>
+ </tr>
+ <tr>
+ <td>1</td>
<td>yasin.upmc@gmail.com</td>
<td> Slice_request page is not working </td>
<td> Unresolved</td>
- </tr>
+ </tr>
<tr>
- <td>2</td>
+ <td>2</td>
<td>azerty@lip6.fr</td>
- <td>Unable to Register</td>
- <td>Unresolved</td>
+ <td>Unable to Register</td>
+ <td>Unresolved</td>
</tr>
-
- </table>
- </div>
-</div>
-</div>
-
-
-
-
-
-<h2><a href="/portal/support/documentation">FAQ</a></h2>
-<h2>Contact Us</h2>
-
-<h3>Mailing List</h3>
-<p>You can subscribe to our mailing list by sending a request to: <b>support</b> AT <b>myslice</b> DOT <b>info</b></p>
-<p>Also you can adress any issues in the same email address.</p>
-
-<h3>Mailing Address</h3>
-<p>
-UPMC - LIP6<br>
-Boîte courrier 16 <br>
-Couloir 26-00, Etage 01, Bureau 102<br>
-4 place Jussieu<br>
-75252 PARIS CEDEX 05<br>
-France<br>
-</p>
+
+ </table>
+ </div>
+
+
+
+ <div class="row">
+
+ <h2><a href="/portal/support/documentation">FAQ</a></h2>
+ <h2>Contact Us</h2>
+
+ <h3>Mailing List</h3>
+ <p>You can subscribe to our mailing list by sending a request to: <b>support</b> AT <b>myslice</b> DOT <b>info</b></p>
+ <p>Also you can adress any issues in the same email address.</p>
+
+ <h3>Mailing Address</h3>
+ <p>
+ UPMC - LIP6<br>
+ Boîte courrier 16 <br>
+ Couloir 26-00, Etage 01, Bureau 102<br>
+ 4 place Jussieu<br>
+ 75252 PARIS CEDEX 05<br>
+ France<br>
+ </p>
+ </div>
<script>
$(document).ready(function() {
$('button#ticketbtn').click(function() {
window.location="/portal/contact/";
- })
+ });
});
</script>
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% block head %}
{{ wizard.form.media }}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
{% endblock %}
-{% block unfold_main %}
+{% block content %}
- <h1>User registration</h1>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
+</div>
+<div class="row">
-{% if envoi %}Your registration message has been sent !{% endif %}
-
-<div class='well'>
-<form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
-{{ form.as_p }}
-<input type="submit" value="Submit" />
-</form>
+{% if envoi %}
+ <h3>Your registration message has been sent !</h3>
+{% endif %}
+
+ <form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
+ {{ form.as_p }}
+ <input type="submit" value="Submit" />
+ </form>
</div>
{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold_main %}
+{% block content %}
- <h1>User registration complete !</h1>
+<div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
+</div>
+<div class="row">
+ <h3>User registration complete !</h3>
+ <p>
+ You will receive an email with further instructions.
+ </p>
+ </div>
-You will receive an email with further instructions.
{% endblock %}
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
{% block head %}
-<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/validate_pending.css" />
<script type="text/javascript">
function on_click_event() {
var ids = [];
</script>
{% endblock %}
-{% block unfold_main %}
-<div class="onelab-title well-lg">
-<h1>Pending requests</h1>
-</div>
-<hr/>
-<h2>My authorities</h2>
-
-{% if my_authorities %}
-
-{% for authority, requests in my_authorities.items %}
-<h3>{{authority}}</h3>
-<div class="container">
- <table width=100% border=1>
- <th>
- <td>type</td>
- <td>id</td>
- <td>details</td>
- <td>timestamp</td>
- <td>status</td>
- </th>
- {% for request in requests %}
-
- <tr>
- <td>
- {% if request.allowed == 'allowed' %}
- <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
- {% else %}
- {% if request.allowed == 'expired' %}
- expired
- {% else %} {# denied #}
- denied
+{% block content %}
+ <div class="row">
+ <h1><img src="{{ STATIC_URL }}img/icon_testbed_small.png" alt="" /> Pending requests</h1>
+ </div>
+
+ {% if my_authorities %}
+
+ {% for authority, requests in my_authorities.items %}
+
+ <div class="row">
+ <h3>{{authority}}</h3>
+ <table class="table">
+ <th>
+ <td>type</td>
+ <td>id</td>
+ <td>details</td>
+ <td>timestamp</td>
+ <td>status</td>
+ </th>
+ {% for request in requests %}
+
+ <tr>
+ <td>
+ {% if request.allowed == 'allowed' %}
+ <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+ {% else %}
+ {% if request.allowed == 'expired' %}
+ expired
+ {% else %} {# denied #}
+ denied
+ {% endif %}
{% endif %}
- {% endif %}
- </td>
- <td>{{ request.type }}</td>
- <td>{{ request.id }}</td>
- <td>
- {% if request.type == 'user' %}
- Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
- {% else %}
- {% if request.type == 'slice' %}
- Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
- {% else %} {# authority #}
- Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
- {% endif %}
- {% endif %}
- </td>
- <td>{{ request.timestamp }}</td>
-
- <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-
- <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
- </tr>
-
- {% endfor %}
- </table>
-{% endfor %}
+ </td>
+ <td>{{ request.type }}</td>
+ <td>{{ request.id }}</td>
+ <td>
+ {% if request.type == 'user' %}
+ Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+ {% else %}
+ {% if request.type == 'slice' %}
+ Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+ {% else %} {# authority #}
+ Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.timestamp }}</td>
+
+ <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+
+ <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+ </tr>
+
+ {% endfor %}
+ </table>
+ </div>
+ {% endfor %}
{% else %}
-<i>There is no pending request waiting for validation.</i>
+ <div class="row">
+ <i>There is no pending request waiting for validation.</i>
+ </div>
{% endif %}
{% if sub_authorities %}
-<hr/>
-<h2>Sub-Authorities</h2>
-
-{% for authority, requests in sub_authorities.items %}
-<h3>{{authority}}</h3>
- <table width=100% border=1>
- <th>
- <td>type</td>
- <td>id</td>
- <td>details</td>
- <td>timestamp</td>
- <td>status</td>
- </th>
- {% for request in requests %}
- <tr>
- <td>
- {% if request.allowed == 'allowed' %}
- <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
- {% else %}
- {% if request.allowed == 'expired' %}
- expired
- {% else %} {# denied #}
- denied
+ <div class="row">
+ <h2>Sub-Authorities</h2>
+ </div>
+ {% for authority, requests in sub_authorities.items %}
+ <div class="row">
+ <h3>{{authority}}</h3>
+ <table class="table">
+ <th>
+ <td>type</td>
+ <td>id</td>
+ <td>details</td>
+ <td>timestamp</td>
+ <td>status</td>
+ </th>
+ {% for request in requests %}
+ <tr>
+ <td>
+ {% if request.allowed == 'allowed' %}
+ <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+ {% else %}
+ {% if request.allowed == 'expired' %}
+ expired
+ {% else %} {# denied #}
+ denied
+ {% endif %}
{% endif %}
- {% endif %}
- </td>
- <td>{{ request.type }}</td>
- <td>{{ request.id }}</td>
- <td>
- {% if request.type == 'user' %}
- Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
- {% else %}
- {% if request.type == 'slice' %}
- Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
- {% else %} {# authority #}
- Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
- {% endif %}
- {% endif %}
- </td>
- <td>{{ request.timestamp }}</td>
-
- <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-
- <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
- </tr>
- {% endfor %}
- </table>
-{% endfor %}
-<hr/>
+ </td>
+ <td>{{ request.type }}</td>
+ <td>{{ request.id }}</td>
+ <td>
+ {% if request.type == 'user' %}
+ Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+ {% else %}
+ {% if request.type == 'slice' %}
+ Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+ {% else %} {# authority #}
+ Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.timestamp }}</td>
+
+ <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+
+ <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ {% endfor %}
{% endif %}
{% if delegation_authorities %}
-<hr/>
-<h2>Authorities with delegation</h2>
-
-{% for authority, requests in delegation_authorities.items %}
-<h3>{{authority}}</h3>
- <table width=100% border=1>
- <th>
- <td>type</td>
- <td>id</td>
- <td>details</td>
- <td>timestamp</td>
- <td>status</td>
- </th>
- {% for request in requests %}
- <tr>
- <td>
- {% if request.allowed == 'allowed' %}
- <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
- {% else %}
- {% if request.allowed == 'expired' %}
- expired
- {% else %} {# denied #}
- denied
- {% endif %}
- {% endif %}
- </td>
- <td>{{ request.type }}</td>
- <td>{{ request.id }}</td>
- <td>
- {% if request.type == 'user' %}
- Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
- {% else %}
- {% if request.type == 'slice' %}
- Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
- {% else %} {# authority #}
- Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
- {% endif %}
- {% endif %}
- </td>
- <td>{{ request.timestamp }}</td>
+ <div class="row">
+ <h2>Authorities with delegation</h2>
+ </div>
+ {% for authority, requests in delegation_authorities.items %}
+ <div class="row">
+ <h3>{{authority}}</h3>
+ <table class="table">
+ <th>
+ <td>type</td>
+ <td>id</td>
+ <td>details</td>
+ <td>timestamp</td>
+ <td>status</td>
+ </th>
+ {% for request in requests %}
+ <tr>
+ <td>
+ {% if request.allowed == 'allowed' %}
+ <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+ {% else %}
+ {% if request.allowed == 'expired' %}
+ expired
+ {% else %} {# denied #}
+ denied
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.type }}</td>
+ <td>{{ request.id }}</td>
+ <td>
+ {% if request.type == 'user' %}
+ Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+ {% else %}
+ {% if request.type == 'slice' %}
+ Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+ {% else %} {# authority #}
+ Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.timestamp }}</td>
+
+ <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
- <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-
- <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
- </tr>
- {% endfor %}
- </table>
-{% endfor %}
-<hr/>
+ <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ {% endfor %}
{% endif %}
-
-<input type='button' id='portal__validate' value='Validate' onclick='on_click_event();'/>
-</div>
-<!-- End of the container div -->
+ <div class="row">
+ <button type="button" id="portal__validate" onclick="on_click_event();">Validate</button>
+ </div>
{% endblock %}
context['username'] = the_user(self.request)
context['theme'] = self.theme
-
# XXX We need to prepare the page for queries
#context.update(page.prelude_env())
from unfold.loginrequired import LoginRequiredView
from django.http import HttpResponse
-from manifold.core.query import Query, AnalyzedQuery
+from manifold.core.query import Query
from manifoldapi.manifoldapi import execute_query
-from string import join
+from string import join
+
import decimal
import datetime
import json
return (str(o) for o in [o])
return super(DecimalEncoder, self)._iterencode(o, markers)
-def dispatch(request, object_type, object_name):
+class objectRequest(object):
- object_properties = None
- object_filters = {}
-
- switch = {
- 'platform' : platform,
- 'slice' : slice,
- 'resource' : resource,
- 'user' : user,
- 'authority' : authority,
- }
-
- if request.method == 'POST':
- req_items = request.POST.items()
- elif request.method == 'GET':
- req_items = request.GET.items()
+ def __init__(self, request, object_type, object_name):
+ self.type = object_type
+ self.name = object_name
+ self.properties = []
+ self.filters = {}
+ self.options = None
- for el in req_items:
- if el[0].startswith('filters'):
- object_filters[el[0][8:-1]] = el[1]
- elif el[0].startswith('columns'):
- object_properties = request.POST.getlist('columns[]')
-
- # platform is local
- if ((object_type == 'platform') or (object_type == 'testbed')) :
- object_type = 'local:platform'
- if object_properties == None :
- object_properties = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
- return switch.get('platform', error)(request, object_name, object_properties, object_filters)
- else :
- if object_properties == None :
- query = Query.get('local:object').filter_by('table', '==', object_type).select('column.name')
- results = execute_query(request, query)
+ self.request = request
+
+ # XXX TODO: What about the local: objects?
+ # Example: local:user (Manifold) is different from user (SFA GW)
+
+ if ((self.type == 'platform') or (self.type == 'testbed')) :
+ self.type = 'local:platform'
+ self.id = 'platform'
+ self.properties = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
+ self.filters['disabled'] = '0'
+ self.filters['gateway_type'] = 'sfa'
+ self.filters['platform'] = '!myslice'
+ else :
+ self.id = 'hrn'
+ query = Query.get('local:object').filter_by('table', '==', self.type).select('column.name')
+ results = execute_query(self.request, query)
if results :
- object_properties = []
for r in results[0]['column'] :
- object_properties.append(r['name'])
+ self.properties.append(r['name'])
else :
- return error(request, object_name, {})
- return switch.get(object_type, error)(request, object_name, object_properties, object_filters)
-
-def platform(request, object_name, object_properties, object_filters = None):
- query = Query().get('local:platform').filter_by('disabled', '==', '0').filter_by('gateway_type', '==', 'sfa').filter_by('platform', '!=', 'myslice')
- if object_filters :
- for k, f in object_filters.iteritems() :
- query.filter_by(k, '==', f)
- query.select(object_properties)
- return send(request, execute_query(request, query), object_properties)
-
-# Add different filters possibilities [['user.user_hrn','==','$user_hrn'],['parent_authority','==','ple.upmc']]
-def slice(request, object_name, object_properties, object_filters = None):
- query = Query().get('slice')#.filter_by('user.user_hrn', '==', '$user_hrn')
- if object_filters :
- for k, f in object_filters.iteritems() :
- query.filter_by(k, '==', f)
- query.select(object_properties)
- return send(request, execute_query(request, query), object_properties)
-
-def resource(request, object_name, object_properties, object_filters = None):
- query = Query().get('resource')
- if object_filters :
- for k, f in object_filters.iteritems() :
- query.filter_by(k, '==', f)
- query.select(object_properties)
- return send(request, execute_query(request, query), object_properties)
+ return error('db error')
+ return None
+
+ def addFilters(self, properties):
+ selected_properties = []
+ for p in properties :
+ if p in self.properties :
+ selected_properties.append(p)
+ self.properties = selected_properties
+ self.setId()
+
+ def setId(self):
+ if self.id in self.properties :
+ self.properties.remove(self.id)
+ [self.id].extend(self.properties)
+
+ def execute(self):
+ query = Query.get(self.type).select(self.properties)
+ if self.filters :
+ for k, f in self.filters.iteritems() :
+ if (f[:1] == "!") :
+ query.filter_by(k, '!=', f[1:])
+ elif (f[:2] == ">=") :
+ query.filter_by(k, '>=', f[2:])
+ elif (f[:1] == ">") :
+ query.filter_by(k, '>', f[1:])
+ elif (f[:2] == "<=") :
+ query.filter_by(k, '<=', f[2:])
+ elif (f[:1] == "<") :
+ query.filter_by(k, '<', f[1:])
+ else :
+ query.filter_by(k, '==', f)
+ return execute_query(self.request, query)
-def user(request, object_name, object_properties, object_filters = None):
- query = Query().get('user')#.filter_by('user_hrn', '==', '$user_hrn')
- if object_filters :
- for k, f in object_filters.iteritems() :
- query.filter_by(k, '==', f)
- query.select(object_properties)
- return send(request, execute_query(request, query), object_properties)
+def dispatch(request, object_type, object_name):
+
+ o = objectRequest(request, object_type, object_name)
+
+ if request.method == 'POST':
+ req_items = request.POST
+ elif request.method == 'GET':
+ req_items = request.GET
-def authority(request, object_name, object_properties, object_filters = None):
- query = Query().get('authority')#.filter_by('user_hrn', '==', '$user_hrn')
- if object_filters :
- for k, f in object_filters.iteritems() :
- query.filter_by(k, '==', f)
- query.select(object_properties)
- return send(request, execute_query(request, query), object_properties)
+ for el in req_items.items():
+ if el[0].startswith('filters'):
+ o.filters[el[0][8:-1]] = el[1]
+ elif el[0].startswith('columns'):
+ o.addFilters(req_items.getlist('columns[]'))
+ elif el[0].startswith('options'):
+ o.options = req_items.getlist('options[]')
-def send(request, response, object_properties):
+ response = o.execute()
+
if request.path.split('/')[1] == 'rest' :
response_data = response
return HttpResponse(json.dumps(response_data, cls=DecimalEncoder, default=DateEncoder), content_type="application/json")
elif request.path.split('/')[1] == 'table' :
- return render_to_response('table-default.html', {'data' : response, 'properties' : object_properties})
+ return render_to_response('table-default.html', {'data' : response, 'properties' : o.properties, 'id' : o.id, 'options' : o.options})
elif request.path.split('/')[1] == 'datatable' :
response_data = {}
- response_data['columns'] = object_properties
- response_data['labels'] = object_properties
+ response_data['columns'] = o.properties
+ response_data['labels'] = o.properties
response_data['data'] = []
response_data['total'] = len(response)
for r in response :
d = []
- for p in object_properties :
+ for p in o.properties :
d.append(r[p])
- print d
-
response_data['data'].append(d)
return HttpResponse(json.dumps(response_data, cls=DecimalEncoder, default=DateEncoder), content_type="application/json")
-def error(request, object_name, object_properties):
- return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+def error(msg):
+ return HttpResponse(json.dumps({'error' : msg}), content_type="application/json")
--- /dev/null
+from manifold.core.query import Query
+
+from django.views.generic.base import TemplateView
+from django.shortcuts import render_to_response
+
+from unfold.loginrequired import LoginRequiredView
+from django.http import HttpResponse
+
+from manifold.core.query import Query, AnalyzedQuery
+from manifoldapi.manifoldapi import execute_query
+
+from string import join
+import decimal
+import datetime
+import json
+
+# handles serialization of datetime in json
+DateEncoder = lambda obj: obj.strftime("%B %d, %Y %H:%M:%S") if isinstance(obj, datetime.datetime) else None
+
+# support converting decimal in json
+json.encoder.FLOAT_REPR = lambda o: format(o, '.2f')
+
+# handles decimal numbers serialization in json
+class DecimalEncoder(json.JSONEncoder):
+ def _iterencode(self, o, markers=None):
+ if isinstance(o, decimal.Decimal):
+ return (str(o) for o in [o])
+ return super(DecimalEncoder, self)._iterencode(o, markers)
+
+def dispatch(request, object_type, object_name):
+
+ object_filters = {}
+ object_params = {}
+ result = {}
+
+ if request.method == 'POST':
+ req_items = request.POST.items()
+ elif request.method == 'GET':
+ return HttpResponse(json.dumps({'error' : 'only post request is supported'}), content_type="application/json")
+
+ query = Query.create(object_type)
+
+# No filters for create
+# if object_filters :
+# for k, f in object_filters.iteritems() :
+# query.filter_by(k, '==', f)
+#
+# # DEBUG
+# print object_filters
+
+ if object_params :
+ query.set(object_params.iteritems())
+ else :
+ return HttpResponse(json.dumps({'error' : 'params are required for create'}), content_type="application/json")
+
+ # DEBUG
+ print object_params
+
+ result = execute_query(request, query)
+
+ # DEBUG
+ print result
+
+ if result :
+ return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+ else :
+ return HttpResponse(json.dumps({'success' : 'record updated'}), content_type="application/json")
+
--- /dev/null
+from manifold.core.query import Query
+
+from django.views.generic.base import TemplateView
+from django.shortcuts import render_to_response
+
+from unfold.loginrequired import LoginRequiredView
+from django.http import HttpResponse
+
+from manifold.core.query import Query, AnalyzedQuery
+from manifoldapi.manifoldapi import execute_query
+
+from string import join
+import decimal
+import datetime
+import json
+
+# handles serialization of datetime in json
+DateEncoder = lambda obj: obj.strftime("%B %d, %Y %H:%M:%S") if isinstance(obj, datetime.datetime) else None
+
+# support converting decimal in json
+json.encoder.FLOAT_REPR = lambda o: format(o, '.2f')
+
+# handles decimal numbers serialization in json
+class DecimalEncoder(json.JSONEncoder):
+ def _iterencode(self, o, markers=None):
+ if isinstance(o, decimal.Decimal):
+ return (str(o) for o in [o])
+ return super(DecimalEncoder, self)._iterencode(o, markers)
+
+class objectRequest(object):
+
+ def __init__(self, request, object_type, object_name):
+ self.type = object_type
+ self.name = object_name
+ # No params in delete
+ self.properties = []
+ self.filters = {}
+ self.options = None
+
+ self.request = request
+
+ # What about key formed of multiple fields???
+ query = Query.get('local:object').filter_by('table', '==', self.type).select('key')
+ results = execute_query(self.request, query)
+ print "key of object = %s" % results
+ if results :
+ for r in results[0]['key'] :
+ self.id = r
+ else :
+ return error('Manifold db error')
+
+ query = Query.get('local:object').filter_by('table', '==', self.type).select('column.name')
+ results = execute_query(self.request, query)
+ if results :
+ for r in results[0]['column'] :
+ self.properties.append(r['name'])
+ else :
+ return error('Manifold db error')
+
+ def addFilters(self, properties):
+ selected_properties = []
+ for p in properties :
+ if p in self.properties :
+ selected_properties.append(p)
+ self.properties = selected_properties
+ self.setId()
+
+ def setId(self):
+ if self.id in self.properties :
+ self.properties.remove(self.id)
+ [self.id].extend(self.properties)
+
+ def execute(self):
+ query = Query.delete(self.type)
+ if self.filters :
+ for k, f in self.filters.iteritems() :
+ if (f[:1] == "!") :
+ query.filter_by(k, '!=', f[1:])
+ elif (f[:2] == ">=") :
+ query.filter_by(k, '>=', f[2:])
+ elif (f[:1] == ">") :
+ query.filter_by(k, '>', f[1:])
+ elif (f[:2] == "<=") :
+ query.filter_by(k, '<=', f[2:])
+ elif (f[:1] == "<") :
+ query.filter_by(k, '<', f[1:])
+ else :
+ query.filter_by(k, '==', f)
+ else:
+ raise Exception, "Filters are required for delete"
+ return execute_query(self.request, query)
+
+def dispatch(request, object_type, object_name):
+
+ o = objectRequest(request, object_type, object_name)
+
+ object_filters = {}
+ object_params = {}
+ result = {}
+
+ if request.method == 'POST':
+ req_items = request.POST
+ elif request.method == 'GET':
+ #return HttpResponse(json.dumps({'error' : 'only post request is supported'}), content_type="application/json")
+ req_items = request.GET
+
+ for el in req_items.items():
+ if el[0].startswith('filters'):
+ o.filters[el[0][8:-1]] = el[1]
+ elif el[0].startswith('columns'):
+ o.addFilters(req_items.getlist('columns[]'))
+ elif el[0].startswith('options'):
+ o.options = req_items.getlist('options[]')
+
+ try:
+ response = o.execute()
+
+ if response :
+ return HttpResponse(json.dumps({'success' : 'record deleted'}), content_type="application/json")
+ else :
+ return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+
+ except Exception, e:
+ return HttpResponse(json.dumps({'error' : str(e)}), content_type="application/json")
+
{% load rest_filters %}
<thead>
<tr>
- {% for p in properties %}
- <th>
- {{ p }}
- </th>
- {% endfor %}
+ {% if "checkbox" in options %}<th>checkbox</th>{% endif %}
+ {% for p in properties %}<th>{{ p }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for d in data %}
-<tr>
- {% for p in properties %}
- <td>
- <div class="line1">{{ d|key:p }}</div>
- </td>
- {% endfor %}
+<tr id="{{ id }}">
+ {% if "checkbox" in options %}<td><input type="checkbox" name="{{ id }}" /></td>{% endif %}
+ {% for p in properties %}<td><div class="line1">{{ d|key:p }}</div></td>{% endfor %}
</tr>
{% endfor %}
</tbody>
\ No newline at end of file
--- /dev/null
+from manifold.core.query import Query
+
+from django.views.generic.base import TemplateView
+from django.shortcuts import render_to_response
+
+from unfold.loginrequired import LoginRequiredView
+from django.http import HttpResponse
+
+from manifold.core.query import Query, AnalyzedQuery
+from manifoldapi.manifoldapi import execute_query
+
+from string import join
+import decimal
+import datetime
+import json
+
+# handles serialization of datetime in json
+DateEncoder = lambda obj: obj.strftime("%B %d, %Y %H:%M:%S") if isinstance(obj, datetime.datetime) else None
+
+# support converting decimal in json
+json.encoder.FLOAT_REPR = lambda o: format(o, '.2f')
+
+# handles decimal numbers serialization in json
+class DecimalEncoder(json.JSONEncoder):
+ def _iterencode(self, o, markers=None):
+ if isinstance(o, decimal.Decimal):
+ return (str(o) for o in [o])
+ return super(DecimalEncoder, self)._iterencode(o, markers)
+
+def dispatch(request, object_type, object_name):
+
+ object_filters = {}
+ object_params = {}
+ result = {}
+
+ if request.method == 'POST':
+ req_items = request.POST.items()
+ elif request.method == 'GET':
+ return HttpResponse(json.dumps({'error' : 'only post request is supported'}), content_type="application/json")
+
+ query = Query.update(object_type)
+
+ if object_filters :
+ for k, f in object_filters.iteritems() :
+ query.filter_by(k, '==', f)
+
+ # DEBUG
+ print object_filters
+
+ if object_params :
+ query.set(object_params.iteritems())
+ else :
+ return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+
+ # DEBUG
+ print object_params
+
+ #result = execute_query(request, query)
+
+ # DEBUG
+ print result
+
+ if result :
+ return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+ else :
+ return HttpResponse(json.dumps({'success' : 'record updated'}), content_type="application/json")
+
\ No newline at end of file
{# This is required by insert_above #}{% insert_handler %}<!DOCTYPE html>
<html lang="en"><head>
-<title>MySlice - {{ title }}</title>
+<title>OneLab - {{ section }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/static/img/myslice-icon.png">
{# This is where insert_str will end up #}{% media_container prelude %}
{% insert_str prelude "js/mustache.js" %}
{% insert_str prelude "js/plugin.js" %}
{% insert_str prelude "js/manifold.js" %}
-{% insert_str prelude "js/topmenu.js" %}
-{% insert_str prelude "css/layout-unfold.css" %}
{% insert_str prelude "css/manifold.css" %}
{% insert_str prelude "css/plugin.css" %}
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/css/{{ theme }}.css">
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
</head>
<body>
{% block container %}
{% block topmenu %}
{% include theme|add:"__widget-topmenu.html" %}
{% endblock topmenu %}
-{% include 'messages-transient.html' %}
- {% block base_content%}{% endblock %}
+ {% include 'messages-transient.html' %}
+ {% block base_content %}
+ {% endblock %}
{% endblock container %}
</body>
</html>