aboutsummaryrefslogtreecommitdiffstats
path: root/web/stream.gathering.org/streamstats.html
blob: 5d6adc79489a9e5fc11195d5ec5d27b10197d39a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<html>
  <head>
    <script>
      function construct_url(name, choices) {
        // port
        var url = name + '=';
        if (document.getElementById('split_' + name).checked) {
          url += 'compare:';
        }
        var choices_so_far = 0;
        for (var i = 0; i < choices.length; ++i) {
          var check = document.getElementById(name + '_' + choices[i]);
          if (!check.checked) {
            continue;
          }
          if (choices_so_far++ != 0) {
            url += ',';
          }
          url += choices[i];
        }
        return url;
      }

      function update() {
        var url = 'http://stream.tg13.gathering.org/streamstats-fast.pl?';
        url += construct_url('port', [ 3013, 3014, 3015, 3016, 3017, 3018, 5013, 5015 ]);
        url += '&' + construct_url('proto', [ 'IPv4', 'IPv6' ]);
        url += '&' + construct_url('audience', [ 'internal', 'external' ]);
        
        document.getElementById('graph').src = url;
      }
    </script>
  </head>
  <body>
    <table>
      <tr>
        <th>Ports:</th>
        <td>
          <label><input type="checkbox" id="port_3013" checked="checked" onchange="update();" /> 3013 (Main)</label><br />
          <label><input type="checkbox" id="port_3014" checked="checked" onchange="update();" /> 3014 (Main SD)</label><br />
          <label><input type="checkbox" id="port_3015" checked="checked" onchange="update();" /> 3015 (Webcam)</label><br />
          <label><input type="checkbox" id="port_3016" checked="checked" onchange="update();" /> 3016 (Webcam south)</label><br />
          <label><input type="checkbox" id="port_3017" checked="checked" onchange="update();" /> 3017 (Webcam south transcode)</label><br />
          <label><input type="checkbox" id="port_3018" checked="checked" onchange="update();" /> 3018 (Fisheye)</label><br />
          <label><input type="checkbox" id="port_5013" checked="checked" onchange="update();" /> 5013 (Main LQ/Flash)</label><br />
          <label><input type="checkbox" id="port_5015" checked="checked" onchange="update();" /> 5015 (Webcam LQ/Flash)</label>
        </td>
        <td>
          <label><input type="checkbox" id="split_port" onchange="update();" /> Split</label>
        </td>
      </tr>
      <tr>
        <th>Protocol:</th>
        <td>
          <label><input type="checkbox" id="proto_IPv4" checked="checked" onchange="update();" /> IPv4</label><br />
          <label><input type="checkbox" id="proto_IPv6" checked="checked" onchange="update();" /> IPv6</label><br />
        </td>
        <td>
          <label><input type="checkbox" id="split_proto" onchange="update();" /> Split</label>
        </td>
      </tr>
      <tr>
        <th>Audience:</th>
        <td>
          <label><input type="checkbox" id="audience_internal" checked="checked" onchange="update();" /> Internal</label><br />
          <label><input type="checkbox" id="audience_external" checked="checked" onchange="update();" /> External</label><br />
        </td>
        <td>
          <label><input type="checkbox" id="split_audience" onchange="update();" /> Split</label>
        </td>
      </tr>
      <tr>
        <td colspan="3">
          <input type="button" value="Update display" onclick="update();" />
        </td>
      </tr>
    </table>
    <p><img src="" id="graph" /></p>
    <script>update();</script>
  </body>
</html>