fixed windows issues

This commit is contained in:
DecDuck
2024-10-09 17:55:19 +11:00
parent 0c0cfebc1e
commit 959dad383e
11 changed files with 40 additions and 28 deletions

View File

@ -2,6 +2,17 @@
@tailwind components;
@tailwind utilities;
html,
body {
-ms-overflow-style: none; /* IE and Edge /
scrollbar-width: none; / Firefox */
}
/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar {
display: none;
}
$motiva: (
("MotivaSansThin.ttf", "ttf", 100, normal),
("MotivaSansLight.woff.ttf", "woff", 300, normal),

View File

@ -1,9 +1,9 @@
<template>
<div
@mousedown="() => window.startDragging()"
class="h-16 cursor-pointer bg-gray-950 flex flex-row justify-between"
>
<div class="flex flex-row grow items-center justify-between pl-5 pr-2 py-3">
<div class="h-16 cursor-pointer bg-gray-950 flex flex-row justify-between">
<div
@mousedown="() => window.startDragging()"
class="flex flex-row grow items-center justify-between pl-5 pr-2 py-3"
>
<div class="inline-flex items-center gap-x-10">
<Wordmark class="h-8 mb-0.5" />
<nav class="inline-flex items-center mt-0.5">

View File

@ -38,15 +38,16 @@
<div class="h-0.5 rounded-full w-full bg-zinc-800" />
<div class="flex flex-col mb-1">
<MenuItem v-slot="{ active }">
<NuxtLink
@click="() => openAdminUrl()"
<a
:href="adminUrl"
target="_blank"
:class="[
active ? 'bg-zinc-800 text-zinc-100' : 'text-zinc-400',
'transition block px-4 py-2 text-sm',
]"
>
Admin Dashboard
</NuxtLink>
</a>
</MenuItem>
<MenuItem v-for="(nav, navIdx) in navigation" v-slot="{ active }">
<NuxtLink
@ -82,10 +83,6 @@ const adminUrl: string = await invoke("gen_drop_url", {
path: "/admin",
});
async function openAdminUrl() {
await invoke("open_url", { path: adminUrl });
}
const navigation: NavigationItem[] = [
{
label: "Account settings",

View File

@ -1,9 +1,8 @@
<template>
<div
@mousedown="() => window.startDragging()"
class="h-10 cursor-pointer flex flex-row items-center justify-between bg-zinc-950"
>
<div class="px-5 py-3">
<div class="px-5 py-3" @mousedown="() => window.startDragging()">
<Wordmark class="mt-1" />
</div>
<WindowControl />

View File

@ -1,5 +1,5 @@
<template>
<HeaderButton @click="() => window.close()">
<HeaderButton @click="() => close()">
<XMarkIcon />
</HeaderButton>
</template>
@ -8,5 +8,11 @@
import { MinusIcon, XMarkIcon } from "@heroicons/vue/16/solid";
import { getCurrentWindow } from "@tauri-apps/api/window";
async function close(){
console.log(window);
const result = await window.close();
console.log(`closed window: ${result}`);
}
const window = getCurrentWindow();
</script>

View File

@ -1,7 +1,7 @@
<template>
<div class="flex flex-col bg-zinc-900 overflow-hidden">
<Header class="select-none" />
<div class="grow overflow-y-scroll">
<div class="grow overflow-y-auto">
<slot />
</div>
</div>

View File

@ -1,7 +1,7 @@
<template>
<div class="flex flex-col bg-zinc-950 overflow-hidden">
<MiniHeader />
<div class="grow overflow-y-scroll">
<div class="grow overflow-y-auto">
<slot />
</div>
</div>

View File

@ -12,8 +12,7 @@
Let's get you set up
</h1>
<p class="mt-6 text-lg leading-8 text-zinc-400">
Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem
cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.
You'll need to have set up a Drop instance and created an account on it. If you're connecting to another person's instance, you'll need the url and an account.
</p>
<div class="mt-10 flex items-center justify-center gap-x-6">
<NuxtLink

View File

@ -24,7 +24,7 @@
class="flex rounded-md shadow-sm ring-1 ring-inset ring-zinc-700 focus-within:ring-2 focus-within:ring-inset focus-within:ring-blue-600 sm:max-w-md"
>
<span
v-if="!url.startsWith('http')"
v-if="showHttps"
class="flex select-none items-center pl-3 text-zinc-500 -mr-2.5 sm:text-sm"
>https://</span
>
@ -87,6 +87,13 @@ const error = ref(undefined);
const loading = ref(false);
const router = useRouter();
const showHttps = computed(() => {
const prefixes = ["http://", "https://"];
const doesntHavePrefix = prefixes.findIndex((e) => url.value.startsWith(e.slice(0, url.value.length))) == -1;
return doesntHavePrefix;
})
async function connect() {
const newUrl = url.value.startsWith("http")

View File

@ -12,7 +12,7 @@ use std::{
use auth::{auth_initiate, recieve_handshake};
use data::DatabaseInterface;
use log::info;
use remote::{gen_drop_url, open_url, use_remote};
use remote::{gen_drop_url, use_remote};
use serde::{Deserialize, Serialize};
use structured_logger::{json::new_writer, Builder};
use tauri_plugin_deep_link::DeepLinkExt;
@ -91,7 +91,6 @@ pub fn run() {
auth_initiate,
use_remote,
gen_drop_url,
open_url,
])
.plugin(tauri_plugin_shell::init())
.setup(|app| {

View File

@ -62,12 +62,6 @@ pub async fn use_remote<'a>(
return Ok(());
}
#[tauri::command]
pub fn open_url(path: String) -> Result<(), String> {
webbrowser::open(&path).unwrap();
Ok(())
}
#[tauri::command]
pub fn gen_drop_url(app: tauri::AppHandle, path: String) -> Result<String, String> {
let base_url = {