Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit c601fc9

Browse files
committed
Add ratio & alt attribute to stats images
1 parent 6e35ace commit c601fc9

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

config.js

+18-6
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,52 @@ module.exports = function () {
66
'name': 'Clientstatistik',
77
'href': 'https://regensburg.freifunk.net/netz/statistik/node/{NODE_ID}/',
88
'image': 'https://grafana.regensburg.freifunk.net/render/d-solo/000000026/node?panelId=1&var-node={NODE_ID}&from=now-1d&width=650&height=350&theme=light&_t={TIME}',
9-
'title': 'Clientstatistik für {NODE_ID} - weiteren Statistiken'
9+
'title': 'Clientstatistik für {NODE_ID} - weiteren Statistiken',
10+
'width': 650,
11+
'height': 350
1012
},
1113
{
1214
'name': 'Trafficstatistik',
1315
'href': 'https://regensburg.freifunk.net/netz/statistik/node/{NODE_ID}/',
1416
'image': 'https://grafana.regensburg.freifunk.net/render/d-solo/000000026/node?panelId=2&from=now-1d&var-node={NODE_ID}&width=650&height=350&theme=light&_t={TIME}',
15-
'title': 'Trafficstatistik für {NODE_ID} - weiteren Statistiken'
17+
'title': 'Trafficstatistik für {NODE_ID} - weiteren Statistiken',
18+
'width': 650,
19+
'height': 350
1620
},
1721
{
1822
'name': 'Systemlast',
1923
'href': 'https://regensburg.freifunk.net/netz/statistik/node/{NODE_ID}/',
2024
'image': 'https://grafana.regensburg.freifunk.net/render/d-solo/000000026/node?panelId=4&from=now-1d&var-node={NODE_ID}&width=650&height=350&theme=light&_t={TIME}',
21-
'title': 'Systemlast für {NODE_ID} - weiteren Statistiken'
25+
'title': 'Systemlast für {NODE_ID} - weiteren Statistiken',
26+
'width': 650,
27+
'height': 350
2228
},
2329
{
2430
'name': 'Airtime',
2531
'href': 'https://regensburg.freifunk.net/netz/statistik/node/{NODE_ID}/',
2632
'image': 'https://grafana.regensburg.freifunk.net/render/d-solo/000000026/node?panelId=5&from=now-1d&var-node={NODE_ID}&width=650&height=350&theme=light&_t={TIME}',
27-
'title': 'Airtime für {NODE_ID} - weiteren Statistiken'
33+
'title': 'Airtime für {NODE_ID} - weiteren Statistiken',
34+
'width': 650,
35+
'height': 350
2836
}
2937
],
3038
'linkInfos': [
3139
{
3240
'name': 'Statistik für alle Links zwischen diese Knoten',
3341
'image': 'https://grafana.regensburg.freifunk.net/render/d-solo/nvSNqoHmz/link?panelId=7&var-node={SOURCE_ID}&var-nodetolink={TARGET_ID}&from=now-1d&&width=650&height=350&theme=light&_t={TIME}',
34-
'title': 'Linkstatistik des letzten Tages, min und max aller Links zwischen diesen Knoten'
42+
'title': 'Linkstatistik des letzten Tages, min und max aller Links zwischen diesen Knoten',
43+
'width': 650,
44+
'height': 350
3545
}
3646
],
3747
'globalInfos': [
3848
{
3949
'name': 'Globale Statistik',
4050
'href': 'https://regensburg.freifunk.net/netz/statistik',
4151
'image': 'https://grafana.regensburg.freifunk.net/render/d-solo/000000028/globals?panelId=2&from=now-7d&&width=650&height=350&theme=light&_t={TIME}',
42-
'title': 'Globale Statistik - weiteren Statistiken'
52+
'title': 'Globale Statistik - weiteren Statistiken',
53+
'width': 650,
54+
'height': 350
4355
}
4456
],
4557
// Array of data provider are supported

lib/utils/helper.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ define({
117117
}
118118
},
119119
showStat: function showStat(V, o, subst) {
120-
var content = V.h('img', { attrs: { src: require('helper').listReplace(o.image, subst) } });
120+
var content = V.h('img', { attrs: { src: require('helper').listReplace(o.image, subst), width: o.width, height: o.height, alt: _.t('loading', { name: o.name }) } });
121121

122122
if (o.href) {
123-
return V.h('p', V.h('a', {
123+
return V.h('div', V.h('a', {
124124
attrs:
125125
{
126126
href: require('helper').listReplace(o.href, subst),
@@ -129,7 +129,7 @@ define({
129129
}
130130
}, content));
131131
}
132-
return V.h('p', content);
132+
return V.h('div', content);
133133
},
134134

135135
getTileBBox: function getTileBBox(s, map, tileSize, margin) {

locale/de.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@
9393
"others": "andere",
9494
"none": "keine",
9595
"remove": "entfernen",
96-
"close": "schließen"
96+
"close": "schließen",
97+
"loading": "%{name} graoh (wird generiert)"
9798
}

locale/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@
9393
"others": "other",
9494
"none": "none",
9595
"remove": "remove",
96-
"close": "close"
96+
"close": "close",
97+
"loading": "%{name} graph (is generated)"
9798
}

scss/modules/_base.scss

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ h4 {
5555

5656
img {
5757
max-width: 100%;
58+
height: auto;
5859
}
5960

6061
a {

scss/modules/_sidebar.scss

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
padding-bottom: 15px;
3030
}
3131

32+
img {
33+
padding: 0 $button-distance 1em;
34+
box-sizing: border-box;
35+
}
36+
3237
.node-list,
3338
.node-links,
3439
.link-list {

0 commit comments

Comments
 (0)