Work on being remotely controlled.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
|
||||
export let log_lvl: number = 0;
|
||||
export let ws_connect: boolean = false;
|
||||
export let ws_connect_status: null|string = null;
|
||||
export let ws_server = 'dev-api.oneskyit.com';
|
||||
@@ -79,7 +80,9 @@ function ws_connect_group_id({group_id, client_id}) {
|
||||
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.');
|
||||
if (log_lvl) {
|
||||
console.log('WS: Message received was sent by self and is an echo that can be ignored.');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
export let data: any;
|
||||
let log_lvl = 0;
|
||||
let log_lvl = 1;
|
||||
|
||||
import { onMount, tick } from 'svelte';
|
||||
import { sineIn } from 'svelte/easing';
|
||||
@@ -164,19 +164,38 @@ function handle_ws_recv(event) {
|
||||
}
|
||||
// AE Open (event file ID)
|
||||
} else if (cmd.startsWith('ae_open:')) {
|
||||
console.log();
|
||||
let cmd_parts = cmd.split(':');
|
||||
let obj_parts = cmd_parts[1].split('=');
|
||||
let obj_type = obj_parts[0];
|
||||
let obj_id = obj_parts[1];
|
||||
|
||||
alert('ae_open: ' + obj_type + ' ' + obj_id);
|
||||
if (log_lvl) {
|
||||
console.log(`ae_open: ${obj_type} ${obj_id}`);
|
||||
}
|
||||
if (log_lvl > 1) {
|
||||
console.log(cmd);
|
||||
}
|
||||
console.log(`ae_open: ${obj_type} ${obj_id}`);
|
||||
// alert('ae_open: ' + obj_type + ' ' + obj_id);
|
||||
|
||||
// NOTE: This is not finished yet.
|
||||
if (obj_type == 'event_file') {
|
||||
$slct.event_file_id = obj_id;
|
||||
$slct_trigger = 'event_file';
|
||||
$events_sess.launcher.event_file_open.open_status = 'open';
|
||||
$events_slct.event_file_id = obj_id;
|
||||
|
||||
$events_sess.launcher.modal__open = $events_slct.event_file_id;
|
||||
let modal_title = null;
|
||||
if (!modal_title) {
|
||||
modal_title = 'test'; // event_file_obj.filename;
|
||||
}
|
||||
$events_sess.launcher.modal__title = modal_title;
|
||||
// $events_sess.launcher.modal__img_src = `/event/file/${event_file_obj.event_file_id_random}/download`;
|
||||
|
||||
// $events_slct.event_file_obj = event_file_obj;
|
||||
|
||||
|
||||
// $slct_trigger = 'event_file';
|
||||
// $events_sess.launcher.event_file_open.open_status = 'open';
|
||||
|
||||
// $events_sess.launcher.show_launcher_message = false;
|
||||
// NOTE: This is not finished yet.
|
||||
// This should now trigger the Svelte component for the event launcher file container. Currently this does nothing. Need to bind to something or use the "events_sess.launcher" object?
|
||||
@@ -200,12 +219,13 @@ function handle_ws_recv(event) {
|
||||
// let obj_id = obj_parts[1];
|
||||
|
||||
if (what == 'event_file_modal') {
|
||||
$slct.event_file_id = null;
|
||||
$slct_trigger = 'event_file';
|
||||
$events_sess.launcher.event_file_open.open_status = 'close';
|
||||
$events_sess.launcher.modal__open = false;
|
||||
// $slct.event_file_id = null;
|
||||
// $slct_trigger = 'event_file';
|
||||
// $events_sess.launcher.event_file_open.open_status = 'close';
|
||||
}
|
||||
|
||||
// AE Refresh (now)
|
||||
// WORKING! AE Refresh (now)
|
||||
} else if (cmd.startsWith('ae_refresh:')) {
|
||||
console.log();
|
||||
let cmd_parts = cmd.split(':');
|
||||
@@ -697,6 +717,7 @@ export let close_event_file_as_modal = function close_event_file_as_modal({}) {
|
||||
{#if $events_loc.launcher.controller_group_code && $events_loc.launcher.ws_connect}
|
||||
<!-- {$ae_api.base_url} -->
|
||||
<Element_websocket_v2
|
||||
log_lvl={log_lvl}
|
||||
bind:ws_connect={$events_loc.launcher.ws_connect}
|
||||
bind:ws_connect_status={$events_sess.launcher.ws_connect_status}
|
||||
ws_server={$ae_api.fqdn}
|
||||
|
||||
@@ -55,7 +55,7 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig } fro
|
||||
<div
|
||||
class:hidden={!$events_loc.launcher.show_section__controller}
|
||||
>
|
||||
|
||||
<div class="flex flex-row gap-1 p-0.5">
|
||||
<select
|
||||
bind:value={$events_loc.launcher.controller}
|
||||
class="select"
|
||||
@@ -64,7 +64,8 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig } fro
|
||||
<option value="remote">Remotely Controlled</option>
|
||||
<option value="local_push">Local and Controller</option>
|
||||
</select>
|
||||
<div class="flex flex-row">
|
||||
</div>
|
||||
<div class="flex flex-row gap-1 p-0.5">
|
||||
<input
|
||||
bind:value={$events_loc.launcher.controller_group_code}
|
||||
placeholder="Controller group code"
|
||||
|
||||
@@ -231,6 +231,7 @@ async function handle_open_file() {
|
||||
<div class="event_launcher_file_cont">
|
||||
<span class="event_file_action">
|
||||
|
||||
|
||||
{#if open_file_clicked}
|
||||
<div class="open_file_clicked alert" in:fade="{{ duration: 250 }}" out:fade="{{ duration: 2000 }}">
|
||||
{#if ($events_loc.launcher.app_mode == 'native')}
|
||||
@@ -262,6 +263,7 @@ async function handle_open_file() {
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<!-- First - Handle opening using a modal. This applies to all Launcher app modes (default, onsite, native) -->
|
||||
{#if (session_type == 'poster' || open_method == 'modal')}
|
||||
<!-- <a
|
||||
@@ -319,6 +321,8 @@ async function handle_open_file() {
|
||||
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
|
||||
<!-- {#if ($events_loc.launcher.app_mode == 'native')} -->
|
||||
<!-- Second - Handle opening a file. This applies to all Launcher app modes (default, onsite, native) -->
|
||||
{:else if ($events_loc.launcher.app_mode == 'native')}
|
||||
@@ -333,6 +337,8 @@ async function handle_open_file() {
|
||||
>
|
||||
<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
|
||||
href="/event/file/{event_file_obj.event_file_id_random}/download?use_os=true" download
|
||||
@@ -344,6 +350,8 @@ async function handle_open_file() {
|
||||
>
|
||||
<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
|
||||
class="ae_btn btn_info {btn_size}"
|
||||
|
||||
Reference in New Issue
Block a user