Changeset 17 for src/main/webapp/plotlog.xhtml
- Timestamp:
- 09/22/20 08:52:49 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/webapp/plotlog.xhtml
r16 r17 4 4 <title>Plot log results</title> 5 5 <script src="Chart.min_2.8.0.js"></script> 6 <script src="utils.js"></script> 6 7 </head> 7 8 <style> … … 23 24 <div id="progress">Waiting for log file name</div> 24 25 <br /> 25 <div>Notice, the plotted utilities do not include possible elicitation costs.</div> 26 <div>Notice, the plotted utilities do not include possible 27 elicitation costs.</div> 26 28 <div style="width: 100%;"> 27 29 <canvas id="canvas"></canvas> 28 30 </div> 29 30 Agreement: <div id="agreement" style="display:inline;">?</div> 31 32 Agreement: 33 <div id="agreement" style="display: inline;">?</div> 31 34 </body> 32 35 … … 39 42 40 43 44 45 41 46 42 47 … … 52 57 53 58 function connect() { 54 55 var id=document.location.search; 56 id = location.search.split('id=')[1] 57 if (id==undefined) return; 59 var query = new URLSearchParams(location.search); 60 var id=query.get('id'); 61 if (id==undefined) { 62 alert("missing ?id=<logfile> in URL"); 63 return; 64 } 58 65 59 66 // load the log file with given id … … 96 103 var profs=json['partyprofiles']; 97 104 for (var party in profs) { 98 partyprofiles[party]= profs[party]['profile'].split('?',1)[0]; // hacky, remove complete query.105 partyprofiles[party]=withoutPartial(profs[party]['profile']); 99 106 } 100 107 101 108 getProfiles(json, partyprofiles); 102 109 } 110 103 111 104 112 /** … … 112 120 if ( (nr & 1 != 0)) continue; // skip COB parties 113 121 var shaop=teams[nr/2]['shaop']; 114 var profile = shaop['profile'].split('?',1)[0]; // hacky, remove complete query.122 var profile = withoutPartial(shaop['profile']); // hacky, remove complete query. 115 123 partyprofiles[partyid]=profile; 116 124 } … … 120 128 } 121 129 130 131 /** 132 @param uristr a string with an uri that may have ?partial=XX 133 @return the given uristr without the "partia=XXl" value 134 */ 135 function withoutPartial(uristr) { 136 var profuri=new URL(uristr); 137 var searchParams = new URLSearchParams(profuri.search); 138 searchParams.delete("partial"); 139 profuri.search = searchParams.toString(); 140 return profuri.toString(); 141 142 } 122 143 123 144 /** … … 371 392 372 393 394 395 373 396 </script> 374 397 … … 376 399 377 400 <script type="application/javascript"> 401 402 378 403 379 404 … … 407 432 408 433 434 435 409 436 </script> 410 437
Note:
See TracChangeset
for help on using the changeset viewer.