forked from makurideru/infrastructuregraph_visualisator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_ci.html
459 lines (426 loc) · 22 KB
/
add_ci.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>IT-Infrastructure Visualisator</title>
<!-- Bootstrap Core CSS -->
<link href="lib/css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery Version 1.11.1 -->
<script src="lib/js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="lib/js/bootstrap.min.js"></script>
<!-- Custom CSS -->
<link rel="stylesheet" href="css/add_ci.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Graph anzeigen</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="add_ci.html">Technologie-Stack hinzufügen</a>
</li>
<li>
<a href="connect_ci.html"><s>CI verknüpfen</s></a>
</li>
<li>
<a href="delete_ci.html"><s>CI löschen</s></a>
</li>
<li>
<a href="edit_ci.html"><s>CI bearbeiten</s></a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div class="well text-left">
<form class="form-inline" action="save_addedCI_in_db.php" method="post">
<h4>Zugeordnete Anwendung</h4>
<div class="panel panel-default">
<div class="form-group col-sm-offset-1 panel-body">
<span class="form-group">
<label class="control-label" for="anw_name">Name:</label>
<input type="text" class="form-control" name="anw_name" placeholder="" required="required">
</span>
</div>
</div>
<h4>Instanzen</h4>
<div class="panel panel-default">
<div id="gesamtcontainer_instanzen">
<div id="instanzcontainer1">
<h5>Serverdaten (1)</h5>
<div class="form-group col-sm-offset-1 panel-body">
<span class="form-group">
<label class="control-label" for="ser_hw">Hardware:</label>
<input type="text" class="form-control" name="ser_hw|1" placeholder=""><br/>
</span> <br/>
<span class="form-group">
<label class="control-label" for="ser_name">Servername:</label>
<input type="text" class="form-control" name="ser_name|1" placeholder="">
</span>
<span class="form-group">
<label class="control-label" for="ser_zone">Zone:</label>
<input type="text" class="form-control" name="ser_zone|1" placeholder="">
</span>
<span class="form-group">
<label class="control-label" for="ser_os">Betriebssystem:</label>
<input type="text" class="form-control" name="ser_os|1" placeholder="">
</span>
</div>
<div class="form-group col-sm-offset-1 panel-body">
<div class="panel panel-default"> <!--Deployment-->
<div id="gesamtcontainer_deployment1">
<div id="deploymentcontainer_1_1">
<h5>Deploymentdaten (1)</h5>
<div class="form-group col-sm-offset-1 panel-body">
<span class="form-group">
<label class="control-label" for="dep_sys">Deployment Layer:</label>
<input type="text" class="form-control" name="dep_lay|1|1" placeholder="">
</span>
<span class="form-group">
<label class="control-label" for="dep_rte">RTE:</label>
<input type="text" class="form-control" name="dep_rte|1|1" placeholder="">
</span>
<span class="form-group">
<label class="control-label" for="dep_port">Port:</label>
<input type="text" class="form-control" name="dep_port|1|1" placeholder="">
</span>
</div><!--innere Artefakte -->
<div class="form-group col-sm-offset-1 panel-body">
<div class="panel panel-default"> <!--Artefakte-->
<div id="gesamtcontainer_InnerArtefakte1_1">
<div id="InnerArtefaktcontainer_1_1_1">
<h5>Zugeordnetes Artefakt (1)</h5>
<div class="form-group col-sm-offset-1 panel-body">
<span class="form-group">
<label class="control-label" for="art_Name">Artefaktname:</label>
<input type="text" class="form-control" name="art_Name|1|1|1" placeholder="">
</span>
<span class="form-group">
<label class="control-label" for="art_Lizenz">Lizenz:</label>
<input type="text" class="form-control" name="art_Lizenz|1|1|1" placeholder="">
</span>
<span class="form-group">
<label class="control-label" for="art_sonst">Sonstiges:</label>
<input type="text" class="form-control" name="art_sonst|1|1|1" placeholder="">
</span>
</div>
<hr/>
</div>
<input type="hidden" id="NumberOfInnerArtefakte_1_1" name="NumberOfInnerArtefakte|1|1" value="1">
</div>
<span class="input-group-btn"> <!--innere Buttons-->
<button type="button" class="btn btn-danger btn-number_inner" onclick="inner2_button_clicked(this);" data-type="plus_inner2" value="1|1|1"> <!--outer|inner|2inner-->
<span class="glyphicon glyphicon-plus"></span>
</button>
<button type="button" class="btn btn-danger btn-number_inner" onclick="inner2_button_clicked(this);" data-type="minus_inner2" value="1|1|1">
<span class="glyphicon glyphicon-minus"></span>
</button>
</span>
</div>
</div>
<hr/>
</div>
<input type="hidden" id="NumberOfDeployments_1" name="NumberOfDeployments|1" value="1">
</div>
<span class="input-group-btn"> <!--mittlere Buttons-->
<button type="button" class="btn btn-info btn-number_middle" onclick="middle_button_clicked(this);" data-type="plus_inner" value="1|1"> <!--outer|inner-->
<span class="glyphicon glyphicon-plus"></span>
</button>
<button type="button" class="btn btn-info btn-number_middle" onclick="middle_button_clicked(this);" data-type="minus_inner" value="1|1">
<span class="glyphicon glyphicon-minus"></span>
</button>
</span>
</div>
</div>
<hr/>
</div>
</div>
<span class="input-group-btn"> <!--äußere Buttons-->
<button type="button" class="btn btn-warning btn-number_outer" data-type="plus_outer">
<span class="glyphicon glyphicon-plus"></span>
</button>
<button type="button" class="btn btn-warning btn-number_outer" data-type="minus_outer">
<span class="glyphicon glyphicon-minus"></span>
</button>
</span>
<input type="hidden" id="NumberOfInstances" name="NumberOfInstances" value="1">
</div>
<div class="form-group col-md-4 text-center">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
</div>
</div>
<!-- /.container -->
<script type="text/javascript">
var $currentNode_outer = 1;
//plugin bootstrap minus and plus (outer)
$('.btn-number_outer').click(function(e){
if(this.getAttribute("data-type") == "plus_outer")
{
$currentNode_outer++;
var neueInstanz = $(''+
' <div id="instanzcontainer'+$currentNode_outer+'">'+
' <h5>Serverdaten ('+$currentNode_outer+')</h5>'+
' <div class="form-group col-sm-offset-1 panel-body"> '+
' <span class="form-group">'+
' <label class="control-label" for="ser_hw">Hardware:</label>'+
' <input type="text" class="form-control" name="ser_hw|'+$currentNode_outer+'" placeholder=""><br/>'+
' </span><br/>'+
' <span class="form-group">'+
' <label class="control-label" for="ser_name">Servername:</label>'+
' <input type="text" class="form-control" name="ser_name|'+$currentNode_outer+'" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="ser_zone">Zone:</label>'+
' <input type="text" class="form-control" name="ser_zone|'+$currentNode_outer+'" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="ser_os">Betriebssystem:</label>'+
' <input type="text" class="form-control" name="ser_os|'+$currentNode_outer+'" placeholder="">'+
' </span>'+
' </div> '+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <div class="panel panel-default"> <!--Deployment-->'+
' <div id="gesamtcontainer_deployment'+$currentNode_outer+'">'+
' <div id="deploymentcontainer_'+$currentNode_outer+'_1">'+
' <h5>Deploymentdaten (1)</h5>'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <span class="form-group">'+
' <label class="control-label" for="dep_sys">Deployment Layer:</label>'+
' <input type="text" class="form-control" name="dep_lay|'+$currentNode_outer+'|1" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="dep_rte">RTE:</label>'+
' <input type="text" class="form-control" name="dep_rte|'+$currentNode_outer+'|1" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="dep_port">Port:</label>'+
' <input type="text" class="form-control" name="dep_port|'+$currentNode_outer+'|1" placeholder="">'+
' </span>'+
' </div><!--Artefakte -->'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <div class="panel panel-default"> <!--Artefakte-->'+
' <div id="gesamtcontainer_InnerArtefakte'+$currentNode_outer+'_1">'+
' <div id="InnerArtefaktcontainer_'+$currentNode_outer+'_1_1">'+
' <h5>Zugeordnetes Artefakt (1)</h5>'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <span class="form-group">'+
' <label class="control-label" for="art_Name">Artefaktname:</label>'+
' <input type="text" class="form-control" name="art_Name|'+$currentNode_outer+'|1|1" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="art_Lizenz">Lizenz:</label>'+
' <input type="text" class="form-control" name="art_Lizenz|'+$currentNode_outer+'|1|1" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="art_sonst">Sonstiges:</label>'+
' <input type="text" class="form-control" name="art_sonst|'+$currentNode_outer+'|1|1" placeholder="">'+
' </span>'+
' </div>'+
' <hr/>'+
' </div>'+
' <input type="hidden" id="NumberOfInnerArtefakte_'+$currentNode_outer+'_1" name="NumberOfInnerArtefakte|'+$currentNode_outer+'|1" value="1">'+
' </div>'+
' <span class="input-group-btn"> <!--innere Buttons-->'+
' <button type="button" class="btn btn-danger btn-number_inner" onclick="inner2_button_clicked(this);" data-type="plus_inner2" value="'+$currentNode_outer+'|1|1"> <!--outer|inner|2inner-->'+
' <span class="glyphicon glyphicon-plus"></span>'+
' </button>'+
' <button type="button" class="btn btn-danger btn-number_inner" onclick="inner2_button_clicked(this);" data-type="minus_inner2" value="'+$currentNode_outer+'|1|1">'+
' <span class="glyphicon glyphicon-minus"></span>'+
' </button>'+
' </span> '+
' </div>'+
' </div>'+
' <hr/>'+
' </div>'+
' <input type="hidden" id="NumberOfDeployments_'+$currentNode_outer+'" name="NumberOfDeployments|'+$currentNode_outer+'" value="1">'+
' </div>'+
' <span class="input-group-btn"> <!--mittlere Buttons-->'+
' <button type="button" class="btn btn-info btn-number_middle" onclick="middle_button_clicked(this);" data-type="plus_inner" value="'+$currentNode_outer+'|1"> <!--outer|inner-->'+
' <span class="glyphicon glyphicon-plus"></span>'+
' </button>'+
' <button type="button" class="btn btn-info btn-number_middle" onclick="middle_button_clicked(this);" data-type="minus_inner" value="'+$currentNode_outer+'|1">'+
' <span class="glyphicon glyphicon-minus"></span>'+
' </button>'+
' </span> '+
' </div>'+
' </div>'+
' <hr/>'+
'</div> '+
'');
$('#gesamtcontainer_instanzen').append(neueInstanz); // put it into the DOM
$("#NumberOfInstances").val($currentNode_outer); //Anzahl Instanzen zählen (+)
}
else{
if(this.getAttribute("data-type") == "minus_outer")
{
if($currentNode_outer > 1)
{
$('#instanzcontainer'+$currentNode_outer+'').remove();
$currentNode_outer--;
$("#NumberOfInstances").val($currentNode_outer); //Anzahl Instanzen zählen (-)
}
}
}
});
//plugin bootstrap minus and plus (inner)
function middle_button_clicked(elem)
{
$contextNode_outer = elem.getAttribute("value").split("|")[0]; //Wert auf dem plus/minus; zu Beginn der Wert von $currentNode_outer (outer)
$currentNode_inner = elem.getAttribute("value").split("|")[1]; //Wert auf dem plus/minus; zu Beginn 1 (inner)
if(elem.getAttribute("data-type") == "plus_inner")
{
$currentNode_inner++;
var neuesArtefakt = $(''+
' <div id="deploymentcontainer_'+$contextNode_outer+'_'+$currentNode_inner+'">'+
' <h5>Deploymentdaten ('+$currentNode_inner+')</h5>'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <span class="form-group">'+
' <label class="control-label" for="dep_sys">Deployment Layer:</label>'+
' <input type="text" class="form-control" name="dep_lay|'+$contextNode_outer+'|'+$currentNode_inner+'" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="dep_rte">RTE:</label>'+
' <input type="text" class="form-control" name="dep_rte|'+$contextNode_outer+'|'+$currentNode_inner+'" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="dep_port">Port:</label>'+
' <input type="text" class="form-control" name="dep_port|'+$contextNode_outer+'|'+$currentNode_inner+'" placeholder="">'+
' </span>'+
' </div><!--Artefakte -->'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <div class="panel panel-default"> <!--Artefakte-->'+
' <div id="gesamtcontainer_InnerArtefakte'+$contextNode_outer+'_'+$currentNode_inner+'">'+
' <div id="InnerArtefaktcontainer_'+$contextNode_outer+'_'+$currentNode_inner+'_1">'+
' <h5>Zugeordnetes Artefakt (1)</h5>'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <span class="form-group">'+
' <label class="control-label" for="art_Name">Artefaktname:</label>'+
' <input type="text" class="form-control" name="art_Name|'+$contextNode_outer+'|'+$currentNode_inner+'|1" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="art_Lizenz">Lizenz:</label>'+
' <input type="text" class="form-control" name="art_Lizenz|'+$contextNode_outer+'|'+$currentNode_inner+'|1" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="art_sonst">Sonstiges:</label>'+
' <input type="text" class="form-control" name="art_sonst|'+$contextNode_outer+'|'+$currentNode_inner+'|1" placeholder="">'+
' </span>'+
' </div>'+
' <hr/>'+
' </div>'+
' <input type="hidden" id="NumberOfInnerArtefakte_'+$contextNode_outer+'_'+$currentNode_inner+'" name="NumberOfInnerArtefakte|'+$contextNode_outer+'|'+$currentNode_inner+'" value="1">'+
' </div>'+
' <span class="input-group-btn"> <!--innere Buttons-->'+
' <button type="button" class="btn btn-danger btn-number_inner" onclick="inner2_button_clicked(this);" data-type="plus_inner2" value="'+$contextNode_outer+'|'+$currentNode_inner+'|1"> <!--outer|inner|2inner-->'+
' <span class="glyphicon glyphicon-plus"></span>'+
' </button>'+
' <button type="button" class="btn btn-danger btn-number_inner" onclick="inner2_button_clicked(this);" data-type="minus_inner2" value="'+$contextNode_outer+'|'+$currentNode_inner+'|1">'+
' <span class="glyphicon glyphicon-minus"></span>'+
' </button>'+
' </span> '+
' </div>'+
' </div>'+
' <hr/>'+
' </div> '+
'');
$('#gesamtcontainer_deployment'+$contextNode_outer+'').append(neuesArtefakt); // put it into the DOM
$(elem).val($contextNode_outer+"|"+$currentNode_inner);
$(elem).next(".btn-number_middle").val($contextNode_outer+"|"+$currentNode_inner); //value auf dem "-" Button setzen
$('#NumberOfDeployments_'+$contextNode_outer+'').val($currentNode_inner); //Anzahl Instanzen zählen (+)
}
else{
if(elem.getAttribute("data-type") == "minus_inner")
{
if($currentNode_inner > 1)
{
$('#deploymentcontainer_'+$contextNode_outer+'_'+$currentNode_inner+'').remove();
$currentNode_inner--;
$(elem).val($contextNode_outer+"|"+$currentNode_inner);
$(elem).prev(".btn-number_middle").val($contextNode_outer+"|"+$currentNode_inner); //value auf dem "+" Button setzen
$('#NumberOfDeployments_'+$contextNode_outer+'').val($currentNode_inner); //Anzahl Instanzen zählen (-)
}
}
}
};
//plugin bootstrap minus and plus (inner_inner)
function inner2_button_clicked(elem)
{
$contextNode_outer = elem.getAttribute("value").split("|")[0]; //Wert auf dem plus/minus; zu Beginn der Wert von $currentNode_outer (outer)
$contextNode_inner = elem.getAttribute("value").split("|")[1]; //Wert auf dem plus/minus; zu Beginn der Wert von $currentNode_inner (inner)
$currentNode_inner2 = elem.getAttribute("value").split("|")[2]; //Wert auf dem plus/minus; zu Beginn 1 (inner_inner)
if(elem.getAttribute("data-type") == "plus_inner2")
{
$currentNode_inner2++;
var neuesInnerArtefakt = $(''+
' <div id="InnerArtefaktcontainer_'+$contextNode_outer+'_'+$contextNode_inner+'_'+$currentNode_inner2+'">'+
' <h5>Zugeordnetes Artefakt ('+$currentNode_inner2+')</h5>'+
' <div class="form-group col-sm-offset-1 panel-body">'+
' <span class="form-group">'+
' <label class="control-label" for="art_Name">Artefaktname:</label>'+
' <input type="text" class="form-control" name="art_Name|'+$contextNode_outer+'|'+$contextNode_inner+'|'+$currentNode_inner2+'" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="art_Lizenz">Lizenz:</label>'+
' <input type="text" class="form-control" name="art_Lizenz|'+$contextNode_outer+'|'+$contextNode_inner+'|'+$currentNode_inner2+'" placeholder="">'+
' </span>'+
' <span class="form-group">'+
' <label class="control-label" for="art_sonst">Sonstiges:</label>'+
' <input type="text" class="form-control" name="art_sonst|'+$contextNode_outer+'|'+$contextNode_inner+'|'+$currentNode_inner2+'" placeholder="">'+
' </span>'+
' </div>'+
' <hr/>'+
' </div>'+
'');
$('#gesamtcontainer_InnerArtefakte'+$contextNode_outer+'_'+$contextNode_inner).append(neuesInnerArtefakt); // put it into the DOM
$(elem).val($contextNode_outer+"|"+$contextNode_inner+"|"+$currentNode_inner2); //value auf dem "+" Button (also auf sich selbst) setzen
$(elem).next(".btn-number_inner").val($contextNode_outer+"|"+$contextNode_inner+"|"+$currentNode_inner2); //value auf dem "-" Button setzen
$('#NumberOfInnerArtefakte_'+$contextNode_outer+'_'+$contextNode_inner).val($currentNode_inner2); //Anzahl Instanzen zählen (+)
}
else{
if(elem.getAttribute("data-type") == "minus_inner2")
{
if($currentNode_inner2 > 1)
{
$('#InnerArtefaktcontainer_'+$contextNode_outer+'_'+$contextNode_inner+'_'+$currentNode_inner2).remove();
$currentNode_inner2--;
$(elem).val($contextNode_outer+"|"+$contextNode_inner+"|"+$currentNode_inner2);
$(elem).prev(".btn-number_inner").val($contextNode_outer+"|"+$contextNode_inner+"|"+$currentNode_inner2); //value auf dem "+" Button setzen
$('#NumberOfInnerArtefakte_'+$contextNode_outer+'_'+$contextNode_inner).val($currentNode_inner2); //Anzahl Instanzen zählen (-)
}
}
}
console.log($contextNode_outer+'_'+$contextNode_inner+'_'+$currentNode_inner2)
};
</script>
</body>
</html>