Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 1c5599d

Browse files
committed
chore: update file paths and types
1 parent a511764 commit 1c5599d

2 files changed

Lines changed: 27 additions & 10 deletions

File tree

control_plane/pages/logs.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def logs_page():
8080
filter_video = ui.checkbox('Video', value=True)
8181
filter_image = ui.checkbox('Image', value=True)
8282
filter_text = ui.checkbox('Text', value=True)
83+
filter_audio = ui.checkbox('Audio', value=True)
84+
filter_depth = ui.checkbox('Depth', value=True)
8385
filter_hidden = ui.checkbox('Hide Hidden (.*)', value=True).classes('ml-4')
8486

8587
columns = [
@@ -124,6 +126,13 @@ def open_review_dialog(row):
124126
safe_name = os.path.basename(p.strip('/')) or 'logs'
125127
ui.image(f'/log_media_{safe_name}/{rel_to_media}').classes('w-full bg-black').style('max-height: 75vh; object-fit: contain;')
126128
break
129+
elif ext in ['.wav', '.mp3', '.m4a', '.aac', '.flac']:
130+
for p in paths:
131+
if abs_path.startswith(p):
132+
rel_to_media = os.path.relpath(abs_path, p)
133+
safe_name = os.path.basename(p.strip('/')) or 'logs'
134+
ui.audio(f'/log_media_{safe_name}/{rel_to_media}').classes('w-full mt-4')
135+
break
127136
elif ext in ['.json', '.txt', '.yaml', '.csv', '.log']:
128137
try:
129138
with open(abs_path, 'r') as f:
@@ -159,6 +168,8 @@ def update_ui(force=False):
159168
if filter_video.value: valid_exts.update(['.mp4', '.mkv', '.avi', '.webm', '.ts', '.mov', '.quic'])
160169
if filter_image.value: valid_exts.update(['.jpg', '.jpeg', '.png', '.gif', '.svg'])
161170
if filter_text.value: valid_exts.update(['.txt', '.json', '.yaml', '.csv', '.log', '.md'])
171+
if filter_audio.value: valid_exts.update(['.wav', '.mp3', '.m4a', '.aac', '.flac'])
172+
if filter_depth.value: valid_exts.update(['.oni', '.bag', '.bin', '.depth', '.ply', '.pcd'])
162173

163174
filtered_files = []
164175
for f in sorted_files:
@@ -173,7 +184,7 @@ def update_ui(force=False):
173184
# Ext filter
174185
if valid_exts and f['ext'] not in valid_exts and f['ext'] != 'unknown':
175186
# Allow unknown to sneak through? Let's just strict filter if ANY checkbox is checked
176-
if filter_video.value or filter_image.value or filter_text.value:
187+
if filter_video.value or filter_image.value or filter_text.value or filter_audio.value or filter_depth.value:
177188
continue
178189

179190
# Text filter
@@ -191,6 +202,8 @@ def update_ui(force=False):
191202
filter_video.on_value_change(lambda _: update_ui(force=True))
192203
filter_image.on_value_change(lambda _: update_ui(force=True))
193204
filter_text.on_value_change(lambda _: update_ui(force=True))
205+
filter_audio.on_value_change(lambda _: update_ui(force=True))
206+
filter_depth.on_value_change(lambda _: update_ui(force=True))
194207
filter_hidden.on_value_change(lambda _: update_ui(force=True))
195208
filter_rig.on_value_change(lambda _: update_ui(force=True))
196209
filter_mobile.on_value_change(lambda _: update_ui(force=True))

mobile_client/server.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"keepAliveIntervalMs": 5000,
2222
"clientConfig": {
2323
"videoFormat": "mp4",
24-
"videoChunkDurationMs": 30000,
24+
"videoChunkDurationMs": 10000,
2525
"videoBufferMaxMB": 16000,
2626
"communicationsPolicy": {
2727
"wifi": True,
@@ -256,19 +256,23 @@ async def websocket_handler(request):
256256

257257
import datetime
258258
dt = datetime.datetime.fromtimestamp(timestamp_sec, tz=datetime.timezone.utc)
259-
year = f"{dt.year:04d}"
260-
month = f"{dt.month:02d}"
261-
day = f"{dt.day:02d}"
259+
date_str = dt.strftime("%Y-%m-%d")
260+
261+
ext = os.path.splitext(filename)[1].lower()
262+
if ext in ['.mp4', '.mov', '.mkv', '.avi', '.webm', '.ts']:
263+
media_type = "video"
264+
elif ext in ['.jpg', '.jpeg', '.png', '.gif']:
265+
media_type = "image"
266+
else:
267+
media_type = "data"
262268

263269
# Prepare upload path
264270
base_upload_path = resolve_path(config["uploadPath"])
265271
target_dir = os.path.join(
266272
base_upload_path,
267-
"orgs", "default",
268-
"devices", safe_client_name,
269-
year,
270-
month,
271-
day
273+
date_str,
274+
media_type,
275+
safe_client_name
272276
)
273277
os.makedirs(target_dir, exist_ok=True)
274278

0 commit comments

Comments
 (0)