style: Apply Prettier formatting with 4-space indentation
Applied consistent code formatting across the project using Prettier, now configured to use 4-space indentation instead of tabs.
This commit is contained in:
@@ -1,116 +1,116 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
export let data: any;
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
export let data: any;
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
// import type { Writable } from 'svelte/store';
|
||||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
// import type { Writable } from 'svelte/store';
|
||||
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { api } from '$lib/api/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
|
||||
import { events_loc, events_slct, events_trigger } from '$lib/stores/ae_events_stores';
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { api } from '$lib/api/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
|
||||
import { events_loc, events_slct, events_trigger } from '$lib/stores/ae_events_stores';
|
||||
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
|
||||
if (!$ae_loc.admin) {
|
||||
$ae_loc.admin = {};
|
||||
}
|
||||
if (!$ae_loc.admin) {
|
||||
$ae_loc.admin = {};
|
||||
}
|
||||
|
||||
$ae_loc.qry__enabled = 'enabled';
|
||||
$ae_loc.qry__hidden = 'not_hidden';
|
||||
$ae_loc.qry__limit = 15;
|
||||
$ae_loc.qry__offset = 0;
|
||||
$ae_loc.qry__enabled = 'enabled';
|
||||
$ae_loc.qry__hidden = 'not_hidden';
|
||||
$ae_loc.qry__limit = 15;
|
||||
$ae_loc.qry__offset = 0;
|
||||
|
||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||
$slct.account_id = data.account_id;
|
||||
console.log(`$slct.account_id = `, $slct.account_id);
|
||||
let ae_acct = data[$slct.account_id];
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||
$slct.account_id = data.account_id;
|
||||
console.log(`$slct.account_id = `, $slct.account_id);
|
||||
let ae_acct = data[$slct.account_id];
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
|
||||
$events_slct.event_id = ae_acct.slct.event_id;
|
||||
$events_slct.event_obj = ae_acct.slct.event_obj;
|
||||
$events_slct.event_id = ae_acct.slct.event_id;
|
||||
$events_slct.event_obj = ae_acct.slct.event_obj;
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
let ae_promises: key_val = {};
|
||||
|
||||
onMount(() => {
|
||||
console.log('Admin: +layout.svelte');
|
||||
});
|
||||
onMount(() => {
|
||||
console.log('Admin: +layout.svelte');
|
||||
});
|
||||
|
||||
// Updated 2024-03-06
|
||||
// async function handle_load_ae_obj_id__event({event_id, try_cache=false}) {
|
||||
// console.log(`*** handle_load_ae_obj_id__event() *** event_id=${event_id} api_cfg=`, $ae_api);
|
||||
// Updated 2024-03-06
|
||||
// async function handle_load_ae_obj_id__event({event_id, try_cache=false}) {
|
||||
// console.log(`*** handle_load_ae_obj_id__event() *** event_id=${event_id} api_cfg=`, $ae_api);
|
||||
|
||||
// let params = {};
|
||||
// let params = {};
|
||||
|
||||
// // $events_sess.badges.status_load__event_obj = 'loading';
|
||||
// ae_promises.load__event_obj = await api.get_ae_obj_id_crud({
|
||||
// api_cfg: $ae_api,
|
||||
// obj_type: 'event',
|
||||
// obj_id: event_id, // NOTE: This is the FQDN, not normally the ID.
|
||||
// use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
// use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
// params: params,
|
||||
// log_lvl: 0
|
||||
// })
|
||||
// .then(function (event_obj_get_result) {
|
||||
// if (event_obj_get_result) {
|
||||
// return event_obj_get_result;
|
||||
// } else {
|
||||
// console.log('No results returned.');
|
||||
// return null;
|
||||
// }
|
||||
// })
|
||||
// .catch(function (error: any) {
|
||||
// console.log('No results returned or failed.', error);
|
||||
// });
|
||||
// // $events_sess.badges.status_load__event_obj = 'loading';
|
||||
// ae_promises.load__event_obj = await api.get_ae_obj_id_crud({
|
||||
// api_cfg: $ae_api,
|
||||
// obj_type: 'event',
|
||||
// obj_id: event_id, // NOTE: This is the FQDN, not normally the ID.
|
||||
// use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
// use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
// params: params,
|
||||
// log_lvl: 0
|
||||
// })
|
||||
// .then(function (event_obj_get_result) {
|
||||
// if (event_obj_get_result) {
|
||||
// return event_obj_get_result;
|
||||
// } else {
|
||||
// console.log('No results returned.');
|
||||
// return null;
|
||||
// }
|
||||
// })
|
||||
// .catch(function (error: any) {
|
||||
// console.log('No results returned or failed.', error);
|
||||
// });
|
||||
|
||||
// return ae_promises.load__event_obj;
|
||||
// }
|
||||
// return ae_promises.load__event_obj;
|
||||
// }
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Æ Admin - {$ae_loc.title ?? 'Æ loading...'}</title>
|
||||
<title>Æ Admin - {$ae_loc.title ?? 'Æ loading...'}</title>
|
||||
</svelte:head>
|
||||
|
||||
<section class="submenu flex flex-row justify-center" class:hidden={$ae_loc.iframe}>
|
||||
<span class=" preset-tonal-secondary px-4 py-2">
|
||||
{#each Object.entries(data.submenu) as [key, item]}
|
||||
<!-- <a href="/settings/{item.slug}">{item.title}</a> -->
|
||||
<!-- class:hidden={!$ae_loc.trusted_access && item.access} -->
|
||||
{#if item.disable}
|
||||
<button
|
||||
title={item.title}
|
||||
class="hover:preset-tonal-secondary border border-secondary-500"
|
||||
class:hidden={(!$ae_loc.trusted_access && item.access === 'trusted') ||
|
||||
(!$ae_loc.administrator_access && item.access === 'administrator') ||
|
||||
item.hide}
|
||||
disabled={item.disable}
|
||||
on:click={() => {
|
||||
// window.location(item.href);
|
||||
// href={item.href}
|
||||
// invalidateAll
|
||||
goto(item.href, {});
|
||||
}}
|
||||
>
|
||||
{item.name}
|
||||
</button>
|
||||
{:else}
|
||||
<a
|
||||
href={item.href}
|
||||
title={item.title}
|
||||
class="hover:preset-tonal-secondary border border-secondary-500"
|
||||
class:hidden={(!$ae_loc.trusted_access && item.access === 'trusted') ||
|
||||
(!$ae_loc.administrator_access && item.access === 'administrator') ||
|
||||
item.hide}
|
||||
class:disabled={item.disable}
|
||||
>
|
||||
{item.name}
|
||||
</a>
|
||||
{/if}
|
||||
{/each}
|
||||
</span>
|
||||
<span class=" preset-tonal-secondary px-4 py-2">
|
||||
{#each Object.entries(data.submenu) as [key, item]}
|
||||
<!-- <a href="/settings/{item.slug}">{item.title}</a> -->
|
||||
<!-- class:hidden={!$ae_loc.trusted_access && item.access} -->
|
||||
{#if item.disable}
|
||||
<button
|
||||
title={item.title}
|
||||
class="hover:preset-tonal-secondary border border-secondary-500"
|
||||
class:hidden={(!$ae_loc.trusted_access && item.access === 'trusted') ||
|
||||
(!$ae_loc.administrator_access && item.access === 'administrator') ||
|
||||
item.hide}
|
||||
disabled={item.disable}
|
||||
on:click={() => {
|
||||
// window.location(item.href);
|
||||
// href={item.href}
|
||||
// invalidateAll
|
||||
goto(item.href, {});
|
||||
}}
|
||||
>
|
||||
{item.name}
|
||||
</button>
|
||||
{:else}
|
||||
<a
|
||||
href={item.href}
|
||||
title={item.title}
|
||||
class="hover:preset-tonal-secondary border border-secondary-500"
|
||||
class:hidden={(!$ae_loc.trusted_access && item.access === 'trusted') ||
|
||||
(!$ae_loc.administrator_access && item.access === 'administrator') ||
|
||||
item.hide}
|
||||
class:disabled={item.disable}
|
||||
>
|
||||
{item.name}
|
||||
</a>
|
||||
{/if}
|
||||
{/each}
|
||||
</span>
|
||||
</section>
|
||||
|
||||
<slot></slot>
|
||||
|
||||
@@ -1,147 +1,147 @@
|
||||
<script lang="ts">
|
||||
export let data: any;
|
||||
console.log(`ae_events_badges +page data:`, data);
|
||||
// console.log(`ae_events_badges Data Params:`, data.url.searchParams.get('event_id'));
|
||||
export let data: any;
|
||||
console.log(`ae_events_badges +page data:`, data);
|
||||
// console.log(`ae_events_badges Data Params:`, data.url.searchParams.get('event_id'));
|
||||
|
||||
import { onMount } from 'svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// import { api } from '$lib/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/stores/ae_stores';
|
||||
// import { events_loc, events_slct, events_trigger } from '$lib/stores/ae_events_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import { api } from '$lib/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/stores/ae_stores';
|
||||
// import { events_loc, events_slct, events_trigger } from '$lib/stores/ae_events_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
|
||||
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
|
||||
import Element_sql_qry from '$lib/elements/element_sql_qry.svelte';
|
||||
// import Element_obj_tbl_row from '$lib/element_obj_tbl_row.svelte';
|
||||
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
|
||||
import Element_sql_qry from '$lib/elements/element_sql_qry.svelte';
|
||||
// import Element_obj_tbl_row from '$lib/element_obj_tbl_row.svelte';
|
||||
|
||||
let sql_report_qry = null;
|
||||
let sql_report_qry = null;
|
||||
|
||||
onMount(() => {
|
||||
console.log('Admin: +page.svelte');
|
||||
onMount(() => {
|
||||
console.log('Admin: +page.svelte');
|
||||
|
||||
console.log('ae_ slct:', $slct);
|
||||
console.log('ae_ slct:', $slct);
|
||||
|
||||
let href_url = window.location.href;
|
||||
// console.log(href_url);
|
||||
let href_url = window.location.href;
|
||||
// console.log(href_url);
|
||||
|
||||
$ae_loc.href_url = href_url;
|
||||
// console.log(`$ae_loc.href_url = `, $ae_loc.href_url);
|
||||
$ae_loc.href_url = href_url;
|
||||
// console.log(`$ae_loc.href_url = `, $ae_loc.href_url);
|
||||
|
||||
// $slct_trigger = 'msg_parent';
|
||||
// ae_util.handle_url_and_message('event_id', $events_slct.event_id);
|
||||
// ae_util.handle_url_and_message('badge_id', $events_slct.badge_id);
|
||||
// if ($events_slct.badge_id) {
|
||||
// console.log(`Got an ID. Let's show the modal!`);
|
||||
// modalStore.trigger(modal_edit__badge_obj);
|
||||
// }
|
||||
});
|
||||
// $slct_trigger = 'msg_parent';
|
||||
// ae_util.handle_url_and_message('event_id', $events_slct.event_id);
|
||||
// ae_util.handle_url_and_message('badge_id', $events_slct.badge_id);
|
||||
// if ($events_slct.badge_id) {
|
||||
// console.log(`Got an ID. Let's show the modal!`);
|
||||
// modalStore.trigger(modal_edit__badge_obj);
|
||||
// }
|
||||
});
|
||||
</script>
|
||||
|
||||
<section class="ae_admin md:container h-full mx-auto">
|
||||
<h2 class="h3">Admin for {$ae_loc.account_name} ({$ae_loc.account_id})</h2>
|
||||
<h2 class="h3">Admin for {$ae_loc.account_name} ({$ae_loc.account_id})</h2>
|
||||
|
||||
<h3 class="h4">Restricted Access</h3>
|
||||
<p>Accessing the admin is currently restricted</p>
|
||||
<h3 class="h4">Restricted Access</h3>
|
||||
<p>Accessing the admin is currently restricted</p>
|
||||
|
||||
<Element_data_store
|
||||
ds_code="admin__overview"
|
||||
ds_type="html"
|
||||
for_type="event"
|
||||
for_id={$ae_loc.event_id}
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
/>
|
||||
<Element_data_store
|
||||
ds_code="admin__overview"
|
||||
ds_type="html"
|
||||
for_type="event"
|
||||
for_id={$ae_loc.event_id}
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
/>
|
||||
|
||||
{#if $ae_loc.trusted_access}
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$ae_loc.admin.show_option = 'ae_loc_json';
|
||||
}}
|
||||
class="btn btn-md preset-tonal-primary hover:preset-tonal-primary border border-primary-500"
|
||||
>
|
||||
AE Local Storage
|
||||
</button>
|
||||
{#if $ae_loc.trusted_access}
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$ae_loc.admin.show_option = 'ae_loc_json';
|
||||
}}
|
||||
class="btn btn-md preset-tonal-primary hover:preset-tonal-primary border border-primary-500"
|
||||
>
|
||||
AE Local Storage
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$ae_loc.admin.show_option = 'event_file_list';
|
||||
}}
|
||||
class="btn btn-md preset-tonal-primary hover:preset-tonal-primary border border-primary-500"
|
||||
>
|
||||
Event File List
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$ae_loc.admin.show_option = 'event_file_list';
|
||||
}}
|
||||
class="btn btn-md preset-tonal-primary hover:preset-tonal-primary border border-primary-500"
|
||||
>
|
||||
Event File List
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$ae_loc.admin.show_option = 'event_badge_printed';
|
||||
}}
|
||||
class="btn btn-md preset-tonal-primary hover:preset-tonal-primary border border-primary-500"
|
||||
>
|
||||
Event Badge Printed
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$ae_loc.admin.show_option = 'event_badge_printed';
|
||||
}}
|
||||
class="btn btn-md preset-tonal-primary hover:preset-tonal-primary border border-primary-500"
|
||||
>
|
||||
Event Badge Printed
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if $ae_loc.admin?.show_option == 'ae_loc_json'}
|
||||
<h2>AE Local Storage</h2>
|
||||
<pre class="text-xs">
|
||||
{#if $ae_loc.admin?.show_option == 'ae_loc_json'}
|
||||
<h2>AE Local Storage</h2>
|
||||
<pre class="text-xs">
|
||||
{JSON.stringify($ae_loc, null, 2)}
|
||||
</pre>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if $ae_loc.admin?.show_option == 'event_file_list'}
|
||||
<h2>Report SQL</h2>
|
||||
<Element_data_store
|
||||
ds_code="rpt_sql_select_event_file_list_w_url"
|
||||
ds_type="sql"
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
bind:val_sql={$ae_loc.ds['rpt_sql_select_event_file_list_w_url']}
|
||||
/>
|
||||
{#if $ae_loc.admin?.show_option == 'event_file_list'}
|
||||
<h2>Report SQL</h2>
|
||||
<Element_data_store
|
||||
ds_code="rpt_sql_select_event_file_list_w_url"
|
||||
ds_type="sql"
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
bind:val_sql={$ae_loc.ds['rpt_sql_select_event_file_list_w_url']}
|
||||
/>
|
||||
|
||||
<Element_sql_qry
|
||||
api_cfg={$ae_api}
|
||||
run_on_load={true}
|
||||
show_textarea={true}
|
||||
sql_statement={$ae_loc.ds['rpt_sql_select_event_file_list_w_url']}
|
||||
sql_data={{ event_id: $slct.event_id, base_url: $ae_api.base_url }}
|
||||
as_list={true}
|
||||
/>
|
||||
{/if}
|
||||
<Element_sql_qry
|
||||
api_cfg={$ae_api}
|
||||
run_on_load={true}
|
||||
show_textarea={true}
|
||||
sql_statement={$ae_loc.ds['rpt_sql_select_event_file_list_w_url']}
|
||||
sql_data={{ event_id: $slct.event_id, base_url: $ae_api.base_url }}
|
||||
as_list={true}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if $ae_loc.admin?.show_option == 'event_badge_printed'}
|
||||
<h2>Report SQL</h2>
|
||||
<Element_data_store
|
||||
ds_code="rpt_sql_select_event_badge_printed_by_ext_event"
|
||||
ds_type="sql"
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
bind:val_sql={$ae_loc.ds['rpt_sql_select_event_badge_printed_by_ext_event']}
|
||||
/>
|
||||
{#if $ae_loc.admin?.show_option == 'event_badge_printed'}
|
||||
<h2>Report SQL</h2>
|
||||
<Element_data_store
|
||||
ds_code="rpt_sql_select_event_badge_printed_by_ext_event"
|
||||
ds_type="sql"
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
bind:val_sql={$ae_loc.ds['rpt_sql_select_event_badge_printed_by_ext_event']}
|
||||
/>
|
||||
|
||||
<Element_sql_qry
|
||||
api_cfg={$ae_api}
|
||||
remove_breaks={false}
|
||||
run_on_load={true}
|
||||
show_textarea={true}
|
||||
sql_statement={$ae_loc.ds['rpt_sql_select_event_badge_printed_by_ext_event']}
|
||||
sql_data={{ event_id: $slct.event_id, base_url: $ae_api.base_url }}
|
||||
as_list={true}
|
||||
/>
|
||||
{/if}
|
||||
<!-- {#if $ae_loc.app_cfg.show_element__cfg_detail} -->
|
||||
<Element_sql_qry
|
||||
api_cfg={$ae_api}
|
||||
remove_breaks={false}
|
||||
run_on_load={true}
|
||||
show_textarea={true}
|
||||
sql_statement={$ae_loc.ds['rpt_sql_select_event_badge_printed_by_ext_event']}
|
||||
sql_data={{ event_id: $slct.event_id, base_url: $ae_api.base_url }}
|
||||
as_list={true}
|
||||
/>
|
||||
{/if}
|
||||
<!-- {#if $ae_loc.app_cfg.show_element__cfg_detail} -->
|
||||
|
||||
<!-- {/if} -->
|
||||
<!-- {/if} -->
|
||||
|
||||
{#if $ae_loc.admin?.show_element__sql_qry}
|
||||
<h2>Report</h2>
|
||||
{#if $ae_loc.admin?.show_element__sql_qry}
|
||||
<h2>Report</h2>
|
||||
|
||||
<span>
|
||||
<!-- Setting run_on_load to false. True seems to cause a problem with it trying to render before the results have been returned. The sql_qry_result should be checked to see if it is a list of some kind. -->
|
||||
<!-- <Element_sql_qry
|
||||
<span>
|
||||
<!-- Setting run_on_load to false. True seems to cause a problem with it trying to render before the results have been returned. The sql_qry_result should be checked to see if it is a list of some kind. -->
|
||||
<!-- <Element_sql_qry
|
||||
api_cfg={$ae_api}
|
||||
run_on_load={false}
|
||||
show_textarea={false}
|
||||
@@ -152,9 +152,9 @@
|
||||
as_list={true}
|
||||
log_lvl={1}
|
||||
/> -->
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<style lang="postcss">
|
||||
|
||||
Reference in New Issue
Block a user