forked from snaptec/openWB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nachtladenconfig.html
228 lines (200 loc) · 7.91 KB
/
nachtladenconfig.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
<!DOCTYPE html>
<html lang="de">
<head>
<base href="/openWB/web/">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>openWB Einstellungen</title>
<meta name="description" content="Control your charge" />
<meta name="author" content="Kevin Wieland, Michael Ortenstein" />
<!-- Favicons (created with http://realfavicongenerator.net/)-->
<link rel="apple-touch-icon" sizes="57x57" href="img/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/favicons/apple-touch-icon-60x60.png">
<link rel="icon" type="image/png" href="img/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="img/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="manifest.json">
<link rel="shortcut icon" href="img/favicons/favicon.ico">
<meta name="msapplication-TileColor" content="#00a8ff">
<meta name="msapplication-config" content="img/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="css/bootstrap-4.4.1/bootstrap.min.css">
<!-- Normalize -->
<link rel="stylesheet" type="text/css" href="css/normalize-8.0.1.css">
<!-- include settings-style -->
<link rel="stylesheet" type="text/css" href="css/settings_style.css?ver=20200416-a">
<!-- important scripts to be loaded -->
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/bootstrap-4.4.1/bootstrap.bundle.min.js"></script>
<!-- load helper functions -->
<script src = "settings/helperFunctions.js?ver=20210329" ></script>
</head>
<body>
<div id="nav"></div> <!-- placeholder for navbar -->
<div role="main" class="container" style="margin-top:20px">
<form id="myForm">
<h1>Einstellungen für Nachtladen - Testversion!!</h1>
<div class="card border-secondary">
<div class="card-header font-weight-bold text-white bg-secondary">
Einstellungen Ladepunkt 1 (funktionslos)
</div>
<div class="card-body">
<div class="form-group">
<div class="form-row mb-1">
<label class="col-md-4 col-form-label">Nachtladen im Modus Sofortladen</label>
<div class="col">
<!-- TODO: create proper MQTT Topic -->
<div class="btn-group btn-group-toggle btn-block" id="nachtladenLp1" name="nachtladen" data-toggle="buttons" data-default="0" data-topicprefix="openWB/config/get/sofort/" data-topicsubgroup="lp/1/">
<label class="btn btn-outline-info btn-toggle">
<input type="radio" name="nachtladen" data-option="0">ausgeschaltet
</label>
<label class="btn btn-outline-info btn-toggle">
<input type="radio" name="nachtladen" data-option="1">eingeschaltet
</label>
</div>
<span class="form-text small">Auswahl der Funktion Nachladen im Modus Sofortladen. Die Auswahl beeinflusst den Regelpunkt und die Berechnung des Ladestroms.</span>
</div>
</div>
</div>
</div> <!-- end card body Einstellungen Ladepunkt 1 -->
</div> <!-- end card Einstellungen Ladepunkt 1 -->
<div class="row justify-content-center">
<div class="col-3">
<button id="saveSettingsBtn" type="button" class="btn btn-success" disabled="disabled">speichern</button>
</div>
<div class="col-1">
</div>
<div class="col-3">
<button id="modalDefaultsBtn" type="button" class="btn btn-danger">Werkseinstellungen</button>
</div>
</div>
</form>
<!-- modal set-defaults-confirmation window -->
<div class="modal fade" id="setDefaultsConfirmationModal" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- modal header -->
<div class="modal-header bg-danger">
<h4 class="modal-title text-light">Achtung</h4>
</div>
<!-- modal body -->
<div class="modal-body text-center">
<p>
Sollen für die Funktion Nachtladen wirklich die Werkseinstellungen eingestellt werden?
</p>
</div>
<!-- modal footer -->
<div class="modal-footer d-flex justify-content-center">
<button type="button" class="btn btn-success" data-dismiss="modal" id="saveDefaultsBtn" disabled="disabled">Fortfahren</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Abbruch</button>
</div>
</div>
</div>
</div>
<!-- modal form-not-valid window -->
<div class="modal fade" id="formNotValidModal" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- modal header -->
<div class="modal-header bg-danger">
<h4 class="modal-title text-light">Fehler</h4>
</div>
<!-- modal body -->
<div class="modal-body text-center">
<p>
Es wurden fehlerhafte Eingaben gefunden, speichern ist nicht möglich! Bitte überprüfen Sie alle Eingaben.
</p>
</div>
<!-- modal footer -->
<div class="modal-footer d-flex justify-content-center">
<button type="button" class="btn btn-primary" data-dismiss="modal">Schließen</button>
</div>
</div>
</div>
</div>
<!-- modal no-values-changed window -->
<div class="modal fade" id="noValuesChangedInfoModal" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- modal header -->
<div class="modal-header bg-info">
<h4 class="modal-title text-light">Info</h4>
</div>
<!-- modal body -->
<div class="modal-body text-center">
<p>
Es wurden keine geänderten Einstellungen gefunden.
</p>
</div>
<!-- modal footer -->
<div class="modal-footer d-flex justify-content-center">
<button type="button" class="btn btn-success" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
</div> <!-- container -->
<footer class="footer bg-dark text-light font-small">
<div class="container text-center">
<small>Sie befinden sich hier: Ladeeinstellungen/Nachtladen</small>
</div>
</footer>
<!-- load mqtt library -->
<script src = "js/mqttws31.js" ></script>
<!-- load topics -->
<script src = "settings/topicsToSubscribe_nachtladenconfig.js?ver=20200505-a" ></script>
<!-- load service -->
<script src = "settings/setupMqttServices.js?ver=20200505-a" ></script>
<!-- load mqtt handler-->
<script src = "settings/processAllMqttMsg.js?ver=20200505-a" ></script>
<script>
$.get(
{ url: 'settings/navbar.html', cache: false },
function(data){
$('#nav').replaceWith(data);
// disable navbar entry for current page
$('#navNachtladen').addClass('disabled');
}
);
function saveSettings() {
// sends all changed values by mqtt if valid
var formValid = $("#myForm")[0].checkValidity();
if ( !formValid ) {
$('#formNotValidModal').modal();
return;
};
getChangedValues();
sendValues();
}
$(document).ready(function(){
$('input').blur(function(event) {
// check input field on blur if value is valid
if ( event.target.checkValidity() == false ) {
$(this).addClass('is-invalid');
} else {
$(this).removeClass('is-invalid');
}
});
$('#saveSettingsBtn').on("click",function() {
saveSettings();
});
$('#modalDefaultsBtn').on("click",function() {
$('#setDefaultsConfirmationModal').modal();
});
$('#saveDefaultsBtn').on("click",function() {
// shown in confirmation modal
// resets all values to defaults and sends all changed values by mqtt
setToDefaults();
getChangedValues();
sendValues();
});
$('.rangeInput').on('input', function() {
// show slider value in label of class valueLabel
updateLabel($(this).attr('id'));
});
}); // end document ready function
</script>
</body>
</html>