Changeset 6
- Timestamp:
- 09/30/19 15:37:07 (5 years ago)
- Location:
- src/main/webapp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/webapp/newsession.xhtml
r5 r6 46 46 next party</b> <br /> Party: <select id="partyselection"> 47 47 </select> <br /> Profile: <select id="profileselection"> 48 </select> <br /> 48 </select> <br /> Parameters: { <input type="text" id="parameters" 49 onchange="updateParameters()" value="" maxlength="100" /> } <br /> <br /> 49 50 50 51 <button onclick="addParty()">Add</button> … … 55 56 <thead> 56 57 <th align="left" width='40%'>Party</th> 58 <th align="left" width='20%'>Parameters</th> 57 59 <th align="left" width='40%'>Profile</th> 58 60 </thead> … … 75 77 </div> 76 78 <div id="results" style="visibility: hidden"> 77 Session completed. <a href="" id="logref">view the log 78 file</a> <br /><a href="" id="plotref">render a utilities plot</a>.79 Session completed. <a href="" id="logref">view the log file</a> <br /> 80 <a href="" id="plotref">render a utilities plot</a>. 79 81 </div> 80 82 … … 82 84 83 85 <script type="application/javascript"> 86 84 87 85 88 … … 94 97 var domainwebsocket = null; 95 98 var partieswebsocket=null; 99 // current setting of parameters 100 var parameters = {}; 101 96 102 // currently known domains (and profiles) as coming from domainwebsocket. 97 103 // keys are domain names, values are list of profile names 98 104 var knowndomains={}; 105 99 106 100 107 /** … … 231 238 232 239 233 240 /** 241 updates parameters field to match the given text. 242 */ 243 function updateParameters() { 244 var text="{"+document.getElementById("parameters").value+"}"; 245 try { 246 parameters=JSON.parse(text); 247 } catch(e) { 248 alert("Parameters can not be parsed. "+e); 249 return; 250 } 251 } 234 252 235 253 /** … … 269 287 } 270 288 var newpartyprof = {}; 271 newpartyprof["party"]=partycombo.options[partycombo.selectedIndex].value; 289 290 newpartyprof["party"]={"partyref":partycombo.options[partycombo.selectedIndex].value, 291 "parameters":parameters }; 272 292 newpartyprof["profile"]=profilecombo.options[profilecombo.selectedIndex].value; 273 293 … … 284 304 var cell1 = row.insertCell(-1); 285 305 var cell2 = row.insertCell(-1); 286 cell1.innerHTML = partyprofiles[pp]["party"]; 287 cell2.innerHTML = partyprofiles[pp]["profile"]; 306 var cell3 = row.insertCell(-1); 307 cell1.innerHTML = partyprofiles[pp]["party"]["partyref"]; 308 cell2.innerHTML = JSON.stringify(partyprofiles[pp]["party"]["parameters"]); 309 cell3.innerHTML = partyprofiles[pp]["profile"]; 288 310 } 289 311 … … 298 320 {"SAOPSettings": 299 321 {"participants":[ 300 {"party": "http://party1","profile":"ws://profile1"},301 {"party": "http://party2","profile":"ws://profile2"}],322 {"party":{"partyref":"http://party1","parameters":{}},"profile":"ws://profile1"}, 323 {"party":{"partyref",}"http://party2","parameters":{}},"profile":"ws://profile2"}], 302 324 "deadline":{"deadlinetime":{"durationms":100}}}} 303 325 … … 384 406 385 407 408 386 409 </script> 387 410 -
src/main/webapp/newtournament.xhtml
r3 r6 20 20 <br /> 21 21 <br /> 22 <input type="number" id="partiespersession" name="tentacles" min="2" max="10" value="2"/>23 Number of parties in each session24 <br /> 25 26 <input type="checkbox" id="reuseparties" /> Pick27 parties with returnwhen creating sessions22 <input type="number" id="partiespersession" name="tentacles" min="2" 23 max="10" value="2" /> Number of parties in each session 24 <br /> 25 26 <input type="checkbox" id="reuseparties" /> Pick parties with return 27 when creating sessions 28 28 <br /> 29 29 30 30 <br /> 31 31 <div id="box" class="box"> 32 Session Protocol settings 33 <br /> 34 Session Protocol: <select> 32 Session Protocol settings <br /> Session Protocol: <select> 35 33 <option value="SAOP">SAOP</option> 36 </select> 37 <br /> 38 Deadline: <input type="number" id="deadlinevalue" name="deadline" 39 min="1" max="10000" value="10" /> <select id="deadlinetype"> 34 </select> <br /> Deadline: <input type="number" id="deadlinevalue" 35 name="deadline" min="1" max="10000" value="10" /> <select 36 id="deadlinetype"> 40 37 <option value="TIME">seconds</option> 41 38 <option value="ROUNDS">rounds</option> … … 45 42 46 43 <div id="box" class="box"> 47 <br /> 48 Domain/Profile Server: <input type="url" name="url" 44 <br /> Domain/Profile Server: <input type="url" name="url" 49 45 id="profilesserverurl" value="localhost:8080/profilesserver-1.0.0" 50 46 pattern=".*:[0-9]+/profilesserver" size="30" 51 onchange="connectDomain()"> </input> 52 <br /> 53 Domain: <select id="domainselection" onchange="selectDomain()"> 47 onchange="connectDomain()"> </input> <br /> Domain: <select 48 id="domainselection" onchange="selectDomain()"> 54 49 <!-- <option>Waiting for profiles server</option> --> 55 </select> 56 57 <br /> 58 <br /> 50 </select> <br /> <br /> 59 51 <button onclick="addProfile()">Add</button> 60 52 Profile: <select id="profileselection"> 61 53 <!-- <option>Waiting for partiesserver</option> --> 62 </select> 63 <br /> 64 65 <br /> 54 </select> <br /> <br /> 66 55 67 56 <table id="profiles"> … … 79 68 <br /> 80 69 <div id="box" class="box"> 81 <br /> 82 Parties Server: <input type="url" name="url" id="partiesserverurl" 83 value="localhost:8080/partiesserver-1.0.0" 70 <br /> Parties Server: <input type="url" name="url" 71 id="partiesserverurl" value="localhost:8080/partiesserver-1.0.0" 84 72 pattern=".*:[0-9]+/partiesserver" size="30" 85 onchange="connectParties()"> </input> 86 <br /> 87 <br /> 88 <button onclick="addParty()">Add</button> 73 onchange="connectParties()"> </input> <br /> <br /> 89 74 Party: <select id="partyselection"> 90 75 <!-- <option>Waiting for partiesserver</option> --> 91 </select> 92 93 <br /> 76 </select> <br /> Parameters: { <input type="text" id="parameters" 77 onchange="updateParameters()" value="" maxlength="100" /> } <br /> 78 <button onclick="addParty()">Add</button> 79 80 <br /> <br /> 94 81 <table> 95 82 <thead> 96 <th align="left">Selected Parties</th> 83 <th align="left">Party</th> 84 <th align="left">Parameters</th> 97 85 </thead> 98 86 <tbody id="partiesList"> … … 106 94 <br /> 107 95 <form> 108 <input id="startbutton" type="button" value="Start Tournament" onclick="start()" /> 96 <input id="startbutton" type="button" value="Start Tournament" 97 onclick="start()" /> 109 98 </form> 110 <div id="started" style="visibility:hidden"> 111 Your tournament started. Click <a href="" id="logref">here</a> to view the log file. 99 <div id="started" style="visibility: hidden"> 100 Your tournament started. Click <a href="" id="logref">here</a> to view 101 the log file. 112 102 </div> 113 103 … … 115 105 116 106 <script type="application/javascript"> 107 117 108 118 109 … … 147 138 var parties=[]; 148 139 var profiles=[] 140 // current setting of parameters 141 var parameters = {}; 149 142 150 143 … … 245 238 246 239 240 /** 241 updates parameters field to match the given text. 242 */ 243 function updateParameters() { 244 var text="{"+document.getElementById("parameters").value+"}"; 245 try { 246 parameters=JSON.parse(text); 247 } catch(e) { 248 alert("Parameters can not be parsed. "+e); 249 return; 250 } 251 } 247 252 248 253 /** … … 276 281 return; 277 282 } 278 parties.push( partycombo.options[partycombo.selectedIndex].value)283 parties.push({"partyref":partycombo.options[partycombo.selectedIndex].value, "parameters":parameters}) 279 284 updatePartyTable(); 280 285 } … … 287 292 var row = table.insertRow(-1); 288 293 var cell1 = row.insertCell(-1); 289 cell1.innerHTML = parties[party]; 294 var cell2 = row.insertCell(-1); 295 cell1.innerHTML = parties[party]["partyref"]; 296 cell2.innerHTML = JSON.stringify(parties[party]["parameters"]); 290 297 } 291 298 … … 397 404 398 405 406 399 407 </script> 400 408
Note:
See TracChangeset
for help on using the changeset viewer.