File: sections_index.html

package info (click to toggle)
appstream-generator 0.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,864 kB
  • sloc: cpp: 13,398; xml: 259; sh: 235; python: 103; makefile: 19
file content (129 lines) | stat: -rw-r--r-- 3,655 bytes parent folder | download
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{% extends "base.html" %}

{% block title %}Data for the {{suite}} suite{% endblock %}

{% block header_content %}
<span style="font-size:18px;"><a href="../" style="color: #000000;">⇦ |</a></span>
<span>AppStream data for {{project_name}}/{{suite}}</span>
{% endblock %}

{% block head_extra %}
<script language="javascript" type="text/javascript" src="{{root_url}}/static/js/jquery/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="{{root_url}}/static/js/flot/jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="{{root_url}}/static/js/flot/jquery.flot.pie.js"></script>
<script language="javascript" type="text/javascript" src="{{root_url}}/static/js/flot/jquery.flot.resize.js"></script>

<style>
.graph-container {
    position: relative;
    height: 380px;
}

.graph-placeholder {
    height: 90%;
    font-size: 14px;
    margin-top: -20px;
}
</style>
{% endblock %}

{% block float_right %}
<small>Last updated on: {{time}}</small>
{% endblock %}

{% block content %}
<h1>Select an archive section</h1>

<h2>Sections</h2>
{% for section in sections %}
  <h3><a href="{{section.section}}/index.html">{{section.section}}</a></h3>
{% endfor %}

<h2>Health of suite "{{suite}}"</h2>

<div class="wrapper">
  <div class="graph-container">
      {% for section in sections %}
      <div align="center" class="float-left" style="height: 100%; float: left; width: 25%;">
        <center><strong>{{section.section}}</strong></center>
        <div id="placeholder_{{section.section}}" class="graph-placeholder" style="float:left; width:100%;"></div>
      </div>
      {% endfor %}
  </div>
</div>

<script>
  $.getJSON("{{root_url}}/statistics.json", function(data) {
    var sections = [];
    {% for section in sections %}
      sections.push("{{section.section}}");
    {% endfor %}

    for (var i = 0; i < sections.length; i++) {
      var sdata = data["{{suite}}"];
      var sectionName = sections[i];
      var secData = sdata[sectionName];

      var resData = [
          {
            label: "Errors",
            data: [ 1, secData["errors"][secData["errors"].length-1][1] ],
            color: "#c05020"
          },
          {
            label: "Warnings",
            data: [ 1, secData["warnings"][secData["warnings"].length-1][1] ],
            color: "#ffcc66"
          },
          {
            label: "Infos",
            data: [ 1, secData["infos"][secData["infos"].length-1][1] ],
            color: "#6060c0"
          },
          {
            label: "Valid Data",
            data: [ 1, secData["metadata"][secData["metadata"].length-1][1] ],
            color: "#30a420"
          }
      ];

      drawSummaryChart(resData, sectionName);
    }
  });
</script>
<script>
  function labelFormatter(label, series) {
      return "<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>" + Math.round(series.percent) + "%</div>";
  }

  function drawSummaryChart(data, section) {
    $.plot('#placeholder_' + section, data, {
        series: {
            pie: {
                innerRadius: 0.34,
                show: true,

                label: {
                    show: true,
                    radius: 3/5,
                    formatter: labelFormatter,
                    background: {
                        opacity: 0.6,
                        color: '#000'
                    }
                }
            }
        },

        grid: {
            hoverable: true,
            clickable: true,
            margin: 0,
            borderWidth: 0
        },

        legend: { show: false }
    });
  }
</script>
{% endblock %}