-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (56 loc) · 1.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
<!DOCTYPE html>
<html>
<head>
<title>Visual Flow Creator</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"
integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./dist/visualflow.css" />
<script src="./dist/visualflow.min.js"></script>
<script src="./packages/core/dist/visualflow-core.min.js"></script>
</head>
<body>
<div style="position:fixed;z-index:999;left:10px;bottom:5px;">
https://github.com/devhau/visualflow<br />
https://visualflow.cc
</div>
<div id="flow"></div>
</body>
<script>
let optionFlow = {
properties: {
name: {
default: ""
},
},
control: {}
}
visualflow_core.workerManager.getControlNodes().forEach((item) => {
optionFlow.control[item.key] = item;
})
let flow = (new visualflow.VisualFlow(document.getElementById("flow")));
flow.setOption(optionFlow, false);
flow.newSolution();
flow.callbackRunProject((data, callbackEnd) => {
console.log(data);
setTimeout(() => {
visualflow_core.workerManager.LoadData(data).excute();
callbackEnd?.();
});
})
flow.callbackStopProject(() => {
visualflow_core.workerManager.stop();
})
visualflow_core.workerManager.on('worker_end', () => {
flow.setRunning(false);
});
visualflow_core.workerManager.on('node_end', ({ node }) => {
console.log('node_end');
console.log(node);
});
visualflow_core.workerManager.on('node_start', ({ node }) => {
console.log('node_begin');
console.log(node);
});
</script>
</html>