modified: config/mqtt.php
modified: resources/views/admin/bel/partials/scripts.blade.php
This commit is contained in:
parent
958bccf4ed
commit
744fb38107
|
@ -2,22 +2,20 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use PhpMqtt\Client\MqttClient;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'default_connection' => 'bel_sekolah',
|
'default_connection' => 'bel_sekolah',
|
||||||
|
|
||||||
'connections' => [
|
'connections' => [
|
||||||
'bel_sekolah' => [
|
'bel_sekolah' => [
|
||||||
'host' => env('MQTT_HOST', 'localhost'),
|
'host' => env('MQTT_HOST', '192.168.1.5'),
|
||||||
'port' => (int) env('MQTT_PORT', 1883),
|
'port' => (int) env('MQTT_PORT', 1883),
|
||||||
'client_id' => env('MQTT_CLIENT_ID', 'laravel_bel_' . bin2hex(random_bytes(4))),
|
'client_id' => env('MQTT_CLIENT_ID', 'laravel_bel_' . bin2hex(random_bytes(4))),
|
||||||
'use_clean_session' => false,
|
'use_clean_session' => false,
|
||||||
'connection_settings' => [
|
'connection_settings' => [
|
||||||
'auto_reconnect' => [
|
'auto_reconnect' => [
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'max_reconnect_attempts' => 5,
|
'max_reconnect_attempts' => 2,
|
||||||
'delay_between_reconnect_attempts' => 3,
|
'delay_between_reconnect_attempts' => 1,
|
||||||
],
|
],
|
||||||
'last_will' => [
|
'last_will' => [
|
||||||
'topic' => 'bel/sekolah/status/backend',
|
'topic' => 'bel/sekolah/status/backend',
|
||||||
|
@ -25,9 +23,9 @@
|
||||||
'quality_of_service' => 1,
|
'quality_of_service' => 1,
|
||||||
'retain' => true,
|
'retain' => true,
|
||||||
],
|
],
|
||||||
'connect_timeout' => 10,
|
'connect_timeout' => 5,
|
||||||
'socket_timeout' => 5,
|
'socket_timeout' => 5,
|
||||||
'keep_alive_interval' => 60,
|
'keep_alive_interval' => 10,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
@ -532,10 +532,10 @@ function updateNextSchedule() {
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
updateClock();
|
updateClock();
|
||||||
updateNextSchedule();
|
updateNextSchedule();
|
||||||
|
getLiveStatus();
|
||||||
// Refresh every minute to stay accurate
|
// Refresh every minute to stay accurate
|
||||||
setInterval(updateNextSchedule, 60000);
|
setInterval(updateNextSchedule, 60000);
|
||||||
setInterval(getLiveStatus, 60000); // Update status every 30 seconds
|
setInterval(getLiveStatus, 3000); // Update status every 30 seconds
|
||||||
|
|
||||||
// Add animation to status cards on hover
|
// Add animation to status cards on hover
|
||||||
document.querySelectorAll('#mqttCard, #rtcCard, #dfplayerCard').forEach(card => {
|
document.querySelectorAll('#mqttCard, #rtcCard, #dfplayerCard').forEach(card => {
|
||||||
|
|
Loading…
Reference in New Issue