Lots of work on the Launcher and configuration. Looks pretty good and useful.

This commit is contained in:
Scott Idem
2025-10-15 19:01:30 -04:00
parent a6058efaf0
commit 9678c5620d
16 changed files with 446 additions and 155 deletions

View File

@@ -5,8 +5,8 @@ import type { Writable } from 'svelte/store';
import type { key_val } from '$lib/ae_stores';
// Set the version for the app data. Changing this should force a notification and ask the user to clear and reload the page.
let ver = '2025-10-15_1401';
let ver_idb = '2025-10-15_1401';
let ver = '2025-10-15_1423';
let ver_idb = '2025-10-15_1423';
/* *** BEGIN *** Initialize events_local_data_struct */
// Longer-term app data. This should be stored to *local* storage.
@@ -158,12 +158,11 @@ let events_local_data_struct: key_val = {
'host_file_config_path': 'device_configs/ae_native_app_config.default.json',
},
idle_timer: 5*60*1000, // How many seconds until idle
idle_cycle: 2*1000, // How frequently the idle status is checked
idle_loop_period: 1*60*1000, // How frequently the loop runs for the screen saver and similar
idle_timer: 7*60*1000, // How many seconds until idle
idle_cycle: 5*1000, // How frequently the idle status is checked
idle_loop_period: 3*60*1000, // How frequently the loop runs for the screen saver and similar
screen_saver_img_kv: {},
// screen_saver_img_li: [],
screen_saver_img_kv: {}, // This key value list is generate when the launcher_file_cont is loaded. It only adds image file types.
modal__title: '-- Not Set --',
modal__open: null,
modal__open_filename: null,

View File

@@ -141,7 +141,7 @@ export let iso_datetime_formatter = function iso_datetime_formatter(
datetime_string = dayjs(raw_datetime).format('hh:mm:ss A Z');
break;
case 'time_long':
datetime_string = dayjs(raw_datetime).format('HH:mm:ss A');
datetime_string = dayjs(raw_datetime).format('HH:mm:ss');
break;
case 'time_12_long':
datetime_string = dayjs(raw_datetime).format('hh:mm:ss A');

View File

@@ -1,6 +1,6 @@
<script lang="ts">
// *** Import Svelte specific
import { tick } from 'svelte';
// import { tick } from 'svelte';
// import { goto, invalidateAll } from '$app/navigation';
// *** Import other supporting libraries
@@ -116,7 +116,7 @@ max-w-max -->
class:top-0={expand && 1 == 3}
class:opacity-100={expand}
class:w-full={expand}
class:hidden={false}
class:hidden={hide}
class:border-transparent={!expand}
class:bg-transparent={!expand}
>

View File

@@ -4,6 +4,8 @@ interface Props {
ws_connect?: boolean;
ws_connect_status?: null|string;
ws_server?: string;
ws_retry_delay?: number;
ws_retry_count?: number;
base_url?: any;
group_id?: string;
client_id?: any;
@@ -27,6 +29,8 @@ let {
ws_connect = $bindable(false),
ws_connect_status = $bindable(null),
ws_server = 'dev-api.oneskyit.com',
ws_retry_delay = 3500,
ws_retry_count = 0,
base_url = `wss://${ws_server}/ws`,
group_id = $bindable('ae-grp-99'),
client_id = $bindable(Date.now()),
@@ -103,6 +107,8 @@ function ws_connect_group_id({group_id, client_id}) {
// });
ws_conn_status = 'connected';
ws_retry_count = 0;
// ws_connection.send(JSON.stringify({
// client_id: client_id,
// target: 'echo',
@@ -203,11 +209,17 @@ function ws_connect_group_id({group_id, client_id}) {
ws_conn_status = 'disconnected';
if (ws_connect) {
if (ws_retry_count >= 10) {
ws_retry_delay = ws_retry_delay += 4999; // Set to a very long time
ws_retry_delay = Math.min(ws_retry_delay, 120000); // Max of 2 minutes
console.log(`WS: Retry count exceeded. Increasing the delay. ws_retry_count=${ws_retry_count} ws_retry_delay=${ws_retry_delay}`);
}
setTimeout(function() {
console.log('WS: Disconnected... Try again!');
ws_retry_count += 1;
ws_connect_group_id({group_id: group_id, client_id: client_id});
console.log('WS: Again done?');
}, 1000);
}, ws_retry_delay);
}
};