fix: Small polishes + remove isolation and CSP

This commit is contained in:
LynithDev 2024-09-16 19:35:04 +02:00
parent 885da4f798
commit 0c4673990a
11 changed files with 26 additions and 81 deletions

5
Cargo.lock generated
View file

@ -1249,7 +1249,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [ dependencies = [
"generic-array", "generic-array",
"rand_core 0.6.4",
"typenum", "typenum",
] ]
@ -7287,7 +7286,6 @@ dependencies = [
"semver", "semver",
"serde", "serde",
"serde_json", "serde_json",
"tauri-codegen",
"tauri-utils", "tauri-utils",
"tauri-winres", "tauri-winres",
"toml 0.8.2", "toml 0.8.2",
@ -7585,12 +7583,10 @@ version = "2.0.0-rc.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53d9fe87e985b273696ae22ce2b9f099a8f1b44bc8fb127467bda5fcb3e4371" checksum = "d53d9fe87e985b273696ae22ce2b9f099a8f1b44bc8fb127467bda5fcb3e4371"
dependencies = [ dependencies = [
"aes-gcm",
"brotli", "brotli",
"cargo_metadata", "cargo_metadata",
"ctor", "ctor",
"dunce", "dunce",
"getrandom 0.2.15",
"glob", "glob",
"html5ever", "html5ever",
"infer", "infer",
@ -7608,7 +7604,6 @@ dependencies = [
"serde-untagged", "serde-untagged",
"serde_json", "serde_json",
"serde_with", "serde_with",
"serialize-to-javascript",
"swift-rs", "swift-rs",
"thiserror", "thiserror",
"toml 0.8.2", "toml 0.8.2",

View file

@ -16,7 +16,7 @@ name = "onelauncher_gui"
crate-type = [ "staticlib", "cdylib", "lib" ] crate-type = [ "staticlib", "cdylib", "lib" ]
[build-dependencies] [build-dependencies]
tauri-build = { workspace = true, features = [ "isolation" ] } tauri-build = { workspace = true }
[dependencies] [dependencies]
onelauncher = { workspace = true, features = [ "tauri", "specta" ] } onelauncher = { workspace = true, features = [ "tauri", "specta" ] }
@ -48,7 +48,6 @@ tracing-error = { workspace = true }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
features = [ features = [
"isolation",
"macos-private-api", "macos-private-api",
"image-ico", "image-ico",
"image-png", "image-png",

View file

@ -6,58 +6,7 @@
"withGlobalTauri": true, "withGlobalTauri": true,
"macOSPrivateApi": true, "macOSPrivateApi": true,
"security": { "security": {
"csp": { "csp": null,
"default-src": [
"'self'",
"customprotocol:",
"asset:"
],
"connect-src": [
"https://modrinth.com",
"https://api.modrinth.com",
"https://polyfrost.org",
"https://*.polyfrost.org",
"https://*.cloudflare.com",
"https://api.mclo.gs",
"ipc:",
"http://ipc.localhost"
],
"img-src": [
"'self'",
"tauri:",
"https:",
"data:",
"blob:",
"'unsafe-inline'",
"asset:",
"https://asset.localhost"
],
"script-src": [
"'self'",
"https://*.cloudflare.com",
"https://*.polyfrost.org"
],
"frame-src": [
"https://*.cloudflare.com",
"https://www.youtube.com",
"https://www.youtube-nocookie.com",
"https://discord.com",
"https://*.githubusercontent.com",
"'self'",
"'unsafe-inline'"
],
"style-src": [
"'unsafe-inline'",
"unsafe-inline",
"'self'"
]
},
"pattern": {
"use": "isolation",
"options": {
"dir": "../frontend/isolation/"
}
},
"assetProtocol": { "assetProtocol": {
"enable": true, "enable": true,
"scope": { "scope": {

View file

@ -1,12 +1 @@
import '@unocss/reset/tailwind.css';
import '@fontsource/poppins/400.css';
import '@fontsource/poppins/500.css';
import '@fontsource/poppins/600.css';
import 'overlayscrollbars/overlayscrollbars.css';
import 'virtual:uno.css';
import '~styles/globals.css';
import '~styles/highlightjs.css';
import '~utils/patches';
export * as bridge from '@onelauncher/client/bindings'; export * as bridge from '@onelauncher/client/bindings';

View file

@ -1,10 +1,22 @@
/* @refresh reload */ /* @refresh reload */
import { Route, Router } from '@solidjs/router'; import { Route, Router } from '@solidjs/router';
/* eslint-disable perfectionist/sort-imports -- Import order does matter Here */
import '~utils/patches';
import '@fontsource/poppins/400.css';
import '@fontsource/poppins/500.css';
import '@fontsource/poppins/600.css';
import 'virtual:uno.css';
import '@unocss/reset/tailwind.css';
import 'overlayscrollbars/overlayscrollbars.css';
import '~styles/globals.css';
import '~styles/highlightjs.css';
import App from '~ui/pages/App'; import App from '~ui/pages/App';
import BrowserRoot from '~ui/pages/browser/BrowserRoot'; import BrowserRoot from '~ui/pages/browser/BrowserRoot';
import ClusterRoot from '~ui/pages/cluster/ClusterRoot'; import ClusterRoot from '~ui/pages/cluster/ClusterRoot';
import Onboarding from '~ui/pages/onboarding/Onboarding'; import Onboarding from '~ui/pages/onboarding/Onboarding';
import SettingsRoot from '~ui/pages/settings/SettingsRoot'; import SettingsRoot from '~ui/pages/settings/SettingsRoot';
import { render } from 'solid-js/web'; import { render } from 'solid-js/web';

View file

@ -1,5 +1,5 @@
.button { .button {
@apply py-1.5 px-3 rounded-lg flex flex-row justify-center items-center gap-x-2.5 h-9.5; @apply py-1.5 px-3 rounded-lg flex flex-row justify-center items-center gap-x-2.5;
&__primary, &__iconPrimary { &__primary, &__iconPrimary {
@apply text-onbrand hover:text-onbrand-hover active:text-onbrand-pressed disabled:text-onbrand-disabled; @apply text-onbrand hover:text-onbrand-hover active:text-onbrand-pressed disabled:text-onbrand-disabled;

View file

@ -1,8 +1,8 @@
import type { Ref } from '@solid-primitives/refs';
import type { OnUpdatedEventListenerArgs, OverlayScrollbars } from 'overlayscrollbars';
import { AlignBottom01Icon } from '@untitled-theme/icons-solid'; import { AlignBottom01Icon } from '@untitled-theme/icons-solid';
import { OverlayScrollbarsComponent, type OverlayScrollbarsComponentRef } from 'overlayscrollbars-solid'; import { OverlayScrollbarsComponent, type OverlayScrollbarsComponentRef } from 'overlayscrollbars-solid';
import { createEffect, createMemo, createSignal, Index, Show, untrack } from 'solid-js'; import { createEffect, createMemo, createSignal, Index, Show, untrack } from 'solid-js';
import type { Ref } from '@solid-primitives/refs';
import type { OnUpdatedEventListenerArgs, OverlayScrollbars } from 'overlayscrollbars';
import Button from '../base/Button'; import Button from '../base/Button';
import styles from './FormattedLog.module.scss'; import styles from './FormattedLog.module.scss';
@ -41,7 +41,7 @@ function FormattedLog(props: FormattedLogProps) {
} }
return ( return (
<div class="relative h-full flex flex-1 flex-col rounded-md bg-component-bg"> <div class="relative h-full flex flex-1 flex-col overflow-hidden rounded-md bg-component-bg">
<Show when={props.enableAutoScroll === true}> <Show when={props.enableAutoScroll === true}>
<div class="absolute right-0 top-0 z-1 h-6 w-full flex flex-row justify-end border border-gray-05 rounded-t-md bg-page p-px"> <div class="absolute right-0 top-0 z-1 h-6 w-full flex flex-row justify-end border border-gray-05 rounded-t-md bg-page p-px">
<Button.Toggle <Button.Toggle

View file

@ -1,7 +1,7 @@
import type { ParentProps } from 'solid-js';
import { useNavigate } from '@solidjs/router'; import { useNavigate } from '@solidjs/router';
import useSettings from '~ui/hooks/useSettings'; import useSettings from '~ui/hooks/useSettings';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid';
import type { ParentProps } from 'solid-js';
import AnimatedRoutes from '../components/AnimatedRoutes'; import AnimatedRoutes from '../components/AnimatedRoutes';
import Navbar from '../components/Navbar'; import Navbar from '../components/Navbar';
@ -19,8 +19,8 @@ function App(props: ParentProps) {
</div> </div>
<div class="h-full w-full overflow-hidden"> <div class="h-full w-full overflow-hidden">
<div class="relative h-full w-full flex flex-col overflow-x-hidden"> <div class="relative h-full w-full flex flex-col overflow-x-hidden pb-8">
<OverlayScrollbarsComponent class="os-hide-horizontal-scrollbar absolute left-0 top-0 h-full w-full flex flex-col overflow-x-hidden overflow-y-auto px-8 pb-8"> <OverlayScrollbarsComponent class="os-hide-horizontal-scrollbar absolute left-0 top-0 h-full w-full flex flex-col overflow-x-hidden overflow-y-auto px-8">
<div class="h-full flex-1"> <div class="h-full flex-1">
<AnimatedRoutes> <AnimatedRoutes>
{props.children} {props.children}

View file

@ -1,10 +1,10 @@
import type { ManagedPackage } from '@onelauncher/client/bindings';
import { ChevronRightIcon } from '@untitled-theme/icons-solid'; import { ChevronRightIcon } from '@untitled-theme/icons-solid';
import OneConfigLogo from '~assets/logos/oneconfig.svg?component-solid'; import OneConfigLogo from '~assets/logos/oneconfig.svg?component-solid';
import Button from '~ui/components/base/Button'; import Button from '~ui/components/base/Button';
import SearchResultsContainer from '~ui/components/content/SearchResults'; import SearchResultsContainer from '~ui/components/content/SearchResults';
import useBrowser from '~ui/hooks/useBrowser'; import useBrowser from '~ui/hooks/useBrowser';
import { onMount, Show } from 'solid-js'; import { onMount, Show } from 'solid-js';
import type { ManagedPackage } from '@onelauncher/client/bindings';
import { BrowserContent } from './BrowserRoot'; import { BrowserContent } from './BrowserRoot';
function BrowserMain() { function BrowserMain() {

View file

@ -120,6 +120,7 @@ function BrowserSidebar() {
<Button <Button
buttonStyle="secondary" buttonStyle="secondary"
children={controller.cluster()?.meta.name || 'None'} children={controller.cluster()?.meta.name || 'None'}
class="h-9.5"
onClick={controller.displayClusterSelector} onClick={controller.displayClusterSelector}
/> />
</div> </div>

View file

@ -1,12 +1,12 @@
import type { UserConfig } from 'vite';
import process from 'node:process'; import process from 'node:process';
import { sentryVitePlugin as sentry } from '@sentry/vite-plugin'; import { sentryVitePlugin as sentry } from '@sentry/vite-plugin';
import unocss from 'unocss/vite'; import unocss from 'unocss/vite';
import { defineConfig, loadEnv } from 'vite'; import { defineConfig, loadEnv } from 'vite';
import solid from 'vite-plugin-solid'; import solid from 'vite-plugin-solid';
import solidSvg from 'vite-plugin-solid-svg'; import solidSvg from 'vite-plugin-solid-svg';
import paths from 'vite-tsconfig-paths'; import paths from 'vite-tsconfig-paths';
import type { UserConfig } from 'vite';
export default defineConfig(async ({ mode }) => { export default defineConfig(async ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') }; process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };