فهرست منبع

add playlist function

Tuan Nguyen 1 سال پیش
والد
کامیت
e941c4e84d
3فایلهای تغییر یافته به همراه91 افزوده شده و 22 حذف شده
  1. 0 1
      app.py
  2. 29 21
      templates/index.html
  3. 62 0
      templates/playlist.html

+ 0 - 1
app.py

@@ -712,4 +712,3 @@ def run_playlist():
 
 if __name__ == '__main__':
     app.run(debug=True, host='0.0.0.0', port=8080)
-

+ 29 - 21
templates/index.html

@@ -66,27 +66,35 @@
 
         <!-- Right Column -->
         <div class="right-column">
-            <div class="section">
-                <h2>Pattern Files</h2>
-                <input type="text" id="search_pattern" placeholder="Search files..." oninput="searchPatternFiles()">
-                <ul id="theta_rho_files"></ul>
-                <div class="pre-execution-toggles modeSection single_run">
-                    <h3>Pre-Execution Action</h3>
-                    <label>
-                        <input type="radio" name="pre_execution" value="clear_in" id="clear_in"> Clear from In
-                    </label>
-                    <label>
-                        <input type="radio" name="pre_execution" value="clear_out" id="clear_out"> Clear from Out
-                    </label>
-                    <label>
-                        <input type="radio" name="pre_execution" value="clear_sideway" id="clear_out"> Clear sideway
-                    </label>
-                    <label>
-                        <input type="radio" name="pre_execution" value="none" id="no_action" checked> None
-                    </label>
-                </div>
-                <div class="button-group">
-                    <button id="run_button" disabled>Run Selected File</button>
+
+                <div class="section modeSection single_run create_playlist">
+                    <h2 class="modeSection single_run">Single Run</h2>
+                    <h2 class="modeSection create_playlist" style="display: none;"> Create Playlist</h2>
+                    <h2 class="modeSection run_playlist" style="display: none;"> Run Playlist</h2>
+                    <input class="modeSection single_run create_playlist" type="text" id="search_pattern" placeholder="Search files..." oninput="searchPatternFiles()">
+                    <ul  class="modeSection single_run create_playlist" id="theta_rho_files"></ul>
+                    <div class="pre-execution-toggles modeSection single_run">
+                        <h3>Pre-Execution Action</h3>
+                        <label>
+                            <input type="radio" name="pre_execution" value="clear_in" id="clear_in"> Clear from In
+                        </label>
+                        <label>
+                            <input type="radio" name="pre_execution" value="clear_out" id="clear_out"> Clear from Out
+                        </label>
+                        <label>
+                            <input type="radio" name="pre_execution" value="clear_sideway" id="clear_out"> Clear sideway
+                        </label>
+                        <label>
+                            <input type="radio" name="pre_execution" value="none" id="no_action" checked> None
+                        </label>
+                    </div>
+                    <div class="button-group modeSection single_run">
+                        <button id="run_button" disabled>Run Selected File</button>
+                        <button onclick="stopExecution()" class="delete-button">Stop</button>
+                    </div>
+                    <div class="button-group modeSection create_playlist" style="display: none;">
+                        <button onclick="addToPlaylist()">Add File to Playlist</button>
+                    </div>
                 </div>
                 <div class="section modeSection single_run">
                     <h2>Upload new files</h2>

+ 62 - 0
templates/playlist.html

@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Sand Table Playlist</title>
+    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
+    <link rel="stylesheet" href="../static/style.css">
+</head>
+<body>
+    <h1>Manage and Run Playlists</h1>
+    <div class="container">
+
+        <!-- Section to build the playlist -->
+        <div class="left-column">
+            <div class="section">
+                <h2>Create Playlist</h2>
+                <p>Add .thr files to your playlist below.</p>
+                <input type="text" id="search_pattern" placeholder="Search files..." oninput="searchPatternFiles()">
+                <ul id="theta_rho_files"></ul>
+            </br>
+                <button onclick="addToPlaylist()">Add to Playlist</button>
+                <ul id="playlist_files"></ul>
+            </div>
+            <div class="section">
+                <h2>Preview</h2>
+                <canvas id="patternPreviewCanvas" style="width: 100%; height: 100%;"></canvas>
+                <p id="first_coordinate">First Coordinate: Not available</p>
+                <p id="last_coordinate">Last Coordinate: Not available</p>
+            </div>
+        </div>
+
+        <!-- Section to set parameters -->
+        <div class="right-column">
+            <div class="section">
+                <h2>Pattern Files</h2>
+                <label for="pause_time">Pause between patterns (min):</label>
+                <input type="number" id="pause_time" value="0" step="1" min="0">
+
+                <br><br>
+                <label for="clear_pattern">Clear Pattern:</label>
+                <select id="clear_pattern">
+                    <option value="no_clear">No Clear</option>
+                    <option value="clear_from_in">Clear from In</option>
+                    <option value="clear_from_out">Clear from Out</option>
+                    <option value="clear_sideway">Clear Sideway</option>
+                    <option value="random">Random</option>
+                </select>
+                <div class="button-group">
+                    <button onclick="runPlaylist()">Run Playlist</button>
+                    <button onclick="stopExecution()" class="delete-button">Stop</button>
+                </div>
+            </div>
+        </div>
+
+        <!-- Status/Log -->
+        <div id="status_log">
+            <h2>Playlist Status</h2>
+            <!-- Messages will be appended here -->
+        </div>
+    </div>
+</body>
+</html>