 Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
5 hours ago  Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
5 hours ago |
|
<?php require_once('../ajax_asm.php'); if( $CUser->Data['id'] > 1 ){ $Data = array(); $Data['success'] = false; if( isset( $_POST['MID'] ) ) { $MID = intval($_POST['MID']); } else $MID = 0; if( isset( $_POST['OPID'] ) ){ $CMD = intval( $_POST['OPID'] ); } else { $CMD = 0; }; if( isset( $_POST['OPCODE'] ) ){ $OPCODE = intval( $_POST['OPCODE'] ); } else { $OPCODE = 0; }; if( $MID > 0 && $CMD > 0 ){ $Data['success'] = true; $QS = "SELECT * FROM `modules` WHERE `id`={$MID}"; $TT = $DATABASE->Query( $QS ); $QS = ''; if( count( $TT ) ){ $JJ = $TT[0]; switch( $CMD ){ case 1: // remove the module's own settings row(s); module_types ids:
// 2 Kafka, 6 SSDP, 8 Embed Video, 9 Modem Manager, 12 Bosch VMS, 13 Attention Cloud
$AUX = intval( $JJ['aux_id'] ); $DEL = array(); switch( intval( $JJ['type'] ) ){ case 2: $DEL[] = "DELETE FROM `module_kafka` WHERE `id`={$AUX}"; break; case 6: $DEL[] = "DELETE FROM `module_ssdp` WHERE `id`={$AUX}"; break; case 8: $DEL[] = "DELETE FROM `module_eve` WHERE `id`={$AUX}"; break; case 9: $DEL[] = "DELETE FROM `module_modem` WHERE `id`={$AUX}"; $DEL[] = "DELETE FROM `module_modem_phonebook`"; break; case 12: $DEL[] = "DELETE FROM `module_bvms` WHERE `id`={$AUX}"; break; case 13: $DEL[] = "DELETE FROM `module_attention` WHERE `id`={$AUX}"; break; }; foreach( $DEL as $DQ ){ // skip tables missing in this database (Query() would die())
if( preg_match( '/FROM `([a-z_]+)`/', $DQ, $TM ) ){ $TX = $DATABASE->Query( "SELECT name FROM sqlite_master WHERE type='table' AND name='{$TM[1]}'", false ); if( count( $TX ) ) $DATABASE->Query( $DQ, false ); }; }; $QS = "DELETE FROM `modules` WHERE `id`={$MID}"; //$DATABASE->Query( $QS );
break; case 2: $QS = "UPDATE `modules` SET `enabled`={$OPCODE} WHERE `id`={$MID}"; break; case 3: if( $OPCODE ) $QS = "UPDATE `module_eve` SET `output_mode`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; case 4: $QS = "UPDATE `module_modem` SET `modem_id`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; case 5: { switch( $OPCODE ){ case 2: $QS = "UPDATE `module_modem` SET `call_enabled`=1, `sms_enabled`=0 WHERE `id`={$JJ['aux_id']}"; break; case 1: $QS = "UPDATE `module_modem` SET `call_enabled`=0, `sms_enabled`=1 WHERE `id`={$JJ['aux_id']}"; break; case 3: $QS = "UPDATE `module_modem` SET `call_enabled`=1, `sms_enabled`=1 WHERE `id`={$JJ['aux_id']}"; break; }; break; }; case 6: $QS = "UPDATE `module_modem` SET `call_hangup_wait`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; case 7: { $EIP = $DATABASE->escape($_POST['OPCODE']); $QS = "UPDATE `module_bvms` SET `ip`='{$EIP}' WHERE `id`={$JJ['aux_id']}"; break; }; case 8: { if( $OPCODE == 0 ) $OPCODE = 80; $QS = "UPDATE `module_bvms` SET `port`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 9: { $EIP = $DATABASE->escape($_POST['OPCODE']); $QS = "UPDATE `module_bvms` SET `api_uri`='{$EIP}' WHERE `id`={$JJ['aux_id']}"; break; }; case 10: { $EIP = $DATABASE->escape($_POST['OPCODE']); $QS = "UPDATE `module_bvms` SET `access_user`='{$EIP}' WHERE `id`={$JJ['aux_id']}"; break; }; case 11: { $EIP = $DATABASE->escape($_POST['OPCODE']); $QS = "UPDATE `module_bvms` SET `access_pass`='{$EIP}' WHERE `id`={$JJ['aux_id']}"; break; }; case 12: { if( $OPCODE == 0 ) $OPCODE = 1000; $QS = "UPDATE `module_attention` SET `persist`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 13: { if( $OPCODE == 0 ) $OPCODE = 3000; $QS = "UPDATE `module_attention` SET `rest`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 14: { if( $OPCODE == 0 ) $OPCODE = 3; $QS = "UPDATE `module_attention` SET `range`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 15:{ $QS = "UPDATE `module_bvms` SET `auth_mode`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 16:{ $QS = "UPDATE `module_bvms` SET `detection_evt_ena`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 17:{ $QS = "UPDATE `module_bvms` SET `detection_evt_id`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 18:{ $QS = "UPDATE `module_bvms` SET `camera_evt_ena`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 19:{ $QS = "UPDATE `module_bvms` SET `camera_evt_id`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; // module_eve: embedded MediaMTX live view / recording (la_mojo kernelModuleEmbedVideo)
case 20:{ // live_mode: 0 - off, 1 - camera H264 passthrough, 2 - re-encode processed frames
if( $OPCODE < 0 || $OPCODE > 2 ) $OPCODE = 1; $QS = "UPDATE `module_eve` SET `live_mode`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 21:{ // live_port
if( $OPCODE < 1 || $OPCODE > 65535 ) $OPCODE = 8889; $QS = "UPDATE `module_eve` SET `live_port`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 22:{ // live_record
$OPCODE = ( $OPCODE > 0 ) ? 1 : 0; $QS = "UPDATE `module_eve` SET `live_record`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 23:{ // live_record_segment, seconds
if( $OPCODE == 0 ) $OPCODE = 60; $OPCODE = max( 10, min( 3600, $OPCODE ) ); $QS = "UPDATE `module_eve` SET `live_record_segment`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 24:{ // live_bitrate, kbit/s
if( $OPCODE == 0 ) $OPCODE = 2000; $OPCODE = max( 100, min( 20000, $OPCODE ) ); $QS = "UPDATE `module_eve` SET `live_bitrate`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 25:{ // live_fps
if( $OPCODE == 0 ) $OPCODE = 15; $OPCODE = max( 1, min( 60, $OPCODE ) ); $QS = "UPDATE `module_eve` SET `live_fps`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; case 26:{ // live_ice_servers: comma separated stun:/turn: urls
$EIP = $DATABASE->escape( trim( isset( $_POST['OPCODE'] ) ? $_POST['OPCODE'] : '' ) ); $QS = "UPDATE `module_eve` SET `live_ice_servers`='{$EIP}' WHERE `id`={$JJ['aux_id']}"; break; }; }; }; if( $QS != '' ) $DATABASE->Query( $QS ); $Data['query'] = $QS; } else { $Data['msg']='Wrong Parameters'; }; echo json_encode( $Data ); exit(); }; header('location: /');?>
|