Skip to content

Commit 70fb4a0

Browse files
author
CYLIA BOUTATA p1408256
committed
affichage correct sans logs
1 parent 5b42e30 commit 70fb4a0

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

core/shsd.py

+6
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ def getAvgPositions(user):
272272
for row in Session.execute(max):
273273
pos.append(row[0])
274274
pos.append(row[1])
275+
if pos[0] is None:
276+
pos[0] = -45
277+
pos[1] = -90
278+
pos[2] = 45
279+
pos[3] = 90
275280

276281
return pos
277282
#liste des couleurs
@@ -317,3 +322,4 @@ def getAvgPositions(user):
317322

318323
if __name__ == '__main__':
319324
app.run(debug=False,port=port)
325+

core/static/Functions.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ function addLegend(my_colors, map) { //{{colors_to_print | tojson}}
6060
var legend = document.createElement("div");
6161
var colors = my_colors;
6262
var colors_json = JSON.parse(colors);
63-
63+
// if no logs
64+
if (colors_json.legend.length === 0){
65+
var to_add = {asn: "No connection to print", color: "#ffffff"};
66+
colors_json.legend.push(to_add);
67+
}
68+
console.log(colors_json);
6469
//-----------ADD LEGEND
6570
var div = document.createElement('div');
6671
var col = L.control({
@@ -122,3 +127,4 @@ function handleClick() {
122127
}
123128
});
124129
}
130+

core/static/style.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,15 @@ li::before {
142142
z-index: 1000;
143143
left: calc(100% - 50px);
144144
top : 0;
145-
width: 30px;
146-
height: 30px;
145+
width: 20px;
146+
height: 20px;
147147

148148
display: flex;
149149
text-align: center;
150150
line-height: 15px;
151151

152152
}
153153

154-
155154
.legend-key {
156155
display: inline-block;
157156
border-radius: 20%;
@@ -195,3 +194,4 @@ footer {
195194
overflow: hidden;
196195
z-index: 1000;
197196
}
197+

0 commit comments

Comments
 (0)