skia2/gm/rebaseline_server/static/view.html
epoger@google.com ad0e552fef rebaseline_server: cleanup of HTML/Javascript
No behavioral change at all.
(SkipBuildbotRuns)

R=borenet@google.com

Review URL: https://codereview.chromium.org/31583007

git-svn-id: http://skia.googlecode.com/svn/trunk@11946 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-24 15:38:27 +00:00

251 lines
9.1 KiB
HTML

<!DOCTYPE html>
<html ng-app="Loader" ng-controller="Loader.Controller">
<head>
<title ng-bind="windowTitle"></title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
<script src="loader.js"></script>
<link rel="stylesheet" href="view.css">
</head>
<body>
<em>
{{loadingMessage}}
</em>
<div ng-hide="!categories"><!-- everything: hide until data is loaded -->
<div class="warning-div"
ng-hide="!(header.isEditable && header.isExported)">
WARNING! These results are editable and exported, so any user
who can connect to this server over the network can modify them.
</div>
<div class="todo-div"><!-- TODOs -->
<p>
TODO(epoger):
<input type="checkbox" name="showTodosCheckbox" value="true"
ng-checked="showTodos == true"
ng-click="showTodos = !showTodos">
show
<ul ng-hide="!showTodos">
<li>
If server was run with --reload flag, automatically check for
new results and tell the user when new results are available
(the user can reload the page if he wants to see them).
</li><li>
Add ability to filter builder and test names
(using a free-form text field, with partial string match)
</li><li>
Add more columns, such as pixel diffs, notes/bugs,
ignoreFailure boolean
</li><li>
Improve the column sorting, as per
<a href="http://jsfiddle.net/vojtajina/js64b/14/">
http://jsfiddle.net/vojtajina/js64b/14/
</a>
</li><li>
Right now, if you change which column is used to
sort the data, the column widths may fluctuate based on the
longest string <i>currently visible</i> within the top {{displayLimit}}
results. Can we fix the column widths to be wide enough to hold
any result, even the currently hidden results?
</li>
</ul>
</div><!-- TODOs -->
<div ng-hide="!(header.timeUpdated)">
Results current as of {{localTimeString(header.timeUpdated)}}
</div>
<div><!-- tabs -->
<div class="tab-spacer" ng-repeat="tab in tabs">
<div class="tab-{{tab == viewingTab}}"
ng-click="setViewingTab(tab)">
&nbsp;{{tab}} ({{numResultsPerTab[tab]}})&nbsp;
</div>
<div class="tab-spacer">
&nbsp;
</div>
</div>
</div><!-- tabs -->
<div class="tab-main"><!-- main display area of selected tab -->
<br>
<!-- We only show the filters/settings table on the Unfiled tab. -->
<table ng-hide="viewingTab != defaultTab" border="1">
<tr>
<th colspan="2">
Filters
</th>
<th>
Settings
</th>
</tr>
<tr valign="top">
<td>
resultType<br>
<label ng-repeat="(resultType, count) in categories['resultType']">
<input type="checkbox"
name="resultTypes"
value="{{resultType}}"
ng-checked="!isValueInSet(resultType, hiddenResultTypes)"
ng-click="toggleValueInSet(resultType, hiddenResultTypes); setUpdatesPending(true)">
{{resultType}} ({{count}})<br>
</label>
</td>
<td>
config<br>
<label ng-repeat="(config, count) in categories['config']">
<input type="checkbox"
name="configs"
value="{{config}}"
ng-checked="!isValueInSet(config, hiddenConfigs)"
ng-click="toggleValueInSet(config, hiddenConfigs); setUpdatesPending(true)">
{{config}} ({{count}})<br>
</label>
</td>
<td><table>
<tr><td>
Image size
<input type="text" ng-model="imageSizePending"
ng-init="imageSizePending=100"
ng-change="areUpdatesPending = true"
maxlength="4"/>
</td></tr>
<tr><td>
Max records to display
<input type="text" ng-model="displayLimitPending"
ng-init="displayLimitPending=50"
ng-change="areUpdatesPending = true"
maxlength="4"/>
</td></tr>
<tr><td>
<button class="update-results-button"
ng-click="updateResults()"
ng-disabled="!areUpdatesPending">
Update Results
</button>
</td></tr>
</tr></table></td>
</tr>
</table>
<p>
<!-- Submission UI that we only show in the Pending Approval tab. -->
<div ng-hide="'Pending Approval' != viewingTab">
<div style="display:inline-block">
<button style="font-size:20px"
ng-click="submitApprovals(filteredTestData)"
ng-disabled="submitPending || (filteredTestData.length == 0)">
Update these {{filteredTestData.length}} expectations on the server
</button>
</div>
<div style="display:inline-block">
<div style="font-size:20px"
ng-hide="!submitPending">
Submitting, please wait...
</div>
</div>
</div>
<p>
<div>
<div style="float:left">
Found {{filteredTestData.length}} matches;
<span ng-hide="filteredTestData.length <= limitedTestData.length">
displaying the first {{limitedTestData.length}}
</span>
<span ng-hide="filteredTestData.length > limitedTestData.length">
displaying them all
</span>
<br>
(click on the column header radio buttons to re-sort by that column)
</div>
<div style="float:right">
<div ng-repeat="otherTab in tabs">
<button ng-click="moveSelectedItemsToTab(otherTab)"
ng-disabled="selectedItems.length == 0"
ng-hide="otherTab == viewingTab">
{{selectedItems.length}} move selected tests to {{otherTab}} tab
</button>
</div>
</div>
<div style="clear:both">
</div>
</div>
<br>
<table border="1">
<tr>
<!-- Most column headers are displayed in a common fashion... -->
<th ng-repeat="categoryName in ['resultType', 'builder', 'test', 'config']">
<input type="radio"
name="sortColumnRadio"
value="{{categoryName}}"
ng-checked="(sortColumn == categoryName)"
ng-click="sortResultsBy(categoryName)">
{{categoryName}}
</th>
<!-- ... but there are a few columns where we display things differently. -->
<th>
<input type="radio"
name="sortColumnRadio"
value="expectedHashDigest"
ng-checked="(sortColumn == 'expectedHashDigest')"
ng-click="sortResultsBy('expectedHashDigest')">
expected image
</th>
<th>
<input type="radio"
name="sortColumnRadio"
value="actualHashDigest"
ng-checked="(sortColumn == 'actualHashDigest')"
ng-click="sortResultsBy('actualHashDigest')">
actual image
</th>
<th>
<!-- item-selection checkbox column -->
</th>
</tr>
<tr ng-repeat="result in limitedTestData">
<td>{{result.resultType}}</td>
<td>{{result.builder}}</td>
<td>{{result.test}}</td>
<td>{{result.config}}</td>
<td>
<a target="_blank" href="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.expectedHashType}}/{{result.test}}/{{result.expectedHashDigest}}.png">
<img width="{{imageSize}}" src="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.expectedHashType}}/{{result.test}}/{{result.expectedHashDigest}}.png"/>
</a>
</td>
<td>
<a target="_blank" href="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.actualHashType}}/{{result.test}}/{{result.actualHashDigest}}.png">
<img width="{{imageSize}}" src="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.actualHashType}}/{{result.test}}/{{result.actualHashDigest}}.png"/>
</a>
</td>
<td>
<input type="checkbox"
name="rowSelect"
value="{{result.index}}"
ng-checked="isValueInArray(result.index, selectedItems)"
ng-click="toggleValueInArray(result.index, selectedItems)">
</tr>
</table>
</div><!-- main display area of selected tab -->
</div><!-- everything: hide until data is loaded -->
<!-- TODO(epoger): Can we get the base URLs (commondatastorage and
issues list) from
http://skia.googlecode.com/svn/buildbot/site_config/global_variables.json
? I tried importing the
http://skia.googlecode.com/svn/buildbot/skia_tools.js script and using
that to do so, but I got Access-Control-Allow-Origin errors.
-->
</body>
</html>