ivoryos 1.0.8__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ivoryos might be problematic. Click here for more details.
- ivoryos/__init__.py +19 -7
- ivoryos/routes/api/api.py +109 -0
- ivoryos/routes/auth/auth.py +5 -5
- ivoryos/routes/control/control.py +55 -353
- ivoryos/routes/control/control_file.py +36 -0
- ivoryos/routes/control/control_new_device.py +142 -0
- ivoryos/routes/control/templates/controllers.html +137 -0
- ivoryos/routes/control/templates/controllers_new.html +112 -0
- ivoryos/routes/control/utils.py +38 -0
- ivoryos/routes/data/data.py +108 -0
- ivoryos/routes/{database/templates/database → data/templates}/workflow_database.html +7 -7
- ivoryos/routes/{database/templates/database → data/templates}/workflow_view.html +3 -3
- ivoryos/routes/design/__init__.py +4 -0
- ivoryos/routes/design/design.py +96 -517
- ivoryos/routes/design/design_file.py +57 -0
- ivoryos/routes/design/design_step.py +43 -0
- ivoryos/routes/design/templates/components/action_form.html +52 -0
- ivoryos/routes/design/templates/components/action_list.html +15 -0
- ivoryos/routes/design/templates/components/autofill_toggle.html +14 -0
- ivoryos/routes/design/templates/components/canvas.html +14 -0
- ivoryos/routes/design/templates/components/canvas_footer.html +5 -0
- ivoryos/routes/design/templates/components/canvas_header.html +54 -0
- ivoryos/routes/design/templates/components/deck_selector.html +12 -0
- ivoryos/routes/design/templates/components/edit_action_form.html +29 -0
- ivoryos/routes/design/templates/components/instrument_panel.html +23 -0
- ivoryos/routes/design/templates/components/modals/drop_modal.html +19 -0
- ivoryos/routes/design/templates/components/modals/json_modal.html +22 -0
- ivoryos/routes/design/templates/components/modals/new_script_modal.html +18 -0
- ivoryos/routes/design/templates/components/modals/rename_modal.html +23 -0
- ivoryos/routes/design/templates/components/modals/saveas_modal.html +27 -0
- ivoryos/routes/design/templates/components/modals.html +6 -0
- ivoryos/routes/design/templates/components/operations_panel.html +43 -0
- ivoryos/routes/design/templates/components/python_code_overlay.html +17 -0
- ivoryos/routes/design/templates/components/script_info.html +31 -0
- ivoryos/routes/design/templates/components/scripts.html +50 -0
- ivoryos/routes/design/templates/components/sidebar.html +16 -0
- ivoryos/routes/design/templates/components/text_to_code_panel.html +20 -0
- ivoryos/routes/design/templates/experiment_builder.html +41 -0
- ivoryos/routes/execute/__init__.py +0 -0
- ivoryos/routes/execute/execute.py +173 -0
- ivoryos/routes/execute/execute_file.py +44 -0
- ivoryos/routes/execute/templates/components/error_modal.html +20 -0
- ivoryos/routes/execute/templates/components/logging_panel.html +31 -0
- ivoryos/routes/execute/templates/components/progress_panel.html +27 -0
- ivoryos/routes/execute/templates/components/run_panel.html +9 -0
- ivoryos/routes/execute/templates/components/run_tabs.html +17 -0
- ivoryos/routes/execute/templates/components/tab_bayesian.html +147 -0
- ivoryos/routes/execute/templates/components/tab_configuration.html +98 -0
- ivoryos/routes/execute/templates/components/tab_repeat.html +14 -0
- ivoryos/routes/execute/templates/experiment_run.html +294 -0
- ivoryos/routes/library/__init__.py +0 -0
- ivoryos/routes/{database/database.py → library/library.py} +10 -112
- ivoryos/routes/{database/templates/database/scripts_database.html → library/templates/library.html} +8 -8
- ivoryos/routes/main/main.py +1 -1
- ivoryos/routes/main/templates/{main/home.html → home.html} +4 -4
- ivoryos/socket_handlers.py +52 -0
- ivoryos/templates/base.html +4 -4
- ivoryos/utils/bo_campaign.py +43 -3
- ivoryos/utils/form.py +1 -0
- ivoryos/utils/py_to_json.py +225 -0
- ivoryos/utils/script_runner.py +30 -7
- ivoryos/version.py +1 -1
- {ivoryos-1.0.8.dist-info → ivoryos-1.1.0.dist-info}/METADATA +5 -8
- ivoryos-1.1.0.dist-info/RECORD +102 -0
- ivoryos/routes/control/templates/control/controllers.html +0 -78
- ivoryos/routes/control/templates/control/controllers_home.html +0 -55
- ivoryos/routes/control/templates/control/controllers_new.html +0 -89
- ivoryos/routes/design/templates/design/experiment_builder.html +0 -521
- ivoryos/routes/design/templates/design/experiment_run.html +0 -558
- ivoryos-1.0.8.dist-info/RECORD +0 -61
- /ivoryos/routes/auth/templates/{auth/login.html → login.html} +0 -0
- /ivoryos/routes/auth/templates/{auth/signup.html → signup.html} +0 -0
- /ivoryos/routes/{database → data}/__init__.py +0 -0
- /ivoryos/routes/{database/templates/database → data/templates/components}/step_card.html +0 -0
- /ivoryos/routes/main/templates/{main/help.html → help.html} +0 -0
- {ivoryos-1.0.8.dist-info → ivoryos-1.1.0.dist-info}/LICENSE +0 -0
- {ivoryos-1.0.8.dist-info → ivoryos-1.1.0.dist-info}/WHEEL +0 -0
- {ivoryos-1.0.8.dist-info → ivoryos-1.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
{% extends 'base.html' %}
|
|
2
|
-
{% block title %}IvoryOS | Design{% endblock %}
|
|
3
|
-
|
|
4
|
-
{% block body %}
|
|
5
|
-
{# overlay block for text-to-code gen #}
|
|
6
|
-
<style>
|
|
7
|
-
.code-overlay {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 0;
|
|
10
|
-
right: -50%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 50%;
|
|
13
|
-
z-index: 100;
|
|
14
|
-
background: #f8f9fa;
|
|
15
|
-
box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
|
|
16
|
-
transition: right 0.3s ease;
|
|
17
|
-
overflow-y: auto;
|
|
18
|
-
}
|
|
19
|
-
.code-overlay.show {
|
|
20
|
-
right: 0;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
<div id="overlay" class="overlay">
|
|
24
|
-
<div>
|
|
25
|
-
<h3 id="overlay-text">Generating design, please wait...</h3>
|
|
26
|
-
<div class="spinner-border" role="status"></div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div class="row">
|
|
31
|
-
<div class="col-md-3 scroll-column" >
|
|
32
|
-
|
|
33
|
-
{# select deck if this is online#}
|
|
34
|
-
{% if off_line %}
|
|
35
|
-
<form id="select-deck" method="POST" action="{{ url_for('design.import_pseudo') }}" enctype="multipart/form-data">
|
|
36
|
-
<div class="input-group mb-3">
|
|
37
|
-
{# <label for="pkl_name" class="form-label">Choose/Change deck:</label>#}
|
|
38
|
-
<select class="form-select" name="pkl_name" id="pkl_name" required onchange="document.getElementById('select-deck').submit();">
|
|
39
|
-
<option {{ '' if 'pseudo_deck' in session else 'selected' }} disabled hidden style="overflow-wrap: break-word;" name="pkl_name" id="pkl_name" value=""> -- choose deck --</option>
|
|
40
|
-
{% for connection in history %}
|
|
41
|
-
<option {{ 'selected' if session['pseudo_deck']==connection else '' }} style="overflow-wrap: break-word;" name="pkl_name" id="pkl_name" value="{{connection}}">{{connection.split('.')[0]}}</option>
|
|
42
|
-
{% endfor %}
|
|
43
|
-
</select>
|
|
44
|
-
</div>
|
|
45
|
-
</form>
|
|
46
|
-
<hr>
|
|
47
|
-
{% endif %}
|
|
48
|
-
|
|
49
|
-
{# edit action #}
|
|
50
|
-
{% if session["edit_action"] %}
|
|
51
|
-
{% with action = session["edit_action"] %}
|
|
52
|
-
<h5> {{ format_name(action['action']) }} </h5>
|
|
53
|
-
<form role="form" method='POST' name="{{instrument}}" action="{{ url_for('design.edit_action', uuid=session["edit_action"]['uuid']) }}">
|
|
54
|
-
{% if not action['args'] == None %}
|
|
55
|
-
<div class="form-group">
|
|
56
|
-
{% if not action['args'].__class__.__name__ == 'dict' %}
|
|
57
|
-
<div class="input-group mb-3">
|
|
58
|
-
<label class="input-group-text">{{ action['action'] }}</label>
|
|
59
|
-
<input class="form-control" type="text" id="arg" name="arg" placeholder="{{ action['arg_types']}}" value="{{ action['args'] }}" aria-labelledby="variableHelpBlock">
|
|
60
|
-
</div>
|
|
61
|
-
{% else %}
|
|
62
|
-
{# {% for arg in action['args'] %}#}
|
|
63
|
-
{# <div class="input-group mb-3">#}
|
|
64
|
-
{# <label class="input-group-text">{{ format_name(arg) }}</label>#}
|
|
65
|
-
{# <input class="form-control" type="text" id="{{ arg }}" name="{{ arg }}" placeholder="{{ action['arg_types'][arg] }}" value="{{ action['args'][arg] }}" aria-labelledby="variableHelpBlock">#}
|
|
66
|
-
{# </div>#}
|
|
67
|
-
{# {% endfor %}#}
|
|
68
|
-
{# <div class="input-group mb-3">#}
|
|
69
|
-
{# <label class="input-group-text">Save Output?</label>#}
|
|
70
|
-
{# <input class="form-control" type="text" id="return" name="return" value="{{ action['return'] }}" aria-labelledby="variableHelpBlock">#}
|
|
71
|
-
{# </div>#}
|
|
72
|
-
{{ forms.hidden_tag() }}
|
|
73
|
-
{% for field in forms %}
|
|
74
|
-
{% if field.type not in ['CSRFTokenField'] %}
|
|
75
|
-
<div class="input-group mb-3">
|
|
76
|
-
<label class="input-group-text">{{ field.label.text }}</label>
|
|
77
|
-
{{ field(class="form-control") }}
|
|
78
|
-
<div class="form-text">{{ field.description }} </div>
|
|
79
|
-
</div>
|
|
80
|
-
{% endif %}
|
|
81
|
-
{% endfor %}
|
|
82
|
-
{% endif %}
|
|
83
|
-
</div>
|
|
84
|
-
{% endif %}
|
|
85
|
-
<button class="btn btn-primary" type="submit">Save</button>
|
|
86
|
-
<button class="btn btn-primary" type="submit" name="back" id="back" value="back">Back</button>
|
|
87
|
-
</form>
|
|
88
|
-
{% endwith %}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
{% elif instrument %}
|
|
92
|
-
<div>
|
|
93
|
-
<div class="d-flex justify-content-between align-items-center " style="margin-bottom: 1vh;margin-top: 1vh;">
|
|
94
|
-
<a class="btn btn-primary" role="button" type="button" href="{{url_for('design.experiment_builder')}}"><i class="bi bi-arrow-return-left"></i></a>
|
|
95
|
-
{{ format_name(instrument) }}
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
{% if script.editing_type == "script" %}
|
|
99
|
-
{# Auto Fill Toggle #}
|
|
100
|
-
<div class="d-flex justify-content-between align-items-center " style="margin-bottom: 1vh;margin-top: 1vh;">
|
|
101
|
-
<div></div>
|
|
102
|
-
<form role="form" method='POST' name="autoFill" id="autoFill">
|
|
103
|
-
<div class="form-check form-switch">
|
|
104
|
-
<input type="hidden" id="autofill" name="autofill" value="temp_value">
|
|
105
|
-
<input class="form-check-input" type="checkbox" id="autoFillCheck" name="autoFillCheck" onchange="document.getElementById('autoFill').submit();"
|
|
106
|
-
value="temp_value"
|
|
107
|
-
{{ "checked" if session["autofill"] else "" }}>
|
|
108
|
-
<label class="form-check-label" for="autoFillCheck">Auto fill</label>
|
|
109
|
-
</div>
|
|
110
|
-
<button type="submit" class="btn btn-default" style="display: none;">Auto fill </button>
|
|
111
|
-
</form>
|
|
112
|
-
</div>
|
|
113
|
-
{% endif %}
|
|
114
|
-
|
|
115
|
-
{# according for instrument #}
|
|
116
|
-
<div class="accordion accordion-flush" id="accordionActions" >
|
|
117
|
-
{% if use_llm and not instrument == "flow_control" %}
|
|
118
|
-
<div class="accordion-item text-to-code">
|
|
119
|
-
<h2 class="accordion-header">
|
|
120
|
-
<button class="accordion-button text-to-code" type="button" data-bs-toggle="collapse" data-bs-target="#text-to-code" aria-expanded="false" aria-controls="collapseExample">
|
|
121
|
-
Text-to-Code
|
|
122
|
-
</button>
|
|
123
|
-
</h2>
|
|
124
|
-
<div id="text-to-code" class="accordion-collapse collapse show" data-bs-parent="#accordionActions">
|
|
125
|
-
<div class="accordion-body">
|
|
126
|
-
<form role="form" method='POST' name="generate" id="generate" action="{{url_for('design.generate_code')}}">
|
|
127
|
-
<input type="hidden" id="instrument" name="instrument" value="{{instrument}}">
|
|
128
|
-
<textarea class="form-control" id="prompt" name="prompt" rows="6" aria-describedby="promptHelpBlock">{{ session['prompt'][instrument] if instrument in session['prompt'] else '' }}</textarea>
|
|
129
|
-
<div id="promptHelpBlock" class="form-text">
|
|
130
|
-
This will overwrite current design.
|
|
131
|
-
</div>
|
|
132
|
-
<!-- <button type="submit" class="btn btn-dark" id="clear" name="clear" onclick="submitForm('generate')">Clear</button>-->
|
|
133
|
-
<button type="submit" class="btn btn-dark" id="gen" name="gen">Generate</button>
|
|
134
|
-
</form>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
{% endif %}
|
|
139
|
-
|
|
140
|
-
{% for name, form in forms.items() %}
|
|
141
|
-
<div class="accordion-item design-control" draggable="true">
|
|
142
|
-
<h2 class="accordion-header">
|
|
143
|
-
<button class="accordion-button collapsed draggable-action"
|
|
144
|
-
type="button" data-bs-toggle="collapse"
|
|
145
|
-
data-bs-target="#{{name}}" aria-expanded="false"
|
|
146
|
-
aria-controls="collapseExample"
|
|
147
|
-
data-action="{{ name }}">
|
|
148
|
-
{{ format_name(name) }}
|
|
149
|
-
</button>
|
|
150
|
-
</h2>
|
|
151
|
-
<div id="{{name}}" class="accordion-collapse collapse" data-bs-parent="#accordionActions">
|
|
152
|
-
<div class="accordion-body">
|
|
153
|
-
<form role="form" method='POST' name="add" id="add-{{name}}">
|
|
154
|
-
<div class="form-group">
|
|
155
|
-
{{ form.hidden_tag() }}
|
|
156
|
-
{% for field in form %}
|
|
157
|
-
{% if field.type not in ['CSRFTokenField', 'HiddenField'] %}
|
|
158
|
-
<div class="input-group mb-3">
|
|
159
|
-
<label class="input-group-text">{{ field.label.text }}</label>
|
|
160
|
-
{% if field.type == "SubmitField" %}
|
|
161
|
-
{{ field(class="btn btn-dark") }}
|
|
162
|
-
{% elif field.type == "BooleanField" %}
|
|
163
|
-
{{ field(class="form-check-input") }}
|
|
164
|
-
{% elif field.type == "FlexibleEnumField" %}
|
|
165
|
-
<input type="text" id="{{ field.id }}" name="{{ field.name }}" value="{{ field.data }}"
|
|
166
|
-
list="{{ field.id }}_options" placeholder="{{ field.render_kw.placeholder if field.render_kw and field.render_kw.placeholder }}"
|
|
167
|
-
class="form-control">
|
|
168
|
-
<datalist id="{{ field.id }}_options">
|
|
169
|
-
{% for key in field.choices %}
|
|
170
|
-
<option value="{{ key }}">{{ key }}</option>
|
|
171
|
-
{% endfor %}
|
|
172
|
-
</datalist>
|
|
173
|
-
|
|
174
|
-
{% else %}
|
|
175
|
-
{{ field(class="form-control") }}
|
|
176
|
-
{% endif %}
|
|
177
|
-
</div>
|
|
178
|
-
{% endif %}
|
|
179
|
-
{% endfor %}
|
|
180
|
-
</div>
|
|
181
|
-
<button type="submit" class="btn btn-dark">Add</button>
|
|
182
|
-
{% if 'hidden_name' in form %}
|
|
183
|
-
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
|
184
|
-
title='{{ form.hidden_name.description or "Docstring is not available" }}'>
|
|
185
|
-
</i>
|
|
186
|
-
{% else %}
|
|
187
|
-
<!-- handle info tooltip for flow control / workflows -->
|
|
188
|
-
{% endif %}
|
|
189
|
-
|
|
190
|
-
</form>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
{% endfor %}
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
{# according for all actions #}
|
|
200
|
-
{% else %}
|
|
201
|
-
<div style="margin-bottom: 4vh;"></div>
|
|
202
|
-
<div class="accordion accordion-flush">
|
|
203
|
-
|
|
204
|
-
<div class="accordion-item design-control">
|
|
205
|
-
<h5 class="accordion-header">
|
|
206
|
-
<button class="accordion-button" data-bs-toggle="collapse" data-bs-target="#deck" role="button" aria-expanded="false" aria-controls="collapseExample">
|
|
207
|
-
Operations
|
|
208
|
-
</button>
|
|
209
|
-
</h5>
|
|
210
|
-
<div class="accordion-collapse collapse show" id="deck">
|
|
211
|
-
<ul class="list-group">
|
|
212
|
-
{% for instrument in defined_variables %}
|
|
213
|
-
<form role="form" method='GET' name="{{instrument}}" action="{{url_for('design.experiment_builder',instrument=instrument)}}">
|
|
214
|
-
<div>
|
|
215
|
-
<button class="list-group-item list-group-item-action" type="submit">{{format_name(instrument)}}</button>
|
|
216
|
-
</div>
|
|
217
|
-
</form>
|
|
218
|
-
{% endfor %}
|
|
219
|
-
</ul>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
|
|
223
|
-
{% if local_variables %}
|
|
224
|
-
<div class="accordion-item design-control">
|
|
225
|
-
<h5 class="accordion-header">
|
|
226
|
-
<button class="accordion-button" data-bs-toggle="collapse" data-bs-target="#local" role="button" aria-expanded="false" aria-controls="collapseExample">
|
|
227
|
-
Local Operations
|
|
228
|
-
</button>
|
|
229
|
-
</h5>
|
|
230
|
-
<div class="accordion-collapse collapse show" id="local">
|
|
231
|
-
<ul class="list-group">
|
|
232
|
-
{% for instrument in local_variables %}
|
|
233
|
-
<form role="form" method='GET' name="{{instrument}}" action="{{url_for('design.experiment_builder',instrument=instrument)}}">
|
|
234
|
-
<div>
|
|
235
|
-
<button class="list-group-item list-group-item-action" type="submit" name="device" value="{{instrument}}" >{{instrument}}</button>
|
|
236
|
-
</div>
|
|
237
|
-
</form>
|
|
238
|
-
{% endfor%}
|
|
239
|
-
</ul>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
{% endif %}
|
|
243
|
-
</div>
|
|
244
|
-
{% endif %}
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
{# canvas #}
|
|
248
|
-
<div class="col-md-9 scroll-column">
|
|
249
|
-
<div class="d-flex align-items-center ">
|
|
250
|
-
{# file dropdown menu #}
|
|
251
|
-
<ul class="nav nav-tabs">
|
|
252
|
-
<li class="nav-item dropdown">
|
|
253
|
-
<a class="nav-link dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">File tools <i class="bi bi-tools"></i></a>
|
|
254
|
-
<ul class="dropdown-menu">
|
|
255
|
-
<button class="dropdown-item" type="button" data-bs-toggle="modal" data-bs-target="#newScriptModal">New</button>
|
|
256
|
-
<button class="dropdown-item" type="button" data-bs-toggle="modal" data-bs-target="#jsonModal">Import (.json <i class="bi bi-filetype-json"></i>)</button>
|
|
257
|
-
<button class="dropdown-item" type="button" data-bs-toggle="modal" data-bs-target="#renameModal">Rename</button>
|
|
258
|
-
<a role="button" class="dropdown-item {{'disabled' if not script.name or script.status == 'finalized'}}" type="button" href="{{url_for('database.publish')}}">Save</a></li>
|
|
259
|
-
<button class="dropdown-item" type="button" data-bs-toggle="modal" data-bs-target="#saveasModal">Save as</button>
|
|
260
|
-
{% if not script.status == 'finalized' %}
|
|
261
|
-
<a role="button" class="dropdown-item" type="button" href="{{url_for('database.finalize')}}">Disable editing</a>
|
|
262
|
-
{% endif %}
|
|
263
|
-
<a class="dropdown-item" role="button" type="button" href="{{url_for('design.download', filetype='script')}}">Export (.json <i class="bi bi-filetype-json"></i>)</a>
|
|
264
|
-
</ul>
|
|
265
|
-
</li>
|
|
266
|
-
|
|
267
|
-
<li class="nav-item"><a class="nav-link" aria-current="page" data-bs-toggle="collapse" href="#info">Info</a></li>
|
|
268
|
-
<li class="nav-item"><a class="{{'nav-link active' if script.editing_type=='prep' else 'nav-link'}}" aria-current="page" href="{{url_for('design.toggle_script_type', stype='prep') }}">Prep</a></li>
|
|
269
|
-
<li class="nav-item"><a class="{{'nav-link active' if script.editing_type=='script' else 'nav-link'}}" aria-current="page" href="{{url_for('design.toggle_script_type', stype='script') }}">Experiment</a></li>
|
|
270
|
-
<li class="nav-item"><a class="{{'nav-link active' if script.editing_type=='cleanup' else 'nav-link'}}" aria-current="page" href="{{url_for('design.toggle_script_type', stype='cleanup') }}">Clean up</a></li>
|
|
271
|
-
</ul>
|
|
272
|
-
<form method="POST" action="{{ url_for('design.toggle_show_code') }}" class="ms-3">
|
|
273
|
-
<div class="form-check form-switch">
|
|
274
|
-
<input class="form-check-input" type="checkbox" id="showPythonCodeSwitch" name="show_code"
|
|
275
|
-
onchange="this.form.submit()" {% if session.get('show_code') %}checked{% endif %}>
|
|
276
|
-
<label class="form-check-label" for="showPythonCodeSwitch">Show Python Code</label>
|
|
277
|
-
</div>
|
|
278
|
-
</form>
|
|
279
|
-
|
|
280
|
-
<div class="form-check form-switch ms-auto">
|
|
281
|
-
<input class="form-check-input" type="checkbox" id="toggleLineNumbers" onchange="toggleLineNumbers()">
|
|
282
|
-
<label class="form-check-label" for="toggleLineNumbers">Show Line Numbers</label>
|
|
283
|
-
</div>
|
|
284
|
-
|
|
285
|
-
</div>
|
|
286
|
-
<div class="canvas-wrapper position-relative">
|
|
287
|
-
<div class="canvas" droppable="true">
|
|
288
|
-
<div class="collapse" id="info">
|
|
289
|
-
<table class="table script-table">
|
|
290
|
-
<tbody>
|
|
291
|
-
<tr><th scope="row">Deck Name</th><td>{{script.deck}}</td></tr>
|
|
292
|
-
<tr><th scope="row">Script Name</th><td>{{ script.name }}</td></tr>
|
|
293
|
-
<tr>
|
|
294
|
-
<th scope="row">Editing status <a role="button" data-bs-toggle="popover" data-bs-title="How to use:" data-bs-content="You can choose to disable editing, so the script is finalized and cannot be edited. Use save as to rename the script"><i class="bi bi-info-circle"></i></a></th>
|
|
295
|
-
<td>{{script.status}}</td>
|
|
296
|
-
</tr>
|
|
297
|
-
<tr>
|
|
298
|
-
<th scope="row">Output Values <a role="button" data-bs-toggle="popover" data-bs-title="How to use:" data-bs-content="This will be your output data. If the return data is not a value, it will save as None is the result file"><i class="bi bi-info-circle"></i></a></th>
|
|
299
|
-
<td>
|
|
300
|
-
{% for i in script.config_return()[1] %}
|
|
301
|
-
<input type="checkbox">{{i}}
|
|
302
|
-
{% endfor %}
|
|
303
|
-
</td>
|
|
304
|
-
</tr>
|
|
305
|
-
<tr>
|
|
306
|
-
<th scope="row">Config Variables <a role="button" data-bs-toggle="popover" data-bs-title="How to use:" data-bs-content="This shows variables you want to configure later using .csv file"><i class="bi bi-info-circle"></i></a></th>
|
|
307
|
-
<td>
|
|
308
|
-
<ul>
|
|
309
|
-
{% for i in script.config("script")[0] %}
|
|
310
|
-
<li>{{i}}</li>
|
|
311
|
-
{% endfor %}
|
|
312
|
-
</ul>
|
|
313
|
-
</td>
|
|
314
|
-
</tr>
|
|
315
|
-
</tbody>
|
|
316
|
-
</table>
|
|
317
|
-
</div>
|
|
318
|
-
|
|
319
|
-
<div class="list-group" id="list" style="margin-top: 20px">
|
|
320
|
-
<ul class="reorder">
|
|
321
|
-
{% for button in buttons %}
|
|
322
|
-
<li id="{{ button['id'] }}" style="list-style-type: none;">
|
|
323
|
-
<span class="line-number d-none">{{ button['id'] }}.</span>
|
|
324
|
-
<a href="{{ url_for('design.edit_action', uuid=button['uuid']) }}" type="button" class="btn btn-light" style="{{ button['style'] }}">{{ button['label'] }}</a>
|
|
325
|
-
{% if not button["instrument"] in ["if","while","repeat"] %}
|
|
326
|
-
<a href="{{ url_for('design.duplicate_action', id=button['id']) }}" type="button" class="btn btn-light"><span class="bi bi-copy"></span></a>
|
|
327
|
-
{% endif %}
|
|
328
|
-
<a href="{{ url_for('design.delete_action', id=button['id']) }}" type="button" class="btn btn-light"><span class="bi bi-trash"></span></a>
|
|
329
|
-
</li>
|
|
330
|
-
{% endfor %}
|
|
331
|
-
</ul>
|
|
332
|
-
|
|
333
|
-
<!-- Python Code Overlay -->
|
|
334
|
-
<!-- Right side: Python code (conditionally shown) -->
|
|
335
|
-
<!-- Python Code Slide-Over Panel -->
|
|
336
|
-
{% if session.get('show_code') %}
|
|
337
|
-
<div id="pythonCodeOverlay" class="code-overlay bg-light border-start show">
|
|
338
|
-
<div class="overlay-header d-flex justify-content-between align-items-center px-3 py-2 border-bottom">
|
|
339
|
-
<strong>Python Code</strong>
|
|
340
|
-
<button class="btn btn-sm btn-outline-secondary" onclick="toggleCodeOverlay(false)">
|
|
341
|
-
<i class="bi bi-x-lg"></i>
|
|
342
|
-
</button>
|
|
343
|
-
</div>
|
|
344
|
-
<div class="overlay-content p-3">
|
|
345
|
-
{% for stype, script in session['python_code'].items() %}
|
|
346
|
-
<pre><code class="language-python">{{ script }}</code></pre>
|
|
347
|
-
{% endfor %}
|
|
348
|
-
<a href="{{ url_for('design.download', filetype='python') }}">Download <i class="bi bi-download"></i></a>
|
|
349
|
-
</div>
|
|
350
|
-
</div>
|
|
351
|
-
{% endif %}
|
|
352
|
-
</div>
|
|
353
|
-
</div>
|
|
354
|
-
<div>
|
|
355
|
-
<a class="btn btn-dark {{ 'disabled' if not script.name or script.status == "finalized" else ''}}" href="{{url_for('database.publish')}}">Quick Save</a>
|
|
356
|
-
<a class="btn btn-dark " href="{{ url_for('design.experiment_run') }}">Compile and Run</a>
|
|
357
|
-
</div>
|
|
358
|
-
</div>
|
|
359
|
-
</div>
|
|
360
|
-
|
|
361
|
-
{# modals #}
|
|
362
|
-
<div class="modal fade" id="newScriptModal" tabindex="-1" aria-labelledby="newScriptModalLabel" aria-hidden="true">
|
|
363
|
-
<div class="modal-dialog">
|
|
364
|
-
<div class="modal-content">
|
|
365
|
-
<div class="modal-header">
|
|
366
|
-
<h1 class="modal-title fs-5" id="newScriptModalLabel">Save your current editing!</h1>
|
|
367
|
-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
368
|
-
</div>
|
|
369
|
-
<div class="modal-body">
|
|
370
|
-
The current editing won't be saved. Are you sure you want to proceed?
|
|
371
|
-
</div>
|
|
372
|
-
<div class="modal-footer">
|
|
373
|
-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Continue editing </button>
|
|
374
|
-
<a role="button" class="btn btn-primary" href="{{url_for('design.clear')}}"> Already saved, clear all </a>
|
|
375
|
-
</div>
|
|
376
|
-
</div>
|
|
377
|
-
</div>
|
|
378
|
-
</div>
|
|
379
|
-
<div class="modal fade" id="saveasModal" tabindex="-1" aria-labelledby="saveasModal" aria-hidden="true" >
|
|
380
|
-
<div class="modal-dialog">
|
|
381
|
-
<div class="modal-content">
|
|
382
|
-
<div class="modal-header">
|
|
383
|
-
<h1 class="modal-title fs-5" id="saveasModal">Save your script as </h1>
|
|
384
|
-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
385
|
-
</div>
|
|
386
|
-
<form method="POST" name="run_name" action="{{ url_for('database.save_as') }}">
|
|
387
|
-
<div class="modal-body">
|
|
388
|
-
<div class="input-group mb-3">
|
|
389
|
-
<label class="input-group-text" for="run_name">Run Name</label>
|
|
390
|
-
<input class="form-control" type="text" name="run_name" id="run_name" placeholder="{{script['name']}}" required="required">
|
|
391
|
-
</div>
|
|
392
|
-
<div class="form-check form-switch">
|
|
393
|
-
<input class="form-check-input" type="checkbox" name="register_workflow" id="register_workflow">
|
|
394
|
-
<label class="input-group-label" for="register_workflow">Register this workflow</label>
|
|
395
|
-
</div>
|
|
396
|
-
</div>
|
|
397
|
-
<div class="modal-footer">
|
|
398
|
-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
|
|
399
|
-
<button type="submit" class="btn btn-primary"> Save </button>
|
|
400
|
-
</div>
|
|
401
|
-
</form>
|
|
402
|
-
</div>
|
|
403
|
-
</div>
|
|
404
|
-
</div>
|
|
405
|
-
<div class="modal fade" id="renameModal" tabindex="-1" aria-labelledby="renameModal" aria-hidden="true" >
|
|
406
|
-
<div class="modal-dialog">
|
|
407
|
-
<div class="modal-content">
|
|
408
|
-
<div class="modal-header">
|
|
409
|
-
<h1 class="modal-title fs-5" id="renameModal">Rename your script</h1>
|
|
410
|
-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
411
|
-
</div>
|
|
412
|
-
<form method="POST" name="run_name" action="{{ url_for('database.edit_run_name') }}">
|
|
413
|
-
<div class="modal-body">
|
|
414
|
-
<div class="input-group mb-3">
|
|
415
|
-
<label class="input-group-text" for="run_name">Run Name</label>
|
|
416
|
-
<input class="form-control" type="text" name="run_name" id="run_name" placeholder="{{script['name']}}" required="required">
|
|
417
|
-
</div>
|
|
418
|
-
</div>
|
|
419
|
-
<div class="modal-footer">
|
|
420
|
-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
|
|
421
|
-
<button type="submit" class="btn btn-primary"> Save </button>
|
|
422
|
-
</div>
|
|
423
|
-
</form>
|
|
424
|
-
</div>
|
|
425
|
-
</div>
|
|
426
|
-
</div>
|
|
427
|
-
<div class="modal fade" id="jsonModal" tabindex="-1" aria-labelledby="jsonModal" aria-hidden="true" >
|
|
428
|
-
<div class="modal-dialog">
|
|
429
|
-
<div class="modal-content">
|
|
430
|
-
<div class="modal-header">
|
|
431
|
-
<h1 class="modal-title fs-5" id="jsonModal">Import from JSON</h1>
|
|
432
|
-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
433
|
-
</div>
|
|
434
|
-
<form method="POST" action="{{ url_for('design.load_json') }}" enctype="multipart/form-data">
|
|
435
|
-
<div class="modal-body">
|
|
436
|
-
<div class="input-group mb-3">
|
|
437
|
-
<input class="form-control" type="file" name="file" required="required">
|
|
438
|
-
</div>
|
|
439
|
-
</div>
|
|
440
|
-
<div class="modal-footer">
|
|
441
|
-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
|
|
442
|
-
<button type="submit" class="btn btn-primary"> Upload </button>
|
|
443
|
-
</div>
|
|
444
|
-
</form>
|
|
445
|
-
</div>
|
|
446
|
-
</div>
|
|
447
|
-
</div>
|
|
448
|
-
<!-- Bootstrap Modal -->
|
|
449
|
-
<div class="modal fade" id="dropModal" tabindex="-1" aria-labelledby="dropModalLabel" aria-hidden="true">
|
|
450
|
-
<div class="modal-dialog">
|
|
451
|
-
<div class="modal-content">
|
|
452
|
-
<div class="modal-header">
|
|
453
|
-
<h5 class="modal-title" id="dropModalLabel">Configure Action</h5>
|
|
454
|
-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
455
|
-
</div>
|
|
456
|
-
<div class="modal-body">
|
|
457
|
-
<p>Drop Position ID: <strong id="modalDropTarget"></strong></p>
|
|
458
|
-
|
|
459
|
-
<!-- Form will be dynamically inserted here -->
|
|
460
|
-
<div id="modalFormFields"></div>
|
|
461
|
-
</div>
|
|
462
|
-
<div class="modal-footer">
|
|
463
|
-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
464
|
-
</div>
|
|
465
|
-
</div>
|
|
466
|
-
</div>
|
|
467
|
-
</div>
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
{% if instrument and use_llm %}
|
|
471
|
-
<script>
|
|
472
|
-
const buttonIds = {{ ['generate'] | tojson }};
|
|
473
|
-
</script>
|
|
474
|
-
<script src="{{ url_for('static', filename='js/overlay.js') }}"></script>
|
|
475
|
-
{% endif %}
|
|
476
|
-
|
|
477
|
-
<script>
|
|
478
|
-
const updateListUrl = "{{ url_for('design.update_list') }}";
|
|
479
|
-
|
|
480
|
-
// Toggle visibility of line numbers
|
|
481
|
-
function toggleLineNumbers(save = true) {
|
|
482
|
-
const show = document.getElementById('toggleLineNumbers').checked;
|
|
483
|
-
document.querySelectorAll('.line-number').forEach(el => {
|
|
484
|
-
el.classList.toggle('d-none', !show);
|
|
485
|
-
});
|
|
486
|
-
|
|
487
|
-
if (save) {
|
|
488
|
-
localStorage.setItem('showLineNumbers', show ? 'true' : 'false');
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
function toggleCodeOverlay() {
|
|
493
|
-
const overlay = document.getElementById("pythonCodeOverlay");
|
|
494
|
-
const toggleBtn = document.getElementById("codeToggleBtn");
|
|
495
|
-
overlay.classList.toggle("show");
|
|
496
|
-
|
|
497
|
-
// Change arrow icon
|
|
498
|
-
const icon = toggleBtn.querySelector("i");
|
|
499
|
-
icon.classList.toggle("bi-chevron-left");
|
|
500
|
-
icon.classList.toggle("bi-chevron-right");
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
// Restore state on page load
|
|
504
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
505
|
-
const savedState = localStorage.getItem('showLineNumbers');
|
|
506
|
-
const checkbox = document.getElementById('toggleLineNumbers');
|
|
507
|
-
|
|
508
|
-
if (savedState === 'true') {
|
|
509
|
-
checkbox.checked = true;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
toggleLineNumbers(false); // don't overwrite localStorage on load
|
|
513
|
-
|
|
514
|
-
checkbox.addEventListener('change', () => toggleLineNumbers());
|
|
515
|
-
});
|
|
516
|
-
</script>
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
<script src="{{ url_for('static', filename='js/sortable_design.js') }}"></script>
|
|
520
|
-
|
|
521
|
-
{% endblock %}
|