-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
54 lines (51 loc) · 1.24 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
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="main.css">
<script src="wasm_exec.js"></script>
<script src="viz.js"></script>
<script src="full.render.js"></script>
<script>
const go = new Go()
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
go.run(result.instance)
});
</script>
</head>
<body>
<header>
<h1>Dockerfile Dependency graph</h1>
<a href="https://github.com/po3rin/dockerdot"><img id="repo" src="static/github.png"></a>
</header>
<div>
<textarea id="textarea">
FROM golang:1.12 AS stage0
WORKDIR /go
ADD ./ /go
RUN go build -o stage0_bin
FROM golang:1.12 AS stage1
WORKDIR /go
ADD ./ /go
RUN go build -o stage1_bin
FROM golang:1.12
COPY --from=stage0 /go/stage0_bin /
COPY --from=stage1 /go/stage1_bin /
</textarea>
</div>
<button id="button">check !!!</button>
<div id="graph"></div>
</body>
<script>
let viz = new Viz()
graph = document.getElementById("graph")
showGraph = (dot) => {
viz.renderSVGElement(dot).then((element)=> {
if (graph.lastChild){
graph.removeChild(graph.lastChild)
}
graph.appendChild(element)
})
}
</script>
</html>