Changeset 10817
- Timestamp:
- 08/05/11 15:32:41 (23 months ago)
- Location:
- ossiedev/trunk/tools/cornetApps
- Files:
-
- 6 added
- 10 modified
-
HtmlPages/static/frames.js (modified) (3 diffs)
-
HtmlPages/static/pics/home.png (added)
-
HtmlPages/static/pics/logout.png (added)
-
HtmlPages/views.py (modified) (1 diff)
-
HtmlPages/views.pyc (modified) (previous)
-
WebDash/views.py (modified) (5 diffs)
-
static/frames.css (modified) (1 diff)
-
static/frames.js (modified) (3 diffs)
-
static/pics/home.png (added)
-
static/pics/logout.png (added)
-
templates/HtmlPages/running.html (modified) (1 diff)
-
templates/HtmlPages/waveforms.html (modified) (1 diff)
-
templates/WebDash/index.html (modified) (2 diffs)
-
templates/WebDash/running.html (added)
-
templates/WebDash/waveforms.html (added)
-
urls.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/trunk/tools/cornetApps/HtmlPages/static/frames.js
r10816 r10817 21 21 $("#waveform").click(function(){ 22 22 //$("#workspace").load($("#console a").attr("href")); 23 $("#workspace").load("/ waveforms/");23 $("#workspace").load("/WebDash/waveforms/"); 24 24 }); 25 25 }); … … 27 27 28 28 $("#left_bottom").ready(function(){ 29 $("#apps").load("/running/"); 30 }); 31 32 $(function ajax(){ 33 //load console in workspace 34 $('#console').click(function(){ 35 $('#workspace').load('/grid/'); 36 }); 29 $("#apps").load("/WebDash/running/"); 37 30 }); 38 31 … … 82 75 83 76 function install(waveform){ 84 $("#apps").load("/ install/"+waveform);77 $("#apps").load("/WebDash/install/"+waveform); 85 78 } 86 79 87 80 function uninstall(waveform){ 88 $("#apps").load("/ uninstall/"+waveform);81 $("#apps").load("/WebDash/uninstall/"+waveform); 89 82 } -
ossiedev/trunk/tools/cornetApps/HtmlPages/views.py
r10816 r10817 78 78 variables = RequestContext(request, {'form':form}) 79 79 return render_to_response('registration/register.html', variables) 80 81 def buildWebDash():82 ctrlr = Controller(False)83 ctrlr.createWidgetContainer()84 ctrlr.CORBAutils.init_CORBA(False)85 ctrlr.buildModel()86 return ctrlr87 88 def waveforms(request):89 ctrlr = buildWebDash()90 availableList = ctrlr.model.getSystemWaveforms()91 return render_to_response("HtmlPages/waveforms.html", locals(), context_instance=RequestContext(request))92 93 def running_page(request):94 ctrlr = buildWebDash()95 96 availableList = ctrlr.model.getSystemWaveforms()97 instancesList = []98 instances = []99 for waveform in availableList:100 instances = ctrlr.model.getInstanceWaveforms(waveform.getName())101 if instances:102 for instance in instances:103 instancesList.append(instance)104 105 return render_to_response('HtmlPages/running.html', {'instancesList' : instancesList})106 107 def install(request, waveform_to_install):108 ctrlr = buildWebDash()109 instance = ctrlr.installWaveform(waveform_to_install, True)110 return running_page(request)111 112 def uninstall(request, instance_to_uninstall):113 ctrlr = buildWebDash()114 uninstall = ctrlr.uninstallWaveform(instance_to_uninstall)115 return running_page(request) -
ossiedev/trunk/tools/cornetApps/WebDash/views.py
r10771 r10817 9 9 import wavedash.src.WaveformModel 10 10 11 def index(request):11 def buildController(): 12 12 ctrlr = Controller(False) 13 13 ctrlr.createWidgetContainer() 14 14 ctrlr.CORBAutils.init_CORBA(False) 15 15 ctrlr.buildModel() 16 return ctrlr 17 18 def waveforms(request): 19 ctrlr = buildController() 20 availableList = ctrlr.model.getSystemWaveforms() 21 return render_to_response("WebDash/waveforms.html", locals(), context_instance=RequestContext(request)) 22 23 def index(request): 24 ctrlr = buildController() 16 25 17 26 availableList = ctrlr.model.getSystemWaveforms() … … 28 37 {'availableList' : availableList, 'instancesList' : instancesList}) 29 38 39 def running_page(request): 40 ctrlr = buildController() 30 41 31 def install(request, waveform): 32 ctrlr = Controller(False) 33 ctrlr.createWidgetContainer() 34 ctrlr.CORBAutils.init_CORBA(False) 35 ctrlr.buildModel() 42 availableList = ctrlr.model.getSystemWaveforms() 43 instancesList = [] 44 instances = [] 45 for waveform in availableList: 46 instances = ctrlr.model.getInstanceWaveforms(waveform.getName()) 47 if instances: 48 for instance in instances: 49 instancesList.append(instance) 50 51 return render_to_response('WebDash/running.html', {'instancesList' : instancesList}) 36 52 37 instance = ctrlr.installWaveform(waveform, True) 53 def install(request, waveform_to_install): 54 ctrlr = buildController() 55 56 instance = ctrlr.installWaveform(waveform_to_install, True) 38 57 if instance: 39 58 message = 'Install Successful' … … 41 60 message = 'Install Unsuccessful' 42 61 43 link = '/WebDash/'44 return render_to_response('WebDash/message.html',45 {'message' : message, 'link' : link})62 #link = '/WebDash/' 63 #return render_to_response('WebDash/message.html', {'message' : message, 'link' : link}) 64 return running_page(request) 46 65 47 66 48 67 def display(request, instance): 49 ctrlr = Controller(False) 50 ctrlr.createWidgetContainer() 51 ctrlr.CORBAutils.init_CORBA(False) 52 ctrlr.buildModel() 68 ctrlr = buildController() 69 53 70 instance = ctrlr.model.getWaveform(instance, wavedash.src.WaveformModel.INSTANCE_WAVEFORM) 54 55 71 56 72 return render_to_response('WebDash/display.html', 57 73 {'instance' : instance}, context_instance=RequestContext(request)) 58 74 59 def uninstall(request, instance): 60 ctrlr = Controller(False) 61 ctrlr.createWidgetContainer() 62 ctrlr.CORBAutils.init_CORBA(False) 63 ctrlr.buildModel() 75 def uninstall(request, instance_to_uninstall): 76 ctrlr = buildController() 64 77 65 uninstall = ctrlr.uninstallWaveform(instance )78 uninstall = ctrlr.uninstallWaveform(instance_to_uninstall) 66 79 if uninstall: 67 80 message = 'Uninstall Successful' … … 69 82 message = 'Uninstall Not Successful' 70 83 71 link = '/WebDash/'72 return render_to_response('WebDash/message.html',73 {'message' : message, 'link' : link})84 #link = '/WebDash/' 85 #return render_to_response('WebDash/message.html', {'message' : message, 'link' : link}) 86 return running_page(request) 74 87 75 88 def configure(request): 76 ctrlr = Controller(False) 77 ctrlr.createWidgetContainer() 78 ctrlr.CORBAutils.init_CORBA(False) 79 ctrlr.buildModel() 89 ctrlr = buildController() 80 90 if request.method == 'POST': 81 91 waveName = request.POST['waveform'] … … 113 123 {'message' : message, 'link' : link}, context_instance=RequestContext(request)) 114 124 115 116 117 -
ossiedev/trunk/tools/cornetApps/static/frames.css
r10787 r10817 99 99 } 100 100 101 #tabs-container {101 .tabs-container { 102 102 padding: 5px 0px; 103 103 position: relative; 104 104 } 105 105 106 .loading { 107 position: relative; 108 background: url('loading.gif') no-repeat; 109 margin-left: auto; 110 margin-right: auto; 111 display: block; 112 } 106 113 .navigation{ 107 114 position: relative; -
ossiedev/trunk/tools/cornetApps/static/frames.js
r10814 r10817 3 3 $(this).parent().children().css('background-color', 'white'); 4 4 $(this).css('background-color', '#3e1'); 5 });6 });7 8 $(function loadNodeMenu(){9 $('#load').click(function(){10 $('#directory').load('/nodeMenu/', function(){11 //slide menu12 $('#menu ul').hide();13 $('#menu li a').click(function(){14 $(this).next().slideToggle('fast');15 });16 });17 5 }); 18 6 }); … … 23 11 }); 24 12 13 $("#menu").ready(function(){ 14 $('#directory').load('/nodeMenu/', function(){ 15 //slide menu 16 $('#menu ul').hide(); 17 $('#menu li a').click(function(){ 18 $(this).next().slideToggle('fast'); 19 }); 20 //load workspace 21 $("#waveform").click(function(){ 22 //$("#workspace").load($("#console a").attr("href")); 23 $("#workspace").load("/waveforms/"); 24 }); 25 }); 26 }); 27 28 $("#left_bottom").ready(function(){ 29 $("#apps").load("/running/"); 30 }); 31 25 32 $(function ajax(){ 26 33 //load console in workspace 27 34 $('#console').click(function(){ 28 $('#workspace').load('/ WebDash/');35 $('#workspace').load('/grid/'); 29 36 }); 30 37 }); 31 38 32 var viewContainer = "#view"; 33 var tabsId = '.tabs'; 34 $("#right-top").ready(function(){ 39 var viewContainerRightTop = "#view"; 40 var tabsIdRightTop = '#right_top .tabs'; 41 42 $("#right_top").ready(function(){ 35 43 // Preload tab on page load 36 if($(tabsId + 'LI.current A').length > 0){37 loadTab($(tabsId + ' LI.current A'), "#view");44 if($(tabsIdRightTop + ' LI.current A').length > 0){ 45 loadTab($(tabsIdRightTop + ' LI.current A'), viewContainerRightTop); 38 46 } 39 $(tabsId + ' A').click(function(){47 $(tabsIdRightTop + ' A').click(function(){ 40 48 if($(this).parent().hasClass('current')){ return false; } 41 $(tabsId + ' LI.current').removeClass('current');49 $(tabsIdRightTop + ' LI.current').removeClass('current'); 42 50 $(this).parent().addClass('current'); 43 loadTab($(this), "#view");51 loadTab($(this), viewContainerRightTop); 44 52 return false; 45 53 }); 46 54 }); 55 56 viewContainerRightBot = "#workspace"; 57 tabsIdRightBot = "#right_bottom .tabs" 58 59 $("#right_bottom").ready(function(){ 60 // Preload tab on page load 61 if($(tabsIdRightBot + 'LI.current A').length > 0){ 62 loadTab($(tabsIdRightBot + ' LI.current A'), viewContainerRightBot); 63 } 64 $(tabsIdRightBot + ' A').click(function(){ 65 if($(this).parent().hasClass('current')){ return false; } 66 $(tabsIdRightBot + ' LI.current').removeClass('current'); 67 $(this).parent().addClass('current'); 68 loadTab($(this), viewContainerRightBot); 69 return false; 70 }); 71 }); 72 47 73 function loadTab(tabObj, container){ 48 74 if(!tabObj || !tabObj.length){ return; } … … 55 81 } 56 82 83 function install(waveform){ 84 $("#apps").load("/install/"+waveform); 85 } 86 87 function uninstall(waveform){ 88 $("#apps").load("/uninstall/"+waveform); 89 } -
ossiedev/trunk/tools/cornetApps/templates/HtmlPages/running.html
r10816 r10817 11 11 </table> 12 12 {% else %} 13 <p>No running waveforms.<p>13 <p>No waveforms are currently running. If they should be, check if node booter is running.<p> 14 14 {% endif %} -
ossiedev/trunk/tools/cornetApps/templates/HtmlPages/waveforms.html
r10816 r10817 5 5 <tr> 6 6 <td> {{ wave.getName }} </td> 7 <!--<td> <button onClick="window.location='/WebDash/{{ wave.getName }}/install/'">Install</button> </td>-->8 7 <td> <button onClick="javascript:install('{{ wave.getName }}');">Install</button> </td> 9 8 {% endfor %} -
ossiedev/trunk/tools/cornetApps/templates/WebDash/index.html
r10774 r10817 10 10 <tr> 11 11 <td> {{ wave.getName }} </td> 12 <td> <button onClick="window.location='/WebDash/ {{ wave.getName }}/install/'">Install</button> </td>12 <td> <button onClick="window.location='/WebDash/install/{{ wave.getName }}/'">Install</button> </td> 13 13 {% endfor %} 14 14 </tr> … … 21 21 <tr> 22 22 <td> <a href='/WebDash/{{ instance.getName }}/display/'>{{ instance.getName }}</a> </td> 23 <td> <button onClick="window.location='/WebDash/ {{ instance.getName }}/uninstall/'">Uninstall </button></td>23 <td> <button onClick="window.location='/WebDash/uninstall/{{ instance.getName }}/'">Uninstall </button></td> 24 24 </tr> 25 25 {% endfor %} -
ossiedev/trunk/tools/cornetApps/urls.py
r10816 r10817 9 9 # Examples: 10 10 url(r'^WebDash/$', 'WebDash.views.index', name='index'), 11 url(r'^WebDash/(?P<waveform>.*)/install/$', 'WebDash.views.install', name='install'), 12 url(r'^WebDash/(?P<instance>.*)/display/$', 'WebDash.views.display', name='display'), 13 url(r'^WebDash/(?P<instance>.*)/uninstall/$', 'WebDash.views.uninstall', name='uninstall'), 11 url(r'^WebDash/waveforms/$', 'WebDash.views.waveforms'), 12 url(r'^WebDash/(?P<instance>.*)/display/$', 'WebDash.views.display', name='display'), 14 13 url(r'^WebDash/configure/$', 'WebDash.views.configure', name='configure'), 15 url(r'^$', 'HtmlPages.views.main_page'), 14 url(r'^WebDash/running/$', 'WebDash.views.running_page'), 15 url(r'^WebDash/install/(?P<waveform_to_install>.*)/', 'WebDash.views.install'), 16 url(r'^WebDash/uninstall/(?P<instance_to_uninstall>.*)/', 'WebDash.views.uninstall'), 17 url(r'^$', 'HtmlPages.views.main_page'), 16 18 url(r'^ossie/$', 'HtmlPages.views.ossie_view'), 17 19 url(r'^login/$', 'django.contrib.auth.views.login'), … … 23 25 url(r'^map/(\d*)/$', 'HtmlPages.views.map_view'), 24 26 url(r'^grid/$', 'HtmlPages.views.grid_view'), 25 url(r'^waveforms/$', 'HtmlPages.views.waveforms'),26 27 url(r'^register/$', 'HtmlPages.views.register_page'), 27 url(r'^install/(?P<waveform_to_install>.*)/$', 'HtmlPages.views.install'),28 url(r'^uninstall/(?P<instance_to_uninstall>.*)/', 'HtmlPages.views.uninstall'),29 url(r'^running/$', 'HtmlPages.views.running_page'),30 28 31 29 # url(r'^cornetApps/', include('cornetApps.foo.urls')),