add is login requied
This commit is contained in:
parent
9e246e7aaa
commit
0f68d3e650
@ -114,8 +114,7 @@ WHERE id = ${current_item.id}`;
|
|||||||
export let is_dialog_item_add = false;
|
export let is_dialog_item_add = false;
|
||||||
|
|
||||||
let is_logedin = false;
|
let is_logedin = false;
|
||||||
|
export let is_login_requied = true;
|
||||||
export let data_access;
|
|
||||||
|
|
||||||
let access_level = "";
|
let access_level = "";
|
||||||
/**
|
/**
|
||||||
@ -135,6 +134,11 @@ WHERE id = ${current_item.id}`;
|
|||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await load_db();
|
await load_db();
|
||||||
is_loaded = true;
|
is_loaded = true;
|
||||||
|
if (!is_login_requied) {
|
||||||
|
is_logedin = true;
|
||||||
|
check_access = () => true;
|
||||||
|
check_login = async () => [true, ""];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$: cur_dialog_name = is_dialog_item_add
|
$: cur_dialog_name = is_dialog_item_add
|
||||||
? `Добавить в ${db_scheme[current_page].tables[current_table]}`
|
? `Добавить в ${db_scheme[current_page].tables[current_table]}`
|
||||||
@ -149,12 +153,14 @@ WHERE id = ${current_item.id}`;
|
|||||||
bind:is_view_open
|
bind:is_view_open
|
||||||
check_access={(name) => check_access(access_level, name, null)}
|
check_access={(name) => check_access(access_level, name, null)}
|
||||||
on_logout={() => {
|
on_logout={() => {
|
||||||
|
if (is_login_requied) {
|
||||||
is_logedin = false;
|
is_logedin = false;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
access_level = "";
|
access_level = "";
|
||||||
current_page = "Запросы";
|
current_page = "Запросы";
|
||||||
current_table = "";
|
current_table = "";
|
||||||
current_view = "";
|
current_view = "";
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
></NavBar>
|
></NavBar>
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ CREATE TABLE IF NOT EXISTS IdBuffer (id INTEGER);
|
|||||||
|
|
||||||
let is_item_dialog_open = false;
|
let is_item_dialog_open = false;
|
||||||
let is_dialog_item_add = false;
|
let is_dialog_item_add = false;
|
||||||
|
let is_login_requied = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} access_level
|
* @param {string} access_level
|
||||||
@ -216,10 +217,10 @@ insert into IdBuffer (id) values (${ar.join("), (")});`);
|
|||||||
<ScreenWrap
|
<ScreenWrap
|
||||||
{db}
|
{db}
|
||||||
{db_scheme}
|
{db_scheme}
|
||||||
{data_access}
|
|
||||||
{load_db}
|
{load_db}
|
||||||
{check_access}
|
{check_access}
|
||||||
{check_login}
|
{check_login}
|
||||||
|
{is_login_requied}
|
||||||
bind:is_item_dialog_open
|
bind:is_item_dialog_open
|
||||||
bind:is_dialog_item_add
|
bind:is_dialog_item_add
|
||||||
bind:current_item
|
bind:current_item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user