-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
448 lines (419 loc) · 17.7 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
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
<!DOCTYPE html>
<head>
<title>Seaclouds Topology Editor</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/canvas.css"/>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<!--<link rel="stylesheet" href="css/font-awesome.min.css"/>-->
<link rel="stylesheet" href="css/editor.css"/>
</head>
<body>
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Add... <span class="caret"> </span>
</button>
<ul id="add-buttons" class="dropdown-menu" role="menu">
<li><a id="add-database" href="#" data-type="Database">Database</a>
<li><a id="add-restservice" href="#" data-type="RestService">Rest Service</a>
<li><a id="add-webapplication" href="#" data-type="WebApplication">Web application</a>
</ul>
</div>
<div class="modal fade" id="add-form">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title">Add new...</h4>
</div>
<div class="modal-body">
<form role="form">
<fieldset id="set-common">
<legend>Description <a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Module name">
</div>
<!--
<div class="form-group">
<label for="label">Label on screen</label>
<input type="text" class="form-control" id="label" placeholder="Module label">
</div>
-->
</fieldset>
<fieldset id="set-code-tech">
<legend>Technological Requirements <a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="code-language">Language</label>
<select class="form-control" id="code-language"> </select>
</div>
<div class="form-group">
<label for="code-min-version">Min version</label>
<select class="form-control" id="code-min-version"></select>
<label for="code-max-version">Max version</label>
<select class="form-control" id="code-max-version"></select>
</div>
<div class="form-group">
<label for="code-container">Code container</label>
<select class="form-control" id="code-container"></select>
</div>
<div class="form-group">
<label for="code-artifact">Artifact</label>
<input type="text" class="form-control" id="code-artifact"
placeholder="http://www.server.com/path">
</div>
</fieldset>
<fieldset id="set-database-tech">
<legend>Technological Requirements <a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="database-category">Category</label>
<select class="form-control" id="database-category"> </select>
</div>
<div class="form-group">
<label for="database-min-version">Min version</label>
<select class="form-control" id="database-min-version"></select>
<label for="database-max-version">Max version</label>
<select class="form-control" id="database-max-version"></select>
</div>
<div class="form-group">
<label for="database-artifact">Initialization script</label>
<input type="text" class="form-control" id="database-artifact"
placeholder="http://www.server.com/path">
</div>
</fieldset>
<fieldset id="set-nonfunctional">
<legend>Non-functional Requirements <a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="nf-benchmark-responsetime">Benchmarked response time (ms)</label>
<input type="text" class="form-control" id="nf-benchmark-responsetime"
placeholder="100">
<label for="nf-benchmark-platform">Benchmark platform</label>
<select class="form-control" id="nf-benchmark-platform"> </select>
</div>
<div class="form-group">
<label for="nf-qos">QoS</label>
<table class="table table-bordered" id="nf-qos">
<thead>
<tr>
<th>Metric name
<th>Operator
<th>Threshold
<th>Actions
<th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" class="form-control" name="metric">
<td>
<select class="form-control" name="operator" id="nf-qos-operator">
<option value=""> </option>
<option value="LT"><</option>
<option value="LE"><=</option>
<option value="EQ">=</option>
<option value="GE">>=</option>
<option value="GT">></option>
</select>
<td>
<input type="text" class="form-control" name="threshold">
<td>
<select class="form-control" name="action" id="nf-qos-action">
<option value=""> </option>
<option value="scale_up">Scale up</option>
<option value="cloud_burst">Cloud Bursting</option>
</select>
<td>
<button type="button" data-action="delete"><i class="fa fa-remove"> </i></button>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<td>
<td>
<td>
<td><button type="button" id="nf-qos-add" data-action="add"><span class="fa fa-plus"> </span></button>
</tr>
</tfoot>
</table>
<!--<input type="text" class="form-control" id="nf-qos" name="nf-qos">-->
</div>
</fieldset>
<fieldset id="set-infrastructure">
<legend>Provider Infrastructure <a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="infrastructure">Provider is</label>
<label class="radio-inline">
<input type="radio" id="infrastructure-none" name="infrastructure" value="">Any
</label>
<label class="radio-inline">
<input type="radio" id="infrastructure-iaas" name="infrastructure" value="IAAS"> IaaS
</label>
<label class="radio-inline">
<input type="radio" id="infrastructure-paas" name="infrastructure" value="PAAS"> PaaS
</label>
</div>
<div class="form-group" id="infrastructure-iaas-div">
<label for="nf-num-cpus">Num CPUs</label>
<input type="text" class="form-control" id="infrastructure-num-cpus" placeholder="4">
<label for="nf-num-cpus">Min Disk Size (GB)</label>
<input type="text" class="form-control" id="infrastructure-disk-size" placeholder="50">
</div>
<div class="form-group">
<label for="nf-location">Location</label>
<label class="radio-inline">
<input type="radio" id="nf-location-none" name="nf-location" value="">None
</label>
<label class="radio-inline">
<input type="radio" id="nf-location-static" name="nf-location" value="STATIC">Static
</label>
<label class="radio-inline">
<input type="radio" id="nf-location-dynamic" name="nf-location" value="DYNAMIC">Dynamic
</label>
</div>
<div class="form-group" id="nf-location-static-div">
<label for="nf-location-static-options">Static location</label>
<select class="form-control" id="nf-location-static-options"> </select>
</div>
<div class="form-group" id="nf-location-dynamic-div">
<label for="nf-location-dynamic-options">Policy</label>
<select class="form-control" id="nf-location-dynamic-options"> </select>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Add!</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="update-link-form">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title">Update link</h4>
</div>
<div class="modal-body">
<form role="form">
<fieldset id="set-operations">
<legend>Description</legend>
<div class="form-group">
<label for="operations-calls">Average number of calls</label>
<input type="text" class="form-control" id="operation-calls" placeholder="1">
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button id="link-update" type="button" class="btn btn-primary">Update</button>
</div>
</div>
</div>
</div>
<div id="canvas">
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/d3.min.js"></script>
<script src="js/loglevel.js"></script>
<script src="js/editor/log.js"></script>
<script src="js/editor/graph.js"></script>
<script src="js/editor/canvas.js"></script>
<script src="js/editor/types.js"></script>
<script src="js/editor/forms.js"></script>
<script src="js/editor/editor.js"></script>
<script>
var Parent = {
type : "Parent",
name : "<Parent>",
init : function(type, name) {
this.type = type;
this.name = name;
console.log("Parent:init:" + type + ": " + name);
return this;
},
};
var Child = Object.create(Parent).init("Child", "<Child>");
Child.init = function(name) {
this.type = "Child";
//this.prototype.init(this.type, name);
console.log("Child.init:" + this.type + ": " + this.name);
return this;
}
var instance = Object.create(Child).init("instance");
var n0, n1, n2, n3, c0, c1;
var canvas = Canvas();
$(document).ready(function() {
n0 = Object.create(Types.WebApplication).init({
name: "www",
label: "www",
properties : { language: "JAVA"},
behaviour: Editor.NodeBehaviour,
});
// n0.status = "running";
n1 = Object.create(Types.WebApplication).init({
name: "webservices",
label : "webservices",
properties : { language : "JAVA" },
behaviour: Editor.NodeBehaviour,
});
n2 = Object.create(Types.Database).init({
name : "db1",
label : "db1",
properties : { category : "database.mysql.MySqlNode" },
behaviour: Editor.NodeBehaviour,
});
n3 = Object.create(Types.NoSql).init({
name : "Database2",
label : "db2",
properties: { category : "nosql.mongodb.MongoDBServer" }
});
c0 = Object.create(Types.Cloud).init({
name : "CloudFoundry Pivotal",
label : "CF"
});
c1 = Object.create(Types.Cloud).init({
name : "Heroku",
label : "Heroku"
});
as0 = Object.create(Types.ApplicationServer).init({
name : "as0",
label : "as0",
});
as1 = Object.create(Types.Tomcat).init({
name : "as1",
label : "as1"
});
canvas.init("canvas", {
addlinkcallback : Editor.addlinkcallback
});
canvas.addnode(n0);
canvas.addnode(n1);
canvas.addnode(n2);
//canvas.addnode(n3);
//canvas.addnode(c0);
//canvas.addnode(c1);
// canvas.addnode(as0);
// canvas.addnode(as1);
canvas.linknodes(n0, n1).behaviour = Editor.LinkBehaviour;
canvas.linknodes(n1, n2).behaviour = Editor.LinkBehaviour;
//canvas.linknodes(n1, c0, "hostedon");
//canvas.linknodes(n0, c0, "hostedon");
//canvas.linknodes(n2, c1, "hostedon");
n0.qos = [
{ "metric": "runtime", "operator": "LT", "threshold": 2000 },
{ "metric": "availability", "operator": "GT", "threshold": 99.9 }
];
n0.versions = [ 5.3, 5.4, 5.5 ];
Editor.init(canvas);
canvas.restart();
});
</script>
<!--
<div class="modal fade" id="add-database-form">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title">Add new database</h4>
</div>
<div class="modal-body">
<form role="form">
<fieldset>
<legend>Description</legend>
<div class="form-group">
<label for="database-name">Name</label>
<input type="text" class="form-control" id="database-name" placeholder="Module name">
</div>
<div class="form-group">
<label for="database-label">Label</label>
<input type="text" class="form-control" id="database-label" placeholder="Module label">
</div>
</fieldset>
<fieldset>
<legend>Technological Requirements</legend>
<div class="form-group">
<label for="database-category">Category</label>
<select class="form-control" id="database-category">
<option>MySql</option>
<option>Oracle</option>
<option>PostgreSQL</option>
<option>MongoDB</option>
<option>Redis</option>
</select>
</div>
</fieldset>
<fieldset>
<legend>Non-functional Requirements</legend>
</fieldset>
<fieldset>
<legend>Provider Infrastructure</legend>
<div class="form-group">
<label for="webapplication-infrastructure">Provider is</label>
<label class="radio-inline">
<input type="radio" id="database-infrastructure-iaas" name="database-infrastructure" value="iaas"> IaaS
</label>
<label class="radio-inline">
<input type="radio" id="database-infrastructure-paas" name="database-infrastructure" value="paas"> PaaS
</label>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button id="database-add" type="button" class="btn btn-primary">Add!</button>
</div>
</div>
</div>
</div>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#add-node-form">
Add node
</button>
<div class="modal fade" id="add-node-form">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">Add new node</h4>
</div>
<div class="modal-body">
<form role="form">
<div class="form-group">
<label for="new-node-label">Label</label>
<input type="text" class="form-control" id="new-node-label" placeholder="Module name">
</div>
<div class="form-group">
<label for="new-node-type">Type</label>
<select class="form-control" id="new-node-type">
<option>web application</option>
<option>database</option>
<option>web services</option>
<option>other</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
-->