Changeset 11093
- Timestamp:
- 04/05/12 01:00:48 (14 months ago)
- Location:
- ossiedev/branches/jsnyder/trunk/tools/cornetApps
- Files:
-
- 1 added
- 11 modified
-
DomainMan/views.py (modified) (4 diffs)
-
HtmlPages/static/frames.js (modified) (3 diffs)
-
README (modified) (2 diffs)
-
cornetApps.db (modified) (previous)
-
static/frames.js (modified) (2 diffs)
-
templates/DomainMan/connect.html (modified) (1 diff)
-
templates/DomainMan/nodes.html (modified) (1 diff)
-
templates/DomainMan/runningNodebooter.html (modified) (1 diff)
-
templates/HtmlPages/grid2.html (added)
-
templates/HtmlPages/ossie.html (modified) (2 diffs)
-
templates/HtmlPages/running.html (modified) (1 diff)
-
urls.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/jsnyder/trunk/tools/cornetApps/DomainMan/views.py
r11092 r11093 58 58 @param password: The user's password 59 59 ''' 60 def startNodebooter(request, ip, port, user, password): 60 def startNodebooter(request, floor, num, user, password): 61 floor = int(floor) 62 num = int(num) 63 node = Node(floor, num) 64 ip = node.ip 65 port = node.port 61 66 client = connect(ip, port, user, password) 62 67 #stdin, stdout, stderr = client.exec_command('cd /sdr; nodeBooter -D -d dev/nodes/default_GPP_node/DeviceManager.dcd.xml') … … 82 87 @param password: The user's password 83 88 ''' 84 def stopNodebooter(request, ip, port, user, password): 89 def stopNodebooter(request, floor, num, user, password): 90 floor = int(floor) 91 num = int(num) 92 node = Node(floor, num) 93 ip = node.ip 94 port = node.port 85 95 client = connect(ip, port, user, password) 86 96 stdin, stdout, stderr = client.exec_command('killall nodeBooter && killall GPP') … … 106 116 return render_to_response('DomainMan/console.html', locals(), context_instance=RequestContext(request)) 107 117 108 """Connect to a nodebooter through a form 118 """ 119 Connect to a node through a form 109 120 """ 110 121 def connect_to_node(request): 111 122 if 'floor' in request.POST and 'number' in request.POST and 'user' in request.POST and 'pass' in request.POST: 112 postFloor = int(request.POST['floor'])113 postNum = int(request.POST['number'])123 floor = int(request.POST['floor']) 124 num = int(request.POST['number']) 114 125 user = str(request.POST['user']) 115 126 password = str(request.POST['pass']) 116 127 117 thisNode = Node(postFloor, postNum) 118 ip = thisNode.ip 119 port = thisNode.port 120 #thisNode.save() 121 #thisNode.setClient(user, password) 122 #node = Node.objects.get(floor=4, num=1) 128 node = Node(floor, num) 129 ip = node.ip 130 port = node.port 123 131 client = connect(ip, port, user, password) 124 #stdin, stdout, stderr = client.exec_command('ls')125 print 'calling runningNodebooter'126 132 runningNodebooter = nodeBooter_running(client) 127 133 else: … … 130 136 return render_to_response('DomainMan/runningNodebooter.html', locals(), context_instance=RequestContext(request)) 131 137 138 """ 139 Raise exception if the inputs of the floor and node number are invalid 140 """ 141 def testValidInputs(floor, num): 142 if floor < 1 or floor > 4: 143 raise Exception("Floor must be between 1 and 4") 144 if num < 1 or num > 12: 145 raise Exception("Node must be between 1 and 12") 146 132 147 #@login_required 133 148 def loadNode(request, floor_num, node_num): 134 149 floor = int(floor_num) 135 150 num = int(node_num) 136 if floor < 1 or floor > 4: 137 raise Exception("Floor must be between 1 and 4") 138 if num < 1 or num > 12: 139 raise Exception("Node must be between 1 and 12") 151 testValidInputs(floor, num) 140 152 node = Node(floor, num) 141 153 ip = node.ip 142 154 port = node.port 143 index2(request, ip) 155 address = str(ip)+":"+str(port) 156 index2(request, address) 144 157 return render_to_response("DomainMan/nodes.html", locals(), context_instance=RequestContext(request)) 145 158 146 """Returns connection form147 159 """ 148 def connect_to_node_view(request): 160 Returns connection form 161 """ 162 def connect_to_node_view(request, selectFloor, selectNum): 149 163 number_of_floors = range(1,5) 150 164 number_of_nodes = range(1,13) 165 selectedFloor=int(selectFloor) 166 selectedNum=int(selectNum) 167 testValidInputs(selectedFloor, selectedNum) 151 168 return render_to_response('DomainMan/connect.html', locals(), RequestContext(request)) 152 169 -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/HtmlPages/static/frames.js
r11092 r11093 11 11 12 12 $("#left_bottom").ready(function(){ 13 $("#apps").load("/~webdemo/django/WebDash/running/");13 loadHrefToDiv("#apps","/~webdemo/django/WebDash/running/"); 14 14 $("a.ajax").click(function(){ 15 $("#apps").load("/~webdemo/django/WebDash/running/");15 loadHrefToDiv("#apps","/~webdemo/django/WebDash/running/"); 16 16 }); 17 17 $('#apps a').click(function(e){ … … 53 53 }); 54 54 55 $("#console").ready(function(){ 56 loadHrefToDiv("#console",$("#currentView").attr("value")); 57 }); 58 55 59 function install(waveform){ 56 $("#apps").load("/~webdem o/django/WebDash/install/"+waveform+"/", function(){60 $("#apps").load("/~webdem/django/WebDash/install/"+waveform+"/", function(){ 57 61 $("a").click($(this).attr("onclick")); 58 62 }); … … 78 82 } 79 83 80 function reloadNode(link){81 $("#workspace").load(link);82 }83 84 84 function display(instance){ 85 85 $("#workspace").load("/~webdemo/django/WebDash/"+instance+"/display/"); 86 86 //$("#workspace").load("/WebDash/"+instance+"/display/"); 87 } 88 89 function openWindow(href){ 90 window.open(href, href, "status=1,height=300,width=400"); 87 91 } 88 92 -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/README
r11092 r11093 1 TODO: installation and setup and howto develop instructions for someone whos never used it 1 TODO: installation and setup and howto develop instructions for someone whos never used itinstallation paragraph for local server 2 2 explain ./manage 3 3 define what functionality is in which files … … 5 5 add refresh status of nodes 6 6 remove passwords from url -> put in SESSION variable 7 add ip and which node is running8 7 choose which node to start domain manager on 9 8 pick the nodeBooter from dev/nodes/ 10 installation paragraph for local server 9 load connect to node in console view 11 10 ############# 12 11 Django setup -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/static/frames.js
r11092 r11093 74 74 } 75 75 76 function loadHrefToDiv(div ){77 $(div).load( $(this).attr("href"));76 function loadHrefToDiv(div,href){ 77 $(div).load(href); 78 78 } 79 79 … … 87 87 } 88 88 89 function openWindow(href){ 90 window.open(href, "status=1,height=300,width=400"); 91 } 92 89 93 /** 90 94 -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/templates/DomainMan/connect.html
r11091 r11093 2 2 <body> 3 3 <form action="{{MEDIA_URL}}/connect_to_node/" method="post">{% csrf_token %} 4 <p> Floor:4 <p>floor: 5 5 <select name = "floor"> 6 6 {% for floor in number_of_floors %} 7 <option value="{{floor}}">Floor {{floor}}</option> 7 {% ifequal floor selectedFloor %} 8 <option selected value="{{floor}}">Floor {{floor}}</option> 9 {% else %} 10 <option value="{{floor}}">Floor {{floor}}</option> 11 {% endifequal %} 8 12 {% endfor %} 9 13 </select> 10 14 </p> 11 <p> Number:15 <p>number: 12 16 <select name="number"> 13 17 {% for node in number_of_nodes %} 14 <option value="{{node}}">Node {{node}}</option> 18 {% ifequal node selectedNum %} 19 <option selected value="{{node}}">Node {{node}}</option> 20 {% else %} 21 <option value="{{node}}">Node {{node}}</option> 22 {% endifequal %} 15 23 {% endfor %} 16 24 </select> -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/templates/DomainMan/nodes.html
r11092 r11093 1 <p>Node: {{node}} IP: {{ip}} Port: {{port}}</p> 1 <p>{{node}}<p> <p>IP: {{ip}} Port: {{port}}</p> 2 <a href='javascript:openWindow("{{MEDIA_URL}}/connect/{{floor}}/{{num}}");'>Check Nodebooter</a> -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/templates/DomainMan/runningNodebooter.html
r11087 r11093 1 <p>{{node}}</p> 2 <p>IP address: {{ip}}</p> 3 <p>Port: {{port}}</p> 4 1 5 <p>The naming service is: 2 6 {% if runningNodebooter %} 3 <span style="color: green;">running</span> 4 < a href='{{MEDIA_URL}}/stopNodeBooter/{{ip}}/{{port}}/{{user}}/{{password}}'>Stop Nodebooter</a>7 <span style="color: green;">running</span></p> 8 <p><a href='{{MEDIA_URL}}/stopNodeBooter/{{floor}}/{{num}}/{{user}}/{{password}}'>Stop Nodebooter</a></p> 5 9 {% endif %} 6 10 {% if not runningNodebooter %} 7 <span style="color: red;">not running</span> 8 < a href='{{MEDIA_URL}}/startNodeBooter/{{ip}}/{{port}}/{{user}}/{{password}}'>Start Nodebooter</a>11 <span style="color: red;">not running</span></p> 12 <p><a href='{{MEDIA_URL}}/startNodeBooter/{{floor}}/{{num}}/{{user}}/{{password}}'>Start Nodebooter</a></p> 9 13 {% endif %} 10 </p> -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/templates/HtmlPages/ossie.html
r11092 r11093 9 9 <div id="column_left"> 10 10 <div id="left_top"> 11 <p> 12 <a href="{{MEDIA_URL}}"><img src="{{STATIC_URL}}pics/home.png" title="Home"/></a> 13 <a href="{{MEDIA_URL}}/logout/"><img src="{{STATIC_URL}}pics/logout.png" title="Logout"/></a> 14 </p> 15 <div id="directory"> </div>{#end menu div#} 11 <a href="{{MEDIA_URL}}"><img src="{{STATIC_URL}}pics/home.png" title="Home"/></a> 12 <a href="{{MEDIA_URL}}/logout/"><img src="{{STATIC_URL}}pics/logout.png" title="Logout"/></a> 13 14 15 16 Select view: <select name="view_type" onchange='javascript:loadHrefToDiv("#console",this.value);'> 17 <option id="currentView" value="{{MEDIA_URL}}/grid/">Grid View</option> 18 <option value="{{MEDIA_URL}}/map/1/">Floor 1 View</option> 19 <option value="{{MEDIA_URL}}/map/2/">Floor 2 View</option> 20 <option value="{{MEDIA_URL}}/map/3/">Floor 3 View</option> 21 <option value="{{MEDIA_URL}}/map/4/">Floor 4 View</option> 22 </select> 23 <div id="console"> 24 </div> 25 {#end menu div#} 16 26 </div><!--end #left_top--> 17 27 <div id="left_bottom"> … … 22 32 <div id="column_right"> 23 33 <div id="right_top"> 24 <ul class="tabs"> 25 <li class="current"><a href="../grid/">Grid View</a></li> 26 <li><a href="{{MEDIA_URL}}/map/1/">Floor 1</a></li> 27 <li><a href="{{MEDIA_URL}}/map/2/">Floor 2</a></li> 28 <li><a href="{{MEDIA_URL}}/map/3/">Floor 3</a></li> 29 <li><a href="{{MEDIA_URL}}/map/4/">Floor 4</a></li> 30 <li id="task manager"><a href="../tasks/">Task Manager</a></li> 31 </ul> 32 <br/> 33 <p><img id="loader" src="{{STATIC_URL}}loading.gif" style="position:absolute;"/></p> 34 <div id="console"></div> 35 </div><!--end #right_top--> 34 <div id="directory"> </div> 35 </div><!--end #right_top--> 36 36 <div id="right_bottom"> 37 37 <div id="workspace" class="tabs-container">Work space </div> -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/templates/HtmlPages/running.html
r10817 r11093 6 6 <td> <a href='/WebDash/{{ instance.getName }}/display/'>{{ instance.getName }}</a> </td> 7 7 <!--<td> <button onClick="window.location='/WebDash/{{ instance.getName }}/uninstall/'">Uninstall </button></td>--> 8 <td><button onClick="javascript:uninstall('{{ instance.getName }}');">Uninstall</button></td> 8 <td><button onClick= 9 'javascript:loadHrefToDiv("#apps","{{MEDIA_URL}}/WebDash/uninstall/{{ instance.getName }}/"); 10 loadHrefToDiv("#apps","{{MEDIA_URL}}/WebDash/running/");'> 11 Uninstall</button></td> 9 12 </tr> 10 13 {% endfor %} -
ossiedev/branches/jsnyder/trunk/tools/cornetApps/urls.py
r11092 r11093 37 37 url(r'^domain_login/$', 'DomainMan.views.cornet_login'), 38 38 url(r'^checkNodeBooter/(?P<ip>.*)/(?P<port>\d+)/(?P<user>.*)/(?P<password>.*)/$', 'DomainMan.views.nodeBooter_page'), 39 url(r'^startNodeBooter/(?P< ip>.*)/(?P<port>\d+)/(?P<user>.*)/(?P<password>.*)/$', 'DomainMan.views.startNodebooter'),40 url(r'^stopNodeBooter/(?P< ip>.*)/(?P<port>\d+)/(?P<user>.*)/(?P<password>.*)/$', 'DomainMan.views.stopNodebooter'),41 url(r'^connect/ $', 'DomainMan.views.connect_to_node_view'),39 url(r'^startNodeBooter/(?P<floor>\d{1})/(?P<num>\d+)/(?P<user>.*)/(?P<password>.*)/$', 'DomainMan.views.startNodebooter'), 40 url(r'^stopNodeBooter/(?P<floor>\d{1})/(?P<num>\d+)/(?P<user>.*)/(?P<password>.*)/$', 'DomainMan.views.stopNodebooter'), 41 url(r'^connect/(\d{1})/(\d+)/$', 'DomainMan.views.connect_to_node_view'), 42 42 url(r'^connect_to_node/$', 'DomainMan.views.connect_to_node'), 43 43 url(r'^xhr_test/$', 'DomainMan.views.xhr_test'),