-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
120 lines (112 loc) · 3.79 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<title>Fusebit Editor Demo</title>
<style>
html,body {
width: 100%;
height: 100%;
background: gray;
font-family: Helvetica, Arial, sans-serif;
}
#container {
width:1000px;
margin-top:30px;
margin-left:auto;
margin-right:auto;
}
#toolbar {
height: 40px;
width: 100%;
background-color: white;
border-bottom: 4px solid #ebedef;
vertical-align: middle;
display: flex;
align-items: center;
padding: 10px;
box-sizing: border-box;
justify-content: space-between;
}
#status {
width:100%;
height: 40px;
background-color: white;
border-bottom: 4px solid #ebedef;
border-top: 4px solid #ebedef;
vertical-align: middle;
display: flex;
align-items: center;
padding: 10px;
box-sizing: border-box;
}
#editor {
width:100%;
height:450px;
}
#logs-container{
width:100%;
height:100px;
}
</style>
<link type="text/css" rel="stylesheet" href="fusebit-custom.css" />
</head>
<body>
<div id="container">
<div id="toolbar">
Custom toolbar
<div>
<button onclick="handleSave()">Save</button>
<button onclick="handleRun()">Run</button>
</div>
</div>
<div id="editor"></div>
<div id="status">Custom status bar</div>
<div id="logs-container" class="fusebit-theme-custom">
<div id="logs" class="fusebit-logs-container" ></div>
</div>
</div>
</body>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-editor/1/4/0/fusebit-editor.min.js"></script>
<script type="text/javascript">
var editorContext = undefined;
function handleSave() {
return editorContext
? editorContext.saveFunction()
: alert('Editor not initialized');
}
function handleRun() {
return editorContext
? editorContext.runFunction()
: alert('Editor not initialized');
}
// Create the Fusebit Editor without the logs, status, and action panel
fusebit.createEditor(document.getElementById('editor'), 'demo-boundary', 'demo-function', {
accountId: '{accountId}', // e.g. acc-9d9341ea356841ed
subscriptionId: '{subscriptionId}', // e.g. sub-ed9d9341ea356841
baseUrl: '{baseUrl}', // e.g. https://stage.us-west-2.fusebit.io
accessToken: '{accessToken}', // e.g. eyJhbGciOiJSUz...
}, {
template: {},
editor: {
theme: 'custom',
actionPanel: false, // hide action panel
statusPanel: false, // hide status panel
logsPanel: false, // hide logs panel
navigationPanel: {
hideConfigurationSettings: true, // hide configuration settings
hideScheduleSettings: true, // hide scheduler settings
hideRunnerTool: true, // hide runner settings
}
},
}).then(editorContext => {
// Create a separate logs panel using the same EditorContext
fusebit.createLogsPanel(document.getElementById('logs'), editorContext, {
theme: 'custom'
});
window.editorContext = editorContext;
});
</script>
</html>