diff --git a/README.md b/README.md index 1c81419..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,62 +0,0 @@ -# Issue & Goal -- opening the app in release mode does not show the tray icon or do anything -- tauri looks to be working and sending the `applicationDidFinishLaunching` event but nothing happens -- the goal is to have this run on macOS (no sandboxing needed) - - -# Notes -### Overall -- you will have to download the `rclone` binary from the [website](https://rclone.org/downloads/) yourself. if you already have rclone installed, it will be used instead of the binary. -- the main window runs the `main.ts` file that's at the project root, it is not related to the vite app. it gets compiled by the `buildExternal.js` script and added to the vite bundle through the `public` directory. -- sometimes `rclone` binary does not start correctly and the loading tray icons is stuck forever, i'd like to solve that too but this is more of a notice to restart the app if that happens. - -### Tauri Info -#### Environment -- OS: Mac OS 14.7.2 arm64 (X64) -- Xcode Command Line Tools: installed -- rustc: 1.82.0 (f6e511eec 2024-10-15) -- cargo: 1.82.0 (8f40fc59f 2024-08-21) -- rustup: 1.27.1 (54dd3d00f 2024-04-24) -- Rust toolchain: stable-aarch64-apple-darwin (default) -- node: 20.8.1 -- npm: 10.1.0 - -#### Packages - - tauri 🦀: 2.2.0 - - tauri-build 🦀: 2.0.4 - - wry 🦀: 0.48.0 - - tao 🦀: 0.31.1 - - @tauri-apps/api : 2.2.0 - - @tauri-apps/cli : 2.2.5 - -#### Plugins - - tauri-plugin-log 🦀: 2.2.0 - - @tauri-apps/plugin-log : 2.2.0 - - tauri-plugin-notification 🦀: 2.2.0 - - @tauri-apps/plugin-notification : 2.2.1 - - tauri-plugin-process 🦀: 2.2.0 - - @tauri-apps/plugin-process : 2.2.0 - - tauri-plugin-http 🦀: 2.2.0 - - @tauri-apps/plugin-http : 2.2.0 - - tauri-plugin-store 🦀: 2.2.0 - - @tauri-apps/plugin-store : 2.2.0 - - tauri-plugin-os 🦀: 2.2.0 - - @tauri-apps/plugin-os : 2.2.0 - - tauri-plugin-shell 🦀: 2.2.0 - - @tauri-apps/plugin-shell : 2.2.0 - - tauri-plugin-single-instance 🦀: 2.2.0 - - @tauri-apps/plugin-single-instance : not installed! - - tauri-plugin-dialog 🦀: 2.2.0 - - @tauri-apps/plugin-dialog : 2.2.0 - - tauri-plugin-fs 🦀: 2.2.0 - - @tauri-apps/plugin-fs : 2.2.0 - - tauri-plugin-opener 🦀: 2.2.3 - - @tauri-apps/plugin-opener : 2.2.5 - -#### App - - build-type: bundle - - CSP: unset - - frontendDist: ../dist - - devUrl: http://localhost:1420/ - - framework: React - - bundler: Vite diff --git a/lib/menu.ts b/lib/menu.ts index 6968703..90f7829 100644 --- a/lib/menu.ts +++ b/lib/menu.ts @@ -1,5 +1,5 @@ import { Menu, MenuItem, PredefinedMenuItem, Submenu } from '@tauri-apps/api/menu' -import { ask, confirm, message, open } from '@tauri-apps/plugin-dialog' +import { ask, message, open } from '@tauri-apps/plugin-dialog' import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification' import { sendNotification } from '@tauri-apps/plugin-notification' import { revealItemInDir } from '@tauri-apps/plugin-opener' @@ -55,7 +55,7 @@ export async function buildMenu() { delete storeState.mountedRemotes[remote] await rebuildTrayMenu() await message(`Successfully unmounted ${remote} from ${mountPoint}`, { - title: 'Unmount Success', + title: 'Success', }) } catch (err) { console.error('Unmount operation failed:', err) @@ -227,12 +227,12 @@ export async function buildMenu() { id: `remove-${remote}`, text: 'Remove', action: async () => { - const confirmation = await confirm( + const answer = await ask( `Are you sure you want to remove ${remote}? This action cannot be reverted.`, { title: `Removing ${remote}`, kind: 'warning' } ) - if (!confirmation) { + if (!answer) { return } diff --git a/lib/rclone/api.ts b/lib/rclone/api.ts index c44347c..d20e483 100644 --- a/lib/rclone/api.ts +++ b/lib/rclone/api.ts @@ -49,7 +49,7 @@ export async function getRemote(remote: string) { // throw e; // }); - console.log(JSON.stringify(r, null, 2)) + // console.log(JSON.stringify(r, null, 2)) return r } diff --git a/lib/rclone/mount.ts b/lib/rclone/mount.ts index 9084b5f..591389d 100644 --- a/lib/rclone/mount.ts +++ b/lib/rclone/mount.ts @@ -1,5 +1,5 @@ import { downloadDir } from '@tauri-apps/api/path' -import { ask, confirm } from '@tauri-apps/plugin-dialog' +import { ask } from '@tauri-apps/plugin-dialog' import { exists, writeFile } from '@tauri-apps/plugin-fs' import { fetch } from '@tauri-apps/plugin-http' import { revealItemInDir } from '@tauri-apps/plugin-opener' @@ -32,7 +32,7 @@ export async function dialogGetMountPlugin() { const currentPlatform = platform() if (currentPlatform === 'macos') { // download fuse-t or osxfuse - const wantsDownload = await confirm( + const wantsDownload = await ask( "Fuse-t is required on macOS to mount remotes. You can open rclone UI again once you're done with the installation.", { title: 'Mount plugin not installed', @@ -53,7 +53,7 @@ export async function dialogGetMountPlugin() { } if (currentPlatform === 'windows') { // download winfsp - const wantsDownload = await confirm( + const wantsDownload = await ask( "WinFsp is required on Windows to mount remotes. You can open rclone UI again once you're done with the installation.", { title: 'Mount plugin not installed', @@ -84,9 +84,11 @@ export async function unmountRemote(mountPoint: string, force = false) { if (output.code !== 0) { if (output.stderr.toLowerCase().includes('busy')) { - const answer = await ask('This resource is busy, do you want to force unmount?', { + const answer = await ask('This resource is busy, do you wish to force unmount?', { title: 'Could not unmount', kind: 'warning', + okLabel: 'Force Unmount', + cancelLabel: 'Cancel', }) if (answer) { return await unmountRemote(mountPoint, true) diff --git a/lib/store.ts b/lib/store.ts index 1938351..8e99094 100644 --- a/lib/store.ts +++ b/lib/store.ts @@ -23,13 +23,11 @@ export interface RemoteConfig { } interface State { - count: number - anotherCount: number - increment: () => void rcloneLoaded: boolean rcloneAuth: string rcloneAuthHeader: string + mountedRemotes: Record serveList: { pid: number; protocol: string; remote: string }[] @@ -70,13 +68,11 @@ const getStorage = (store: LazyStore): StateStorage => ({ export const useStore = create()( shared( (set) => ({ - count: 0, - anotherCount: 0, - increment: () => set((state) => ({ count: state.count + 1 })), rcloneLoaded: false, rcloneAuth: '', rcloneAuthHeader: '', + mountedRemotes: {}, serveList: [], diff --git a/lib/window.ts b/lib/window.ts index e3dec26..adf4f8a 100644 --- a/lib/window.ts +++ b/lib/window.ts @@ -33,8 +33,6 @@ export async function openFullWindow({ url: url, }) - await new Promise((resolve) => setTimeout(resolve, 1000)) - const size = await currentMonitor().then((m) => m?.size) if (!size) return diff --git a/src-tauri/Entitlements.plist b/src-tauri/__E.plist similarity index 100% rename from src-tauri/Entitlements.plist rename to src-tauri/__E.plist diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 5cbfd53..fa73715 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -248,9 +248,6 @@ { "url": "http://localhost:5572/**" }, - { - "url": "https://www.google.com" - }, { "url": "https://downloads.rclone.org/**" }, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 7f04e06..9e0379c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -78,7 +78,6 @@ } }, "hardenedRuntime": true, - "entitlements": "Entitlements.plist", "minimumSystemVersion": "10.13" } } diff --git a/src/pages/Test.tsx b/src/pages/Test.tsx index 87f9f2c..6d7913f 100644 --- a/src/pages/Test.tsx +++ b/src/pages/Test.tsx @@ -1,11 +1,6 @@ -import { useStore } from '../../lib/store' - // const store = new LazyStore('store.json') function Test() { - const count = useStore((state) => state.count) - const increment = useStore((state) => state.increment) - // useEffect(() => { // console.log('Test') @@ -34,16 +29,6 @@ function Test() {

Rclone UI

- - -

{count}

)