forked from serverlessworkflow/serverlessworkflow.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.html
More file actions
262 lines (237 loc) · 11.6 KB
/
editor.html
File metadata and controls
262 lines (237 loc) · 11.6 KB
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
<!DOCTYPE html>
<!--
Copyright 2021 The Serverless Workflow Specification Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/png" href="img/sw-logo-header.png">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
<link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@1,400;1,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" data-name="vs/editor/editor.main" href="css/editor/editor.main.css"/>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-169200952-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-169200952-1');
</script>
<script src="./js/serverlessWorkflowSdk.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
mermaid.mermaidAPI.initialize({
startOnLoad: false
});
</script>
<title>Serverless Workflow Online Editor</title>
</head>
<body id="page-top">
<nav
id="localnav"
class="localnav theme-dark localnav-scrim"
data-sticky
aria-label="Global"
role="navigation">
<div class="localnav-wrapper">
<div class="localnav-background"></div>
<div class="localnav-content">
<div class="localnav-title">
<a href="https://github.com/serverlessworkflow" target="_blank" class="icon-wrapper">
<span class="fa fa-github" style="color: #ffffff;"></span>
<span>GitHub</span>
</a>
</div>
<ul class="localnav-menu">
<li class="localnav-menu-tray">
<ul class="localnav-menu-items">
<li class="localnav-menu-item">
<a class="localnav-menu-link" href="/""
target="_blank">Home</a>
</li>
<li class="localnav-menu-item">
<a class="localnav-menu-link" href="community.html">Community</a>
</li>
<li class="localnav-menu-item">
<a class="localnav-menu-link" href="https://cloud-native.slack.com/archives/CMBAZQSEP"
target="_blank">Slack</a>
</li>
<li class="localnav-menu-item">
<a class="localnav-menu-link" href='https://twitter.com/cncfworkflow' target="_blank">Twitter</a>
</li>
<li class="localnav-menu-item">
<a class="localnav-menu-link"
href='https://www.youtube.com/channel/UCQ080N6AqM_k-7itU6rSqZQ'
target="_blank">YouTube</a>
</li>
</ul>
</li>
<li class="localnav-actions localnav-actions-center">
<div class="localnav-action localnav-action-menucta" aria-hidden="true">
<label for="localnav-menustate" class="localnav-menucta">
<span class="localnav-menuicon-bread localnav-menuicon-bread-top">
<span class="localnav-menuicon-bread-crust localnav-menuicon-bread-crust-top"></span>
</span>
<span class="localnav-menuicon-bread localnav-menuicon-bread-bottom">
<span class="localnav-menuicon-bread-crust localnav-menuicon-bread-crust-bottom"></span>
</span>
</label>
</div>
</li>
</ul>
</div>
</div>
</nav>
<section id="swonlineeditor" style="padding: 20px;">
<div class="container">
<h2>Serverless Workflow Web Editor</h2>
<hr class="hr-short"/>
Edit your workflow and select the "Generate workflow diagram" button to update the image.
<br/>You can also select one of the existing workflow examples from the dropdown.
<br/><br/>
<p class="lead">
<div class="row">
<div class="col-sm-6">
<div class="card">
<div class="card-body">
<p class="card-title">
<select id="examples" name="examples" onchange="selectExample(this.value);">
<option value='' selected>Select an existing workflow example</option>
<option value='helloworld'>Hello World Example</option>
<option value='parallelexecution'>Parallel execution example</option>
<option value='eventbaseddecisions'>Event-based decisions example</option>
<option value='provisionorders'>Provision orders Example</option>
<option value='monitorjobs'>Monitor jobs example</option>
<option value='vetappointment'>Vet appointment example</option>
<option value='monitorvitals'>Monitor patient vitals example</option>
<option value="customeremail">Customer email example (async)</option>
<option value="newitempurchase">New item purchase example (compensation)</option>
<option value="checkinbox">Check Inbox periodicall (cron)</option>
</select>
<select id="theme" name="theme" onchange="changeTheme(this.value);">
<option value='' selected>Change editor color theme</option>
<option value='vs'>Default</option>
<option value='vs-dark'>Dark</option>
<option value='hc-black'>High Contrast Dark</option>
</select>
</p>
<div id="sweditor" style="width: 100%; height: 600px; border: 1px solid grey"></div>
<br/>
</div>
</div>
</div>
<div class="col-sm-6" style="border: 0px solid">
<div class="card">
<div class="card-body">
<h5 class="card-title">
<a href="#" class="btn btn-primary btn-sm"
onclick="generateDiagram(this.value);return false;">Generate
workflow diagram</a></h5>
<br/><br/>
<div class="workflowdiagram">
<br/>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<footer id="footer" class="footer" role="contentinfo" aria-labelledby="footer-label">
<div class="footer-content">
<nav class="footer-breadcrumbs" aria-label="breadcrumb" role="navigation">
<div class="footer-breadcrumbs-path">
Proud to be supported by:<br/><br/>
<a href="https://www.cncf.io/" target="_blank"><img src="img/cncf-color.png" width="15%"/></a>
<a href="https://netlify.com/" target="_blank"><img src="img/netlify-logo-full.png" width="10%"/></a>
<a href="https://restream.io/" target="_blank"><img src="img/restream-logo.png" width="10%"/></a>
</div>
</nav>
<section class="footer-mini" vocab="http://schema.org/" typeof="Organization">
<div class="footer-mini-legal">
<div class="footer-mini-legal-copyright">Copyright © 2022 Serverless Workflow Specification Authors
<br/>Documentation Distributed under CC-BY-4.0
</div>
<ul class="footer-mini-legal-links">
<li><a class="footer-mini-legal-link"
href="https://github.com/serverlessworkflow/specification/blob/main/LICENSE" target="_blank">License</a>
</li>
<li><a class="footer-mini-legal-link"
href="https://github.com/serverlessworkflow/specification/blob/main/code-of-conduct.md"
target="_blank">Code Of Conduct</a></li>
<li><a class="footer-mini-legal-link"
href="https://github.com/serverlessworkflow/specification/blob/main/contributing.md"
target="_blank">Contributing</a></li>
<li><a class="footer-mini-legal-link" href="mailto:serverlessworkflow@gmail.com">Contact</a></li>
</ul>
</div>
</section>
</div>
</footer>
<script>
var require = {paths: {vs: 'min/vs'}};
</script>
<script src="js/loader.js"></script>
<script src="js/editor.main.nls.js"></script>
<script src="js/editor.main.js"></script>
<script src="js/sweditor.js"></script>
<script>
var jsonCode = [
'{',
"}"
].join('\n');
var modelUri = monaco.Uri.parse("https://serverlessworkflow.io/schemas/0.8/workflow.json");
var model = monaco.editor.createModel(JSON.stringify(helloWorldExample, null, 2), "json", modelUri);
// configure the JSON language support with schemas and schema associations
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true, allowComments: false,
schemas: [{
uri: "https://serverlessworkflow.io/schemas/0.8/workflow.json",
fileMatch: [modelUri.toString()]
}], enableSchemaRequest: true
});
monaco.editor.create(document.getElementById("sweditor"), {
model: model
});
generateDiagram();
</script>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script>
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
};
function selectElement(id, valueToSelect) {
let element = document.getElementById(id);
element.value = valueToSelect;
}
var exampleId = getUrlParameter('exampleid');
if(exampleId) {
selectElement('examples', exampleId)
selectExample(exampleId);
}
</script>
</body>
</html>