-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
137 lines (132 loc) · 6.76 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="author" content="Dylan Stecklein"/>
<title>VOLTTRON Deployment</title>
<script>
function installBaseReq() {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/install-base-req', true);
xhr.onreadystatechange = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
alert(response.message);
};
};
var data = 'password=' + encodeURIComponent(document.getElementById('password').value);
xhr.send(data);
};
function createInstance() {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/create-instance', true);
xhr.onreadystatechange = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
alert(response.message);
};
};
xhr.send();
};
function configureAgents() {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/configure-agents', true);
xhr.onreadystatechange = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
alert(response.message);
};
};
var checkboxes = document.querySelectorAll('input[name="checkbox"]:checked');
var data = Array.from(checkboxes).map(checkbox => checkbox.value);
xhr.send(JSON.stringify({ data }));
};
function startVOLTTRON() {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/start-volttron', true)
xhr.onreadystatechange = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
alert(response.message);
};
};
xhr.send()
};
function stopVOLTTRON() {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/stop-volttron', true)
xhr.onreadystatechange = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
alert(response.message);
};
};
xhr.send()
};
</script>
</head>
<body>
<h1>VOLTTRON Deployment and Manager</h1>
<p>To install the base requirements for VOLTTRON, provide your password below then click 'Install Base Requirements'</p>
<form onsubmit="event.preventDefault(); installBaseReq();" enctype="application/x-www-form-urlencoded">
<label for="password">Password:</label>
<input type="password" name="password" id="password"/>
<button type="submit">Install Base Requirements</button>
</form>
<p>To create a new instance, click 'Create Instance'</p>
<form onsubmit="event.preventDefault(); createInstance();" enctype="application/x-www-form-urlencoded">
<button type="submit">Create Instance</button>
</form>
<p>Pick any of the following services then click 'Install Services' to install them.</p>
<form onsubmit="event.preventDefault(); configureAgents();" enctype="application/x-www-form-urlencoded" id="config_form">
<input type="checkbox" id="agent1" name="checkbox" value="ActuatorAgent">
<label for="agent1"> Acutator Agent</label>
<input type="checkbox" id="agent2" name="checkbox" value="BACnetProxy">
<label for="agent2"> BACnet Proxy</label>
<br>
<input type="checkbox" id="agent3" name="checkbox" value="DataMover">
<label for="agent3"> Data Mover</label>
<input type="checkbox" id="agent4" name="checkbox" value="DNP3Agent">
<label for="agent4"> DNP3 Agent</label>
<br>
<input type="checkbox" id="agent5" name="checkbox" value="ForwardHistorian">
<label for="agent5"> Forward Historian</label>
<input type="checkbox" id="agent6" name="checkbox" value="IEEE2030_5Agent">
<label for="agent6"> IEEE 2030.5 Agent</label>
<br>
<input type="checkbox" id="agent7" name="checkbox" value="MongodbTaggingService">
<label for="agent7"> MongoDB Tagging </label>
<input type="checkbox" id="agent8" name="checkbox" value="MQTTHistorian">
<label for="agent8"> MQTT Historian</label>
<br>
<input type="checkbox" id="agent9" name="checkbox" value="OpenADRVenAgent">
<label for="agent9"> OpenADR VEN Agent</label>
<input type="checkbox" id="agent10" name="checkbox" value="PlatformDriverAgent">
<label for="agent10"> Platform Driver Agent</label>
<br>
<input type="checkbox" id="agent11" name="checkbox" value="SQLAggregateHistorian">
<label for="agent11"> SQL Aggregate Historian</label>
<input type="checkbox" id="agent12" name="checkbox" value="SQLHistorian">
<label for="agent12"> SQL Historian</label>
<br>
<input type="checkbox" id="agent13" name="checkbox" value="SQLiteTaggingService">
<label for="agent13"> SQLite Tagging</label>
<input type="checkbox" id="agent14" name="checkbox" value="VolttronCentral">
<label for="agent14"> VOLTTRON Central</label>
<br>
<input type="checkbox" id="agent15" name="checkbox" value="VolttronCentralPlatform">
<label for="agent15"> VOLTTRON Central Platform</label>
<input type="checkbox" id="agent16" name="checkbox" value="WeatherDotGov">
<label for="agent16"> Weather Dot Gov</label>
<br>
<button type="submit">Install Services</button>
</form>
<p>To start or stop VOLTTRON, click 'Start VOLTTRON' or 'Stop VOLTTRON'</p>
<form onsubmit="event.preventDefault(); startVOLTTRON();" envtype="application/x-www-form-urlencoded">
<button type="submit">Start VOLTTRON</button>
</form>
<form onsubmit="event.preventDefault(); stopVOLTTRON();" enctype="application/x-www-form-urlencoded">
<button type="submit">Stop VOLTTRON</button>
</form>
</body>
</html>