mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-07-30 08:46:04 -04:00
- Add SHARE-000..011 task specs and docs/design/shares.md defining the sd.app public sharing architecture and wire protocols - Rework INDEX-010 to scope ephemeral UUID reconciliation per-library instead of a single global map, since core can have multiple libraries loaded at once - Add sidecar serving and configurable bind host to apps/server, and wire the web platform's daemon status to the server's own origin - Add quick preview button to the file inspector, with a null-safe useOptionalExplorer for use outside the explorer context
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { Platform } from "@sd/interface/platform";
|
|
|
|
/**
|
|
* Web platform implementation for Spacedrive server
|
|
*
|
|
* This provides a minimal platform abstraction for the web client.
|
|
* Unlike Tauri, web platform cannot access native file system or daemon state directly.
|
|
*/
|
|
export const platform: Platform = {
|
|
platform: "web",
|
|
|
|
openLink(url: string) {
|
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
},
|
|
|
|
// sd-server serves the UI, RPC, and sidecars from a single origin, so the
|
|
// sidecar base URL is wherever this page was loaded from. Without this the
|
|
// ServerContext never gets a serverUrl and thumbnails silently never load.
|
|
async getDaemonStatus() {
|
|
return {
|
|
is_running: true,
|
|
socket_path: "",
|
|
server_url: window.location.origin,
|
|
started_by_us: false,
|
|
};
|
|
},
|
|
|
|
confirm(message: string, callback: (result: boolean) => void) {
|
|
callback(window.confirm(message));
|
|
},
|
|
|
|
// Web-specific implementations (no native capabilities)
|
|
// File pickers, daemon control, etc. are not available on web
|
|
};
|