few GUI improvements

pull/19/head
Niko PLP 8 months ago
parent dd826b5fff
commit 9c43d577dd
  1. 6
      ng-app/src/App.svelte
  2. 4
      ng-app/src/api.ts
  3. 9
      ng-app/src/lib/FullLayout.svelte
  4. 15
      ng-app/src/lib/Home.svelte
  5. 2
      ng-app/src/lib/Test.svelte
  6. 4
      ng-app/src/routes/User.svelte
  7. 2
      ng-app/src/routes/WalletCreate.svelte
  8. 2
      ng-app/src/routes/WalletLogin.svelte
  9. 97
      ng-app/src/wallet_emojis.ts
  10. 8
      ng-verifier/src/verifier.rs
  11. 57
      ng-wallet/src/emojis.rs
  12. 2
      ng-wallet/src/lib.rs

@ -61,7 +61,7 @@
try {
await disconnections_subscribe();
} catch (e) {
console.log("called disconnections_subscribe twice");
//console.log("called disconnections_subscribe twice");
}
let tauri_platform = import.meta.env.TAURI_PLATFORM;
//console.log(await ng.test());
@ -92,7 +92,7 @@
let event_api = await import("@tauri-apps/api/event");
let main = window_api.Window.getByLabel("main");
unsub_main_close = await main.onCloseRequested(async (event) => {
console.log("onCloseRequested main");
//console.log("onCloseRequested main");
await event_api.emit("close_all", {});
let registration = window_api.Window.getByLabel("registration");
if (registration) {
@ -126,7 +126,7 @@
window.wallet_channel = wallet_channel;
wallet_channel.postMessage({ cmd: "startup" }, location.href);
wallet_channel.onmessage = async (event) => {
console.log(event.data.cmd, event.data);
//console.log(event.data.cmd, event.data);
if (!location.href.startsWith(event.origin)) return;
switch (event.data.cmd) {
case "startup":

@ -94,7 +94,7 @@ const handler = {
// TODO: install timestamp
V0 : { client_type, details: JSON.stringify(info), version, timestamp_install:0, timestamp_updated:0 }
};
console.log(info,res);
//console.log(info,res);
return res;
} else if (path[0] === "disconnections_subscribe") {
let { getCurrent } = await import("@tauri-apps/plugin-window");
@ -117,7 +117,7 @@ const handler = {
}
else if (path[0] === "app_request_stream") {
let stream_id = (lastStreamId += 1).toString();
console.log("stream_id",stream_id);
//console.log("stream_id",stream_id);
let { getCurrent } = await import("@tauri-apps/plugin-window");
let session_id = args[0];
let request = args[1];

@ -35,6 +35,7 @@
PaperAirplane,
Bell,
User,
Share,
} from "svelte-heros-v2";
let width: number;
@ -139,6 +140,14 @@
/>
</svelte:fragment>
</SidebarItem>
<SidebarItem label="Shared" href="#/shared" class="py-1 tall:p-2">
<svelte:fragment slot="icon">
<Share
tabindex="-1"
class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white"
/>
</svelte:fragment>
</SidebarItem>
<SidebarItem label="Site" href="#/site" class="py-1 tall:p-2">
<svelte:fragment slot="icon">
<User

@ -13,7 +13,12 @@
import { online } from "../store";
import FullLayout from "./FullLayout.svelte";
import Test from "./Test.svelte";
import { PaperAirplane, Bell, ArrowRightOnRectangle } from "svelte-heros-v2";
import {
PaperAirplane,
Bell,
ArrowRightOnRectangle,
Share,
} from "svelte-heros-v2";
// @ts-ignore
import Logo from "../assets/nextgraph.svg?component";
// @ts-ignore
@ -49,7 +54,13 @@
>
</a>
<div class="w-auto flex row">
<a href="#/messages" class="row items-center" on:click>
<a href="#/shared" class="row items-center" on:click>
<Share
tabindex="-1"
class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white focus:outline-none"
/>
</a>
<a href="#/messages" class="ml-6 row items-center" on:click>
<PaperAirplane
tabindex="-1"
class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white focus:outline-none"

@ -212,7 +212,7 @@
/><br />
All those limitations will be lifted once the "UserStorage for Web" feature
will be released. Stay tuned! <br /><br />
Check your connection status in the <a href="#/user">user panel</a>.
Check your connection status in the <a href="#/user">User panel</a>.
</p>
</div>
{:else}

@ -191,7 +191,7 @@
/>
<span class="ml-3">Logout</span>
</li>
<li
<!-- <li
tabindex="0"
class="flex items-center p-2 text-base font-normal text-gray-900 clickable rounded-lg dark:text-white hover:bg-gray-200 dark:hover:bg-gray-700"
on:keypress={close_session}
@ -202,7 +202,7 @@
class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white"
/>
<span class="ml-3">Switch wallet</span>
</li>
</li> -->
{#if !downloading}
<li
tabindex="0"

@ -229,7 +229,7 @@
core_registration,
additional_bootstrap,
};
console.log("do wallet with params", params);
//console.log("do wallet with params", params);
try {
ready = await ng.wallet_create(params);
wallets.set(await ng.get_wallets());

@ -108,7 +108,7 @@
event.detail.id,
event.detail.wallet.V0.personal_site
);
console.log(session);
//console.log(session);
if (session) {
set_active_session(session);
}

@ -505,7 +505,7 @@ let face = [
},
];
let big_animal = [
let bigger_animal = [
{
hexcode: "1f981",
shortcode: "lion",
@ -563,9 +563,9 @@ let face = [
code: "rhinoceros",
},
{
hexcode: "1f407",
shortcode: "rabbit",
code: "rabbit",
hexcode: "1f9a9",
shortcode: "flamingo",
code: "flamingo",
},
{
hexcode: "1f433",
@ -584,11 +584,11 @@ let face = [
},
];
let animal = [
let smaller_animal = [
{
hexcode: "1f413",
shortcode: "rooster",
code: "chicken",
code: "rooster",
svg: "",
},
{
@ -612,9 +612,9 @@ let face = [
code: "owl",
},
{
hexcode: "1f9a9",
shortcode: "flamingo",
code: "flamingo",
hexcode: "1f407",
shortcode: "rabbit",
code: "rabbit",
},
{
hexcode: "1f427",
@ -964,7 +964,7 @@ let face = [
{
hexcode: "1f695",
shortcode: "taxi",
code: "car",
code: "taxi",
},
{
hexcode: "1f3cd",
@ -1461,58 +1461,59 @@ export async function load_svg() {
sport[13].svg = await import("./assets/pazzle/emoji_u1f3d3.svg?component");
sport[14].svg = await import("./assets/pazzle/emoji_u1f94b.svg?component");
/************** BIG ANIMAL *********************/
/************** BIGGER ANIMAL *********************/
big_animal[0].svg = await import("./assets/pazzle/emoji_u1f981.svg?component");
big_animal[1].svg = await import("./assets/pazzle/emoji_u1f406.svg?component");
big_animal[2].svg = await import("./assets/pazzle/emoji_u1f434.svg?component");
bigger_animal[0].svg = await import("./assets/pazzle/emoji_u1f981.svg?component");
bigger_animal[1].svg = await import("./assets/pazzle/emoji_u1f406.svg?component");
bigger_animal[2].svg = await import("./assets/pazzle/emoji_u1f434.svg?component");
big_animal[3].svg = await import("./assets/pazzle/emoji_u1f993.svg?component");
big_animal[4].svg = await import("./assets/pazzle/emoji_u1f416.svg?component");
big_animal[5].svg = await import("./assets/pazzle/emoji_u1f410.svg?component");
bigger_animal[3].svg = await import("./assets/pazzle/emoji_u1f993.svg?component");
bigger_animal[4].svg = await import("./assets/pazzle/emoji_u1f416.svg?component");
bigger_animal[5].svg = await import("./assets/pazzle/emoji_u1f410.svg?component");
big_animal[6].svg = await import("./assets/pazzle/emoji_u1f411.svg?component");
big_animal[7].svg = await import("./assets/pazzle/emoji_u1f42a.svg?component");
big_animal[8].svg = await import("./assets/pazzle/emoji_u1f992.svg?component");
bigger_animal[6].svg = await import("./assets/pazzle/emoji_u1f411.svg?component");
bigger_animal[7].svg = await import("./assets/pazzle/emoji_u1f42a.svg?component");
bigger_animal[8].svg = await import("./assets/pazzle/emoji_u1f992.svg?component");
big_animal[9].svg = await import("./assets/pazzle/emoji_u1f418.svg?component");
big_animal[10].svg = await import(
bigger_animal[9].svg = await import("./assets/pazzle/emoji_u1f418.svg?component");
bigger_animal[10].svg = await import(
"./assets/pazzle/emoji_u1f98f.svg?component"
);
big_animal[11].svg = await import(
"./assets/pazzle/emoji_u1f407.svg?component"
);
big_animal[12].svg = await import("./assets/pazzle/emoji_u1f433.svg?component");
big_animal[13].svg = await import("./assets/pazzle/emoji_u1f42c.svg?component");
big_animal[14].svg = await import(
bigger_animal[11].svg = await import("./assets/pazzle/emoji_u1f9a9.svg?component");
bigger_animal[12].svg = await import("./assets/pazzle/emoji_u1f433.svg?component");
bigger_animal[13].svg = await import("./assets/pazzle/emoji_u1f42c.svg?component");
bigger_animal[14].svg = await import(
"./assets/pazzle/emoji_u1f43b_200d_2744.svg?component"
);
/************** ANIMAL *********************/
/************** SMALLER ANIMAL *********************/
animal[0].svg = await import("./assets/pazzle/emoji_u1f413.svg?component");
animal[1].svg = await import("./assets/pazzle/emoji_u1f423.svg?component");
animal[2].svg = await import("./assets/pazzle/emoji_u1f985.svg?component");
smaller_animal[0].svg = await import("./assets/pazzle/emoji_u1f413.svg?component");
smaller_animal[1].svg = await import("./assets/pazzle/emoji_u1f423.svg?component");
smaller_animal[2].svg = await import("./assets/pazzle/emoji_u1f985.svg?component");
animal[3].svg = await import("./assets/pazzle/emoji_u1f986.svg?component");
animal[4].svg = await import("./assets/pazzle/emoji_u1f989.svg?component");
animal[5].svg = await import("./assets/pazzle/emoji_u1f9a9.svg?component");
smaller_animal[3].svg = await import("./assets/pazzle/emoji_u1f986.svg?component");
smaller_animal[4].svg = await import("./assets/pazzle/emoji_u1f989.svg?component");
smaller_animal[5].svg = await import(
"./assets/pazzle/emoji_u1f407.svg?component"
);
animal[6].svg = await import("./assets/pazzle/emoji_u1f427.svg?component");
animal[7].svg = await import("./assets/pazzle/emoji_u1f98e.svg?component");
animal[8].svg = await import("./assets/pazzle/emoji_u1f422.svg?component");
smaller_animal[6].svg = await import("./assets/pazzle/emoji_u1f427.svg?component");
smaller_animal[7].svg = await import("./assets/pazzle/emoji_u1f98e.svg?component");
smaller_animal[8].svg = await import("./assets/pazzle/emoji_u1f422.svg?component");
animal[9].svg = await import("./assets/pazzle/emoji_u1f40d.svg?component");
animal[10].svg = await import(
smaller_animal[9].svg = await import("./assets/pazzle/emoji_u1f40d.svg?component");
smaller_animal[10].svg = await import(
"./assets/pazzle/emoji_u1f994.svg?component"
);
animal[11].svg = await import(
smaller_animal[11].svg = await import(
"./assets/pazzle/emoji_u1f987.svg?component"
);
animal[12].svg = await import("./assets/pazzle/emoji_u1f41f.svg?component");
animal[13].svg = await import("./assets/pazzle/emoji_u1f41a.svg?component");
animal[14].svg = await import("./assets/pazzle/emoji_u1f419.svg?component");
smaller_animal[12].svg = await import("./assets/pazzle/emoji_u1f41f.svg?component");
smaller_animal[13].svg = await import("./assets/pazzle/emoji_u1f41a.svg?component");
smaller_animal[14].svg = await import("./assets/pazzle/emoji_u1f419.svg?component");
/************** PLANTS *********************/
@ -1693,8 +1694,8 @@ export const emojis = {
emotion,
body,
sport,
big_animal,
animal,
bigger_animal,
smaller_animal,
plants,
fruits,
food,
@ -1707,8 +1708,8 @@ export const emojis = {
export const emoji_cat = [
"face",
"sport",
"big_animal",
"animal",
"bigger_animal",
"smaller_animal",
"plants",
"fruits",
"food",

@ -186,7 +186,7 @@ impl Verifier {
// );
if let Some(sender) = self.branch_subscriptions.get_mut(branch) {
if sender.is_closed() {
log_info!("closed so removed");
//log_info!("closed so removed");
self.branch_subscriptions.remove(branch);
} else {
let _ = sender.send(response).await;
@ -231,7 +231,7 @@ impl Verifier {
}
let fnonce = Box::new(move || {
log_info!("CLOSE_CHANNEL");
//log_info!("CLOSE_CHANNEL");
if !tx.is_closed() {
tx.close_channel();
}
@ -1292,7 +1292,7 @@ impl Verifier {
&& theirs.difference(&ours_set).count() == 0
{
// no need to sync
log_info!("branch is up to date");
// log_info!("branch is up to date");
return Ok(());
}
@ -1851,7 +1851,7 @@ impl Verifier {
.await?;
log_info!("REPLAY DONE");
}
log_info!("SENDING {} EVENTS FOR OUTBOX", events_to_replay.len());
log_info!("SENDING {} EVENTS FROM OUTBOX", events_to_replay.len());
for e in events_to_replay {
let files = e.event.file_ids();
if !files.is_empty() {

@ -14,7 +14,7 @@ pub struct EmojiDef<'a> {
pub shortcode: &'a str,
pub code: &'a str,
}
#[allow(non_upper_case_globals)]
const face: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f600",
@ -92,7 +92,7 @@ const face: [EmojiDef<'static>; 15] = [
code: "sleeping",
},
];
#[allow(non_upper_case_globals)]
const face_unwell: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f637",
@ -171,7 +171,7 @@ const face_unwell: [EmojiDef<'static>; 15] = [
code: "annoyed",
},
];
#[allow(non_upper_case_globals)]
const face_costume: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f921",
@ -249,7 +249,7 @@ const face_costume: [EmojiDef<'static>; 15] = [
code: "fairy",
},
];
#[allow(non_upper_case_globals)]
const emotion: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f48c",
@ -327,7 +327,7 @@ const emotion: [EmojiDef<'static>; 15] = [
code: "praying",
},
];
#[allow(non_upper_case_globals)]
const body: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f4aa",
@ -405,7 +405,7 @@ const body: [EmojiDef<'static>; 15] = [
code: "shoe",
},
];
#[allow(non_upper_case_globals)]
const sport: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f93a",
@ -483,8 +483,8 @@ const sport: [EmojiDef<'static>; 15] = [
code: "martial",
},
];
const big_animal: [EmojiDef<'static>; 15] = [
#[allow(non_upper_case_globals)]
const bigger_animal: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f981",
shortcode: "lion",
@ -541,9 +541,9 @@ const big_animal: [EmojiDef<'static>; 15] = [
code: "rhinoceros",
},
EmojiDef {
hexcode: "1f407",
shortcode: "rabbit",
code: "rabbit",
hexcode: "1f9a9",
shortcode: "flamingo",
code: "flamingo",
},
EmojiDef {
hexcode: "1f433",
@ -562,11 +562,12 @@ const big_animal: [EmojiDef<'static>; 15] = [
},
];
const animal: [EmojiDef<'static>; 15] = [
#[allow(non_upper_case_globals)]
const smaller_animal: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f413",
shortcode: "rooster",
code: "chicken",
code: "rooster",
},
EmojiDef {
hexcode: "1f423",
@ -589,9 +590,9 @@ const animal: [EmojiDef<'static>; 15] = [
code: "owl",
},
EmojiDef {
hexcode: "1f9a9",
shortcode: "flamingo",
code: "flamingo",
hexcode: "1f407",
shortcode: "rabbit",
code: "rabbit",
},
EmojiDef {
hexcode: "1f427",
@ -639,7 +640,7 @@ const animal: [EmojiDef<'static>; 15] = [
code: "octopus",
},
];
#[allow(non_upper_case_globals)]
const plants: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f40c",
@ -717,7 +718,7 @@ const plants: [EmojiDef<'static>; 15] = [
code: "mushroom",
},
];
#[allow(non_upper_case_globals)]
const fruits: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f347",
@ -795,7 +796,7 @@ const fruits: [EmojiDef<'static>; 15] = [
code: "pepper",
},
];
#[allow(non_upper_case_globals)]
const food: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f950",
@ -873,7 +874,7 @@ const food: [EmojiDef<'static>; 15] = [
code: "two_glasses",
},
];
#[allow(non_upper_case_globals)]
const travel: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f3d4",
@ -923,7 +924,7 @@ const travel: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f695",
shortcode: "taxi",
code: "car",
code: "taxi",
},
EmojiDef {
hexcode: "1f3cd",
@ -951,7 +952,7 @@ const travel: [EmojiDef<'static>; 15] = [
code: "rocket",
},
];
#[allow(non_upper_case_globals)]
const sky: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "2600",
@ -1029,7 +1030,7 @@ const sky: [EmojiDef<'static>; 15] = [
code: "rainbow",
},
];
#[allow(non_upper_case_globals)]
const play: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f3b8",
@ -1107,7 +1108,7 @@ const play: [EmojiDef<'static>; 15] = [
code: "scuba_diving",
},
];
#[allow(non_upper_case_globals)]
const house: [EmojiDef<'static>; 15] = [
EmojiDef {
hexcode: "1f9f9",
@ -1194,8 +1195,8 @@ lazy_static! {
("emotion", emotion),
("body", body),
("sport", sport),
("big_animal", big_animal),
("animal", animal),
("bigger_animal", bigger_animal),
("smaller_animal", smaller_animal),
("plants", plants),
("fruits", fruits),
("food", food),
@ -1211,8 +1212,8 @@ lazy_static! {
pub const EMOJI_CAT: [&'static str; 15] = [
"face",
"sport",
"big_animal",
"animal",
"bigger_animal",
"smaller_animal",
"plants",
"fruits",
"food",

@ -320,7 +320,7 @@ pub fn open_wallet_with_pazzle(
return Err(NgWalletError::InvalidPin);
}
log_info!("pazzle={:?}", pazzle);
//log_info!("pazzle={:?}", pazzle);
let opening_pazzle = Instant::now();

Loading…
Cancel
Save