Changeset 6 for src/main/webapp/newtournament.xhtml
- Timestamp:
- 09/30/19 15:37:07 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.