-
Notifications
You must be signed in to change notification settings - Fork 1
/
index-credentials.html
105 lines (88 loc) · 3.26 KB
/
index-credentials.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
<!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>
<div id="canvas">
</div>
<script 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/js-yaml.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/credentials.js"></script>
<script>
var dam;
var topology;
var canvas = Canvas();
$(document).ready(function() {
canvas.init("canvas", {
addlinkcallback : Credentials.addlinkcallback
});
$.get("resources/dam.yml", function(data) {
dam = jsyaml.safeLoad(data);
topology = Credentials.to_topology(dam);
Credentials.init(canvas);
Credentials.fromjson(topology);
canvas.restart();
});
$("#show-dam").click(function() {
console.log(jsyaml.safeDump(Credentials.store_credentials_in_dam(dam)));
});
// canvas.linknodes(n0, n1).behaviour = Credentials.LinkBehaviour;
// canvas.linknodes(n1, n2).behaviour = Credentials.LinkBehaviour;
// canvas.linknodes(n1, c0, "hostedon");
// canvas.linknodes(n0, c0, "hostedon");
// canvas.linknodes(n2, c1, "hostedon");
});
</script>
<div class="modal fade" id="edit-credentials-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">Edit...</h4>
</div>
<div class="modal-body">
<form role="form">
<fieldset id="set-apikey">
<legend>API Key <a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="apikey-apikey">API Key</label>
<input type="text"class="form-control" id="apikey-apikey">
</div>
</fieldset>
<fieldset id="set-userpwd">
<legend>User/Password<a href="#"><i class="fa fa-chevron-down"> </i></a></legend>
<div class="form-group">
<label for="user">User</label>
<input type="text"class="form-control" id="userpwd-user">
</div>
<div class="form-group">
<label for="user">Password</label>
<input type="text"class="form-control" id="userpwd-pwd">
</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>
<button id="show-dam">Inject credentials</button>