Changeset 8 for src/main/webapp/newtournament.xhtml
- Timestamp:
- 01/28/20 10:20:01 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/webapp/newtournament.xhtml
r7 r8 30 30 <br /> 31 31 <div id="box" class="box"> 32 Session Protocol settings <br /> Session Protocol: <select> 32 Session Protocol settings <br /> Session Protocol: 33 <select id="protocolselection"> 33 34 <option value="SAOP">SAOP</option> 34 </select> <br /> Deadline: <input type="number" id="deadlinevalue" 35 <option value="SHAOP">SHAOP</option> 36 </select> 37 38 <br /> Deadline: <input type="number" id="deadlinevalue" 35 39 name="deadline" min="1" max="10000" value="10" /> <select 36 40 id="deadlinetype"> 41 <option value="ROUNDS">rounds</option> 37 42 <option value="TIME">seconds</option> 38 <option value="ROUNDS">rounds</option>39 43 </select> 40 44 </div> … … 52 56 Profile: <select id="profileselection"> 53 57 <!-- <option>Waiting for partiesserver</option> --> 54 </select> <br /> <br /> 58 </select> 59 Filter: <input type="text" id="filter" value="" maxlength="40" /> 60 61 <br /> <br /> 55 62 56 63 <table id="profiles"> … … 304 311 function addProfile() { 305 312 var profilecombo = document.getElementById("profileselection"); 306 313 307 314 if (profilecombo.options.length==0) { 308 315 alert("Please set domain/profile server and select a domain and a profile"); 309 316 return; 310 317 } 311 profiles.push(profilecombo.options[profilecombo.selectedIndex].value) 318 var filteroptions = document.getElementById("filter").value; 319 if (filteroptions!="") { 320 filteroptions="?"+filteroptions; 321 } 322 323 profiles.push(profilecombo.options[profilecombo.selectedIndex].value + filteroptions) 312 324 updateProfileTable(); // what, MVC? 313 325 } … … 327 339 /** 328 340 start the tournament as currently set on this page. 329 We need to send a TournamentSettings object to the server, which typically looks like this 330 but is protocol dependent (currently we do SAOP) 331 341 We need to send a TournamentSettings object to the server, which typically looks like this with SAOP 342 <code> 332 343 {"AllPermutationsSettings":{"parties":["party1","party2"], 333 344 "profiles":["profile1","profile2","profile3"], … … 335 346 "partiesPerSession":2, 336 347 "sessionsettings":{"SAOPSettings":{"participants":[],"deadline":{"deadlinetime":{"durationms":10}}}}}} 337 348 </code> 338 349 participants are already in the global partyprofiles dictionary 350 351 With SHAOP, it looks like this 352 <code> 353 { 354 "AllPermutationsSettings": { 355 "parties": [ { "partyref": "classpath:geniusweb.exampleparties.simpleshaop.ShaopParty", "parameters": { } }, 356 { "partyref": "classpath:geniusweb.exampleparties.randomparty.RandomParty", "parameters": { }} 357 ], 358 "reuseParties": false, 359 "profiles": [ "prof1?partial=10", "prof2?partial=15"], 360 "partiesPerSession": 2, 361 "sessionsettings": { "SHAOPSettings": { 362 "participants": [ ], 363 "deadline": { "deadlinerounds": { "rounds": 10, "durationms": 10000 } } } } } } 364 </code> 339 365 */ 340 366 function start() { … … 380 406 deadline["deadlinerounds"] = {"rounds": value, "durationms": 10000}; 381 407 } 382 383 408 var reuseParties = document.getElementById("reuseparties").checked; 384 var sessionSettings = {"SAOPSettings":{"participants":[],"deadline":deadline}}; 409 410 var protocolcombobox = document.getElementById("protocolselection"); 411 var protocol = protocolcombobox.options[protocolcombobox.selectedIndex].value; 412 var header=protocol+"Settings"; 413 414 // create S(H)AOPSettings. [header] is a weird ECMA script workaround for javascript issue. 415 var sessionSettings = { [header]:{"participants":[],"deadline":deadline}}; 385 416 return JSON.stringify({"AllPermutationsSettings":{"parties":parties,"profiles":profiles,"reuseParties":reuseParties,"partiesPerSession":2,"sessionsettings":sessionSettings}}); 386 417 } … … 390 421 */ 391 422 function init() { 392 document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.1.0" 393 document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.1.0" 423 document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.1.0"; 424 document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.1.0"; 394 425 395 426
Note:
See TracChangeset
for help on using the changeset viewer.