ivoryos 1.0.1__py3-none-any.whl → 1.0.4__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 +22 -6
- ivoryos/routes/auth/auth.py +15 -18
- ivoryos/routes/control/control.py +78 -43
- ivoryos/routes/control/templates/control/controllers_home.html +7 -7
- ivoryos/routes/database/database.py +64 -44
- ivoryos/routes/database/templates/database/{experiment_database.html → scripts_database.html} +27 -18
- ivoryos/routes/database/templates/database/{workflow_run_database.html → workflow_database.html} +27 -5
- ivoryos/routes/design/design.py +135 -79
- ivoryos/routes/design/templates/design/experiment_builder.html +100 -45
- ivoryos/routes/design/templates/design/experiment_run.html +491 -328
- ivoryos/static/js/sortable_design.js +1 -1
- ivoryos/utils/client_proxy.py +1 -1
- ivoryos/utils/form.py +30 -3
- ivoryos/utils/script_runner.py +2 -1
- ivoryos/utils/utils.py +13 -0
- ivoryos/version.py +1 -1
- {ivoryos-1.0.1.dist-info → ivoryos-1.0.4.dist-info}/METADATA +37 -1
- {ivoryos-1.0.1.dist-info → ivoryos-1.0.4.dist-info}/RECORD +22 -22
- /ivoryos/routes/database/templates/database/{experiment_step_view.html → workflow_view.html} +0 -0
- {ivoryos-1.0.1.dist-info → ivoryos-1.0.4.dist-info}/LICENSE +0 -0
- {ivoryos-1.0.1.dist-info → ivoryos-1.0.4.dist-info}/WHEEL +0 -0
- {ivoryos-1.0.1.dist-info → ivoryos-1.0.4.dist-info}/top_level.txt +0 -0
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
{% block body %}
|
|
5
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>
|
|
6
23
|
<div id="overlay" class="overlay">
|
|
7
24
|
<div>
|
|
8
25
|
<h3 id="overlay-text">Generating design, please wait...</h3>
|
|
@@ -252,6 +269,13 @@
|
|
|
252
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>
|
|
253
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>
|
|
254
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>
|
|
255
279
|
|
|
256
280
|
<div class="form-check form-switch ms-auto">
|
|
257
281
|
<input class="form-check-input" type="checkbox" id="toggleLineNumbers" onchange="toggleLineNumbers()">
|
|
@@ -259,54 +283,74 @@
|
|
|
259
283
|
</div>
|
|
260
284
|
|
|
261
285
|
</div>
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
{% endfor %}
|
|
279
|
-
</td>
|
|
280
|
-
</tr>
|
|
281
|
-
<tr>
|
|
282
|
-
<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>
|
|
283
|
-
<td>
|
|
284
|
-
<ul>
|
|
285
|
-
{% for i in script.config("script")[0] %}
|
|
286
|
-
<li>{{i}}</li>
|
|
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}}
|
|
287
302
|
{% endfor %}
|
|
288
|
-
</
|
|
289
|
-
</
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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>
|
|
307
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>
|
|
308
353
|
</div>
|
|
309
|
-
</div>
|
|
310
354
|
<div>
|
|
311
355
|
<a class="btn btn-dark {{ 'disabled' if not script.name or script.status == "finalized" else ''}}" href="{{url_for('database.publish')}}">Quick Save</a>
|
|
312
356
|
<a class="btn btn-dark " href="{{ url_for('design.experiment_run') }}">Compile and Run</a>
|
|
@@ -445,6 +489,17 @@
|
|
|
445
489
|
}
|
|
446
490
|
}
|
|
447
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
|
+
|
|
448
503
|
// Restore state on page load
|
|
449
504
|
document.addEventListener('DOMContentLoaded', () => {
|
|
450
505
|
const savedState = localStorage.getItem('showLineNumbers');
|