/
base.html
705 lines (628 loc) · 34.8 KB
/
base.html
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
{% extends "defaults.jinja" %}
{% block base %}
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<title>{% block title %}{% endblock %} - {{ FLEXMEASURES_PLATFORM_NAME }}
</title>
{% endblock head %}
<meta charset="windows-1252">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{% block styles %}
<!-- Leaflet -->
<link href="https://cdn.jsdelivr.net/npm/leaflet@1.7.1/dist/leaflet.css" rel="stylesheet" />
<link href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css" rel="stylesheet" />
<link href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css" rel="stylesheet" />
<!-- Bootstrap -->
<link href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
{% if show_datepicker %}
<link href="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.css"
rel="stylesheet" />
{% endif %}
<!-- Fonts -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet" />
<link href="{{ url_for('flexmeasures_ui.static', filename='css/external/weather-icons.min.css') }}"
rel="stylesheet" />
<!-- Ion range slider -->
<link href="https://cdn.jsdelivr.net/npm/ion-rangeslider@2.3.1/css/ion.rangeSlider.css"
rel="stylesheet" />
<!-- Custom CSS -->
<link href="{{ url_for('flexmeasures_ui.static', filename='css/flexmeasures.css') }}" rel="stylesheet" />
{% if active_page == "tasks" %}
<link href="{{ url_for('flexmeasures_ui.static', filename='css/external/rq-dashboard-bootstrap.min.css') }}"
rel="stylesheet" />
{% elif active_page in ("assets", "users", "portfolio") %}
<link href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css" rel="stylesheet" />
{% endif %}
{% if extra_css %}
<link href="{{ extra_css }}" rel="stylesheet" />
{% endif %}
{% endblock %}
</head>
<body>
{% block body %}
{% block nav %}
<nav class="navbar navbar-default navbar-fixed-top" id="topnavbar">
<div id="navbar-container" class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a href="/">
<span class="navbar-tool-name">
{% if menu_logo %}
<img id="navbar-logo" src="{{menu_logo}}"/>
{% else %}
<img id="navbar-logo" src="https://artwork.lfenergy.org/projects/flexmeasures/horizontal/white/flexmeasures-horizontal-white.svg" alt="FlexMeasures"/>
{% endif %}
</span>
</a>
</span>
</div>
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% for href, id, caption, tooltip, icon in navigation_bar %}
{% if id == "tasks" %}
<li {% if id == active_page %} class="active" {% endif %} class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="fa fa-tasks"
aria-hidden="true"></span>
Tasks
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/forecasting"
{% endif %}>Forecasts</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/scheduling"
{% endif %}>Schedules</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/labelling"
{% endif %}>Labels</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/alerting"
{% endif %}>Alerts</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/reporting"
{% endif %}>Reports</a></li>
</ul>
</li>
{% else %}
<li {% if id == active_page %} class="active" {% endif %} data-toggle="tooltip" title="{{ tooltip }}" data-placement="bottom"
{% if id == 'upload' or (current_user.has_role('anonymous') and id in ('tasks', 'users', 'control', 'portfolio')) %}
class="disabled" {% endif %}>
<a {% if not ( id == 'upload' or (current_user.has_role('anonymous') and id in ('tasks', 'users', 'control', 'portfolio')) ) %}href="/{{ href|e }}"
{% endif %}{% if id == 'docs' %} target="_blank" {% endif %}>
<span class="fa fa-{{ icon }}" aria-hidden="true"></span>
{{ caption|e }}
{# use tooltip as caption for small screens #}
{% if not caption %}
<span class="visible-xs-inline">{{ tooltip }}</span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</nav>
{% endblock nav %}
{% if message and message != "" %}
<div class="col-sm-12 alert alert-info">{{ message}} </div>
{% endif %}
{% if (msg is defined) and msg %}
<div class="col-sm-12 alert alert-info">{{ msg }}</div>
{% endif %}
<!-- loading this earlier so templates can use it -->
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/floatthead/2.2.1/jquery.floatThead.min.js"></script>
<!-- This should always be there, even on error pages -->
<script type="text/javascript">
var timerangeStart = "{{ start_time }}";
var timerangeEnd = "{{ end_time }}";
</script>
{# Div blocks that child pages can reference #}
{% block divs %}
{% block datetimepicker %}
<div class="form-group row datetimepicker">
<div class="col-sm-2">
<div class="col-sm-1"><i class="icon-time center-icon"></i></div>
</div>
<div class="col-sm-10">
<label class="control-label">Time window</label>
<div class="btn-group btn-group-justified">
<input type="text" name="daterange" value="01/01/2015 1:30 PM - 01/01/2015 2:00 PM" />
</div>
</div>
</div>
<!-- form to refresh page -->
<form style="display: hidden" action="" method="POST" id="datepicker_form">
<input type="hidden" id="datepicker_form_start_time" name="start_time" value="{{ start_time }}" />
<input type="hidden" id="datepicker_form_end_time" name="end_time" value="{{ end_time }}" />
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
{% endblock datetimepicker %}
{% block forecastpicker %}
<div class="form-group row">
<div class="col-sm-2">
<div class="col-sm-1"><i class="icon-binoculars center-icon"></i></div>
</div>
<div class="col-sm-10">
<label class="control-label">Forecast (rolling)</label>
<!--<div class="btn-group btn-group-justified" role="group" aria-label="...">-->
<!--<a role="button" href="#" class="btn btn-default forecast-toggle active" forecast-type="rolling">Rolling</a>-->
<!--<a role="button" href="#" class="btn btn-default forecast-toggle" forecast-type="static">Static</a>-->
<!--</div>-->
<div>
<form action="" method="POST" id="forecast_horizon_form">
<select class="form-control" id="forecast_horizon" name="forecast_horizon"
onchange="this.form.submit()">
{% for horizon in forecast_horizons %}
<option value="{{ horizon }}" {% if horizon == active_forecast_horizon %} selected="selected"
{% endif %}>with a horizon of {{ horizon }}</option>
{% endfor %}
</select>
</form>
</div>
</div>
</div>
{% endblock forecastpicker %}
{% block leftsidepanel %}
<script>
// Set up swiping and clicking for the left sidepanel
var leftSidepanels = document.getElementsByClassName('left-sidepanel');
var leftSidepanelLabels = document.getElementsByClassName('left-sidepanel-label');
async function openSidepanel(e) {
if ( (e.target.classList.contains('sidepanel-container')) | (e.type == 'click') ) {
for (var i = leftSidepanels.length - 1; i >= 0; i--) {
leftSidepanels[i].classList.add('sidepanel-show');
}
}
}
async function closeSidepanel(e) {
for (var i = leftSidepanels.length - 1; i >= 0; i--) {
leftSidepanels[i].classList.remove('sidepanel-show');
}
}
for (var i = leftSidepanelLabels.length - 1; i >= 0; i--) {
leftSidepanelLabels[i].addEventListener("click", openSidepanel)
}
document.addEventListener('swiped-right', openSidepanel);
document.addEventListener('swiped-left', closeSidepanel);
</script>
{% endblock leftsidepanel %}
{% block sensorChartSetup %}
<!-- Render Charts -->
<script type="module" type="text/javascript">
import { subtract, thisMonth, lastNMonths, getOffsetBetweenTimezonesForDate } from "{{ url_for('flexmeasures_ui.static', filename='js/daterange-utils.js') }}";
import { partition, updateBeliefs, beliefTimedelta} from "{{ url_for('flexmeasures_ui.static', filename='js/replay-utils.js') }}";
let vegaView;
let previousResult;
let queryStartDate;
let queryEndDate;
let storeStartDate;
let storeEndDate;
async function embedAndLoad(chartSpecsPath, elementId, datasetName, previousResult, startDate, endDate) {
await vegaEmbed('#'+elementId, chartSpecsPath + 'dataset_name=' + datasetName + '&width=container&include_sensor_annotations=false&include_asset_annotations=false', {{ chart_options | safe }})
.then(function (result) {
// result.view is the Vega View, chartSpecsPath is the original Vega-Lite specification
vegaView = result.view;
if (previousResult) {
var slicedPreviousResult = previousResult.filter(item => {
return item.event_start >= startDate.getTime() && item.event_start < endDate.getTime()
})
vegaView.change(datasetName, vega.changeset().remove(vega.truthy).insert(slicedPreviousResult)).resize().run();
}
});
}
{% if active_page == "assets" %}
var dataPath = '/api/v3_0/assets/' + {{ asset.id }}
var dataDevPath = '/api/dev/asset/' + {{ asset.id }}
var datasetName = 'asset_' + {{ asset.id }}
{% elif active_page == "sensors" %}
var dataPath = '/api/dev/sensor/' + {{ sensor_id }}
var dataDevPath = '/api/dev/sensor/' + {{ sensor_id }}
var datasetName = 'sensor_' + {{ sensor_id }}
{% endif %}
var elementId = 'sensorchart'
var chartSpecsPath = dataPath + '/chart?'
// Set up abort controller to cancel requests
var controller = new AbortController()
var signal = controller.signal
const date = Date();
const picker = new Litepicker({
element: document.getElementById('datepicker'),
plugins: ['ranges', 'keyboardnav'],
ranges: {
customRanges: {
'Today': [new Date(date), new Date(date)],
'Last 7 days': [subtract(date, 6), new Date(date)],
'This month': thisMonth(date)
},
position: 'bottom'
},
autoRefresh: true,
moduleRanges: true,
showWeekNumbers: true,
numberOfMonths: 1,
numberOfColumns: 1,
inlineMode: true,
switchingMonths: 1,
singleMode: false,
dropdowns: {
years: true,
months: true,
},
format: 'YYYY-MM-DD\\T00:00:00',
});
picker.on('selected', (startDate, endDate) => {
// Stop replay
let toggle = document.querySelector('#replay')
toggle.classList.remove('playing');
toggle.classList.remove('paused');
toggle.classList.add('stopped');
startDate = startDate.toJSDate()
endDate = endDate.toJSDate()
endDate.setDate(endDate.getDate() + 1);
storeStartDate = startDate
storeEndDate = endDate
var queryStartDate = (startDate != null) ? (startDate.toISOString()) : (null)
var queryEndDate = (endDate != null) ? (endDate.toISOString()) : (null)
// Abort previous request and create abort controller for new request
controller.abort()
controller = new AbortController()
signal = controller.signal
$("#spinner").show();
Promise.all([
// Fetch time series data
fetch(dataPath + '/chart_data/?event_starts_after=' + queryStartDate + '&event_ends_before=' + queryEndDate, {
method: "GET",
headers: {"Content-Type": "application/json"},
signal: signal,
})
.then(function(response) { return response.json(); }),
/**
// Fetch annotations
fetch(dataPath + '/chart_annotations/?event_starts_after=' + queryStartDate + '&event_ends_before=' + queryEndDate, {
method: "GET",
headers: {"Content-Type": "application/json"},
signal: signal,
})
.then(function(response) { return response.json(); }),
*/
// Embed chart
embedAndLoad(chartSpecsPath + 'event_starts_after=' + queryStartDate + '&event_ends_before=' + queryEndDate + '&', elementId, datasetName, previousResult, startDate, endDate),
]).then(function(result) {
$("#spinner").hide();
vegaView.change(datasetName, vega.changeset().remove(vega.truthy).insert(result[0])).resize().run();
previousResult = result[0];
/**
vegaView.change(datasetName + '_annotations', vega.changeset().remove(vega.truthy).insert(result[1])).resize().run();
*/
}).catch(console.error);
});
document.onreadystatechange = () => {
if (document.readyState === 'complete') {
fetch(dataDevPath, {
method: "GET",
headers: {"Content-Type": "application/json"},
})
.then(function(response) { return response.json(); })
.then(function(data) {
var offsetDifference = getOffsetBetweenTimezonesForDate(new Date(), data.timezone, jstz.determine().name());
if (offsetDifference != 0) {
document.getElementById('tzwarn').style.display = 'block';
var offsetNotice = (offsetDifference > 0) ? 'which is currently ahead by ' + offsetDifference + 'minutes' : 'which is currently behind by ' + offsetDifference + ' minutes'
document.getElementById('tzwarn').innerHTML = 'Please note that the sensor data you are viewing is located in a different timezone (' + offsetNotice + ').<br/>To view the data from a local perspective, set your locale timezone to ' + data.timezone + '.'
}
{% if active_page == "assets" %}
var timerangeVar = 'timerange_of_sensors_to_show'
{% else %}
var timerangeVar = 'timerange'
{% endif %}
if (timerangeVar in data) {
var start = new Date(data[timerangeVar].start);
var end = new Date(data[timerangeVar].end)
end.setSeconds(end.getSeconds() - 1); // -1 second in case most recent event ends at midnight
start.setHours(0,0,0,0) // get start of first day
end.setHours(0,0,0,0) // get start of last day
{% if event_starts_after and event_ends_before %}
// Initialize picker to the date selection specified in the session
var sessionStart = new Date('{{ event_starts_after }}');
var sessionEnd = new Date('{{ event_ends_before }}')
sessionEnd.setSeconds(sessionEnd.getSeconds() - 1); // -1 second in case most recent event ends at midnight
sessionStart.setHours(0,0,0,0) // get start of first day
sessionEnd.setHours(0,0,0,0) // get start of last day
picker.setDateRange(
sessionStart,
sessionEnd,
);
{% else %}
// Initialize picker to the last 2 days of sensor data
var nearEnd = new Date(end)//.setDate(end.getDate() - 1)
nearEnd.setDate(nearEnd.getDate() - 1)
picker.setDateRange(
nearEnd,
end,
);
{% endif %}
// No use looking for data in years outside timerange of sensor data
picker.setOptions({
dropdowns: {
minYear: start.getFullYear(),
maxYear: end.getFullYear(),
},
});
};
});
}
};
// Set up play/pause button for replay, incl. the complete replay logic
let toggle = document.querySelector('#replay');
toggle.addEventListener('click', function(e) {
e.preventDefault();
// toggle.classList.toggle('paused');
if (toggle.classList.contains('playing')) {
// Pause replay
toggle.classList.remove('playing');
toggle.classList.add('paused');
} else if (toggle.classList.contains('stopped')) {
// Start replay
// toggle.classList.remove('paused');
toggle.classList.remove('stopped');
toggle.classList.add('playing');
var beliefTime = new Date(storeStartDate)
var numReplaySteps = Math.ceil((storeEndDate - storeStartDate) / beliefTimedelta)
queryStartDate = (storeStartDate != null) ? (storeStartDate.toISOString()) : (null)
queryEndDate = (storeEndDate != null) ? (storeEndDate.toISOString()) : (null)
$("#spinner").show();
Promise.all([
// Fetch time series data (all data, not only the most recent beliefs)
fetch(dataPath + '/chart_data/?event_starts_after=' + queryStartDate + '&event_ends_before=' + queryEndDate + '&most_recent_beliefs_only=false', {
method: "GET",
headers: {"Content-Type": "application/json"},
})
.then(function(response) { return response.json(); }),
]).then(function(result) {
$("#spinner").hide();
replayBeliefsData(result[0]);
}).catch(console.error);
const timer = ms => new Promise(res => setTimeout(res, ms))
/**
* Replays beliefs data.
*
* As we go forward in time in steps, replayedData is updated with newData that was known at beliefTime,
* by splitting off newData from remainingData.
* Then, replayedData is loaded into the chart.
*
* @param {Array} remainingData Array containing beliefs.
*/
async function replayBeliefsData (remainingData) {
var replayedData = []
for (var i = 0; i < numReplaySteps + 1; i++) {
while (document.getElementById('replay').classList.contains('paused') ) {
await timer(1000);
}
if (document.getElementById('replay').classList.contains('stopped') ) {
break;
}
beliefTime = new Date(beliefTime.getTime() + beliefTimedelta)
// Split off one replay step of new data from the remaining data
var newData
[newData, remainingData] = partition(
remainingData,
(item) => item.belief_time <= beliefTime.getTime(),
);
// Update beliefs in the replayed data given the new data
replayedData = updateBeliefs(replayedData, newData)
/** When selecting a longer time periode (more than a week), the replay slows down a bit. This
* seems to be mainly from reloading the data into the graph. Slicing the data takes 10-30 ms, and
* loading that data into the graph takes 30-200 ms, depending on how much data is shown in the
* graph. After trying different approaches, we fell back to the original approach of telling vega
* to remove all previous data and to insert a completely new dataset at each iteration. Updating
* the view with removing only a few data points (representing obsolete beliefs) and inserting only
* a few data points (representing the most recent new beliefs) actually made it slower.
*/
vegaView.change(datasetName, vega.changeset().remove(vega.truthy).insert(replayedData)).run().finalize();
document.getElementById('replay-time').innerHTML = beliefTime
await timer(25);
}
// Stop replay when finished
toggle.classList.remove('playing');
toggle.classList.add('stopped');
document.getElementById('replay-time').innerHTML = ''
}
} else {
// Resume replay
toggle.classList.remove('paused');
toggle.classList.add('playing');
}
});
</script>
{% endblock sensorChartSetup %}
{% block attributions %}
<div id="att-text" style="display: none;">
<ul>
<li>Plots made with <a href="https://vega.github.io/vega-lite/">Vega-Lite</a>.</li>
<li>Icons made by <a href="https://freepik.com">Freepik</a>, <a
href="https://www.flaticon.com/authors/tomas-knop" title="Tomas Knop">Tomas Knop</a>, <a
href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> and
<a href="https://www.flaticon.com/authors/those-icons" title="Those Icons">Those Icons</a> from <a
href="https://flaticon.com">www.flaticon.com</a>.</li>
</ul>
</div>
{% endblock attributions %}
{% endblock divs %}
{#- Scripts used by all views (e.g. by navigation menu) -#}
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"></script>
{% block scripts %}
<!-- External scripts -->
<script src="https://cdn.jsdelivr.net/npm/ion-rangeslider@2.3.1/js/ion.rangeSlider.min.js"></script>
<script src="https://d3js.org/d3.v6.min.js"></script>
{% if js_versions %}
<script src="https://cdn.jsdelivr.net/npm/vega@{{ js_versions.vega }}"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@{{ js_versions.vegalite }}"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@{{ js_versions.vegaembed }}"></script>
{% endif %}
<!-- Custom scripts -->
<script src="{{ url_for('flexmeasures_ui.static', filename='js/swiped-events.min.js') }}"></script>
<script src="{{ url_for('flexmeasures_ui.static', filename='js/flexmeasures.js') }}"></script>
{% if show_datepicker %}
<script src="{{ url_for('flexmeasures_ui.static', filename='js/daterangepicker-init.js') }}"></script>
{% endif %}
<!-- External scripts that should run after custom scripts -->
{% if show_datepicker %}
<script src="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.min.js"></script>
{% endif %}
{% endblock scripts %}
{% block paginate_tables_script %}
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script
src="https://cdn.datatables.net/plug-ins/1.10.22/features/conditionalPaging/dataTables.conditionalPaging.js"></script>
{% endblock paginate_tables_script %}
<footer class="page-footer font-small pt-4 mt-4">
<div class="footer text-center">
<div class="container-fluid">
{% block copyright_notice %}
FlexMeasures technology is created by <a href="https://seita.nl/">Seita Energy Flexibility</a>,
in cooperation with <a href="https://aoneeng.com/">A1 Engineering</a>
©
<script>var CurrentYear = new Date().getFullYear(); document.write(CurrentYear)</script>.
{% endblock copyright_notice %}
{% block about %}
<a href="#" data-toggle="modal" data-target="#About">About FlexMeasures</a>.
<!-- The modal -->
<div class="modal fade" id="About" tabindex="-1" role="dialog" aria-labelledby="modalLabelLarge" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="modalLabelLarge">About FlexMeasures</h4>
</div>
<div class="modal-body">
<div class="justify">
<p>
In a world with renewable energy, flexibility is crucial for cost and CO₂ reduction.
Planning ahead allows flexible devices to profit from scheduling the best flexible
actions (such as shifting or curtailing energy use).
</p>
<p>
The {{ FLEXMEASURES_PLATFORM_NAME }} Platform is a tool for businesses operating energy devices.
Its purpose is to realise the best value for device owners by scheduling balancing actions.
For instance, if the devices draw from or supply to the power grid, {{ FLEXMEASURES_PLATFORM_NAME }} can assist in
selling balancing services to energy markets.
It fulfills this purpose with three services: Monitoring, forecasting and scheduling.
{{ FLEXMEASURES_PLATFORM_NAME }} is designed as open-source software to empower energy service companies while they
maintain autonomy over their operations and their technology roadmap.
Read more <a href="https://flexmeasures.readthedocs.io">here</a>.
</p>
<p>
{{ FLEXMEASURES_PLATFORM_NAME }} is compliant with the Universal Smart Energy Framework (<a
href="https://www.usef.energy/download-the-framework/a-flexibility-market-design/">USEF</a>), a
“flexibility market design for the trading and commoditisation of energy flexibility and the
architecture, tools and rules to make it work effectively.
USEF fits on top of most market models and is already being adopted across Europe to accelerate and
future-proof smart energy projects.”
</p>
{% if current_user.has_role('anonymous') and current_user.has_role('CPO') %}
<p>
This demo is tuned to operators of charge points for electric vehicles (EVs).
The terminology used follows the Open Charge Point Interface (<a
href="https://ocpi-protocol.org/">OCPI</a>).
This dashboard shows you the locations of all charge points connected to the platform and how they
are doing.
Each charge point contains multiple chargers—called Electric Vehicle Supply Equipment (EVSE)
in OCPI—which are monitored individually (click on a charge point location to reveal its
EVSE).
</p>
<p>
{{ FLEXMEASURES_PLATFORM_NAME }} supports automated scheduling of charging profiles through its API.
Charging profiles are optimised against applicable market conditions like wholesale prices and
contracted (time-of-use) tariffs.
Charging preferences can be set to reflect whether EV owners are in a hurry or parking for some
time.
</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock about %}
{% block credits %}
<a href="#" data-toggle="modal" data-target="#Credits">Credits</a>.
<!-- The modal -->
<div class="modal fade" id="Credits" tabindex="-1" role="dialog" aria-labelledby="modalLabelLarge" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="modalLabelLarge">Credits</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<h3>Images from <a href="https://seita.nl">Seita</a></h3>
<div>FlexMeasures on laptop - image by <a href="https://drakemultimedia.nl/" title="Bobby Drake">Bobby Drake</a></div>
<h3>Images from <a href="https://unsplash.com/" title="Unsplash">Unsplash</a></h3>
<div>Tesla charging station - image by <a href="https://www.chasealewis.com/" title="Chase Lewis">Chase Lewis</a></div>
<div>Wind turbines on top of mountain - image by <a href="https://www.tbk-f.com/" title="TJ K.">TJ K.</a></div>
</div>
<div class="col-sm-6">
<h3>Icons from <a href="https://www.flaticon.com/" title="Flaticon">Flaticon</a></h3>
<div><a href="https://www.flaticon.com/free-icon/wind-power_1085695">Wind turbine</a> - icon by <a href="https://www.flaticon.com/authors/good-ware" title="Good Ware">Good Ware</a> (made to spin by Seita)</div>
<div><a href="https://www.flaticon.com/search?word=currency&author_id=258">Coins</a> - icons by <a href="https://www.flaticon.com/authors/pixelmeetup" title="Pixelmeetup">Pixelmeetup</a></div>
<div>Other icons by <a href="https://www.freepik.com" title="Freepik">Freepik</a></div>
</div>
</div>
</div>
<div class="modal-header">
We did our best to give credit to the original photographers and illustrators for the images included on this website. If we have not properly credited an original photographer or illustrator, please notifiy us and we will make the appropriate changes necessary.
</div>
</div>
</div>
</div>
{% endblock credits %}
{% block technical_info %}
{# We might render templates from plugins, where this meta info is not available #}
{% if app_running_since %}
This app is running since {{ app_running_since }}
{% endif %}
{% if (flexmeasures_version or git_version) and not current_user.has_role('anonymous') %}
{% if flexmeasures_version %}
on version {{ flexmeasures_version }}.
{% else %}
{% if git_version != "Unknown" %}
on version {{ git_version }}+{{ git_commits_since }}.
{% else %}
on revision {{ git_hash }}.
{% endif %}
{% endif %}
{% endif %}
{% if loaded_plugins %}
Loaded plugins: {{ loaded_plugins }}.
{% endif %}
{% endblock technical_info %}
</div>
<div>
<a href="https://flexmeasures.io/"><img src="https://artwork.lfenergy.org/projects/flexmeasures/icon/white/flexmeasures-icon-white.svg" alt="FlexMeasures" class="footer-logo"></a>
</div>
</div>
</footer>
{% endblock body %}
</body>
</html>
{% endblock base %}