From e2a073b0ad69115ae50eb7acec19b59104624154 Mon Sep 17 00:00:00 2001 From: Chrysostomos Kolovos Date: Sun, 23 Feb 2014 14:05:44 +0200 Subject: [PATCH] nitlab scheduler --- plugins/scheduler/__init__.py | 42 -- plugins/scheduler/static/css/scheduler.css | 141 ---- plugins/scheduler/static/js/raphael-1.5.2.js | 7 - plugins/scheduler/static/js/raphael.js | 1 - plugins/scheduler/static/js/scheduler.js | 736 ------------------- plugins/scheduler/template/scheduler.html | 49 -- portal/sliceview.py | 38 +- 7 files changed, 26 insertions(+), 988 deletions(-) delete mode 100644 plugins/scheduler/__init__.py delete mode 100644 plugins/scheduler/static/css/scheduler.css delete mode 100644 plugins/scheduler/static/js/raphael-1.5.2.js delete mode 120000 plugins/scheduler/static/js/raphael.js delete mode 100644 plugins/scheduler/static/js/scheduler.js delete mode 100644 plugins/scheduler/template/scheduler.html mode change 100644 => 100755 portal/sliceview.py diff --git a/plugins/scheduler/__init__.py b/plugins/scheduler/__init__.py deleted file mode 100644 index caaaa521..00000000 --- a/plugins/scheduler/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -from unfold.plugin import Plugin - -class Scheduler(Plugin): - - # set checkboxes if a final column with checkboxes is desired - # pass columns as the initial set of columns - # if None then this is taken from the query's fields - # latitude,longitude, zoom : the starting point - def __init__ (self, query, query_all_resources, query_lease = None, **settings): - Plugin.__init__ (self, **settings) - self.query=query - self.query_all_resources = query_all_resources - self.query_all_resources_uuid = query_all_resources.query_uuid - self.query_lease = query_lease - self.query_lease_uuid = query_lease.query_uuid if query_lease else None - - def template_file (self): - return "scheduler.html" - - def template_env (self, request): - env={} - return env - - def requirements (self): - reqs = { - 'js_files' : [ "js/scheduler.js", - #"//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js", - "js/raphael.js", - "js/manifold.js", "js/manifold-query.js", - "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js", - "js/unfold-helper.js", - "js/jquery-ui-timepicker-addon.js", "js/jquery-ui-sliderAccess.js", - ], - 'css_files' : [ "css/scheduler.css", - "css/jquery-ui-timepicker-addon.css", - ], - } - return reqs - - # the list of things passed to the js plugin - def json_settings_list (self): - return ['plugin_uuid','query_uuid', 'query_lease_uuid', 'query_all_resources_uuid'] diff --git a/plugins/scheduler/static/css/scheduler.css b/plugins/scheduler/static/css/scheduler.css deleted file mode 100644 index fbaede02..00000000 --- a/plugins/scheduler/static/css/scheduler.css +++ /dev/null @@ -1,141 +0,0 @@ -/* - $Id: toggle.css 12435 2009-03-11 15:07:00Z thierry $ - */ - -/* this class is used to store data that needs to get passed to javascript code */ -/* these elements are not meant to be rendered */ -.hidden { - display: none; -} -.center { - text-align: center; -} - -.scrollx { - overflow-x:scroll; - height: 340px; -} -.scrolly { -overflow-y : scroll; -} -/* space around various messages */ -div.my-slice-renewal { - margin: 30px; -} - -/* toggles for the nodes sections */ -div#toggle-container-my-slice-persons-current, -div#toggle-container-my-slice-nodes-current { - background: #f0f0f0; -} - -div#toggle-container-my-slice-persons-add, -div#toggle-container-my-slice-nodes-add { - background: #f0e0e0; -} - -/* the scheduler area */ -div#toggle-container-my-slice-nodes-reserve { - background: #def; -} - -/* where the graphics go */ -div#leases_area { - /* padding: 10px 25px; */ -} - -/* don't display the scheduler data table - not quite sure this works */ -table#leases_data { - display: none; -} - -/* the various controls for the scheduler */ -/* upper section, with selection mode */ -#leases_modes { padding: 10px; text-align: center; color: #333; } - -#leases_buttons { padding: 0px 10px 10px 10px; } -#leases_refresh { position: relative; left: 30%;} -#leases_submit { position: relative; left: 60%; } - - -/* column configuation style */ - -div#toggle-container-my-slice-nodes-configuration { - background: #f8f8f8; -} - -OPTION.out{background-color:white; color:black} -OPTION.in{background-color:#CAE8EA; color:#4f6b72} - -div.out{background-color:white; color:black} -div.in{background-color:#CAE8EA; color:#4f6b72} -div.selected{background-color:gray; color:black} -div.invisible{display:none} - -div.toggle-info { - padding: 10px 20px; - background-color: #cae8ea; - margin: 10px 10px; - -} - -div#scrolldiv { - border : solid 2px grey; - padding:4px; - width:300px; - height:180px; - overflow:auto; -} - -th,td.top { - vertical-align: top; - text-align: left; - padding:10px; -} - -td.smallright { - text-align: right; - width:20px; -} - -table.center { - margin-left:auto; - margin-right:auto; -} - -table.columnlist { - width:280px; -} - -td.header { - background-color: #CAE8EA; - text-align: center; - width:30px; -} - -span.header { - font-weight: bold; - color: #3399CC; -} - -a.source-url{ - font-weight: bold; -} - -span.gray{ - color: #555555; -} - -span.short { - height:10px; -} - -span.column-title { - font-size: 12px; - font-weight: bold; -} - -span.column-detail { - font-size: 11px; - font-style: italic; -} diff --git a/plugins/scheduler/static/js/raphael-1.5.2.js b/plugins/scheduler/static/js/raphael-1.5.2.js deleted file mode 100644 index e5e71261..00000000 --- a/plugins/scheduler/static/js/raphael-1.5.2.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Raphael 1.5.2 - JavaScript Vector Library - * - * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com) - * Licensed under the MIT (http://raphaeljs.com/license.html) license. - */ -(function(){function a(){if(a.is(arguments[0],G)){var b=arguments[0],d=bV[m](a,b.splice(0,3+a.is(b[0],E))),e=d.set();for(var g=0,h=b[w];g";bg=bf.firstChild;bg.style.behavior="url(#default#VML)";if(!(bg&&typeof bg.adj=="object"))return a.type=null;bf=null}a.svg=!(a.vml=a.type=="VML");j[e]=a[e];k=j[e];a._id=0;a._oid=0;a.fn={};a.is=function(a,b){b=x.call(b);if(b=="finite")return!O[f](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||J.call(a).slice(8,-1).toLowerCase()==b};a.angle=function(b,c,d,e,f,g){{if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return((h<0)*180+y.atan(-i/-h)*180/D+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)}};a.rad=function(a){return a%360*D/180};a.deg=function(a){return a*180/D%360};a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,G)){var e=b.length;while(e--)if(B(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};function bh(){var a=[],b=0;for(;b<32;b++)a[b]=(~(~(y.random()*16)))[H](16);a[12]=4;a[16]=(a[16]&3|8)[H](16);return"r-"+a[v]("")}a.setWindow=function(a){h=a;g=h.document};var bi=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("");e.close();d=e.body}catch(a){d=createPopup().document.body}var f=d.createTextRange();bi=bm(function(a){try{d.style.color=r(a)[Y](c,p);var b=f.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b[H](16)).slice(-6)}catch(a){return"none"}})}else{var h=g.createElement("i");h.title="Raphaël Colour Picker";h.style.display="none";g.body[l](h);bi=bm(function(a){h.style.color=a;return g.defaultView.getComputedStyle(h,p).getPropertyValue("color")})}return bi(b)},bj=function(){return"hsb("+[this.h,this.s,this.b]+")"},bk=function(){return"hsl("+[this.h,this.s,this.l]+")"},bl=function(){return this.hex};a.hsb2rgb=function(b,c,d,e){if(a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b){d=b.b;c=b.s;b=b.h;e=b.o}return a.hsl2rgb(b,c,d/2,e)};a.hsl2rgb=function(b,c,d,e){if(a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b){d=b.l;c=b.s;b=b.h}if(b>1||c>1||d>1){b/=360;c/=100;d/=100}var f={},g=["r","g","b"],h,i,j,k,l,m;if(c){d<0.5?h=d*(1+c):h=d+c-d*c;i=2*d-h;for(var n=0;n<3;n++){j=b+1/3*-(n-1);j<0&&j++;j>1&&j--;j*6<1?f[g[n]]=i+(h-i)*6*j:j*2<1?f[g[n]]=h:j*3<2?f[g[n]]=i+(h-i)*(2/3-j)*6:f[g[n]]=i}}else f={r:d,g:d,b:d};f.r*=255;f.g*=255;f.b*=255;f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1);a.is(e,"finite")&&(f.opacity=e);f.toString=bl;return f};a.rgb2hsb=function(b,c,d){if(c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){d=b.b;c=b.g;b=b.r}if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r;c=e.g;d=e.b}if(b>1||c>1||d>1){b/=255;c/=255;d/=255}var f=z(b,c,d),g=A(b,c,d),h,i,j=f;{if(g==f)return{h:0,s:0,b:f,toString:bj};var k=f-g;i=k/f;b==f?h=(c-d)/k:c==f?h=2+(d-b)/k:h=4+(b-c)/k;h/=6;h<0&&h++;h>1&&h--}return{h:h,s:i,b:j,toString:bj}};a.rgb2hsl=function(b,c,d){if(c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){d=b.b;c=b.g;b=b.r}if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r;c=e.g;d=e.b}if(b>1||c>1||d>1){b/=255;c/=255;d/=255}var f=z(b,c,d),g=A(b,c,d),h,i,j=(f+g)/2,k;if(g==f)k={h:0,s:0,l:j};else{var l=f-g;i=j<0.5?l/(f+g):l/(2-f-g);b==f?h=(c-d)/l:c==f?h=2+(d-b)/l:h=4+(b-c)/l;h/=6;h<0&&h++;h>1&&h--;k={h:h,s:i,l:j}}k.toString=bk;return k};a._path2string=function(){return this.join(",")[Y](ba,"$1")};function bm(a,b,c){function d(){var g=Array[e].slice.call(arguments,0),h=g[v]("►"),i=d.cache=d.cache||{},j=d.count=d.count||[];if(i[f](h))return c?c(i[h]):i[h];j[w]>=1000&&delete i[j.shift()];j[L](h);i[h]=a[m](b,g);return c?c(i[h]):i[h]}return d}a.getRGB=bm(function(b){if(!b||!(!((b=r(b)).indexOf("-")+1)))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none"};!(_[f](b.toLowerCase().substring(0,2))||b.charAt()=="#")&&(b=bi(b));var c,d,e,g,h,i,j,k=b.match(N);if(k){if(k[2]){g=T(k[2].substring(5),16);e=T(k[2].substring(3,5),16);d=T(k[2].substring(1,3),16)}if(k[3]){g=T((i=k[3].charAt(3))+i,16);e=T((i=k[3].charAt(2))+i,16);d=T((i=k[3].charAt(1))+i,16)}if(k[4]){j=k[4][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);k[1].toLowerCase().slice(0,4)=="rgba"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100)}if(k[5]){j=k[5][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360);k[1].toLowerCase().slice(0,4)=="hsba"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,g,h)}if(k[6]){j=k[6][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360);k[1].toLowerCase().slice(0,4)=="hsla"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,g,h)}k={r:d,g:e,b:g};k.hex="#"+(16777216|g|e<<8|d<<16).toString(16).slice(1);a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1}},a);a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=0.075;if(b.h>1){b.h=0;b.s-=0.2;b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})}return c.hex};a.getColor.reset=function(){delete this.start};a.parsePathString=bm(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,G)&&a.is(b[0],G)&&(d=bo(b));d[w]||r(b)[Y](bb,function(a,b,e){var f=[],g=x.call(b);e[Y](bc,function(a,b){b&&f[L](+b)});if(g=="m"&&f[w]>2){d[L]([b][n](f.splice(0,2)));g="l";b=b=="m"?"l":"L"}while(f[w]>=c[g]){d[L]([b][n](f.splice(0,c[g])));if(!c[g])break}});d[H]=a._path2string;return d});a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,l=C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-y.atan((m-o)/(n-p))*180/D;(m>o||n1){x=y.sqrt(x);c=x*c;d=x*d}var z=c*c,A=d*d,C=(f==g?-1:1)*y.sqrt(B((z*A-z*u*u-A*t*t)/(z*u*u+A*t*t))),E=C*c*u/d+(a+h)/2,F=C*-d*t/c+(b+i)/2,G=y.asin(((b-F)/d).toFixed(9)),H=y.asin(((i-F)/d).toFixed(9));G=aH&&(G=G-D*2);!g&&H>G&&(H=H-D*2)}var I=H-G;if(B(I)>k){var J=H,K=h,L=i;H=G+k*(g&&H>G?1:-1);h=E+c*y.cos(H);i=F+d*y.sin(H);m=bt(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=y.cos(G),N=y.sin(G),O=y.cos(H),P=y.sin(H),Q=y.tan(I/4),R=4/3*c*Q,S=4/3*d*Q,T=[a,b],U=[a+R*N,b-S*M],V=[h+R*P,i-S*O],W=[h,i];U[0]=2*T[0]-U[0];U[1]=2*T[1]-U[1];{if(j)return[U,V,W][n](m);m=[U,V,W][n](m)[v]()[s](",");var X=[];for(var Y=0,Z=m[w];Y"1e12"&&(l=0.5);B(n)>"1e12"&&(n=0.5);if(l>0&&l<1){q=bu(a,b,c,d,e,f,g,h,l);p[L](q.x);o[L](q.y)}if(n>0&&n<1){q=bu(a,b,c,d,e,f,g,h,n);p[L](q.x);o[L](q.y)}i=f-2*d+b-(h-2*f+d);j=2*(d-b)-2*(f-d);k=b-d;l=(-j+y.sqrt(j*j-4*i*k))/2/i;n=(-j-y.sqrt(j*j-4*i*k))/2/i;B(l)>"1e12"&&(l=0.5);B(n)>"1e12"&&(n=0.5);if(l>0&&l<1){q=bu(a,b,c,d,e,f,g,h,l);p[L](q.x);o[L](q.y)}if(n>0&&n<1){q=bu(a,b,c,d,e,f,g,h,n);p[L](q.x);o[L](q.y)}return{min:{x:A[m](0,p),y:A[m](0,o)},max:{x:z[m](0,p),y:z[m](0,o)}}}),bw=bm(function(a,b){var c=bq(a),d=b&&bq(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1];b.Y=a[2];break;case"A":a=["C"][n](bt[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x));d=b.y+(b.y-(b.by||b.y));a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x));b.qy=b.y+(b.y-(b.qy||b.y));a=["C"][n](bs(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1];b.qy=a[2];a=["C"][n](bs(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](br(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](br(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](br(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](br(b.x,b.y,b.X,b.Y));break}return a},h=function(a,b){if(a[b][w]>7){a[b].shift();var e=a[b];while(e[w])a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1);k=z(c[w],d&&d[w]||0)}},i=function(a,b,e,f,g){if(a&&b&&a[g][0]=="M"&&b[g][0]!="M"){b.splice(g,0,["M",f.x,f.y]);e.bx=0;e.by=0;e.x=a[g][1];e.y=a[g][2];k=z(c[w],d&&d[w]||0)}};for(var j=0,k=z(c[w],d&&d[w]||0);j0.5)*2-1;C(e-0.5,2)+C(f-0.5,2)>0.25&&(f=y.sqrt(0.25-C(e-0.5,2))*g+0.5)&&f!=0.5&&(f=f.toFixed(5)-0.00001*g)}return p});b=b[s](/\s*\-\s*/);if(d=="linear"){var i=b.shift();i=-S(i);if(isNaN(i))return null;var j=[0,0,y.cos(i*D/180),y.sin(i*D/180)],k=1/(z(B(j[2]),B(j[3]))||1);j[2]*=k;j[3]*=k;if(j[2]<0){j[0]=-j[2];j[2]=0}if(j[3]<0){j[1]=-j[3];j[3]=0}}var m=bx(b);if(!m)return null;var n=a.getAttribute(I);n=n.match(/^url\(#(.*)\)$/);n&&c.defs.removeChild(g.getElementById(n[1]));var o=bG(d+"Gradient");o.id=bh();bG(o,d=="radial"?{fx:e,fy:f}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]});c.defs[l](o);for(var q=0,t=m[w];q1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(o);h[R](n,G.hex);n=="stroke"&&G[f]("opacity")&&bG(h,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity});break;case"gradient":(({circle:1,ellipse:1})[f](c.type)||r(o).charAt()!="r")&&bI(h,o,c.paper);break;case"opacity":i.gradient&&!i[f]("stroke-opacity")&&bG(h,{"stroke-opacity":o>1?o/100:o});case"fill-opacity":if(i.gradient){var H=g.getElementById(h.getAttribute(I)[Y](/^url\(#|\)$/g,p));if(H){var J=H.getElementsByTagName("stop");J[J[w]-1][R]("stop-opacity",o)}break}default:n=="font-size"&&(o=T(o,10)+"px");var K=n[Y](/(\-.)/g,function(a){return V.call(a.substring(1))});h.style[K]=o;h[R](n,o);break}}}bM(c,d);m?c.rotate(m.join(q)):S(j)&&c.rotate(j,true)},bL=1.2,bM=function(b,c){if(b.type!="text"||!(c[f]("text")||c[f]("font")||c[f]("font-size")||c[f]("x")||c[f]("y")))return;var d=b.attrs,e=b.node,h=e.firstChild?T(g.defaultView.getComputedStyle(e.firstChild,p).getPropertyValue("font-size"),10):10;if(c[f]("text")){d.text=c.text;while(e.firstChild)e.removeChild(e.firstChild);var i=r(c.text)[s]("\n");for(var j=0,k=i[w];jb.height&&(b.height=e.y+e.height-b.y);e.x+e.width-b.x>b.width&&(b.width=e.x+e.width-b.x)}}a&&this.hide();return b};bN[e].attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale());d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,F)){if(b=="translation")return cz.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(c==null&&a.is(b,G)){var g={};for(var h=0,i=b.length;h"));m.W=h.w=m.paper.span.offsetWidth;m.H=h.h=m.paper.span.offsetHeight;m.X=h.x;m.Y=h.y+Q(m.H/2);switch(h["text-anchor"]){case"start":m.node.style["v-text-align"]="left";m.bbx=Q(m.W/2);break;case"end":m.node.style["v-text-align"]="right";m.bbx=-Q(m.W/2);break;default:m.node.style["v-text-align"]="center";break}}};bI=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d,e="linear",f=".5 .5";a.attrs.gradient=b;b=r(b)[Y](bd,function(a,b,c){e="radial";if(b&&c){b=S(b);c=S(c);C(b-0.5,2)+C(c-0.5,2)>0.25&&(c=y.sqrt(0.25-C(b-0.5,2))*((c>0.5)*2-1)+0.5);f=b+q+c}return p});b=b[s](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-S(g);if(isNaN(g))return null}var h=bx(b);if(!h)return null;a=a.shape||a.node;d=a.getElementsByTagName(I)[0]||cd(I);!d.parentNode&&a.appendChild(d);if(h[w]){d.on=true;d.method="none";d.color=h[0].color;d.color2=h[h[w]-1].color;var i=[];for(var j=0,k=h[w];j")}}catch(a){cd=function(a){return g.createElement("<"+a+" xmlns=\"urn:schemas-microsoft.com:vml\" class=\"rvml\">")}}bV=function(){var b=by[m](0,arguments),c=b.container,d=b.height,e,f=b.width,h=b.x,i=b.y;if(!c)throw new Error("VML container not found.");var k=new j,n=k.canvas=g.createElement("div"),o=n.style;h=h||0;i=i||0;f=f||512;d=d||342;f==+f&&(f+="px");d==+d&&(d+="px");k.width=1000;k.height=1000;k.coordsize=b_*1000+q+b_*1000;k.coordorigin="0 0";k.span=g.createElement("span");k.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";n[l](k.span);o.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d);if(c==1){g.body[l](n);o.left=h+"px";o.top=i+"px";o.position="absolute"}else c.firstChild?c.insertBefore(n,c.firstChild):c[l](n);bz.call(k,k,a.fn);return k};k.clear=function(){this.canvas.innerHTML=p;this.span=g.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[l](this.span);this.bottom=this.top=null};k.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bF(a);return true}}var ce=navigator.userAgent.match(/Version\\x2f(.*?)\s/);navigator.vendor=="Apple Computer, Inc."&&(ce&&ce[1]<4||navigator.platform.slice(0,2)=="iP")?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});h.setTimeout(function(){a.remove()})}:k.safari=function(){};var cf=function(){this.returnValue=false},cg=function(){return this.originalEvent.preventDefault()},ch=function(){this.cancelBubble=true},ci=function(){return this.originalEvent.stopPropagation()},cj=(function(){{if(g.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,g=function(e){if(o&&u[f](b))for(var g=0,h=e.targetTouches&&e.targetTouches.length;g1&&(a=Array[e].splice.call(arguments,0,arguments[w]));return new cC(a)};k.setSize=bU;k.top=k.bottom=null;k.raphael=a;function co(){return this.x+q+this.y}bO.resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};bO.scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:co};b=b||a;!(+b)&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var j=this.getBBox(),k=j.x+j.width/2,l=j.y+j.height/2,m=B(a/this._.sx),o=B(b/this._.sy);c=+c||c==0?c:k;d=+d||d==0?d:l;var r=this._.sx>0,s=this._.sy>0,t=~(~(a/B(a))),u=~(~(b/B(b))),x=m*t,y=o*u,z=this.node.style,A=c+B(k-c)*x*(k>c==r?1:-1),C=d+B(l-d)*y*(l>d==s?1:-1),D=a*t>b*u?o:m;switch(this.type){case"rect":case"image":var E=i.width*m,F=i.height*o;this.attr({height:F,r:i.r*D,width:E,x:A-E/2,y:C-F/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*m,ry:i.ry*o,r:i.r*D,cx:A,cy:C});break;case"text":this.attr({x:A,y:C});break;case"path":var G=bp(i.path),H=true,I=r?x:m,J=s?y:o;for(var K=0,L=G[w];Kr)p=n.data[r*l];else{p=a.findDotsAtSegment(b,c,d,e,f,g,h,i,r/l);n.data[r]=p}r&&(k+=C(C(o.x-p.x,2)+C(o.y-p.y,2),0.5));if(j!=null&&k>=j)return p;o=p}if(j==null)return k},cr=function(b,c){return function(d,e,f){d=bw(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=cq(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k;k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][v]();n+=j;g=+i[5];h=+i[6];continue}if(!b&&!c){m=cq(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j;g=+i[5];h=+i[6]}k+=i}l.end=k;m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1);m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cs=cr(1),ct=cr(),cu=cr(0,1);bO.getTotalLength=function(){if(this.type!="path")return;if(this.node.getTotalLength)return this.node.getTotalLength();return cs(this.attrs.path)};bO.getPointAtLength=function(a){if(this.type!="path")return;return ct(this.attrs.path,a)};bO.getSubpath=function(a,b){if(this.type!="path")return;if(B(this.getTotalLength()-b)<"1e-6")return cu(this.attrs.path,a).end;var c=cu(this.attrs.path,b,1);return a?cu(c,a).end:c};a.easing_formulas={linear:function(a){return a},"<":function(a){return C(a,3)},">":function(a){return C(a-1,3)+1},"<>":function(a){a=a*2;if(a<1)return C(a,3)/2;a-=2;return(C(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=0.3,c=b/4;return C(2,-10*a)*y.sin((a-c)*(2*D)/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;if(a<1/c)d=b*a*a;else if(a<2/c){a-=1.5/c;d=b*a*a+0.75}else if(a<2.5/c){a-=2.25/c;d=b*a*a+0.9375}else{a-=2.625/c;d=b*a*a+0.984375}return d}};var cv=[],cw=function(){var b=+(new Date);for(var c=0;cd)return d;while(cf?c=e:d=e;e=(d-c)/2+c}return e}return n(a,1/(200*f))}bO.onAnimation=function(a){this._run=a||0;return this};bO.animate=function(c,d,e,g){var h=this;h.timeouts=h.timeouts||[];if(a.is(e,"function")||!e)g=e||null;if(h.removed){g&&g.call(h);return h}var i={},j={},k=false,l={};for(var m in c)if(c[f](m)){if(X[f](m)||h.paper.customAttributes[f](m)){k=true;i[m]=h.attr(m);i[m]==null&&(i[m]=W[m]);j[m]=c[m];switch(X[m]){case"along":var n=cs(c[m]),o=ct(c[m],n*!(!c.back)),p=h.getBBox();l[m]=n/d;l.tx=p.x;l.ty=p.y;l.sx=o.x;l.sy=o.y;j.rot=c.rot;j.back=c.back;j.len=n;c.rot&&(l.r=S(h.rotate())||0);break;case E:l[m]=(j[m]-i[m])/d;break;case"colour":i[m]=a.getRGB(i[m]);var q=a.getRGB(j[m]);l[m]={r:(q.r-i[m].r)/d,g:(q.g-i[m].g)/d,b:(q.b-i[m].b)/d};break;case"path":var t=bw(i[m],j[m]);i[m]=t[0];var u=t[1];l[m]=[];for(var v=0,x=i[m][w];v= lease[1]) && (timestamp < (lease[1] + lease[2] * 1800)))) { - result = lease; - return false; // stop each - } - }); - -/* - $.each(Array(scheduler.myLeases, scheduler.allLeases), function(i, array) { - $.each(array, function(i, lease) { - if (lease[0] == urn) { - if ((timestamp >= lease[1]) && (timestamp < (lease[1] + lease[2] * 1800))) { - result = lease; - - return false; - } - } - }); - if (result) - return false; - }); -*/ - return result; - }, - - /* Iterative search through raphael.js objects, no forEach, no getById in the current version */ - _lease_element_find: function(urn, start_time) - { - var date = new Date(start_time*1000); - var pos = this._paper.top; - while (pos) { - if (pos.key == urn + "-" + date) - return pos; - pos = pos.prev; - } - return null; - }, - - /** - * @brief Draw - */ - _draw: function() - { - var canvas_id = this._canvas_id; - var o = this.options; - - var total_width = o.x_nodelabel + this.nb_grains() * this.options.leases_w; - var total_height = 2 * o.y_header /* the timelabels */ - + 2 * o.y_sep /* extra space */ - + o.y_node /* all-nodes & timebuttons row */ - + (this._resources.length) * (o.y_node + o.y_sep); /* the regular nodes and preceding space */ - - /* reuse for paper if exists with same size, or (re-)create otherwise */ - var paper; - if (this._paper == null) { - paper = Raphael (canvas_id, total_width + o.x_sep, total_height); - } else if (this._paper.width==total_width && this._paper.height==total_height) { - paper=this._paper; - paper.clear(); - } else { - $("#"+canvas_id)[0].innerHTML=""; - //this.elmt().html(); - paper = Raphael (canvas_id, total_width + o.x_sep, total_height); - } - this._paper = paper; - - /* the path for the triangle-shaped buttons */ - var timebutton_path = "M1,0L"+(this.options.leases_w-1)+",0L"+(this.options.leases_w/2)+","+o.y_header+"L1,0"; - - var axisx = this._axisx; - var axisy = this._resources; - - /* maintain the list of nodelabels for the 'all nodes' button */ - this._nodelabels = []; - - - /* create the time slots legend */ - var top = 0; - var left = o.x_nodelabel; - - var daymarker_height = 2*o.y_header + 2*o.y_sep + (axisy.length + 1) * (o.y_node + o.y_sep); - var daymarker_path = "M0,0L0," + daymarker_height; - - var half_daymarker_off= 2*o.y_header + o.y_sep; - var half_daymarker_path="M0," + half_daymarker_off + "L0," + daymarker_height; - - var col=0; - for (var i=0, len = axisx.length; i < len; ++i) { - /* pick the printable part */ - var timelabel = axisx[i][1]; - var y = top + o.y_header; - if (col % 2 == 0) - y += o.y_header; - col +=1; - /* display time label */ - var timelabel = paper.text(left, y, timelabel).attr(txt_timelabel).attr({"text-anchor": "middle"}); - /* draw vertical line */ - var path_spec = "M" + left + " " + (y+o.y_header / 2) + "L" + left + " " + this.total_height; - var rule = paper.path(path_spec).attr(attr_rules); - /* show a day marker when relevant */ - var timestamp = parseInt(axisx[i][0]); - if ((timestamp % (24 * 3600)) == 0) { - paper.path(daymarker_path).attr({'translation': left + ',' + top}).attr(attr_daymarker); - } else if ( (timestamp%(12*3600))==0) { - paper.path(half_daymarker_path).attr({'translation': left + ',' + top}).attr(attr_daymarker); - } - left += o.leases_w; - } - - ////////// the row with the timeslot buttons (the one labeled 'All nodes') - this.granularity = this.min_granularity; // XXX axisx[1][0]-axisx[0][0]; - - // move two lines down - top += 2 * o.y_header + 2 * o.y_sep; - left = o.x_nodelabel; - // all nodes buttons - var allnodes = paper.text(o.x_nodelabel - o.x_sep, top + o.y_node / 2, "All nodes").attr(txt_allnodes) - .attr({"font-size": o.y_node, "text-anchor": "end", "baseline": "bottom"}); - //allnodes.scheduler = this; - allnodes.click(this._allnodes_click); // XXX click - - // timeslot buttons [it's the triangles above the slots] - for (var i = 0, len = axisx.length; i < len; ++i) { - var timebutton = paper.path(timebutton_path).attr({'translation':left + ',' + top}).attr(attr_timebutton); - timebutton.from_time = axisx[i][0]; - timebutton.scheduler = this; - timebutton.click(this._timebutton_click); - left += (o.leases_w); - } - - //////// the body of the scheduler : loop on nodes - top += o.y_node + o.y_sep; - - var data_index = 0; - this.leases = []; /* XXX ??? XXX */ - - for (var i = 0, len = axisy.length; i < len; ++i) { - var urn = axisy[i][0]; - var nodename = axisy[i][1]; - var type = axisy[i][2]; - left = 0; - /* - * MODIFIED font-size - var nodelabel = paper.text(o.x_nodelabel-x_sep,top+y_node/2,nodename).attr(txt_nodelabel) - .attr ({"font-size":y_node, "text-anchor":"end","baseline":"bottom"}); - */ - var nodelabel = paper.text(o.x_nodelabel - o.x_sep, top + o.y_node / 3, nodename).attr(txt_nodelabel) - .attr({"font-size": "12px", "text-anchor": "end","baseline": "bottom"}); - - this._nodelabel_select(nodelabel, 1); // By default we select all nodes - nodelabel.scheduler = this; - nodelabel.click(this._nodelabel_click); //click action works here - this._nodelabels.push(nodelabel); - - // lease_methods.init_free(nodelabel.click, lease_methods.click_mine); - //lease_methods.init_free(nodelabel.lease); - - left += o.x_nodelabel; - - // data index contains the full array of leases - // not the same amount of grains per node - - // NOTE: remembering the previous lease might help for long leases. - var grain=0; - while (grain < this.nb_grains()) { - - if (l = this._lease_find(urn, this._initial_timestamp + grain * 1800)) { - slicename = l.slice_id; - } else { - slicename = ""; - } - - //lease_id = this.data[data_index][0]; - //slicename = this.data[data_index][1]; - /* Duration should not be the lease duration, but the grain */ - var duration = 1; // this.data[data_index][2]; - - var lease = paper.rect(left, top, o.leases_w * duration, o.y_node, o.radius); - lease.scheduler = this; // we record a pointer to the scheduler in the lease element - //lease.lease_id=lease_id; - lease.nodename = nodename; - lease.urn = urn; - lease.nodelabel = nodelabel; - - if (slicename == "") { - lease.initial = "free"; - this._lease_init_free(lease); - } else if (slicename == o.slicename) { - lease.initial = "mine"; - this._lease_init_mine(lease); - } else { - lease.initial = "other"; - this._lease_init_other(lease, slicename); - } - - lease.from_time = axisx[grain % this.nb_grains()][0]; - grain += duration; - lease.until_time = axisx[grain % this.nb_grains()][0]; - - /* We set a key to the lease element to find it later in the paper thanks to this._lease_element_find() */ - lease.key = urn + '-' + lease.from_time; - - // and vice versa - this._lease_elements.push(lease); - // move on with the loop - left += o.leases_w * duration; - data_index += 1; - } - top += o.y_node + o.y_sep; - }; - }, /* _draw */ - - _init_axisx: function(currentDate) - { - this._axisx = Array(); - - if(currentDate == "") { - // creating timestamp of the current time - currentDate = new Date().getTime() / 1000; - } - this._initial_timestamp = currentDate; - //console.log(currentDate); - - // round it by granularity (becomes an Int) - var rounded = Math.round(currentDate / this.min_granularity) * this.min_granularity; - // Convert Int to Date - rounded = new Date(rounded * 1000); - // get hours and minutes in a 24h format 00:00 - var roundedHours = (rounded.getHours() < 10 ? '0' : '') + rounded.getHours(); - var roundedMinutes = (rounded.getMinutes() < 10 ? '0' : '') + rounded.getMinutes(); - - this._axisx.push(Array(rounded, roundedHours + ":" + roundedMinutes)); - - // Generate as many slots as we need - for(i = 0; i < this.options.leases_slots; i++) { - rounded = this.min_granularity + (rounded.getTime() / 1000); - rounded = new Date(rounded * 1000); - roundedHours = (rounded.getHours() < 10 ? '0' : '') + rounded.getHours(); - roundedMinutes = (rounded.getMinutes() < 10 ? '0' : '') + rounded.getMinutes(); - - this._axisx.push(Array(rounded, roundedHours + ":" + roundedMinutes)); - } - }, - - clear: function () - { - for (var i=0, len = this.leases.length; i0) ? 1 : 0; - for (var i=0, len=this._nodelabels.length; i= until_time) { - if (scan.current == "free") - relevant_free.push(scan); - else if (scan.current == "mine") - relevant_mine.push(scan); - } - } - // window.console.log("Found " + relevant_free.length + " free and " + relevant_mine.length + " mine"); - /* decide what to do, whether book or release */ - if (relevant_mine.length == 0 && relevant_free.length == 0) { - alert ("Nothing to do in this timeslot on the selected nodes"); - return; - } - // if at least one is free, let's book - if (relevant_free.length > 0) { - for (var i = 0, len = relevant_free.length; i < len; ++i) { - var lease = relevant_free[i]; - scheduler._lease_init_mine(lease, scheduler._lease_click_free); - } - // otherwise we unselect - } else { - for (var i = 0, len = relevant_mine.length; i < len; ++i) { - var lease = relevant_mine[i]; - scheduler._lease_init_free(lease, scheduler._lease_click_mine); - } - } - }, /* _timebutton_click */ - - /* --------------------------------------------------------------------- - * The nodelabel buttons - */ - - // set selected mode and render visually - _nodelabel_select: function (nodelabel, flag) - { - nodelabel.selected = flag; - nodelabel.attr({'font-weight': (flag ? 'bold' : 'normal')}); - // TODO - // - // loop on axis x and select each timebutton - // for (var i=0, len=axisx.length; i < len; ++i) - // figure out how to use timebutton_methods.click(); - - }, - - // toggle selected - _nodelabel_click: function (event) - { - this.scheduler._nodelabel_select( this, ! this.selected ); - }, - - - /* --------------------------------------------------------------------- - * The lease buttons - */ - _lease_init_free: function (lease, unclick) - { - var o = lease.scheduler.options; - lease.current = "free"; - // set color - lease.animate((lease.initial == "free") ? attr_lease_free_free : attr_lease_mine_free, o.anim_delay); - // keep track of the current status - // record action - lease.click(this._lease_click_free); - if (unclick) lease.unclick(unclick); - }, - - // find out all the currently free leases that overlap this one - _lease_click_free: function (event) - { - var scheduler = this.scheduler; - - scheduler._lease_init_mine(this, scheduler._lease_click_free); - //publish - //this.from_time - //this.urn - //this.until_time - var urn = this.urn - var start_time = this.from_time.getTime() / 1000; - var end_time = this.until_time.getTime() / 1000; - var duration = (end_time - start_time) / 1800; // XXX HARDCODED LEASE GRAIN - - /* Add a new lease : XXX should be replaced by a dictionary */ - /* - // Do we have a lease with the same urn just before or just after ? - //var removeIdBefore = null; - //var removeIdAfter = null; - var remove_lease_before = null; - var remove_lease_after = null; - // It is important to group leases, while this is technically - // equivalent, some testbeds such as IotLab limit the number of - // leases a user can have. - // XXX we might have several leases before or after if they have - // XXX not been grouped like this tool does - $.each(scheduler._leases, function(i, lease) { - if (lease[0] == urn) { - if (lease[1] + lease[2] * 1800 == start_time) { // XXX HARDCODED LEASE GRAIN - // Merge with previous lease - // removeIdBefore = i; - remove_lease_before = lease; - start_time = lease[1]; - duration += lease[2]; - } - if (lease[1] == end_time) { - // Merge with following lease - // removeIdAfter = i; - remove_lease_after = lease; - duration += lease[2]; - } - } - }); - //if (removeIdBefore != null) { - // scheduler._leases.splice(removeIdBefore , 1); - // if (removeIdAfter != null) - // removeIdAfter -= 1; - //} - //if (removeIdAfter != null) { - // scheduler._leases.splice(removeIdAfter , 1); - //} - - // We add the new lease, no need to push - var new_lease = [this.urn, start_time, duration]; - - // We send events, manifold will inform us about the change and we will react accordingly - /* - if (remove_lease_before != null) - manifold.raise_event(scheduler.options.query_lease_uuid, SET_REMOVED, remove_lease_before); - if (remove_lease_after != null) - manifold.raise_event(scheduler.options.query_lease_uuid, SET_REMOVED, remove_lease_after); - */ - manifold.raise_event(scheduler.options.query_lease_uuid, SET_ADD, new_lease); - //scheduler._leases.push([this.urn, start_time, duration]); - - //console.log(scheduler._leases); - //jQuery.publish('/update-set/' + scheduler.options.query_uuid, [scheduler._leases]); - - /* We need to inform manifold about the whole diff, in addition to maintaining our own structure */ - event.preventDefault(); - }, - - _lease_init_mine: function (lease, unclick) - { - var o = lease.scheduler.options; - lease.current = "mine"; - lease.animate((lease.initial == "mine") ? attr_lease_mine_mine : attr_lease_free_mine, o.anim_delay); - lease.click(this._lease_click_mine); - if (unclick) - lease.unclick(unclick); - }, - - /* TODO: remove selected lease from array _leases and publish change */ - _lease_click_mine: function (event) - { - var scheduler = this.scheduler; - // this lease was originally free but is now marked for booking - // we free just this lease - //console.log('this is mine'); - scheduler._lease_init_free(this, scheduler._lease_click_mine); - event.preventDefault(); - }, - - - lease_init_other: function (lease, slicename) - { - lease.animate (attr_lease_other,anim_delay); - /* a text obj to display the name of the slice that owns that lease */ - var otherslicelabel = lease.scheduler.paper.text (lease.attr("x")+lease.attr("width")/2, - // xxx - lease.attr("y")+lease.attr("height")/2,slicename).attr(txt_otherslice); - /* hide it right away */ - otherslicelabel.hide(); - /* record it */ - lease.label=otherslicelabel; - lease.hover ( function (e) {this.label.toFront();this.label.show();}, - function (e) {this.label.hide();} ); - } - - }); - - $.plugin('Scheduler', Scheduler); - -})(jQuery); diff --git a/plugins/scheduler/template/scheduler.html b/plugins/scheduler/template/scheduler.html deleted file mode 100644 index cd2e9c8e..00000000 --- a/plugins/scheduler/template/scheduler.html +++ /dev/null @@ -1,49 +0,0 @@ -
- - - - -

Date:

- -

Search:

- - - - - - -
- - -
diff --git a/portal/sliceview.py b/portal/sliceview.py old mode 100644 new mode 100755 index eaec3faa..52c4ef77 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -18,7 +18,8 @@ from plugins.querygrid import QueryGrid from plugins.queryupdater import QueryUpdater from plugins.googlemap import GoogleMap from plugins.senslabmap import SensLabMap -from plugins.scheduler import Scheduler +#from plugins.scheduler import Scheduler +from plugins.scheduler2 import Scheduler2 from plugins.querycode import QueryCode # Thierry # stay away from query editor for now as it seems to make things go very slow @@ -244,15 +245,27 @@ class SliceView (LoginRequiredAutoLogoutView): checkboxes = True, ) - if do_query_leases: - resources_as_scheduler = Scheduler( - page = page, - title = 'Scheduler', - domid = 'scheduler', - query = sq_resource, - query_all_resources = query_resource_all, - query_lease = sq_lease, - ) + + + #if do_query_leases: + # resources_as_scheduler = Scheduler( + # page = page, + # title = 'Scheduler', + # domid = 'scheduler', + # query = sq_resource, + # query_all_resources = query_resource_all, + # query_lease = sq_lease, + # ) + + resources_as_scheduler2 = Scheduler2( + page = page, + domid = 'scheduler', + title = 'Scheduler', + # this is the query at the core of the slice list + query = sq_resource, + query_all_resources = query_resource_all, + query_lease = sq_lease, + ) # with the new 'Filter' stuff on top, no need for anything but the querytable resources_as_list_area = resources_as_list @@ -260,12 +273,13 @@ class SliceView (LoginRequiredAutoLogoutView): resources_sons = [ resources_as_gmap, resources_as_3dmap, - resources_as_scheduler, + resources_as_scheduler2, resources_as_list_area, ] if do_query_leases else [ resources_as_gmap, resources_as_3dmap, resources_as_list_area, + resources_as_scheduler2, ] if insert_grid: resources_sons.append(resources_as_grid) @@ -276,7 +290,7 @@ class SliceView (LoginRequiredAutoLogoutView): title="Resources", outline_complete=True, sons= resources_sons, - active_domid = 'resources-map', + active_domid = 'scheduler', persistent_active=True, ) main_stack.insert (resources_area) -- 2.43.0