Nobuaki Sukegawa | bd16530 | 2016-01-19 11:10:07 +0900 | [diff] [blame] | 1 | /* |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 2 | Licensed to the Apache Software Foundation (ASF) under one |
| 3 | or more contributor license agreements. See the NOTICE file |
| 4 | distributed with this work for additional information |
| 5 | regarding copyright ownership. The ASF licenses this file |
| 6 | to you under the Apache License, Version 2.0 (the |
| 7 | "License"); you may not use this file except in compliance |
| 8 | with the License. You may obtain a copy of the License at |
| 9 | |
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | |
| 12 | Unless required by applicable law or agreed to in writing, |
| 13 | software distributed under the License is distributed on an |
| 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | KIND, either express or implied. See the License for the |
| 16 | specific language governing permissions and limitations |
| 17 | under the License. |
| 18 | |
Nobuaki Sukegawa | bd16530 | 2016-01-19 11:10:07 +0900 | [diff] [blame] | 19 | */ |
| 20 | |
Cameron Martin | caef0ed | 2025-01-15 11:58:39 +0100 | [diff] [blame^] | 21 | $.getJSON("results.json", function (results) { |
| 22 | $(document).ready(function () { |
| 23 | var transport = 3; |
| 24 | var socket = 4; |
| 25 | var success = 5; |
| 26 | var expected = 6; |
| 27 | var returnCode = 7; |
| 28 | var logFile = 8; |
| 29 | testTable = $("#test_results").DataTable({ |
| 30 | data: results["results"], |
| 31 | columnDefs: [ |
| 32 | { |
| 33 | targets: 3, |
| 34 | render: function (data, type, row) { |
| 35 | return row[transport] + "-" + row[socket]; |
| 36 | }, |
| 37 | }, |
| 38 | { |
| 39 | targets: 4, |
| 40 | render: function (data, type, row) { |
| 41 | return ( |
| 42 | (row[success] ? "success" : "failure") + |
| 43 | "(" + |
| 44 | (row[returnCode] == 128 ? "timeout" : row[returnCode]) + |
| 45 | ")" + |
| 46 | '(<a href="' + |
| 47 | row[logFile].server + |
| 48 | '">Server</a>, ' + |
| 49 | '<a href="' + |
| 50 | row[logFile].client + |
| 51 | '">Client</a>)' |
| 52 | ); |
| 53 | }, |
| 54 | }, |
| 55 | { |
| 56 | targets: 5, |
| 57 | render: function (data, type, row) { |
| 58 | // 'yes' rather than 'expected' to ease search |
| 59 | return row[expected] ? "yes" : "unexpected"; |
| 60 | }, |
| 61 | }, |
| 62 | ], |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 63 | }); |
Cameron Martin | caef0ed | 2025-01-15 11:58:39 +0100 | [diff] [blame^] | 64 | $("#test_results_filter label input").focus().val("unexpected failure"); |
| 65 | $("#test_info").text( |
| 66 | "Test Date: " + |
| 67 | results["date"] + |
| 68 | "\n" + |
| 69 | "Revision: " + |
| 70 | results["revision"] + |
| 71 | "\n" + |
| 72 | "Platform: " + |
| 73 | results["platform"] + |
| 74 | "\n" + |
| 75 | "Test duration: " + |
| 76 | results["duration"], |
| 77 | ) + " seconds"; |
| 78 | }); |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 79 | }); |