Cleaning things up like always.

This commit is contained in:
Scott Idem
2024-10-07 15:29:20 -04:00
parent 2ac495af8e
commit ccb36ca953
5 changed files with 54 additions and 31 deletions

View File

@@ -78,6 +78,11 @@ function ws_connect_group_id({group_id, client_id}) {
let ws_recv_data = JSON.parse(event.data);
console.log(ws_recv_data);
if (client_id == ws_recv_data.client_id) {
console.log('WS: Message received was sent by self and is an echo that can be ignored.');
return false;
}
if (ws_recv_data.type == 'cmd') {
console.log(`WS: Type CMD: ${ws_recv_data.cmd}`);
ws_received_list_cmd.unshift(ws_recv_data); // Add to the beginning of the list

View File

@@ -149,6 +149,7 @@ function handle_ws_recv(event) {
let cmd = event.detail.cmd;
console.log(cmd);
// AE Load (event session ID)
if (cmd.startsWith('ae_load:')) {
console.log();
let cmd_parts = cmd.split(':');
@@ -161,6 +162,7 @@ function handle_ws_recv(event) {
$slct_trigger = 'event_session';
$events_sess.launcher.show_launcher_message = false;
}
// AE Open (event file ID)
} else if (cmd.startsWith('ae_open:')) {
console.log();
let cmd_parts = cmd.split(':');
@@ -168,6 +170,8 @@ function handle_ws_recv(event) {
let obj_type = obj_parts[0];
let obj_id = obj_parts[1];
alert('ae_open: ' + obj_type + ' ' + obj_id);
// NOTE: This is not finished yet.
if (obj_type == 'event_file') {
$slct.event_file_id = obj_id;
@@ -186,6 +190,8 @@ function handle_ws_recv(event) {
}
// NOTE: This is not finished yet.
// AE Close (event file modal)
} else if (cmd.startsWith('ae_close:')) {
console.log();
let cmd_parts = cmd.split(':');
@@ -198,6 +204,8 @@ function handle_ws_recv(event) {
$slct_trigger = 'event_file';
$events_sess.launcher.event_file_open.open_status = 'close';
}
// AE Refresh (now)
} else if (cmd.startsWith('ae_refresh:')) {
console.log();
let cmd_parts = cmd.split(':');
@@ -520,7 +528,7 @@ export let close_event_file_as_modal = function close_event_file_as_modal({}) {
<Drawer
bgColor="bg-blue"
class="bg-orange-100 opacity-90 hover:opacity-95 transition-all duration-1000"
class="bg-orange-100 opacity-90 hover:opacity-97 transition-all duration-1000 border border-gray-300 dark:border-gray-600"
placement="left"
transitionType="fly"
transitionParams={
@@ -617,7 +625,7 @@ export let close_event_file_as_modal = function close_event_file_as_modal({}) {
<Modal
title="{$events_sess.launcher?.modal__title}"
bind:open={$events_sess.launcher.modal__open}
autoclose={true}
autoclose={false}
size="xl"
class="bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
classHeader="px-1 py-0 md:px-1 md:py-0"
@@ -627,12 +635,12 @@ export let close_event_file_as_modal = function close_event_file_as_modal({}) {
// This should work....????
console.log(`TEST - FAIL??? Local Push Controller Command: ae_close:event_file_modal`);
console.log(`Before: ${$events_sess.launcher.controller_trigger_send}`);
$events_sess.launcher.controller_cmd = `ae_close:event_file_modal`;
$events_sess.launcher.controller_trigger_send = true;
$events_sess = $events_sess;
events_sess.set($events_sess);
tick();
events_sess.set($events_sess);
// $events_sess.launcher.controller_cmd = `ae_close:event_file_modal`;
// $events_sess.launcher.controller_trigger_send = true;
// $events_sess = $events_sess;
// events_sess.set($events_sess);
// tick();
// events_sess.set($events_sess);
console.log(`After: ${$events_sess.launcher.controller_trigger_send}`);
}
}}
@@ -653,10 +661,10 @@ export let close_event_file_as_modal = function close_event_file_as_modal({}) {
$events_sess.launcher.controller_trigger_send = true;
// $events_sess.launcher.modal__open = false;
}}
class="absolute top-0 right-12 p-1"
class="absolute top-0 right-20 m-1 p-1 btn btn-sm variant-soft-error hover:variant-filled-error"
>
<span class="fas fa-times"></span>
Close Remote
<span class="fas fa-times m-1"></span>
Close Remote Display Only
</button>
<!-- <span class="aspect-[9/16] max-h-96"> -->

View File

@@ -96,6 +96,19 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig } fro
Connect?
{/if}
</button>
{#if $events_loc.launcher.ws_connect}
<button
on:click={() => {
$events_sess.launcher.controller_unlock_group_code = false;
$events_sess.launcher.controller_cmd = 'ae_refresh:now';
$events_sess.launcher.controller_trigger_send = 'trigger';
}}
class="btn btn-sm variant-ghost-secondary hover:variant-filled-secondary"
>
Send Group Reload
</button>
{/if}
</div>

View File

@@ -273,7 +273,7 @@ async function handle_open_file() {
data-filename={event_file_obj.filename}
title={event_file_obj.filename}
>
<span class="fas fa-paper-plane" class:d_none="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
</a> -->
<button
class="btn btn-lg variant-ghost-primary"
@@ -312,10 +312,10 @@ async function handle_open_file() {
title={`${event_file_obj.filename} [BTN] -- SHA256 hash: ${event_file_obj.hash_sha256.slice(0, 10)}...`}
>
{#if (screen_saver_exts.includes(event_file_obj.extension))}
<span class="fas fa-chart-bar m-1" class:d_none="{hide_launch_icon}"></span>
<span class="fas fa-chart-bar m-1" class:hidden="{hide_launch_icon}"></span>
Open Poster
{:else}
<span class="fas fa-paper-plane" class:d_none="{hide_launch_icon}"></span>
<span class="fas fa-paper-plane m-1" class:hidden="{hide_launch_icon}"></span>
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
{/if}
</button>
@@ -331,7 +331,7 @@ async function handle_open_file() {
data-filename={event_file_obj.filename}
title={`${event_file_obj.filename} [A] -- SHA256 hash: ${event_file_obj.hash_sha256.slice(0, 10)}...`}
>
<span class="fas fa-paper-plane" class:d_none="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
</a>
{:else if ($events_loc.launcher.app_mode == 'onsite' && (event_file_obj.extension == 'ppt' || event_file_obj.extension == 'pptx') && event_file_obj.open_in_os == 'win')}
<a
@@ -342,7 +342,7 @@ async function handle_open_file() {
data-filename={event_file_obj.filename}
title={`${event_file_obj.filename} [A] -- SHA256 hash: ${event_file_obj.hash_sha256.slice(0, 10)}...`}
>
<span class="fas fa-paper-plane" class:d_none="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
</a>
{:else}
<button
@@ -371,7 +371,7 @@ async function handle_open_file() {
{/if}
</span>
{:then}
<span class="fas fa-paper-plane" class:d_none="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
{#if ae_promises[event_file_obj.event_file_id_random] === null}
<span class="fas fa-exclamation-triangle"></span>
Download failed!
@@ -391,21 +391,21 @@ async function handle_open_file() {
data-filename={event_file_obj.filename}
title={event_file_obj.filename}
>
<span class="fas fa-paper-plane" class:d_none="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
</a> -->
{/if}
<!-- <a href="/event/file/{event_file_obj.event_file_id_random}/download?filename={event_file_obj.filename}&use_os=true" class="ae_btn btn_info {btn_size}">{event_file_obj.filename}</a> -->
</span>
<span class="event_file_meta" class:d_none="{hide_meta}">
<span class="event_file_created_on" class:d_none="{hide_created_on}">
<span class="event_file_meta" class:hidden="{hide_meta}">
<span class="event_file_created_on" class:hidden="{hide_created_on}">
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'datetime_short')}
</span>
<span class="event_file_size" class:d_none="{hide_size}">
<span class="event_file_size" class:hidden="{hide_size}">
{#if event_file_obj.file_size}{ae_util.format_bytes(event_file_obj.file_size)}{/if}
</span>
<span class="event_file_os" class:d_none="{hide_os}">
<span class="event_file_os" class:hidden="{hide_os}">
{#if event_file_obj.open_in_os == 'win'}
<span class="fab fa-windows"></span> Win
{:else if event_file_obj.open_in_os == 'mac'}
@@ -417,13 +417,13 @@ async function handle_open_file() {
<!-- {#if ($events_loc.launcher.app_mode == 'native' || $events_loc.launcher.app_mode == 'onsite')} -->
<!-- {#if (show_bak_download)} -->
<a href="/event/file/{event_file_obj.event_file_id_random}/download" class="event_file_download" class:d_none="{!show_bak_download}" title="Download with original filename and extension"><span class="fas fa-download"></span></a>
<a href="/event/file/{event_file_obj.event_file_id_random}/download" class="event_file_download" class:hidden="{!show_bak_download}" title="Download with original filename and extension"><span class="fas fa-download"></span></a>
<!-- {/if} -->
</span>
<!-- <button
class="ae_btn btn_xs btn_outline_debug"
class:d_none="{hide_api_download}"
class:hidden="{hide_api_download}"
on:click={() => {
// if (!confirm('Download file from API server?')) {
// return false;

View File

@@ -22,6 +22,10 @@ export default {
// flowbite-svelte
primary: { 50: '#FFF5F2', 100: '#FFF1EE', 200: '#FFE4DE', 300: '#FFD5CC', 400: '#FFBCAD', 500: '#FE795D', 600: '#EF562F', 700: '#EB4F27', 800: '#CC4522', 900: '#A5371B'},
},
opacity: {
97: '.97',
99: '.99',
}
// listStyleType: {
// none: 'none',
// disc: 'disc',
@@ -30,13 +34,6 @@ export default {
// roman: 'upper-roman',
// },
},
// listStyleType: {
// none: 'none',
// disc: 'disc',
// decimal: 'decimal',
// square: 'square',
// roman: 'upper-roman',
// },
},
plugins: [