mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-25 08:07:31 +00:00
Merge branch 'feat/do-files-sync' into feat/desktop-offline
This commit is contained in:
@@ -5,6 +5,7 @@ import { addPlainLanguage } from "@/i18n/plain-language";
|
||||
import { ThemeProvider } from "@/components/providers/theme-provider";
|
||||
import { CalendarAlertProvider } from "@/components/providers/calendar-alert-provider";
|
||||
import { PushBindingsHost } from "@/components/providers/push-bindings-host";
|
||||
import { FilesSyncPrompts } from "@/components/files-sync/files-sync-prompts";
|
||||
import { EmbeddedBridgeProvider } from "@/components/providers/embedded-bridge-provider";
|
||||
import { RateLimitToastProvider } from "@/components/providers/rate-limit-toast-provider";
|
||||
import { TourProvider } from "@/components/tour/tour-provider";
|
||||
@@ -34,6 +35,7 @@ import { NotificationActionsHost } from "@/components/providers/notification-act
|
||||
import { DesktopOsHost } from "@/components/desktop/desktop-os-host";
|
||||
import { FileDropHost } from "@/components/file-drop/file-drop-host";
|
||||
import { EditedFilesHost } from "@/components/desktop/edited-files-host";
|
||||
import { FilesSyncHost } from "@/components/providers/files-sync-host";
|
||||
import { DevicePolicyHost } from "@/components/device/device-policy-host";
|
||||
import { PushNotificationPrompt } from "@/components/push-notification-prompt";
|
||||
import { AccountArchiveRestorePrompt } from "@/components/account-archive-prompt";
|
||||
@@ -97,8 +99,10 @@ export default async function LocaleLayout({
|
||||
<PushBindingsHost />
|
||||
<DesktopOsHost />
|
||||
{!IS_LITE && <EditedFilesHost />}
|
||||
{!IS_LITE && <FilesSyncHost />}
|
||||
<FreeBusyAutoShare />
|
||||
{!IS_LITE && <PopoutHost />}
|
||||
{!IS_LITE && <FilesSyncPrompts />}
|
||||
</MainWindowOnly>
|
||||
{!IS_LITE && <WindowSyncHost />}
|
||||
{!IS_LITE && <WindowMenuBar />}
|
||||
|
||||
@@ -223,6 +223,7 @@
|
||||
[data-boot-settings-tab="calendar"] [data-sk-settings-tab="calendar"],
|
||||
[data-boot-settings-tab="contacts"] [data-sk-settings-tab="contacts"],
|
||||
[data-boot-settings-tab="files"] [data-sk-settings-tab="files"],
|
||||
[data-boot-settings-tab="files_sync"] [data-sk-settings-tab="files_sync"],
|
||||
[data-boot-settings-tab="addons"] [data-sk-settings-tab="addons"],
|
||||
[data-boot-settings-tab="offline"] [data-sk-settings-tab="offline"],
|
||||
[data-boot-settings-tab="privacy"] [data-sk-settings-tab="privacy"],
|
||||
@@ -242,6 +243,7 @@
|
||||
@custom-variant boot-no-settings-addons (&:where([data-boot-settings-tabs]:not([data-boot-settings-tabs~="addons"]) *));
|
||||
@custom-variant boot-no-settings-offline (&:where([data-boot-settings-tabs]:not([data-boot-settings-tabs~="offline"]) *));
|
||||
@custom-variant boot-settings-recovery (&:where([data-boot-settings-tabs~="recovery"] *));
|
||||
@custom-variant boot-settings-files-sync (&:where([data-boot-settings-tabs~="files_sync"] *));
|
||||
|
||||
/* Settings pages with one section have no section jump row (SectionNav). */
|
||||
@custom-variant boot-settings-one-section (&:where([data-boot-settings-tab="security"] *, [data-boot-settings-tab="filters"] *, [data-boot-settings-tab="vacation"] *, [data-boot-settings-tab="recovery"] *, [data-boot-settings-tab="addons"] *));
|
||||
|
||||
@@ -27,6 +27,8 @@ const OPTIONAL: Partial<Record<SettingsSearchTab, string>> = {
|
||||
calendar: "boot-no-calendar:hidden boot-no-settings-calendar:hidden",
|
||||
contacts: "boot-no-settings-contacts:hidden",
|
||||
files: "boot-no-files:hidden boot-no-settings-files:hidden",
|
||||
// Desktop app only, while the files sync runs.
|
||||
files_sync: "hidden boot-settings-files-sync:flex",
|
||||
addons: "boot-no-settings-addons:hidden",
|
||||
// Not in the static Lite build.
|
||||
offline: "boot-no-settings-offline:hidden",
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
import { act, cleanup, fireEvent, render, screen, within } from '@testing-library/react';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { FileBrowser } from '@/components/files/file-browser';
|
||||
import { FileDetailsPanel } from '@/components/files/file-details-panel';
|
||||
import { useFileStore, type FileResource } from '@/stores/file-store';
|
||||
import { useFilesSyncStore } from '@/stores/files-sync-store';
|
||||
import type { BulwarkDesktopBridge } from '@/lib/desktop/types';
|
||||
import type { FilesSyncController, FilesSyncItemStatus } from '@/lib/files-sync/types';
|
||||
import type { IJMAPClient } from '@/lib/jmap/client-interface';
|
||||
|
||||
// Files on this computer on the Files screen: "Show in Explorer" (Finder, file
|
||||
// manager) for what a root covers, and the sync status on rows and in the
|
||||
// details panel. The next-intl mock returns keys.
|
||||
|
||||
vi.mock('@/lib/debug', () => ({ debug: { log: () => {}, warn: () => {}, error: () => {} } }));
|
||||
vi.mock('@/components/settings/share-collection-dialog', () => ({ ShareCollectionDialog: () => null }));
|
||||
|
||||
const NOTES = {
|
||||
id: 'f-notes', name: 'notes.txt', serverName: 'notes.txt', isDirectory: false, contentType: 'text/plain',
|
||||
contentLength: 10, lastModified: '2026-10-01T00:00:00Z', blobId: 'b-notes', parentId: null,
|
||||
} as FileResource;
|
||||
const PLANS = {
|
||||
id: 'd-plans', name: 'Plans', serverName: 'Plans', isDirectory: true, contentType: '',
|
||||
contentLength: 0, lastModified: '2026-10-01T00:00:00Z', blobId: null, parentId: null,
|
||||
} as unknown as FileResource;
|
||||
|
||||
function controller(covered: string[]) {
|
||||
return {
|
||||
coverage: vi.fn((id: string) => (covered.includes(id) ? { rootId: 'r1', kind: 'folder' as const, path: id } : null)),
|
||||
showInFolder: vi.fn(async () => true),
|
||||
} as unknown as FilesSyncController & { coverage: ReturnType<typeof vi.fn>; showInFolder: ReturnType<typeof vi.fn> };
|
||||
}
|
||||
|
||||
function setPlatform(platform: 'win32' | 'darwin' | 'linux') {
|
||||
window.bulwarkDesktop = { version: 1, platform } as unknown as BulwarkDesktopBridge;
|
||||
}
|
||||
|
||||
function renderBrowser(resources: FileResource[] = [NOTES, PLANS]) {
|
||||
const client = { listAllFileNodesAcrossAccounts: vi.fn(async () => []) } as unknown as IJMAPClient;
|
||||
act(() => {
|
||||
useFileStore.setState({ client, sharedRoots: [], allFolders: [], currentParentId: null, pathStack: [{ id: null, name: '' }], hasListed: true });
|
||||
});
|
||||
const noop = vi.fn(async () => {});
|
||||
render(
|
||||
<FileBrowser
|
||||
currentPath="/"
|
||||
resources={resources}
|
||||
isLoading={false}
|
||||
error={null}
|
||||
selectedResources={new Set()}
|
||||
uploadProgress={null}
|
||||
clipboard={null}
|
||||
onCreateFolder={noop}
|
||||
onUploadFiles={noop}
|
||||
onUploadFolder={noop}
|
||||
onCancelUpload={vi.fn()}
|
||||
onDelete={noop}
|
||||
onBatchDelete={noop}
|
||||
onRename={noop}
|
||||
onBatchDownload={noop}
|
||||
onRefresh={noop}
|
||||
onClearSelection={vi.fn()}
|
||||
onCut={vi.fn()}
|
||||
onCopy={vi.fn()}
|
||||
onPaste={noop}
|
||||
onMoveTo={noop}
|
||||
onPreviewImage={vi.fn()}
|
||||
onCreateFile={noop}
|
||||
onDuplicate={noop}
|
||||
getImageUrl={async () => ''}
|
||||
favorites={[]}
|
||||
recentFiles={[]}
|
||||
onToggleFavorite={vi.fn()}
|
||||
onOpenRecent={vi.fn()}
|
||||
client={client}
|
||||
ownAccountId="a"
|
||||
onNavigate={vi.fn()}
|
||||
onSetSelection={vi.fn()}
|
||||
onToggleSelect={vi.fn()}
|
||||
onPreviewFile={vi.fn()}
|
||||
onDownload={noop}
|
||||
onRenameNode={noop}
|
||||
onDeleteNode={noop}
|
||||
onDownloadNode={noop}
|
||||
onRevealNode={noop}
|
||||
onRemoveRecent={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
}
|
||||
|
||||
function moreButton(name: string) {
|
||||
return screen.getAllByRole('button', { name: 'more_actions' }).find((b) => b.closest('[data-resource]')?.getAttribute('data-resource') === name)!;
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
window.bulwarkDesktop = undefined;
|
||||
useFilesSyncStore.getState().reset();
|
||||
});
|
||||
|
||||
describe('Show in Explorer on the Files screen', () => {
|
||||
it('is in the row menu of a covered file and folder only, and opens it there', () => {
|
||||
setPlatform('win32');
|
||||
const c = controller(['f-notes', 'd-plans']);
|
||||
useFilesSyncStore.setState({ available: true, controller: c });
|
||||
renderBrowser();
|
||||
fireEvent.click(moreButton('notes.txt'));
|
||||
const item = within(screen.getByRole('menu')).getByRole('menuitem', { name: 'show_in.explorer' });
|
||||
fireEvent.click(item);
|
||||
expect(c.showInFolder).toHaveBeenCalledWith('f-notes');
|
||||
expect(screen.queryByRole('menu')).toBeNull();
|
||||
fireEvent.click(moreButton('Plans'));
|
||||
fireEvent.click(within(screen.getByRole('menu')).getByRole('menuitem', { name: 'show_in.explorer' }));
|
||||
expect(c.showInFolder).toHaveBeenLastCalledWith('d-plans');
|
||||
});
|
||||
|
||||
it('is not offered for what no root covers, nor outside the app', () => {
|
||||
setPlatform('win32');
|
||||
useFilesSyncStore.setState({ available: true, controller: controller(['d-plans']) });
|
||||
renderBrowser();
|
||||
fireEvent.click(moreButton('notes.txt'));
|
||||
expect(within(screen.getByRole('menu')).queryByRole('menuitem', { name: 'show_in.explorer' })).toBeNull();
|
||||
cleanup();
|
||||
useFilesSyncStore.setState({ available: false, controller: controller(['f-notes']) });
|
||||
renderBrowser();
|
||||
fireEvent.click(moreButton('notes.txt'));
|
||||
expect(within(screen.getByRole('menu')).queryByRole('menuitem', { name: /show_in/ })).toBeNull();
|
||||
});
|
||||
|
||||
it.each([
|
||||
['darwin', 'show_in.finder'],
|
||||
['linux', 'show_in.file_manager'],
|
||||
] as const)('is named for the platform: %s', (platform, label) => {
|
||||
setPlatform(platform);
|
||||
useFilesSyncStore.setState({ available: true, controller: controller(['f-notes']) });
|
||||
renderBrowser([NOTES]);
|
||||
fireEvent.click(moreButton('notes.txt'));
|
||||
expect(within(screen.getByRole('menu')).getByRole('menuitem', { name: label })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('sync status on the Files screen', () => {
|
||||
it.each<FilesSyncItemStatus>(['synced', 'syncing', 'pending', 'error', 'online-only'])('names a %s row', (state) => {
|
||||
useFilesSyncStore.setState({ available: true, controller: controller([]), items: { 'f-notes': state } });
|
||||
renderBrowser([NOTES, PLANS]);
|
||||
const row = document.querySelector('[data-resource="notes.txt"]') as HTMLElement;
|
||||
expect(within(row).getByRole('img', { name: `item.${state}` })).toBeInTheDocument();
|
||||
// Plans has no status: no badge.
|
||||
const plans = document.querySelector('[data-resource="Plans"]') as HTMLElement;
|
||||
expect(plans.querySelector('[data-files-sync-item]')).toBeNull();
|
||||
});
|
||||
|
||||
it('shows nothing outside the app', () => {
|
||||
useFilesSyncStore.setState({ available: false, items: { 'f-notes': 'synced' } });
|
||||
renderBrowser([NOTES]);
|
||||
expect(document.querySelector('[data-files-sync-item]')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('details panel', () => {
|
||||
function renderPanel() {
|
||||
render(
|
||||
<FileDetailsPanel
|
||||
resource={NOTES}
|
||||
selection={[NOTES]}
|
||||
folderName="My files"
|
||||
folderItems={[NOTES]}
|
||||
path="/notes.txt"
|
||||
isStarred={false}
|
||||
canShare={false}
|
||||
canPreview={false}
|
||||
canEdit={false}
|
||||
iconOptions={{ showIcons: true, coloredIcons: true, showThumbnails: false }}
|
||||
getImageUrl={async () => ''}
|
||||
onClose={vi.fn()}
|
||||
onOpen={vi.fn()}
|
||||
onEdit={vi.fn()}
|
||||
onShare={vi.fn()}
|
||||
onToggleStar={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
}
|
||||
|
||||
it('says the status and offers Show in Finder for a covered file', () => {
|
||||
setPlatform('darwin');
|
||||
const c = controller(['f-notes']);
|
||||
useFilesSyncStore.setState({ available: true, controller: c, items: { 'f-notes': 'pending' } });
|
||||
renderPanel();
|
||||
expect(screen.getByText('item.label')).toBeInTheDocument();
|
||||
expect(screen.getByText('item.pending')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'show_in.finder' }));
|
||||
expect(c.showInFolder).toHaveBeenCalledWith('f-notes');
|
||||
});
|
||||
|
||||
it('has neither for a file no root covers', () => {
|
||||
setPlatform('win32');
|
||||
useFilesSyncStore.setState({ available: true, controller: controller([]) });
|
||||
renderPanel();
|
||||
expect(screen.queryByText('item.label')).toBeNull();
|
||||
expect(screen.queryByRole('button', { name: /show_in/ })).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import { act, fireEvent, render, screen, within } from '@testing-library/react';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import en from '@/locales/en/common.json';
|
||||
import type { FilesRoot } from '@/lib/desktop/types';
|
||||
import type { FilesSyncController } from '@/lib/files-sync/types';
|
||||
|
||||
// The mass-delete question asked wherever the user is (FilesSyncPrompts, mounted
|
||||
// with the app-wide hosts), and kept away while the settings page asks it itself.
|
||||
|
||||
vi.unmock('next-intl');
|
||||
|
||||
const { useFilesSyncStore } = await import('@/stores/files-sync-store');
|
||||
const { FilesSyncPrompts, useInlineMassDeleteQuestions } = await import('../files-sync-prompts');
|
||||
|
||||
const ROOT: FilesRoot = {
|
||||
id: 'r1', kind: 'folder', account: 'acc', path: 'C:\\Users\\ann\\Projects', remoteId: 'n1', remoteLabel: 'Work / Projects', paused: false, createdAt: 1,
|
||||
};
|
||||
|
||||
function setup(count = 80, side: 'local' | 'remote' = 'local') {
|
||||
const controller = { confirmMassDelete: vi.fn(async () => {}) } as unknown as FilesSyncController & { confirmMassDelete: ReturnType<typeof vi.fn> };
|
||||
useFilesSyncStore.setState({
|
||||
available: true,
|
||||
account: 'acc',
|
||||
controller,
|
||||
roots: [ROOT],
|
||||
status: { r1: { rootId: 'r1', state: 'confirm-delete', pending: 0, done: 0, lastSyncedAt: null, massDelete: { count, side } } },
|
||||
});
|
||||
return controller;
|
||||
}
|
||||
|
||||
const wrap = (node: React.ReactNode) => <NextIntlClientProvider locale="en" messages={en}>{node}</NextIntlClientProvider>;
|
||||
|
||||
afterEach(() => useFilesSyncStore.getState().reset());
|
||||
|
||||
describe('mass-delete prompt, app-wide', () => {
|
||||
it('asks with the count and the side, and deletes on yes', () => {
|
||||
const controller = setup(80, 'local');
|
||||
render(wrap(<FilesSyncPrompts />));
|
||||
const dialog = screen.getByRole('alertdialog', { name: 'Delete 80 items?' });
|
||||
expect(dialog).toHaveTextContent('80 items were deleted from Projects on this computer. Delete them in Files too?');
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Delete them' }));
|
||||
expect(controller.confirmMassDelete).toHaveBeenCalledWith('r1', true);
|
||||
});
|
||||
|
||||
it('brings them back on no, naming the Files folder when they went there', () => {
|
||||
const controller = setup(51, 'remote');
|
||||
render(wrap(<FilesSyncPrompts />));
|
||||
const dialog = screen.getByRole('alertdialog');
|
||||
expect(dialog).toHaveTextContent('51 items were deleted from Work / Projects in Files. Delete them on this computer too?');
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Bring them back' }));
|
||||
expect(controller.confirmMassDelete).toHaveBeenCalledWith('r1', false);
|
||||
});
|
||||
|
||||
it('goes away on "Decide later" without answering, and comes back for a new question', () => {
|
||||
const controller = setup(80);
|
||||
render(wrap(<FilesSyncPrompts />));
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Decide later' }));
|
||||
expect(screen.queryByRole('alertdialog')).toBeNull();
|
||||
expect(controller.confirmMassDelete).not.toHaveBeenCalled();
|
||||
act(() => useFilesSyncStore.setState({
|
||||
status: { r1: { rootId: 'r1', state: 'confirm-delete', pending: 0, done: 0, lastSyncedAt: null, massDelete: { count: 95, side: 'local' } } },
|
||||
}));
|
||||
expect(screen.getByRole('alertdialog', { name: 'Delete 95 items?' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('asks nothing when no folder waits for an answer, or outside the app', () => {
|
||||
setup();
|
||||
act(() => useFilesSyncStore.setState({ status: { r1: { rootId: 'r1', state: 'paused', pending: 0, done: 0, lastSyncedAt: null } } }));
|
||||
const { unmount } = render(wrap(<FilesSyncPrompts />));
|
||||
expect(screen.queryByRole('alertdialog')).toBeNull();
|
||||
unmount();
|
||||
setup();
|
||||
act(() => useFilesSyncStore.setState({ available: false }));
|
||||
render(wrap(<FilesSyncPrompts />));
|
||||
expect(screen.queryByRole('alertdialog')).toBeNull();
|
||||
});
|
||||
|
||||
it('stays away while the settings page asks in its rows', () => {
|
||||
setup();
|
||||
function Page() {
|
||||
useInlineMassDeleteQuestions();
|
||||
return null;
|
||||
}
|
||||
const { rerender } = render(wrap(<><FilesSyncPrompts /><Page /></>));
|
||||
expect(screen.queryByRole('alertdialog')).toBeNull();
|
||||
rerender(wrap(<FilesSyncPrompts />));
|
||||
expect(screen.getByRole('alertdialog')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,102 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslations } from "next-intl";
|
||||
import { AlertCircle, CheckCircle2, Clock, Cloud, FolderOpen, RefreshCw, type AppIcon } from "@/components/icons";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ContextMenuItem } from "@/components/ui/context-menu";
|
||||
import { getDesktopBridge } from "@/lib/desktop/bridge";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { FilesSyncItemStatus } from "@/lib/files-sync/types";
|
||||
import { useFilesSyncStore } from "@/stores/files-sync-store";
|
||||
import { toast } from "@/stores/toast-store";
|
||||
import { showInKey } from "./files-sync-text";
|
||||
|
||||
/*
|
||||
* Files on this computer, on the Files screen: "Show in Explorer" (Finder, file
|
||||
* manager) on a file or folder a synced folder or the drive covers, and its sync
|
||||
* status on rows and in the details panel. All of it reads stores/files-sync-store.ts
|
||||
* and calls the engine's controller; nothing shows outside the desktop app.
|
||||
*/
|
||||
|
||||
const ITEM_ICONS: Record<FilesSyncItemStatus, { icon: AppIcon; className: string }> = {
|
||||
synced: { icon: CheckCircle2, className: "text-green-600 dark:text-green-400" },
|
||||
syncing: { icon: RefreshCw, className: "text-primary animate-spin motion-reduce:animate-none" },
|
||||
pending: { icon: Clock, className: "text-muted-foreground" },
|
||||
error: { icon: AlertCircle, className: "text-destructive" },
|
||||
"online-only": { icon: Cloud, className: "text-muted-foreground" },
|
||||
};
|
||||
|
||||
/** The node's sync status, when the engine has one for it. */
|
||||
function useItemStatus(nodeId: string): FilesSyncItemStatus | null {
|
||||
return useFilesSyncStore((s) => (s.available ? s.items[nodeId] ?? null : null));
|
||||
}
|
||||
|
||||
/** "Show in Explorer" for a node a root covers, or null. */
|
||||
export function useShowInFolder(nodeId: string | null | undefined): { label: string; run: () => void } | null {
|
||||
const t = useTranslations("files_sync");
|
||||
const available = useFilesSyncStore((s) => s.available);
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
// Coverage changes with the roots and what the engine knows of the tree.
|
||||
useFilesSyncStore((s) => s.roots);
|
||||
useFilesSyncStore((s) => s.items);
|
||||
if (!available || !controller || !nodeId) return null;
|
||||
if (!controller.coverage(nodeId)) return null;
|
||||
return {
|
||||
label: t(showInKey(getDesktopBridge()?.platform)),
|
||||
run: () => {
|
||||
void controller.showInFolder(nodeId).then(
|
||||
(shown) => { if (!shown) toast.error(t("show_in.failed")); },
|
||||
() => toast.error(t("show_in.failed")),
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/** The menu entry of a row on the Files screen. */
|
||||
export function ShowInFolderMenuItem({ nodeId, onRan }: { nodeId: string; onRan: () => void }) {
|
||||
const showIn = useShowInFolder(nodeId);
|
||||
if (!showIn) return null;
|
||||
return <ContextMenuItem icon={FolderOpen} label={showIn.label} testId="files-sync-show-in" onClick={() => { onRan(); showIn.run(); }} />;
|
||||
}
|
||||
|
||||
/** The same in the details panel's buttons. */
|
||||
export function ShowInFolderButton({ nodeId }: { nodeId: string }) {
|
||||
const showIn = useShowInFolder(nodeId);
|
||||
if (!showIn) return null;
|
||||
return (
|
||||
<Button size="sm" variant="outline" className="h-8 gap-1.5" onClick={showIn.run} data-testid="files-sync-show-in">
|
||||
<FolderOpen className="w-4 h-4" />{showIn.label}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
/** A small icon on a row, named for screen readers and on hover. */
|
||||
export function FilesSyncBadge({ nodeId, className }: { nodeId: string; className?: string }) {
|
||||
const t = useTranslations("files_sync");
|
||||
const status = useItemStatus(nodeId);
|
||||
if (!status) return null;
|
||||
const { icon: Icon, className: iconClass } = ITEM_ICONS[status];
|
||||
const label = t(`item.${status}`);
|
||||
return (
|
||||
<span role="img" aria-label={label} title={label} className="inline-flex shrink-0" data-files-sync-item={status}>
|
||||
<Icon className={cn("w-3.5 h-3.5", iconClass, className)} aria-hidden="true" />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/** "On this computer: Synced", a row of the details panel's list. */
|
||||
export function FilesSyncDetailsRow({ nodeId }: { nodeId: string }) {
|
||||
const t = useTranslations("files_sync");
|
||||
const status = useItemStatus(nodeId);
|
||||
if (!status) return null;
|
||||
const { icon: Icon, className: iconClass } = ITEM_ICONS[status];
|
||||
return (
|
||||
<div data-files-sync-item={status}>
|
||||
<dt className="text-xs text-muted-foreground">{t("item.label")}</dt>
|
||||
<dd className="flex items-center gap-1.5">
|
||||
<Icon className={cn("w-3.5 h-3.5 shrink-0", iconClass)} aria-hidden="true" />
|
||||
{t(`item.${status}`)}
|
||||
</dd>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState, useSyncExternalStore } from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { AlertTriangle } from "@/components/icons";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Dialog } from "@/components/ui/dialog";
|
||||
import { useFilesSyncStore } from "@/stores/files-sync-store";
|
||||
import type { FilesRoot } from "@/lib/desktop/types";
|
||||
import type { FilesSyncRootStatus } from "@/lib/files-sync/types";
|
||||
import { rootName } from "./files-sync-text";
|
||||
|
||||
/*
|
||||
* The mass-delete question (FILES-SYNC-BRIEF: more than 50 items or more than half a
|
||||
* pair at once pauses the pair and asks). The settings page asks it in the folder's
|
||||
* row; everywhere else FilesSyncPrompts asks it in a dialog, so the user sees it
|
||||
* wherever they are.
|
||||
*/
|
||||
|
||||
let inlineHosts = 0;
|
||||
const inlineListeners = new Set<() => void>();
|
||||
const subscribeInline = (listener: () => void) => {
|
||||
inlineListeners.add(listener);
|
||||
return () => { inlineListeners.delete(listener); };
|
||||
};
|
||||
const inlineShown = () => inlineHosts > 0;
|
||||
|
||||
/** The settings page asks in its rows while it's open: the dialog stays away meanwhile. */
|
||||
export function useInlineMassDeleteQuestions(): void {
|
||||
useEffect(() => {
|
||||
inlineHosts += 1;
|
||||
inlineListeners.forEach((listener) => listener());
|
||||
return () => {
|
||||
inlineHosts -= 1;
|
||||
inlineListeners.forEach((listener) => listener());
|
||||
};
|
||||
}, []);
|
||||
}
|
||||
|
||||
/** The question's text, for a root in `confirm-delete`. */
|
||||
export function useMassDeleteText(root: FilesRoot, massDelete: NonNullable<FilesSyncRootStatus["massDelete"]>): string {
|
||||
const t = useTranslations("files_sync");
|
||||
// The side the items went from: this computer's folder, or the Files folder.
|
||||
return massDelete.side === "local"
|
||||
? t("mass_delete.local", { count: massDelete.count, folder: rootName(root, t("drive.root_name")) })
|
||||
: t("mass_delete.remote", { count: massDelete.count, folder: root.remoteLabel || t("drive.root_name") });
|
||||
}
|
||||
|
||||
interface AnswerButtonsProps {
|
||||
rootId: string;
|
||||
count: number;
|
||||
/** After an answer went out. */
|
||||
onAnswered?: () => void;
|
||||
}
|
||||
|
||||
/** "Delete them" and "Bring them back", straight to the engine. */
|
||||
export function MassDeleteAnswers({ rootId, count, onAnswered }: AnswerButtonsProps) {
|
||||
const t = useTranslations("files_sync");
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const answer = (allow: boolean) => {
|
||||
if (!controller) return;
|
||||
setBusy(true);
|
||||
void controller.confirmMassDelete(rootId, allow).catch(() => {}).finally(() => {
|
||||
setBusy(false);
|
||||
onAnswered?.();
|
||||
});
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<Button size="sm" variant="outline" disabled={busy || !controller} onClick={() => answer(false)} data-testid="files-sync-mass-delete-restore">
|
||||
{t("mass_delete.restore", { count })}
|
||||
</Button>
|
||||
<Button size="sm" variant="destructive" disabled={busy || !controller} onClick={() => answer(true)} data-testid="files-sync-mass-delete-allow">
|
||||
{t("mass_delete.allow", { count })}
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
/** The question inside a folder's row on the settings page. */
|
||||
export function MassDeleteQuestion({ root, status }: { root: FilesRoot; status: FilesSyncRootStatus }) {
|
||||
const massDelete = status.massDelete ?? { count: 0, side: "local" as const };
|
||||
const text = useMassDeleteText(root, massDelete);
|
||||
return (
|
||||
<div role="group" aria-label={text} className="mt-3 rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3" data-files-sync-question={root.id}>
|
||||
<p className="flex items-start gap-2 text-sm text-foreground">
|
||||
<AlertTriangle className="w-4 h-4 mt-0.5 shrink-0 text-amber-600 dark:text-amber-400" aria-hidden="true" />
|
||||
<span>{text}</span>
|
||||
</p>
|
||||
<div className="flex flex-wrap justify-end gap-2">
|
||||
<MassDeleteAnswers rootId={root.id} count={massDelete.count} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function PromptDialog({ root, status, onLater }: { root: FilesRoot; status: FilesSyncRootStatus; onLater: () => void }) {
|
||||
const t = useTranslations("files_sync");
|
||||
const massDelete = status.massDelete!;
|
||||
const text = useMassDeleteText(root, massDelete);
|
||||
return (
|
||||
<Dialog
|
||||
isOpen
|
||||
onClose={onLater}
|
||||
role="alertdialog"
|
||||
title={t("mass_delete.title", { count: massDelete.count })}
|
||||
description={text}
|
||||
showClose={false}
|
||||
preventOutsideClose
|
||||
testId="files-sync-mass-delete-dialog"
|
||||
icon={(
|
||||
<div className="flex-shrink-0 w-10 h-10 rounded-full bg-amber-500/10 flex items-center justify-center">
|
||||
<AlertTriangle className="w-5 h-5 text-amber-600 dark:text-amber-400" aria-hidden="true" />
|
||||
</div>
|
||||
)}
|
||||
footer={(
|
||||
<>
|
||||
<Button variant="ghost" onClick={onLater}>{t("mass_delete.later")}</Button>
|
||||
<MassDeleteAnswers rootId={root.id} count={massDelete.count} />
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* App-wide: asks about a mass delete wherever the user is, one root at a time.
|
||||
* "Decide later" hides it for this question; the folder's row on the settings page
|
||||
* still asks, and the pair stays paused until then.
|
||||
*/
|
||||
export function FilesSyncPrompts() {
|
||||
const available = useFilesSyncStore((s) => s.available);
|
||||
const roots = useFilesSyncStore((s) => s.roots);
|
||||
const status = useFilesSyncStore((s) => s.status);
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
const pageAsks = useSyncExternalStore(subscribeInline, inlineShown, () => false);
|
||||
const [later, setLater] = useState<ReadonlySet<string>>(() => new Set());
|
||||
|
||||
if (!available || !controller || pageAsks) return null;
|
||||
const keyOf = (s: FilesSyncRootStatus) => `${s.rootId}:${s.massDelete?.side}:${s.massDelete?.count}`;
|
||||
const root = roots.find((r) => {
|
||||
const s = status[r.id];
|
||||
return s?.state === "confirm-delete" && !!s.massDelete && !later.has(keyOf(s));
|
||||
});
|
||||
if (!root) return null;
|
||||
const rootStatus = status[root.id];
|
||||
return (
|
||||
<PromptDialog
|
||||
key={keyOf(rootStatus)}
|
||||
root={root}
|
||||
status={rootStatus}
|
||||
onLater={() => setLater((prev) => new Set(prev).add(keyOf(rootStatus)))}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
"use client";
|
||||
|
||||
import { useFormatter, useTranslations } from "next-intl";
|
||||
import { AlertCircle, AlertTriangle, CheckCircle2, CloudOff, Loader2, Lock, Pause, RefreshCw, type AppIcon } from "@/components/icons";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { FilesSyncRootState, FilesSyncRootStatus } from "@/lib/files-sync/types";
|
||||
import { filesSyncErrorKey, syncTimeOptions } from "./files-sync-text";
|
||||
|
||||
const ICONS: Record<FilesSyncRootState, { icon: AppIcon; className: string }> = {
|
||||
starting: { icon: Loader2, className: "text-muted-foreground animate-spin motion-reduce:animate-none" },
|
||||
syncing: { icon: RefreshCw, className: "text-primary animate-spin motion-reduce:animate-none" },
|
||||
idle: { icon: CheckCircle2, className: "text-green-600 dark:text-green-400" },
|
||||
paused: { icon: Pause, className: "text-muted-foreground" },
|
||||
offline: { icon: CloudOff, className: "text-muted-foreground" },
|
||||
error: { icon: AlertCircle, className: "text-destructive" },
|
||||
"confirm-delete": { icon: AlertTriangle, className: "text-amber-600 dark:text-amber-400" },
|
||||
blocked: { icon: Lock, className: "text-muted-foreground" },
|
||||
};
|
||||
|
||||
/** One line saying how a root is doing: up to date, syncing, paused, offline, stopped. */
|
||||
export function FilesSyncStatusLine({ status, paused, className }: {
|
||||
status: FilesSyncRootStatus | undefined;
|
||||
/** The root says it's paused; the engine may not have said so yet. */
|
||||
paused?: boolean;
|
||||
className?: string;
|
||||
}) {
|
||||
const t = useTranslations("files_sync");
|
||||
const format = useFormatter();
|
||||
const state: FilesSyncRootState = status?.state ?? (paused ? "paused" : "starting");
|
||||
|
||||
let text: string;
|
||||
switch (state) {
|
||||
case "idle":
|
||||
text = status?.lastSyncedAt
|
||||
? t("status.idle", { time: format.dateTime(new Date(status.lastSyncedAt), syncTimeOptions(status.lastSyncedAt)) })
|
||||
: t("status.idle_never");
|
||||
break;
|
||||
case "syncing":
|
||||
text = t("status.syncing", { done: status?.done ?? 0, pending: status?.pending ?? 0 });
|
||||
break;
|
||||
case "offline":
|
||||
text = t("status.offline", { count: status?.pending ?? 0 });
|
||||
break;
|
||||
case "error":
|
||||
text = t("status.error", { reason: t(filesSyncErrorKey(status?.errorKey)) });
|
||||
break;
|
||||
case "confirm-delete":
|
||||
text = t("status.confirm_delete");
|
||||
break;
|
||||
default:
|
||||
text = t(`status.${state}`);
|
||||
}
|
||||
const { icon: Icon, className: iconClass } = ICONS[state];
|
||||
return (
|
||||
<p className={cn("flex items-center gap-1.5 text-xs", state === "error" ? "text-destructive" : "text-muted-foreground", className)} data-files-sync-state={state}>
|
||||
<Icon className={cn("w-3.5 h-3.5 shrink-0", iconClass)} aria-hidden="true" />
|
||||
<span>{text}</span>
|
||||
</p>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import type { FilesRoot } from "@/lib/desktop/types";
|
||||
import type { FilesSyncActivityKind, FilesSyncItemStatus } from "@/lib/files-sync/types";
|
||||
|
||||
/** The engine's message keys, under `files_sync.errors.`. */
|
||||
export const FILES_SYNC_ERROR_KEYS = [
|
||||
"offline", "server_refused", "too_large", "name_invalid", "disk_full", "denied", "busy", "quota", "not_found", "policy", "failed",
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* The key inside the `files_sync` namespace for an engine message key. The engine may
|
||||
* write `offline`, `errors.offline` or `files_sync.errors.offline`; anything unknown
|
||||
* reads as `failed`, so a new key never shows raw.
|
||||
*/
|
||||
export function filesSyncErrorKey(key: string | undefined | null): string {
|
||||
const last = (key ?? "").split(".").pop() ?? "";
|
||||
return `errors.${(FILES_SYNC_ERROR_KEYS as readonly string[]).includes(last) ? last : "failed"}`;
|
||||
}
|
||||
|
||||
export const FILES_SYNC_ACTIVITY_KINDS: readonly FilesSyncActivityKind[] = [
|
||||
"uploaded", "downloaded", "folder-created", "renamed", "moved", "deleted", "trashed",
|
||||
"conflict", "renamed-for-disk", "too-large", "waiting", "mass-delete", "error",
|
||||
];
|
||||
|
||||
export const FILES_SYNC_ITEM_STATES: readonly FilesSyncItemStatus[] = ["synced", "syncing", "pending", "error", "online-only"];
|
||||
|
||||
/** "Show in Explorer", "Show in Finder", "Show in file manager". */
|
||||
export function showInKey(platform: string | undefined | null): string {
|
||||
if (platform === "win32") return "show_in.explorer";
|
||||
if (platform === "darwin") return "show_in.finder";
|
||||
return "show_in.file_manager";
|
||||
}
|
||||
|
||||
/** The name of a root to show: the drive's, or the last part of the folder's path. */
|
||||
export function rootName(root: FilesRoot, driveName: string): string {
|
||||
if (root.kind === "drive") return driveName;
|
||||
const parts = root.path.split(/[\\/]+/).filter(Boolean);
|
||||
return parts[parts.length - 1] ?? root.path;
|
||||
}
|
||||
|
||||
/** A time as "14:05" today and "3 Nov, 14:05" before. */
|
||||
export function syncTimeOptions(at: number, now = Date.now()): { hour: "numeric"; minute: "2-digit"; day?: "numeric"; month?: "short" } {
|
||||
const sameDay = new Date(at).toDateString() === new Date(now).toDateString();
|
||||
return sameDay
|
||||
? { hour: "numeric", minute: "2-digit" }
|
||||
: { day: "numeric", month: "short", hour: "numeric", minute: "2-digit" };
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import { getFilePreviewKind } from "@/lib/file-preview";
|
||||
import type { FileAppAction } from "@/lib/files-app-actions";
|
||||
import { useAppSidePanel } from "@/components/plugins/app-side-panel";
|
||||
import { MAX_SIDE_PANEL_FILES } from "@/lib/plugin-sandbox/assistant/f.types";
|
||||
import { ShowInFolderMenuItem } from "@/components/files-sync/files-sync-item";
|
||||
import { resourceToView, useFileStore, isSharedFilesPage, sharedFilePages, type FileResource } from "@/stores/file-store";
|
||||
import { TRASH_LOCATION, TRASH_PATH, isTrashLocation } from "@/lib/files-trash";
|
||||
import { PluginActions, usePluginActions } from "@/components/plugins/plugin-actions";
|
||||
@@ -1057,6 +1058,7 @@ export function FileBrowser({
|
||||
<ContextMenuItem icon={Download} label={t("download")} onClick={() => { closeMenu(); void onDownload(resource.name); }} />
|
||||
)}
|
||||
<ContextMenuItem icon={Info} label={t("details")} onClick={() => { closeMenu(); toggleDetails(true); }} />
|
||||
<ShowInFolderMenuItem nodeId={resource.id} onRan={closeMenu} />
|
||||
<ContextMenuSeparator />
|
||||
<ContextMenuItem icon={Trash2} label={t("delete")} shortcut="Del" destructive onClick={() => { closeMenu(); deleteNames([resource.name]); }} />
|
||||
<FilePluginMenuEntries
|
||||
|
||||
@@ -8,6 +8,7 @@ import { cn } from "@/lib/utils";
|
||||
import type { FileResource } from "@/stores/file-store";
|
||||
import type { FileResourceView } from "@/lib/plugin-types";
|
||||
import { PluginSlot } from "@/components/plugins/plugin-slot";
|
||||
import { FilesSyncDetailsRow, ShowInFolderButton } from "@/components/files-sync/files-sync-item";
|
||||
import {
|
||||
FileSize, ResourceIcon, Thumbnail, canShowThumbnail, formatFullDate, type IconOptions,
|
||||
} from "@/components/files/file-item-parts";
|
||||
@@ -157,6 +158,7 @@ export function FileDetailsPanel({
|
||||
{isStarred ? t("unstar") : t("star")}
|
||||
</Button>
|
||||
)}
|
||||
<ShowInFolderButton nodeId={resource.id} />
|
||||
</div>
|
||||
<dl className="space-y-3 text-sm">
|
||||
<Row
|
||||
@@ -167,6 +169,7 @@ export function FileDetailsPanel({
|
||||
{resource.lastModified && <Row label={t("modified")} value={formatFullDate(resource.lastModified)} />}
|
||||
<Row label={t("sharing")} value={sharing} />
|
||||
<Row label={t("path")} value={path} mono />
|
||||
<FilesSyncDetailsRow nodeId={resource.id} />
|
||||
</dl>
|
||||
{pluginProps && <PluginSlot name="file-preview-section" className="w-full" extraProps={pluginProps} />}
|
||||
</div>,
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
FileSize, MiddleCutName, ResourceIcon, ShareBadge, Thumbnail, canShowThumbnail, formatFullDate, formatShortDate,
|
||||
type IconOptions,
|
||||
} from "@/components/files/file-item-parts";
|
||||
import { FilesSyncBadge } from "@/components/files-sync/files-sync-item";
|
||||
import type { SortDir, SortKey } from "@/components/files/files-header";
|
||||
import { TOUCH_HIT_AREA } from "@/components/ui/button";
|
||||
import { FILE_LIST_COLUMNS } from "./file-list-layout";
|
||||
@@ -274,6 +275,7 @@ function FileListRow({ resource, isSelected, isFocused, isTabStop, isDropTarget,
|
||||
</span>
|
||||
{isStarred && <Star className="w-3.5 h-3.5 shrink-0 text-amber-400 fill-amber-400" aria-label={t("favorites")} />}
|
||||
<ShareBadge resource={resource} t={t} />
|
||||
<FilesSyncBadge nodeId={resource.id} />
|
||||
</div>
|
||||
{touch && (
|
||||
<div className="text-xs text-muted-foreground truncate">
|
||||
@@ -487,6 +489,7 @@ function FileTile({ resource, isSelected, isFocused, isTabStop, isCut, selecting
|
||||
{!resource.isSymlink && <><FileSize bytes={resource.contentLength} /> · </>}{formatShortDate(resource.lastModified)}
|
||||
</span>
|
||||
<ShareBadge resource={resource} t={t} className="w-3 h-3" />
|
||||
<FilesSyncBadge nodeId={resource.id} className="w-3 h-3" />
|
||||
</div>
|
||||
</div>
|
||||
<IconButton
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { applyControlsArea, watchTitlebarArea, watchWindowRows, type TitlebarArea } from "@/lib/window-controls-overlay";
|
||||
import { claimBrowserSignIn } from "@/lib/desktop/browser-sign-in";
|
||||
import { claimFilesControls } from "@/lib/files-sync/controls";
|
||||
|
||||
/**
|
||||
* The window's controls over the app, with no title bar row: see
|
||||
@@ -13,7 +14,10 @@ import { claimBrowserSignIn } from "@/lib/desktop/browser-sign-in";
|
||||
export function WindowControlsHost() {
|
||||
// In the first render of every page, before any frame exists: a frame can reach the
|
||||
// bridge, and whoever comes after this gets nothing.
|
||||
if (typeof window !== "undefined") claimBrowserSignIn();
|
||||
if (typeof window !== "undefined") {
|
||||
claimBrowserSignIn();
|
||||
claimFilesControls();
|
||||
}
|
||||
const [area, setArea] = useState<TitlebarArea | null>(null);
|
||||
|
||||
useEffect(() => watchTitlebarArea((next) => {
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { getDesktopBridge } from "@/lib/desktop/bridge";
|
||||
import { getDesktopPolicy, onDesktopPolicyChange } from "@/lib/desktop/policy";
|
||||
import { canDownload } from "@/lib/device-policy";
|
||||
import { claimFilesControls } from "@/lib/files-sync/controls";
|
||||
import { FilesSyncHost as Host, type HostAccount } from "@/lib/files-sync/host";
|
||||
import { registerFilesSyncLifecycle, setRunningFilesSyncHost } from "@/lib/files-sync/lifecycle";
|
||||
import { scopeDecided } from "@/lib/offline/offline-mode";
|
||||
import { subscribePushStateChanges } from "@/lib/push-events";
|
||||
import { useAccountStore } from "@/stores/account-store";
|
||||
import { useAuthStore } from "@/stores/auth-store";
|
||||
import { useFilesSyncStore } from "@/stores/files-sync-store";
|
||||
|
||||
registerFilesSyncLifecycle();
|
||||
|
||||
/** `FilesFolderSyncEnabled` forced off. Main removes the folders itself; this keeps the engine off them meanwhile. */
|
||||
function folderSyncForcedOff(): boolean {
|
||||
const entry = getDesktopPolicy().FilesFolderSyncEnabled;
|
||||
return entry.locked && entry.value === false;
|
||||
}
|
||||
|
||||
/** A definite no from the organisation. An unknown policy isn't one. */
|
||||
function downloadsForbidden(account: string): boolean {
|
||||
return scopeDecided(account) && !canDownload(account);
|
||||
}
|
||||
|
||||
/**
|
||||
* Files on this computer, in the desktop app's main window (it's under MainWindowOnly): starts
|
||||
* the sync engine for the signed-in accounts and keeps it fed with push, the network and the
|
||||
* policies. Renders nothing. In a browser, or a shell without the files bridge, it does nothing.
|
||||
*/
|
||||
export function FilesSyncHost() {
|
||||
const hostRef = useRef<Host | null>(null);
|
||||
const accounts = useAccountStore((s) => s.accounts);
|
||||
const activeAccountId = useAuthStore((s) => s.activeAccountId);
|
||||
const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
|
||||
const revision = useAuthStore((s) => s.connectedAccountsRevision);
|
||||
const client = useAuthStore((s) => s.client);
|
||||
|
||||
useEffect(() => {
|
||||
const bridge = getDesktopBridge();
|
||||
const controls = bridge?.files ? claimFilesControls() : null;
|
||||
if (!bridge || !controls) return;
|
||||
const store = useFilesSyncStore.getState();
|
||||
const host = new Host({
|
||||
controls,
|
||||
platform: bridge.platform,
|
||||
publish: (patch) => useFilesSyncStore.getState().publish(patch),
|
||||
setController: (controller) => useFilesSyncStore.getState().setController(controller),
|
||||
folderSyncForcedOff,
|
||||
downloadsForbidden,
|
||||
});
|
||||
hostRef.current = host;
|
||||
setRunningFilesSyncHost(host);
|
||||
host.start();
|
||||
const stopPush = subscribePushStateChanges((change, changedClient) => {
|
||||
for (const [account, entry] of useAuthStore.getState().getAllConnectedClients()) {
|
||||
if (entry !== changedClient) continue;
|
||||
if (Object.values(change.changed).some((types) => !!types && "FileNode" in types)) host.remoteChanged(account);
|
||||
}
|
||||
});
|
||||
const stopPolicy = onDesktopPolicyChange(() => host.policyChanged());
|
||||
const online = () => host.online();
|
||||
window.addEventListener("online", online);
|
||||
return () => {
|
||||
stopPush();
|
||||
stopPolicy();
|
||||
window.removeEventListener("online", online);
|
||||
setRunningFilesSyncHost(null);
|
||||
host.stop();
|
||||
hostRef.current = null;
|
||||
store.reset();
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const host = hostRef.current;
|
||||
if (!host) return;
|
||||
const clients = isAuthenticated ? useAuthStore.getState().getAllConnectedClients() : new Map();
|
||||
const list: HostAccount[] = [];
|
||||
for (const [id, entry] of clients) {
|
||||
const account = accounts.find((a) => a.id === id);
|
||||
if (account && !account.isConnected) continue;
|
||||
list.push({ id, label: account?.email || account?.username || account?.label || id, client: entry });
|
||||
}
|
||||
host.setAccounts(list, isAuthenticated ? activeAccountId : null);
|
||||
}, [accounts, activeAccountId, isAuthenticated, revision, client]);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import en from '@/locales/en/common.json';
|
||||
import type { FilesDriveState, FilesRoot } from '@/lib/desktop/types';
|
||||
import type { FilesSyncActivity, FilesSyncController, FilesSyncRootStatus } from '@/lib/files-sync/types';
|
||||
|
||||
// Files on this computer, the settings page: the drive, synced folders, the
|
||||
// activity list and the mass-delete question, against the store and a fake
|
||||
// controller (the engine is built elsewhere).
|
||||
|
||||
vi.unmock('next-intl');
|
||||
vi.mock('@/lib/debug', () => ({ debug: { log: () => {}, warn: () => {}, error: () => {} } }));
|
||||
|
||||
const { useFilesSyncStore } = await import('@/stores/files-sync-store');
|
||||
const { useAuthStore } = await import('@/stores/auth-store');
|
||||
const { DesktopFilesSettings } = await import('../desktop-files-settings');
|
||||
|
||||
type Fake = { [K in keyof FilesSyncController]: ReturnType<typeof vi.fn> };
|
||||
|
||||
function fakeController(): Fake {
|
||||
return {
|
||||
addFolder: vi.fn(async () => ({ ok: true as const, value: folderRoot() })),
|
||||
removeRoot: vi.fn(async () => {}),
|
||||
setPaused: vi.fn(async () => {}),
|
||||
confirmMassDelete: vi.fn(async () => {}),
|
||||
setDriveEnabled: vi.fn(async () => ({ ok: true as const, value: null })),
|
||||
setDriveLetter: vi.fn(async () => ({ ok: true as const, value: { letter: 'Z', chosen: 'Z', locked: false, available: [] } })),
|
||||
coverage: vi.fn(() => null),
|
||||
showInFolder: vi.fn(async () => true),
|
||||
clearActivity: vi.fn(),
|
||||
} as never;
|
||||
}
|
||||
|
||||
function folderRoot(patch: Partial<FilesRoot> = {}): FilesRoot {
|
||||
return {
|
||||
id: 'r1', kind: 'folder', account: 'acc', path: 'C:\\Users\\ann\\Documents\\Projects', remoteId: 'n-proj',
|
||||
remoteLabel: 'Projects', paused: false, createdAt: 1, ...patch,
|
||||
};
|
||||
}
|
||||
|
||||
function drive(patch: Partial<FilesDriveState> = {}): FilesDriveState {
|
||||
return {
|
||||
supported: true, forcedOff: false, wanted: [],
|
||||
letter: { letter: null, chosen: null, locked: false, available: ['X', 'Z'] },
|
||||
...patch,
|
||||
};
|
||||
}
|
||||
|
||||
let controller: ReturnType<typeof fakeController>;
|
||||
|
||||
function setup(patch: Record<string, unknown> = {}) {
|
||||
controller = fakeController();
|
||||
useFilesSyncStore.setState({ available: true, account: 'acc', controller: controller as unknown as FilesSyncController, ...patch });
|
||||
}
|
||||
|
||||
function renderPage() {
|
||||
return render(
|
||||
<NextIntlClientProvider locale="en" messages={en} timeZone="UTC">
|
||||
<DesktopFilesSettings />
|
||||
</NextIntlClientProvider>,
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
useFilesSyncStore.getState().reset();
|
||||
});
|
||||
afterEach(() => {
|
||||
useFilesSyncStore.getState().reset();
|
||||
});
|
||||
|
||||
describe('Files on this computer settings page', () => {
|
||||
it('draws nothing outside the desktop app or on an older shell', () => {
|
||||
useFilesSyncStore.setState({ available: false, roots: [folderRoot()], drive: drive() });
|
||||
const { container } = renderPage();
|
||||
expect(container).toBeEmptyDOMElement();
|
||||
});
|
||||
|
||||
it('has no drive section off Windows', () => {
|
||||
setup({ drive: null });
|
||||
renderPage();
|
||||
expect(screen.queryByRole('switch', { name: 'Show Files as a drive' })).toBeNull();
|
||||
expect(screen.getByRole('heading', { name: 'Synced folders' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('turns the drive on for the account from the click itself', () => {
|
||||
setup({ drive: drive() });
|
||||
renderPage();
|
||||
const toggle = screen.getByRole('switch', { name: 'Show Files as a drive' });
|
||||
expect(toggle).toHaveAttribute('aria-checked', 'false');
|
||||
// No drive, no letter.
|
||||
expect(screen.queryByText('Drive letter')).toBeNull();
|
||||
fireEvent.click(toggle);
|
||||
// Synchronously: the shell needs the click it came from.
|
||||
expect(controller.setDriveEnabled).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
it('shows the drive on, and turns it off', () => {
|
||||
setup({ drive: drive({ wanted: ['acc'] }) });
|
||||
renderPage();
|
||||
const toggle = screen.getByRole('switch', { name: 'Show Files as a drive' });
|
||||
expect(toggle).toHaveAttribute('aria-checked', 'true');
|
||||
fireEvent.click(toggle);
|
||||
expect(controller.setDriveEnabled).toHaveBeenCalledWith(false);
|
||||
});
|
||||
|
||||
it('says the organisation turned the drive off and keeps the switch off', () => {
|
||||
setup({ drive: drive({ forcedOff: true, wanted: ['acc'] }) });
|
||||
renderPage();
|
||||
const toggle = screen.getByRole('switch', { name: 'Show Files as a drive' });
|
||||
expect(toggle).toHaveAttribute('aria-checked', 'false');
|
||||
expect(toggle).toBeDisabled();
|
||||
expect(screen.getByText(en.settings.org_locked)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('offers no letter by default and the free letters, and sets the chosen one', () => {
|
||||
setup({ drive: drive({ wanted: ['acc'] }) });
|
||||
renderPage();
|
||||
const select = screen.getByRole('combobox', { name: 'Drive letter' }) as HTMLSelectElement;
|
||||
expect(select.value).toBe('none');
|
||||
expect([...select.options].map((o) => o.textContent)).toEqual(['No letter', 'X:', 'Z:']);
|
||||
fireEvent.change(select, { target: { value: 'Z' } });
|
||||
expect(controller.setDriveLetter).toHaveBeenCalledWith('Z');
|
||||
fireEvent.change(select, { target: { value: 'none' } });
|
||||
expect(controller.setDriveLetter).toHaveBeenLastCalledWith(null);
|
||||
});
|
||||
|
||||
it('shows a letter forced by policy, locked', () => {
|
||||
setup({ drive: drive({ wanted: ['acc'], letter: { letter: 'Q', chosen: 'X', locked: true, available: ['X'] } }) });
|
||||
renderPage();
|
||||
const select = screen.getByRole('combobox', { name: 'Drive letter' }) as HTMLSelectElement;
|
||||
expect(select.value).toBe('Q');
|
||||
expect(select).toBeDisabled();
|
||||
const row = select.closest('[data-search-label]') as HTMLElement;
|
||||
expect(within(row).getByText(en.settings.org_locked)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('lists a synced folder with its Files folder and pauses and resumes it', () => {
|
||||
setup({ roots: [folderRoot()], status: { r1: { rootId: 'r1', state: 'idle', pending: 0, done: 0, lastSyncedAt: null } } });
|
||||
const { rerender } = renderPage();
|
||||
expect(screen.getByText('C:\\Users\\ann\\Documents\\Projects')).toBeInTheDocument();
|
||||
expect(screen.getByText('With Projects in Files')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Pause' }));
|
||||
expect(controller.setPaused).toHaveBeenCalledWith('r1', true);
|
||||
|
||||
act(() => useFilesSyncStore.setState({ roots: [folderRoot({ paused: true })], status: { r1: { rootId: 'r1', state: 'paused', pending: 0, done: 0, lastSyncedAt: null } } }));
|
||||
rerender(
|
||||
<NextIntlClientProvider locale="en" messages={en} timeZone="UTC">
|
||||
<DesktopFilesSettings />
|
||||
</NextIntlClientProvider>,
|
||||
);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Resume' }));
|
||||
expect(controller.setPaused).toHaveBeenLastCalledWith('r1', false);
|
||||
});
|
||||
|
||||
it('asks before removing a folder, saying its files stay', () => {
|
||||
setup({ roots: [folderRoot()] });
|
||||
renderPage();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Remove…' }));
|
||||
const dialog = screen.getByRole('alertdialog');
|
||||
expect(dialog).toHaveTextContent('The files on this computer stay where they are');
|
||||
expect(controller.removeRoot).not.toHaveBeenCalled();
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Stop syncing' }));
|
||||
expect(controller.removeRoot).toHaveBeenCalledWith('r1');
|
||||
});
|
||||
|
||||
it('says how each folder is doing', () => {
|
||||
const at = Date.UTC(2026, 10, 4, 14, 5);
|
||||
vi.useFakeTimers({ now: at + 60_000, toFake: ['Date'] });
|
||||
const states: [string, Partial<FilesSyncRootStatus>][] = [
|
||||
['idle', { lastSyncedAt: at }],
|
||||
['syncing', { done: 3, pending: 7 }],
|
||||
['paused', {}],
|
||||
['offline', { pending: 2 }],
|
||||
['error', { errorKey: 'files_sync.errors.quota' }],
|
||||
['blocked', {}],
|
||||
['starting', {}],
|
||||
];
|
||||
const roots = states.map(([state]) => folderRoot({ id: state, path: `/home/ann/${state}` }));
|
||||
const status = Object.fromEntries(states.map(([state, extra]) => [state, { rootId: state, state, pending: 0, done: 0, lastSyncedAt: null, ...extra }]));
|
||||
setup({ roots, status });
|
||||
renderPage();
|
||||
const line = (id: string) => document.querySelector(`[data-files-sync-root="${id}"] [data-files-sync-state]`)!.textContent;
|
||||
expect(line('idle')).toMatch(/^Up to date\. Last synced .*2:05/);
|
||||
expect(line('syncing')).toBe('Syncing: 3 done, 7 to go');
|
||||
expect(line('paused')).toBe('Paused');
|
||||
expect(line('offline')).toBe('Offline. 2 changes wait for the server');
|
||||
expect(line('error')).toBe('Stopped: Your storage in Files is full');
|
||||
expect(line('blocked')).toBe('Turned off by your organisation');
|
||||
expect(line('starting')).toBe('Starting…');
|
||||
// A blocked folder can't be resumed, only removed.
|
||||
expect(within(document.querySelector('[data-files-sync-root="blocked"]') as HTMLElement).queryByRole('button', { name: 'Resume' })).toBeNull();
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it('shows an unknown error key as a plain failure, never the key', () => {
|
||||
setup({ roots: [folderRoot()], status: { r1: { rootId: 'r1', state: 'error', pending: 0, done: 0, lastSyncedAt: null, errorKey: 'something_new' } } });
|
||||
renderPage();
|
||||
expect(screen.getByText('Stopped: Something went wrong')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('adds a folder: picks the Files folder, then calls the controller from that click', async () => {
|
||||
const listAllFileNodes = vi.fn(async () => [
|
||||
{ id: 'n-proj', name: 'Projects', parentId: null, blobId: null },
|
||||
{ id: 'n-2026', name: '2026', parentId: 'n-proj', blobId: null },
|
||||
{ id: 'n-file', name: 'a.txt', parentId: 'n-proj', blobId: 'b1' },
|
||||
]);
|
||||
useAuthStore.setState({ client: { listAllFileNodes } as never });
|
||||
setup({ roots: [] });
|
||||
renderPage();
|
||||
expect(screen.getByText('No folders are synced yet.')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Add folder…' }));
|
||||
const dialog = await screen.findByRole('dialog', { name: 'Which folder in Files?' });
|
||||
// Only folders are offered.
|
||||
expect(within(dialog).queryByText('a.txt')).toBeNull();
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Expand Projects' }));
|
||||
await waitFor(() => expect(within(dialog).getByText('2026')).toBeInTheDocument());
|
||||
fireEvent.click(within(dialog).getByText('2026'));
|
||||
expect(controller.addFolder).not.toHaveBeenCalled();
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Choose folder on this computer…' }));
|
||||
// In the same task as the click: nothing slow is awaited first.
|
||||
expect(controller.addFolder).toHaveBeenCalledWith('n-2026', 'Projects / 2026');
|
||||
useAuthStore.setState({ client: null });
|
||||
});
|
||||
|
||||
it('says why a folder could not be added, and nothing when the picker was closed', async () => {
|
||||
useAuthStore.setState({ client: { listAllFileNodes: vi.fn(async () => [{ id: 'n-proj', name: 'Projects', parentId: null, blobId: null }]) } as never });
|
||||
setup({ roots: [] });
|
||||
controller.addFolder.mockResolvedValueOnce({ ok: false, error: 'overlap' });
|
||||
renderPage();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Add folder…' }));
|
||||
let dialog = await screen.findByRole('dialog');
|
||||
fireEvent.click(within(dialog).getByText('Projects'));
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Choose folder on this computer…' }));
|
||||
expect(await screen.findByRole('alert')).toHaveTextContent(en.files_sync.folders.add_failed.overlap);
|
||||
|
||||
controller.addFolder.mockResolvedValueOnce({ ok: false, error: 'cancelled' });
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Add folder…' }));
|
||||
dialog = await screen.findByRole('dialog');
|
||||
fireEvent.click(within(dialog).getByText('Projects'));
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: 'Choose folder on this computer…' }));
|
||||
await waitFor(() => expect(controller.addFolder).toHaveBeenCalledTimes(2));
|
||||
await waitFor(() => expect(screen.queryByRole('alert')).toBeNull());
|
||||
useAuthStore.setState({ client: null });
|
||||
});
|
||||
|
||||
it('hides adding folders when the organisation turned folder sync off', () => {
|
||||
setup({ folderSyncForcedOff: true, roots: [folderRoot()], status: { r1: { rootId: 'r1', state: 'blocked', pending: 0, done: 0, lastSyncedAt: null } } });
|
||||
renderPage();
|
||||
expect(screen.queryByRole('button', { name: 'Add folder…' })).toBeNull();
|
||||
expect(screen.getByTestId('files-sync-folders-locked')).toHaveTextContent(en.settings.org_locked);
|
||||
// The folder can still be removed; its files stay.
|
||||
expect(screen.getByRole('button', { name: 'Remove…' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('lists recent activity newest first, marks conflicts and errors, and clears it', () => {
|
||||
const activity: FilesSyncActivity[] = [
|
||||
{ id: 'a1', at: 1000, rootId: 'r1', kind: 'uploaded', direction: 'up', path: 'notes.txt' },
|
||||
{ id: 'a3', at: 3000, rootId: 'r1', kind: 'error', direction: 'up', path: 'big.iso', messageKey: 'files_sync.errors.quota' },
|
||||
{ id: 'a2', at: 2000, rootId: 'r1', kind: 'conflict', direction: null, path: 'plan.docx', detail: 'plan (conflict, PC, 2026-11-04).docx' },
|
||||
{ id: 'a4', at: 500, rootId: 'r1', kind: 'too-large', direction: null, path: 'video.mp4', detail: '1048576' },
|
||||
];
|
||||
setup({ roots: [folderRoot()], activity });
|
||||
renderPage();
|
||||
const rows = within(screen.getByTestId('files-sync-activity')).getAllByRole('listitem');
|
||||
expect(rows.map((r) => r.getAttribute('data-activity-kind'))).toEqual(['error', 'conflict', 'uploaded', 'too-large']);
|
||||
expect(rows[0]).toHaveTextContent('big.iso couldn\'t be synced: Your storage in Files is full');
|
||||
expect(within(rows[0]).getByRole('img', { name: 'Error' })).toBeInTheDocument();
|
||||
expect(rows[1]).toHaveTextContent('plan.docx was changed in both places. The other version is kept as plan (conflict, PC, 2026-11-04).docx');
|
||||
expect(within(rows[1]).getByRole('img', { name: 'Conflict' })).toBeInTheDocument();
|
||||
expect(rows[2]).toHaveTextContent('Projects');
|
||||
expect(rows[2]).toHaveTextContent('Uploaded notes.txt');
|
||||
expect(within(rows[2]).getByRole('img', { name: 'To Files' })).toBeInTheDocument();
|
||||
expect(rows[3]).toHaveTextContent('video.mp4 is bigger than Files allows (1 MB)');
|
||||
expect(within(rows[3]).getByRole('img', { name: 'Error' })).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Clear' }));
|
||||
expect(controller.clearActivity).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('has a line for every kind of activity', () => {
|
||||
const kinds = ['uploaded', 'downloaded', 'folder-created', 'renamed', 'moved', 'deleted', 'trashed', 'conflict', 'renamed-for-disk', 'too-large', 'waiting', 'mass-delete', 'error'] as const;
|
||||
setup({ roots: [folderRoot()], activity: kinds.map((kind, i) => ({ id: kind, at: 10_000 - i, rootId: 'r1', kind, direction: null, path: 'x.txt', detail: 'y.txt' })) });
|
||||
renderPage();
|
||||
const rows = within(screen.getByTestId('files-sync-activity')).getAllByRole('listitem');
|
||||
expect(rows).toHaveLength(kinds.length);
|
||||
for (const row of rows) expect(row.textContent).not.toMatch(/files_sync\.|\{/);
|
||||
});
|
||||
|
||||
it('says when nothing happened yet', () => {
|
||||
setup({ roots: [folderRoot()] });
|
||||
renderPage();
|
||||
expect(screen.getByText('Nothing has happened yet.')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: 'Clear' })).toBeDisabled();
|
||||
});
|
||||
|
||||
it('asks about a mass delete in the folder row, with both answers', () => {
|
||||
setup({
|
||||
roots: [folderRoot(), folderRoot({ id: 'r2', path: '/home/ann/Photos', remoteLabel: 'Photos' })],
|
||||
status: {
|
||||
r1: { rootId: 'r1', state: 'confirm-delete', pending: 0, done: 0, lastSyncedAt: null, massDelete: { count: 120, side: 'local' } },
|
||||
r2: { rootId: 'r2', state: 'confirm-delete', pending: 0, done: 0, lastSyncedAt: null, massDelete: { count: 64, side: 'remote' } },
|
||||
},
|
||||
});
|
||||
renderPage();
|
||||
const first = document.querySelector('[data-files-sync-root="r1"]') as HTMLElement;
|
||||
expect(first).toHaveTextContent('120 items were deleted from Projects on this computer. Delete them in Files too?');
|
||||
const second = document.querySelector('[data-files-sync-root="r2"]') as HTMLElement;
|
||||
expect(second).toHaveTextContent('64 items were deleted from Photos in Files. Delete them on this computer too?');
|
||||
fireEvent.click(within(first).getByRole('button', { name: 'Delete them' }));
|
||||
expect(controller.confirmMassDelete).toHaveBeenCalledWith('r1', true);
|
||||
fireEvent.click(within(second).getByRole('button', { name: 'Bring them back' }));
|
||||
expect(controller.confirmMassDelete).toHaveBeenLastCalledWith('r2', false);
|
||||
});
|
||||
});
|
||||
@@ -35,6 +35,7 @@ const { useSettingsStore } = await import('@/stores/settings-store');
|
||||
const { SETTINGS_NAV_GROUPS } = await import('../settings-tab-icons');
|
||||
const { BOOT_HINTS_KEY } = await import('@/lib/boot-skeleton/keys');
|
||||
const { resetRailHintsMemo } = await import('@/lib/boot-skeleton/hints');
|
||||
const { useFilesSyncStore } = await import('@/stores/files-sync-store');
|
||||
|
||||
/** A client that supports everything it is asked about. */
|
||||
const fullClient = new Proxy({}, {
|
||||
@@ -91,11 +92,25 @@ describe('Settings while the session restores', () => {
|
||||
expect(skeleton()).toBeNull();
|
||||
const shown = [...document.querySelectorAll('[data-testid^="settings-tab-"]')]
|
||||
.map((el) => el.getAttribute('data-testid')!.slice('settings-tab-'.length));
|
||||
// Recovery waits for a server probe this test doesn't answer.
|
||||
const drawn = SETTINGS_NAV_GROUPS.flatMap((g) => g.tabs).filter((tab) => tab !== 'recovery');
|
||||
// Recovery waits for a server probe this test doesn't answer; Files on
|
||||
// this computer for the desktop app's sync engine.
|
||||
const drawn = SETTINGS_NAV_GROUPS.flatMap((g) => g.tabs).filter((tab) => tab !== 'recovery' && tab !== 'files_sync');
|
||||
expect(shown).toEqual(drawn);
|
||||
});
|
||||
|
||||
it('lists Files on this computer after Files only while the desktop sync engine runs', () => {
|
||||
useAuthStore.setState({ isAuthenticated: true, isLoading: false, client: fullClient as never });
|
||||
useFilesSyncStore.setState({ available: true });
|
||||
try {
|
||||
render(<SettingsApp linkSegments={[]} />);
|
||||
const shown = [...document.querySelectorAll('[data-testid^="settings-tab-"]')]
|
||||
.map((el) => el.getAttribute('data-testid')!.slice('settings-tab-'.length));
|
||||
expect(shown.slice(shown.indexOf('files'), shown.indexOf('files') + 2)).toEqual(['files', 'files_sync']);
|
||||
} finally {
|
||||
useFilesSyncStore.getState().reset();
|
||||
}
|
||||
});
|
||||
|
||||
it('leaves the next load the pages this account has', () => {
|
||||
useAuthStore.setState({ isAuthenticated: true, isLoading: false, client: bareClient as never });
|
||||
render(<SettingsApp linkSegments={[]} />);
|
||||
|
||||
@@ -36,6 +36,7 @@ const { useCalendarStore } = await import('@/stores/calendar-store');
|
||||
const { useContactStore } = await import('@/stores/contact-store');
|
||||
const { useEmailStore } = await import('@/stores/email-store');
|
||||
const { useAccountStore } = await import('@/stores/account-store');
|
||||
const { useFilesSyncStore } = await import('@/stores/files-sync-store');
|
||||
const { TourProvider } = await import('@/components/tour/tour-provider');
|
||||
const { AdvancedSettingsProvider } = await import('../settings-section');
|
||||
const { tabSearchEntries, getByPath, withAppName, settingsTabLabelKey } = await import('@/lib/settings-search');
|
||||
@@ -60,6 +61,7 @@ const pages = {
|
||||
contacts: (await import('../contacts-settings')).ContactsSettings,
|
||||
contacts2: (await import('../address-book-management-settings')).AddressBookManagementSettings,
|
||||
files: (await import('../files-settings')).FilesSettingsComponent,
|
||||
files_sync: (await import('../desktop-files-settings')).DesktopFilesSettings,
|
||||
addons: (await import('../addons-settings')).AddonsSettings,
|
||||
backup: (await import('../about-data-settings')).AboutDataSettings,
|
||||
offline: (await import('@/components/offline/offline-settings')).OfflineSettings,
|
||||
@@ -76,7 +78,7 @@ const OVERRIDES: Record<string, () => unknown> = {
|
||||
getPrincipals: async () => [], listArchivedEmails: async () => ({ items: [], nextPosition: null }),
|
||||
};
|
||||
/** Pages with rows of the desktop app's own, or browser rows it hides. */
|
||||
const DESKTOP_PAGES = new Set(['general', 'notifications', 'privacy', 'backup']);
|
||||
const DESKTOP_PAGES = new Set(['general', 'notifications', 'privacy', 'backup', 'files_sync']);
|
||||
|
||||
/** The desktop app's bridge, answering as Windows does, with every switch off. */
|
||||
const DESKTOP_BRIDGE = {
|
||||
@@ -121,7 +123,7 @@ const TAB_PAGES: Record<string, string[]> = {
|
||||
accessibility: ['accessibility'],
|
||||
message_list: ['message_list'], reading: ['reading'], composing: ['composing'], vacation: ['vacation'],
|
||||
filters: ['filters'], organize: ['organize'], security: ['security'], sharing: ['sharing'], recovery: ['recovery'], calendar: ['calendar', 'calendar2'],
|
||||
contacts: ['contacts', 'contacts2'], files: ['files'], addons: ['addons'], backup: ['backup'],
|
||||
contacts: ['contacts', 'contacts2'], files: ['files'], files_sync: ['files_sync'], addons: ['addons'], backup: ['backup'],
|
||||
offline: ['offline'], privacy: ['privacy'], about: ['about'],
|
||||
};
|
||||
|
||||
@@ -141,7 +143,15 @@ describe('settings search index', () => {
|
||||
const realMatchMedia = window.matchMedia;
|
||||
const variants: Record<string, () => void> = {
|
||||
base: () => {},
|
||||
desktop: () => { window.bulwarkDesktop = DESKTOP_BRIDGE as never; },
|
||||
desktop: () => {
|
||||
window.bulwarkDesktop = DESKTOP_BRIDGE as never;
|
||||
// Files on this computer: the engine runs, on Windows, with the drive on offer.
|
||||
useFilesSyncStore.setState({
|
||||
available: true,
|
||||
account: 'acc',
|
||||
drive: { supported: true, forcedOff: false, wanted: [], letter: { letter: null, chosen: null, locked: false, available: ['Z'] } },
|
||||
});
|
||||
},
|
||||
touch: () => {
|
||||
window.matchMedia = ((q: string) => ({ ...realMatchMedia(q), matches: q.includes('coarse') })) as typeof window.matchMedia;
|
||||
},
|
||||
@@ -160,6 +170,7 @@ describe('settings search index', () => {
|
||||
useAccountStore.setState(accountsInitial, true);
|
||||
window.matchMedia = realMatchMedia;
|
||||
window.bulwarkDesktop = undefined;
|
||||
useFilesSyncStore.getState().reset();
|
||||
apply();
|
||||
out[variant] = {};
|
||||
for (const [tab, Page] of Object.entries(pages)) {
|
||||
|
||||
@@ -0,0 +1,346 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import { useFormatter, useTranslations } from "next-intl";
|
||||
import {
|
||||
AlertCircle, AlertTriangle, ArrowDown, ArrowUp, FolderSync, HardDrive, HelpCircle, Loader2, Trash2, type AppIcon,
|
||||
} from "@/components/icons";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ConfirmDialog } from "@/components/ui/confirm-dialog";
|
||||
import { FolderPickerDialog, type PickerFolder } from "@/components/files/folder-picker-dialog";
|
||||
import { FilesSyncStatusLine } from "@/components/files-sync/files-sync-status-line";
|
||||
import { MassDeleteQuestion, useInlineMassDeleteQuestions } from "@/components/files-sync/files-sync-prompts";
|
||||
import { filesSyncErrorKey, rootName, syncTimeOptions } from "@/components/files-sync/files-sync-text";
|
||||
import { fileNodeKind } from "@/lib/jmap/filenode-kind";
|
||||
import { findTrashFolder, trashSubtreeIds } from "@/lib/files-trash";
|
||||
import { cn, formatFileSize } from "@/lib/utils";
|
||||
import type { FilesDriveState, FilesError, FilesRoot } from "@/lib/desktop/types";
|
||||
import type { FilesSyncActivity, FilesSyncActivityKind } from "@/lib/files-sync/types";
|
||||
import { useAuthStore } from "@/stores/auth-store";
|
||||
import { useFilesSyncStore } from "@/stores/files-sync-store";
|
||||
import { OrgLockedNote } from "./org-locked-note";
|
||||
import { SettingItem, SettingsSection, Select, ToggleSwitch } from "./settings-section";
|
||||
|
||||
/**
|
||||
* Settings > Files on this computer, in the desktop app only: the Files drive
|
||||
* (Windows), folders kept the same as a Files folder, and what happened lately.
|
||||
* Everything comes from stores/files-sync-store.ts and goes to the engine's
|
||||
* controller; the page never talks to the bridge.
|
||||
*/
|
||||
export function DesktopFilesSettings() {
|
||||
const available = useFilesSyncStore((s) => s.available);
|
||||
const drive = useFilesSyncStore((s) => s.drive);
|
||||
// The page asks about a mass delete in the folder's row; the app-wide dialog waits.
|
||||
useInlineMassDeleteQuestions();
|
||||
if (!available) return null;
|
||||
return (
|
||||
<div className="space-y-8" data-testid="files-sync-settings">
|
||||
{drive && <DriveSection drive={drive} />}
|
||||
<FoldersSection />
|
||||
<ActivitySection />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** What went wrong turning something on, in words. */
|
||||
function addErrorKey(error: FilesError): string | null {
|
||||
if (error === "cancelled") return null;
|
||||
if (error === "overlap" || error === "denied" || error === "policy") return `folders.add_failed.${error}`;
|
||||
return "folders.add_failed.failed";
|
||||
}
|
||||
|
||||
function DriveSection({ drive }: { drive: FilesDriveState }) {
|
||||
const t = useTranslations("files_sync");
|
||||
const account = useFilesSyncStore((s) => s.account);
|
||||
const roots = useFilesSyncStore((s) => s.roots);
|
||||
const status = useFilesSyncStore((s) => s.status);
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const on = !drive.forcedOff && !!account && drive.wanted.includes(account);
|
||||
const driveRoot = roots.find((r) => r.kind === "drive" && r.account === account);
|
||||
const { letter } = drive;
|
||||
const letterValue = (letter.locked ? letter.letter : letter.chosen) ?? "none";
|
||||
const letters = [...new Set([...letter.available, letter.chosen, letter.letter].filter((l): l is string => !!l))].sort();
|
||||
|
||||
const toggle = (next: boolean) => {
|
||||
if (!controller) return;
|
||||
setError(null);
|
||||
setBusy(true);
|
||||
// Straight from the click: turning it on needs the click it came from.
|
||||
void controller.setDriveEnabled(next).then(
|
||||
(result) => { if (!result.ok) setError(addErrorKey(result.error)); },
|
||||
() => setError("folders.add_failed.failed"),
|
||||
).finally(() => setBusy(false));
|
||||
};
|
||||
const chooseLetter = (value: string) => {
|
||||
if (!controller) return;
|
||||
setError(null);
|
||||
void controller.setDriveLetter(value === "none" ? null : value).then(
|
||||
(result) => { if (!result.ok) setError(addErrorKey(result.error)); },
|
||||
() => setError("folders.add_failed.failed"),
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<SettingsSection id="drive" title={t("drive.title")}>
|
||||
<SettingItem
|
||||
label={t("drive.label")}
|
||||
description={drive.supported ? t("drive.description") : t("drive.unsupported")}
|
||||
locked={drive.forcedOff}
|
||||
>
|
||||
<ToggleSwitch
|
||||
checked={on}
|
||||
disabled={!drive.supported || drive.forcedOff || !controller || !account || busy}
|
||||
testId="files-sync-drive-toggle"
|
||||
onChange={toggle}
|
||||
/>
|
||||
</SettingItem>
|
||||
{on && driveRoot && <FilesSyncStatusLine status={status[driveRoot.id]} paused={driveRoot.paused} />}
|
||||
{on && driveRoot && status[driveRoot.id]?.state === "confirm-delete" && status[driveRoot.id]?.massDelete && (
|
||||
<MassDeleteQuestion root={driveRoot} status={status[driveRoot.id]} />
|
||||
)}
|
||||
{(on || letter.locked) && drive.supported && (
|
||||
<SettingItem label={t("drive.letter_label")} description={t("drive.letter_description")} locked={letter.locked}>
|
||||
<Select
|
||||
value={letterValue}
|
||||
disabled={letter.locked || !controller}
|
||||
onChange={chooseLetter}
|
||||
options={[
|
||||
{ value: "none", label: t("drive.letter_none") },
|
||||
...letters.map((l) => ({ value: l, label: `${l}:` })),
|
||||
]}
|
||||
/>
|
||||
</SettingItem>
|
||||
)}
|
||||
{error && <p role="alert" className="text-sm text-destructive">{t(error)}</p>}
|
||||
</SettingsSection>
|
||||
);
|
||||
}
|
||||
|
||||
/** The folders of the user's own Files, for the picker: no trash, nothing shared. */
|
||||
async function loadFolders(): Promise<PickerFolder[]> {
|
||||
const client = useAuthStore.getState().client;
|
||||
if (!client) throw new Error("not signed in");
|
||||
const nodes = await client.listAllFileNodes();
|
||||
const inTrash = trashSubtreeIds(nodes, findTrashFolder(nodes)?.id);
|
||||
return nodes
|
||||
.filter((n) => fileNodeKind(n) === "directory" && !n.discoverableOnly && !n.isShared && !inTrash.has(n.id) && !n.id.includes(":"))
|
||||
.map((n) => ({ id: n.id, name: n.name, parentId: n.parentId ?? null }));
|
||||
}
|
||||
|
||||
/** "Projects / 2026" for a folder, "My files" for the top. */
|
||||
function folderLabel(folders: PickerFolder[], id: string | null, top: string): string {
|
||||
if (id === null) return top;
|
||||
const byId = new Map(folders.map((f) => [f.id, f]));
|
||||
const names: string[] = [];
|
||||
const seen = new Set<string>();
|
||||
for (let cur = byId.get(id); cur && !seen.has(cur.id); cur = cur.parentId ? byId.get(cur.parentId) : undefined) {
|
||||
seen.add(cur.id);
|
||||
names.unshift(cur.name);
|
||||
}
|
||||
return names.join(" / ") || top;
|
||||
}
|
||||
|
||||
function FoldersSection() {
|
||||
const t = useTranslations("files_sync");
|
||||
const tFiles = useTranslations("files");
|
||||
const account = useFilesSyncStore((s) => s.account);
|
||||
const roots = useFilesSyncStore((s) => s.roots);
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
const forcedOff = useFilesSyncStore((s) => s.folderSyncForcedOff);
|
||||
const [folders, setFolders] = useState<PickerFolder[] | null>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [removing, setRemoving] = useState<FilesRoot | null>(null);
|
||||
|
||||
const folderRoots = roots.filter((r) => r.kind === "folder" && (!account || r.account === account));
|
||||
|
||||
const openPicker = () => {
|
||||
setError(null);
|
||||
setLoading(true);
|
||||
loadFolders().then(setFolders, () => setError("folders.load_failed")).finally(() => setLoading(false));
|
||||
};
|
||||
// Called from the picker's button: the OS folder picker needs that click, so
|
||||
// nothing is awaited before addFolder.
|
||||
const pick = (remoteId: string | null) => {
|
||||
if (!controller) return;
|
||||
const label = folderLabel(folders ?? [], remoteId, tFiles("my_files"));
|
||||
void controller.addFolder(remoteId, label).then(
|
||||
(result) => { if (!result.ok) setError(addErrorKey(result.error)); },
|
||||
() => setError("folders.add_failed.failed"),
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<SettingsSection id="folders" title={t("folders.title")} description={t("folders.description")}>
|
||||
{forcedOff && (
|
||||
<div className="space-y-1" data-testid="files-sync-folders-locked">
|
||||
<OrgLockedNote />
|
||||
<p className="text-sm text-muted-foreground">{t("folders.forced_off")}</p>
|
||||
</div>
|
||||
)}
|
||||
{folderRoots.length === 0 ? (
|
||||
!forcedOff && <p className="text-sm text-muted-foreground">{t("folders.empty")}</p>
|
||||
) : (
|
||||
<ul className="divide-y divide-border rounded-md border border-border">
|
||||
{folderRoots.map((root) => (
|
||||
<FolderRow key={root.id} root={root} onRemove={() => setRemoving(root)} />
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
{!forcedOff && (
|
||||
<div className="flex items-center gap-3">
|
||||
<Button size="sm" variant="outline" className="gap-1.5" onClick={openPicker} disabled={loading || !controller} data-testid="files-sync-add-folder">
|
||||
{loading ? <Loader2 className="w-4 h-4 animate-spin motion-reduce:animate-none" /> : <FolderSync className="w-4 h-4" />}
|
||||
{loading ? t("folders.loading") : t("folders.add")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{error && <p role="alert" className="text-sm text-destructive">{t(error)}</p>}
|
||||
{folders && (
|
||||
<FolderPickerDialog
|
||||
isOpen
|
||||
onClose={() => setFolders(null)}
|
||||
onPick={pick}
|
||||
title={t("folders.pick_title")}
|
||||
confirmText={t("folders.pick_confirm")}
|
||||
folders={folders}
|
||||
// Nothing is "where it is now": every folder, My files too, can be picked.
|
||||
currentId="#none"
|
||||
/>
|
||||
)}
|
||||
<ConfirmDialog
|
||||
isOpen={!!removing}
|
||||
onClose={() => setRemoving(null)}
|
||||
onConfirm={() => { if (removing && controller) void controller.removeRoot(removing.id).catch(() => {}); }}
|
||||
title={t("folders.remove_title")}
|
||||
message={t("folders.remove_message")}
|
||||
confirmText={t("folders.remove_confirm")}
|
||||
variant="destructive"
|
||||
/>
|
||||
</SettingsSection>
|
||||
);
|
||||
}
|
||||
|
||||
function FolderRow({ root, onRemove }: { root: FilesRoot; onRemove: () => void }) {
|
||||
const t = useTranslations("files_sync");
|
||||
const status = useFilesSyncStore((s) => s.status[root.id]);
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
const paused = root.paused || status?.state === "paused";
|
||||
const blocked = status?.state === "blocked";
|
||||
return (
|
||||
<li className="p-3" data-files-sync-root={root.id}>
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between">
|
||||
<div className="flex items-start gap-2.5 min-w-0">
|
||||
<FolderSync className="w-4 h-4 mt-0.5 shrink-0 text-muted-foreground" aria-hidden="true" />
|
||||
<div className="min-w-0 space-y-0.5">
|
||||
<p className="text-sm font-medium text-foreground break-all" dir="auto">{root.path}</p>
|
||||
<p className="text-xs text-muted-foreground break-words">{t("folders.paired_with", { folder: root.remoteLabel })}</p>
|
||||
<FilesSyncStatusLine status={status} paused={root.paused} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 shrink-0">
|
||||
{!blocked && (
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
disabled={!controller}
|
||||
onClick={() => { void controller?.setPaused(root.id, !paused).catch(() => {}); }}
|
||||
>
|
||||
{paused ? t("folders.resume") : t("folders.pause")}
|
||||
</Button>
|
||||
)}
|
||||
<Button size="sm" variant="outline" onClick={onRemove}>{t("folders.remove")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
{status?.state === "confirm-delete" && status.massDelete && <MassDeleteQuestion root={root} status={status} />}
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
const ERROR_KINDS: ReadonlySet<FilesSyncActivityKind> = new Set(["error", "too-large"]);
|
||||
|
||||
function ActivityMark({ item }: { item: FilesSyncActivity }) {
|
||||
const t = useTranslations("files_sync");
|
||||
let mark: { icon: AppIcon; label: string; className: string } | null = null;
|
||||
if (ERROR_KINDS.has(item.kind)) mark = { icon: AlertCircle, label: t("activity.mark_error"), className: "text-destructive" };
|
||||
else if (item.kind === "conflict") mark = { icon: AlertTriangle, label: t("activity.mark_conflict"), className: "text-amber-600 dark:text-amber-400" };
|
||||
else if (item.kind === "mass-delete") mark = { icon: HelpCircle, label: t("activity.mark_question"), className: "text-amber-600 dark:text-amber-400" };
|
||||
else if (item.direction === "up") mark = { icon: ArrowUp, label: t("activity.to_files"), className: "text-muted-foreground" };
|
||||
else if (item.direction === "down") mark = { icon: ArrowDown, label: t("activity.to_computer"), className: "text-muted-foreground" };
|
||||
if (!mark) return <span className="w-3.5 shrink-0" aria-hidden="true" />;
|
||||
const Icon = mark.icon;
|
||||
return (
|
||||
<span role="img" aria-label={mark.label} title={mark.label} className="inline-flex shrink-0 mt-0.5">
|
||||
<Icon className={cn("w-3.5 h-3.5", mark.className)} aria-hidden="true" />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function ActivitySection() {
|
||||
const t = useTranslations("files_sync");
|
||||
const format = useFormatter();
|
||||
const activity = useFilesSyncStore((s) => s.activity);
|
||||
const roots = useFilesSyncStore((s) => s.roots);
|
||||
const controller = useFilesSyncStore((s) => s.controller);
|
||||
const items = useMemo(() => [...activity].sort((a, b) => b.at - a.at), [activity]);
|
||||
const rootById = useMemo(() => new Map(roots.map((r) => [r.id, r])), [roots]);
|
||||
|
||||
const message = (item: FilesSyncActivity) => {
|
||||
const detail = item.kind === "too-large" && item.detail && /^\d+$/.test(item.detail)
|
||||
? formatFileSize(Number(item.detail))
|
||||
: item.detail ?? "";
|
||||
const text = t(`activity.${item.kind}`, { path: item.path, detail });
|
||||
return (item.kind === "error" || item.kind === "waiting") && item.messageKey
|
||||
? `${text}: ${t(filesSyncErrorKey(item.messageKey))}`
|
||||
: text;
|
||||
};
|
||||
|
||||
return (
|
||||
<SettingsSection id="activity" title={t("activity.title")}>
|
||||
{items.length === 0 ? (
|
||||
<p className="text-sm text-muted-foreground">{t("activity.empty")}</p>
|
||||
) : (
|
||||
<ul className="max-h-96 overflow-y-auto divide-y divide-border/60 rounded-md border border-border" data-testid="files-sync-activity">
|
||||
{items.map((item) => {
|
||||
const root = rootById.get(item.rootId);
|
||||
const marked = ERROR_KINDS.has(item.kind) || item.kind === "conflict" || item.kind === "mass-delete";
|
||||
return (
|
||||
<li
|
||||
key={item.id}
|
||||
className={cn("flex items-start gap-2 px-3 py-2 text-sm", ERROR_KINDS.has(item.kind) && "bg-destructive/5", item.kind === "conflict" && "bg-amber-500/5")}
|
||||
data-activity-kind={item.kind}
|
||||
>
|
||||
<ActivityMark item={item} />
|
||||
<time dateTime={new Date(item.at).toISOString()} className="text-xs text-muted-foreground tabular-nums shrink-0 mt-0.5">
|
||||
{format.dateTime(new Date(item.at), syncTimeOptions(item.at))}
|
||||
</time>
|
||||
{root && (
|
||||
<span className="inline-flex items-center gap-1 text-xs text-muted-foreground shrink-0 max-w-[30%] mt-0.5">
|
||||
{root.kind === "drive" ? <HardDrive className="w-3 h-3 shrink-0" aria-hidden="true" /> : <FolderSync className="w-3 h-3 shrink-0" aria-hidden="true" />}
|
||||
<span className="truncate">{rootName(root, t("drive.root_name"))}</span>
|
||||
</span>
|
||||
)}
|
||||
<span className={cn("min-w-0 flex-1 break-words", marked && "font-medium")} dir="auto">{message(item)}</span>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
<div>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="gap-1.5"
|
||||
disabled={items.length === 0 || !controller}
|
||||
onClick={() => controller?.clearActivity()}
|
||||
data-testid="files-sync-clear-activity"
|
||||
>
|
||||
<Trash2 className="w-4 h-4" />{t("activity.clear")}
|
||||
</Button>
|
||||
</div>
|
||||
</SettingsSection>
|
||||
);
|
||||
}
|
||||
@@ -42,6 +42,8 @@ import { HelpLinks } from '@/components/layout/help-links';
|
||||
import { OrganizeSettings } from '@/components/settings/organize-settings';
|
||||
import { AccountSecuritySettings } from '@/components/settings/account-security-settings';
|
||||
import { FilesSettingsComponent } from '@/components/settings/files-settings';
|
||||
import { DesktopFilesSettings } from '@/components/settings/desktop-files-settings';
|
||||
import { useFilesSyncStore } from '@/stores/files-sync-store';
|
||||
import { ContactsSettings } from '@/components/settings/contacts-settings';
|
||||
import { AddonsSettings } from '@/components/settings/addons-settings';
|
||||
import { NotificationSettings } from '@/components/settings/notification-settings';
|
||||
@@ -686,6 +688,8 @@ export function SettingsApp({ linkSegments: routeSegments }: SettingsAppProps =
|
||||
const supportsCalendar = client?.supportsCalendars() ?? false;
|
||||
const supportsSieve = client?.supportsSieve() ?? false;
|
||||
const supportsFiles = client?.supportsFiles() ?? false;
|
||||
// Files on this computer: the desktop app's sync engine runs in this window.
|
||||
const filesSyncAvailable = useFilesSyncStore((s) => s.available);
|
||||
// Delegates (Settings > Sharing) needs someone to share with and something to share.
|
||||
const supportsSharing = !delegationHidden && !!client?.getShareTargets && (client?.supportsPrincipals() ?? false)
|
||||
&& ((client?.supportsMailboxSharing?.() ?? false)
|
||||
@@ -718,6 +722,7 @@ export function SettingsApp({ linkSegments: routeSegments }: SettingsAppProps =
|
||||
...(supportsCalendar && isFeatureEnabled('calendarEnabled') ? [{ id: 'calendar' as Tab, label: t('tabs.calendar'), icon: tabIcons.calendar, group: 'apps' as TabGroup }] : []),
|
||||
...(isFeatureEnabled('contactsEnabled') ? [{ id: 'contacts' as Tab, label: t('tabs.contacts'), icon: tabIcons.contacts, group: 'apps' as TabGroup }] : []),
|
||||
...(supportsFiles && isFeatureEnabled('filesEnabled') ? [{ id: 'files' as Tab, label: t('tabs.files'), icon: tabIcons.files, group: 'apps' as TabGroup }] : []),
|
||||
...(filesSyncAvailable && supportsFiles && isFeatureEnabled('filesEnabled') ? [{ id: 'files_sync' as Tab, label: tRoot(settingsTabLabelKey('files_sync')), icon: tabIcons.files_sync, group: 'apps' as TabGroup }] : []),
|
||||
...(isFeatureEnabled('sidebarAppsEnabled') || isFeatureEnabled('pluginsEnabled') ? [{ id: 'addons' as Tab, label: t('tabs.addons'), icon: tabIcons.addons, group: 'apps' as TabGroup }] : []),
|
||||
// Plugin-contributed pages nest under Add-ons: a page of its own for each
|
||||
// plugin that offers one, and an entry for each plugin that offers only a
|
||||
@@ -926,6 +931,7 @@ export function SettingsApp({ linkSegments: routeSegments }: SettingsAppProps =
|
||||
: <><ContactsSettings /><div className="mt-8"><AddressBookManagementSettings /></div></>
|
||||
)}
|
||||
{effectiveActiveTab === 'files' && <FilesSettingsComponent />}
|
||||
{effectiveActiveTab === 'files_sync' && <DesktopFilesSettings />}
|
||||
{effectiveActiveTab === 'addons' && <AddonsSettings />}
|
||||
{effectiveActiveTab === 'privacy' && <PrivacySettings />}
|
||||
{effectiveActiveTab === 'offline' && <OfflineSettings />}
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
Calendar,
|
||||
Filter,
|
||||
FolderOpen,
|
||||
FolderSync,
|
||||
HardDrive,
|
||||
BookUser,
|
||||
Bell,
|
||||
@@ -48,6 +49,7 @@ export const SETTINGS_TAB_ICONS: Record<SettingsSearchTab, AppIcon> = {
|
||||
calendar: Calendar,
|
||||
contacts: BookUser,
|
||||
files: HardDrive,
|
||||
files_sync: FolderSync,
|
||||
addons: Puzzle,
|
||||
offline: CloudOff,
|
||||
privacy: EyeOff,
|
||||
@@ -66,6 +68,6 @@ export type SettingsTabGroup = 'top' | 'mail' | 'apps' | 'bottom';
|
||||
export const SETTINGS_NAV_GROUPS: readonly { group: SettingsTabGroup; tabs: readonly SettingsSearchTab[] }[] = [
|
||||
{ group: 'top', tabs: ['account', 'security', 'privacy', 'sharing', 'notifications', 'general', 'offline', 'appearance', 'accessibility'] },
|
||||
{ group: 'mail', tabs: ['message_list', 'reading', 'composing', 'organize', 'filters', 'vacation', 'recovery'] },
|
||||
{ group: 'apps', tabs: ['calendar', 'contacts', 'files', 'addons'] },
|
||||
{ group: 'apps', tabs: ['calendar', 'contacts', 'files', 'files_sync', 'addons'] },
|
||||
{ group: 'bottom', tabs: ['backup', 'about'] },
|
||||
];
|
||||
|
||||
@@ -230,5 +230,24 @@
|
||||
<enabledValue><decimal value="1"/></enabledValue>
|
||||
<disabledValue><decimal value="0"/></disabledValue>
|
||||
</policy>
|
||||
<policy name="FilesDriveEnabled" class="Both" displayName="$(string.FilesDriveEnabled)" explainText="$(string.FilesDriveEnabled_Explain)" key="Software\Policies\Bulwark\Desktop" valueName="FilesDriveEnabled">
|
||||
<parentCategory ref="Bulwark_Desktop_system"/>
|
||||
<supportedOn ref="SUPPORTED_Bulwark_Desktop"/>
|
||||
<enabledValue><decimal value="1"/></enabledValue>
|
||||
<disabledValue><decimal value="0"/></disabledValue>
|
||||
</policy>
|
||||
<policy name="FilesFolderSyncEnabled" class="Both" displayName="$(string.FilesFolderSyncEnabled)" explainText="$(string.FilesFolderSyncEnabled_Explain)" key="Software\Policies\Bulwark\Desktop" valueName="FilesFolderSyncEnabled">
|
||||
<parentCategory ref="Bulwark_Desktop_system"/>
|
||||
<supportedOn ref="SUPPORTED_Bulwark_Desktop"/>
|
||||
<enabledValue><decimal value="1"/></enabledValue>
|
||||
<disabledValue><decimal value="0"/></disabledValue>
|
||||
</policy>
|
||||
<policy name="FilesDriveLetter" class="Both" displayName="$(string.FilesDriveLetter)" explainText="$(string.FilesDriveLetter_Explain)" presentation="$(presentation.FilesDriveLetter)" key="Software\Policies\Bulwark\Desktop">
|
||||
<parentCategory ref="Bulwark_Desktop_system"/>
|
||||
<supportedOn ref="SUPPORTED_Bulwark_Desktop"/>
|
||||
<elements>
|
||||
<text id="FilesDriveLetter_Value" valueName="FilesDriveLetter" required="true" maxLength="8"/>
|
||||
</elements>
|
||||
</policy>
|
||||
</policies>
|
||||
</policyDefinitions>
|
||||
|
||||
@@ -69,6 +69,12 @@
|
||||
<string id="DeveloperToolsAvailability_Explain">Dieselben Werte wie die gleichnamige Richtlinie von Chrome. 2: Die Entwicklertools sind aus und die Einstellung ist gesperrt. 0 oder 1 oder nicht konfiguriert: Benutzer können sie nach einer Warnung in den Einstellungen einschalten. Mit den Entwicklertools kann jeder an der Tastatur alles lesen, was die App enthält, auch E-Mails und Passwörter im Speicher.</string>
|
||||
<string id="RecentFilesInAttach">Zuletzt verwendete Dateien im Menü „Anfügen“ anzeigen</string>
|
||||
<string id="RecentFilesInAttach_Explain">Wenn aktiviert oder nicht konfiguriert, listet die Schaltfläche „Anfügen“ in einer neuen Nachricht die Dateien auf, die der Benutzer zuletzt geöffnet hat, so wie das Betriebssystem sie erfasst. Ein Klick fügt eine davon an. Die Liste wird beim Öffnen des Menüs gelesen und bleibt auf dem Gerät. Wenn deaktiviert, fehlt die Liste und die App lehnt es ab, sie zu lesen. Das Anfügen über den Dateidialog ist nicht betroffen.</string>
|
||||
<string id="FilesDriveEnabled">Dateien als Laufwerk zulassen</string>
|
||||
<string id="FilesDriveEnabled_Explain">Wenn aktiviert oder nicht konfiguriert, können Benutzer ihre Dateien im Dateimanager als Laufwerk anzeigen. Dateien werden beim Öffnen heruntergeladen. Vorerst nur unter Windows. Wenn deaktiviert, wird das Laufwerk nicht angeboten, und ein vorhandenes Laufwerk wird mit den Kopien der Dateien darin entfernt. Die Dateien auf dem Server sind davon nicht betroffen.</string>
|
||||
<string id="FilesFolderSyncEnabled">Synchronisieren von Ordnern mit Dateien zulassen</string>
|
||||
<string id="FilesFolderSyncEnabled_Explain">Wenn aktiviert oder nicht konfiguriert, können Benutzer einen Ordner auf dem Computer und einen Ordner in Dateien in beide Richtungen gleich halten. Wenn deaktiviert, wird dies nicht angeboten, und Ordner, die gerade synchronisiert werden, hören damit auf. Die Dateien in diesen Ordnern bleiben, wo sie sind.</string>
|
||||
<string id="FilesDriveLetter">Laufwerksbuchstabe für Dateien</string>
|
||||
<string id="FilesDriveLetter_Explain">Nur unter Windows. Ein Buchstabe von D bis Z gibt dem Laufwerk Dateien für jeden Benutzer diesen Buchstaben, und Benutzer können ihn nicht ändern. Geben Sie none ein, damit es nie einen Buchstaben bekommt. Wenn nicht konfiguriert, wählen Benutzer in den Einstellungen, und bis dahin gibt es keinen Buchstaben. Ein Wert, den die App nicht lesen kann, gilt als none.</string>
|
||||
</stringTable>
|
||||
<presentationTable>
|
||||
<presentation id="InstanceUrl"><textBox refId="InstanceUrl_Value"><label>Adresse des Bulwark-Servers</label></textBox></presentation>
|
||||
@@ -88,6 +94,7 @@
|
||||
<presentation id="KeystoreAllowedOrigins"><listBox refId="KeystoreAllowedOrigins_Value">Adressen</listBox></presentation>
|
||||
<presentation id="WipeOfflineData"><textBox refId="WipeOfflineData_Value"><label>Löschcode</label></textBox></presentation>
|
||||
<presentation id="DeveloperToolsAvailability"><decimalTextBox refId="DeveloperToolsAvailability_Value" defaultValue="2">Wert (0, 1 oder 2)</decimalTextBox></presentation>
|
||||
<presentation id="FilesDriveLetter"><textBox refId="FilesDriveLetter_Value"><label>Laufwerksbuchstabe</label></textBox></presentation>
|
||||
</presentationTable>
|
||||
</resources>
|
||||
</policyDefinitionResources>
|
||||
|
||||
@@ -69,6 +69,12 @@
|
||||
<string id="DeveloperToolsAvailability_Explain">The same values as Chrome's policy of this name. 2: developer tools are off and the setting is locked. 0 or 1, or not configured: people can turn them on under Settings, after a warning. Developer tools let anyone at the keyboard read everything the app holds, mail and passwords in memory included.</string>
|
||||
<string id="RecentFilesInAttach">Show recent files in the Attach menu</string>
|
||||
<string id="RecentFilesInAttach_Explain">When enabled or not configured, the Attach button in a new message lists the files the user opened recently, as the operating system records them, so one click attaches one. The list is read when the menu opens and stays on the device. When disabled, the list is gone and the app refuses to read it. Attaching through the file dialog is not affected.</string>
|
||||
<string id="FilesDriveEnabled">Allow Files as a drive</string>
|
||||
<string id="FilesDriveEnabled_Explain">When enabled or not configured, people can show their Files in the file manager as a drive, with files downloaded when opened. Windows only for now. When disabled, the drive is not offered, and a drive that is already there is removed with the copies of files in it. Files on the server are not affected.</string>
|
||||
<string id="FilesFolderSyncEnabled">Allow syncing folders with Files</string>
|
||||
<string id="FilesFolderSyncEnabled_Explain">When enabled or not configured, people can keep a folder on the computer and a folder in Files the same, in both directions. When disabled, this is not offered and folders that sync now stop. The files in those folders stay where they are.</string>
|
||||
<string id="FilesDriveLetter">Drive letter for Files</string>
|
||||
<string id="FilesDriveLetter_Explain">Windows only. A letter from D to Z gives the Files drive that letter for every user, and they can't change it. Enter none to never give it a letter. When not configured, people choose under Settings, and there is no letter until they do. A value the app can't read counts as none.</string>
|
||||
</stringTable>
|
||||
<presentationTable>
|
||||
<presentation id="InstanceUrl"><textBox refId="InstanceUrl_Value"><label>Address of the Bulwark server</label></textBox></presentation>
|
||||
@@ -88,6 +94,7 @@
|
||||
<presentation id="KeystoreAllowedOrigins"><listBox refId="KeystoreAllowedOrigins_Value">Addresses</listBox></presentation>
|
||||
<presentation id="WipeOfflineData"><textBox refId="WipeOfflineData_Value"><label>Wipe code</label></textBox></presentation>
|
||||
<presentation id="DeveloperToolsAvailability"><decimalTextBox refId="DeveloperToolsAvailability_Value" defaultValue="2">Value (0, 1 or 2)</decimalTextBox></presentation>
|
||||
<presentation id="FilesDriveLetter"><textBox refId="FilesDriveLetter_Value"><label>Drive letter</label></textBox></presentation>
|
||||
</presentationTable>
|
||||
</resources>
|
||||
</policyDefinitionResources>
|
||||
|
||||
@@ -71,6 +71,12 @@
|
||||
<integer>2</integer>
|
||||
<key>RecentFilesInAttach</key>
|
||||
<true/>
|
||||
<key>FilesDriveEnabled</key>
|
||||
<true/>
|
||||
<key>FilesFolderSyncEnabled</key>
|
||||
<true/>
|
||||
<key>FilesDriveLetter</key>
|
||||
<string>none</string>
|
||||
<key>Recommended</key>
|
||||
<dict>
|
||||
<key>UpdateChannel</key>
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
"OpenWithEnabled": true,
|
||||
"DeveloperToolsAvailability": 2,
|
||||
"RecentFilesInAttach": true,
|
||||
"FilesDriveEnabled": true,
|
||||
"FilesFolderSyncEnabled": true,
|
||||
"FilesDriveLetter": "none",
|
||||
"Recommended": {
|
||||
"UpdateChannel": "stable"
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
jmapServerAllowed,
|
||||
parseCertificateRule,
|
||||
parseInstanceUrl,
|
||||
pagePolicySnapshot,
|
||||
parsePolicyValue,
|
||||
parseServerPattern,
|
||||
pluginAllowedByPolicy,
|
||||
@@ -32,7 +33,7 @@ describe('the schema', () => {
|
||||
'PluginsMode', 'PluginAllowlist', 'OfflineEnabled', 'AppLockRequired', 'AppLockTimeoutMinutes', 'TelemetryAllowed',
|
||||
'CrashReportsAllowed', 'QuickComposeShortcut', 'AuthServerAllowlist', 'AuthNegotiateDelegateAllowlist',
|
||||
'AutoSelectCertificateForUrls', 'KeystoreEnabled', 'KeystoreAllowedOrigins', 'BrowserSignIn', 'WipeOfflineData',
|
||||
'OpenWithEnabled', 'DeveloperToolsAvailability', 'RecentFilesInAttach',
|
||||
'OpenWithEnabled', 'DeveloperToolsAvailability', 'RecentFilesInAttach', 'FilesDriveEnabled', 'FilesFolderSyncEnabled', 'FilesDriveLetter',
|
||||
]);
|
||||
for (const key of POLICY_KEYS) {
|
||||
const { title, description } = POLICY_SCHEMA[key];
|
||||
@@ -65,6 +66,37 @@ describe('developer tools and Open with', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Files on this computer', () => {
|
||||
it('tells the page the drive and folder sync are forced off, so it can show the lock', () => {
|
||||
const forced = resolvePolicies(layers({ forcedMachine: { FilesDriveEnabled: 0, FilesFolderSyncEnabled: 0, FilesDriveLetter: 'R' } }));
|
||||
const page = pagePolicySnapshot(forced);
|
||||
expect(page.FilesDriveEnabled).toMatchObject({ value: false, locked: true });
|
||||
expect(page.FilesFolderSyncEnabled).toMatchObject({ value: false, locked: true });
|
||||
// The letter comes from main with the drive's state.
|
||||
expect(page.FilesDriveLetter).toMatchObject({ value: null, locked: false });
|
||||
});
|
||||
|
||||
it('turn the drive and folder sync off only by force, and a value nobody can read leaves them off', () => {
|
||||
for (const key of ['FilesDriveEnabled', 'FilesFolderSyncEnabled'] as const) {
|
||||
expect(resolvePolicies(layers({}))[key]).toMatchObject({ value: true, locked: false });
|
||||
expect(resolvePolicies(layers({ recommendedUser: { [key]: 0 } }))[key]).toMatchObject({ value: true, locked: false });
|
||||
expect(resolvePolicies(layers({ forcedUser: { [key]: 0 } }))[key]).toMatchObject({ value: false, locked: true });
|
||||
expect(resolvePolicies(layers({ forcedMachine: { [key]: 'perhaps' } }))[key]).toMatchObject({ value: false, locked: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('takes a drive letter from D to Z or none, forced only, and a value nobody can read means no letter', () => {
|
||||
expect(parsePolicyValue('FilesDriveLetter', 'x')).toEqual({ ok: true, value: 'X' });
|
||||
expect(parsePolicyValue('FilesDriveLetter', ' Q: ')).toEqual({ ok: true, value: 'Q' });
|
||||
expect(parsePolicyValue('FilesDriveLetter', 'NONE')).toEqual({ ok: true, value: 'none' });
|
||||
for (const bad of ['C', 'A:', 'B', 'QQ', 'Q:\\', '', 4, null]) expect(parsePolicyValue('FilesDriveLetter', bad).ok, String(bad)).toBe(false);
|
||||
expect(resolvePolicies(layers({})).FilesDriveLetter).toMatchObject({ value: null, locked: false });
|
||||
expect(resolvePolicies(layers({ recommendedMachine: { FilesDriveLetter: 'R' } })).FilesDriveLetter).toMatchObject({ value: null, locked: false });
|
||||
expect(resolvePolicies(layers({ forcedMachine: { FilesDriveLetter: 'r' } })).FilesDriveLetter).toMatchObject({ value: 'R', locked: true });
|
||||
expect(resolvePolicies(layers({ forcedUser: { FilesDriveLetter: 'C' } })).FilesDriveLetter).toMatchObject({ value: 'none', locked: true });
|
||||
});
|
||||
});
|
||||
|
||||
describe('precedence', () => {
|
||||
it('forced machine > forced user > recommended machine > recommended user > default', () => {
|
||||
const all = {
|
||||
|
||||
@@ -83,6 +83,9 @@ export interface PolicyValues {
|
||||
OpenWithEnabled: boolean;
|
||||
DeveloperToolsAvailability: number | null;
|
||||
RecentFilesInAttach: boolean;
|
||||
FilesDriveEnabled: boolean;
|
||||
FilesFolderSyncEnabled: boolean;
|
||||
FilesDriveLetter: string | null;
|
||||
}
|
||||
|
||||
export type PolicyKey = keyof PolicyValues;
|
||||
@@ -129,7 +132,7 @@ export type PolicyDefinition = PolicyBase &
|
||||
}
|
||||
| {
|
||||
type: 'string';
|
||||
format: 'instanceUrl' | 'shortcut' | 'hostList' | 'nonce';
|
||||
format: 'instanceUrl' | 'shortcut' | 'hostList' | 'nonce' | 'driveLetter';
|
||||
default: null;
|
||||
maxLength: number;
|
||||
label: PolicyText;
|
||||
@@ -480,6 +483,47 @@ export const POLICY_SCHEMA: Record<PolicyKey, PolicyDefinition> = {
|
||||
de: 'Wenn aktiviert oder nicht konfiguriert, listet die Schaltfläche „Anfügen“ in einer neuen Nachricht die Dateien auf, die der Benutzer zuletzt geöffnet hat, so wie das Betriebssystem sie erfasst. Ein Klick fügt eine davon an. Die Liste wird beim Öffnen des Menüs gelesen und bleibt auf dem Gerät. Wenn deaktiviert, fehlt die Liste und die App lehnt es ab, sie zu lesen. Das Anfügen über den Dateidialog ist nicht betroffen.',
|
||||
},
|
||||
},
|
||||
FilesDriveEnabled: {
|
||||
category: 'system',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
onInvalid: false,
|
||||
forcedOnly: true,
|
||||
sample: true,
|
||||
title: { en: 'Allow Files as a drive', de: 'Dateien als Laufwerk zulassen' },
|
||||
description: {
|
||||
en: 'When enabled or not configured, people can show their Files in the file manager as a drive, with files downloaded when opened. Windows only for now. When disabled, the drive is not offered, and a drive that is already there is removed with the copies of files in it. Files on the server are not affected.',
|
||||
de: 'Wenn aktiviert oder nicht konfiguriert, können Benutzer ihre Dateien im Dateimanager als Laufwerk anzeigen. Dateien werden beim Öffnen heruntergeladen. Vorerst nur unter Windows. Wenn deaktiviert, wird das Laufwerk nicht angeboten, und ein vorhandenes Laufwerk wird mit den Kopien der Dateien darin entfernt. Die Dateien auf dem Server sind davon nicht betroffen.',
|
||||
},
|
||||
},
|
||||
FilesFolderSyncEnabled: {
|
||||
category: 'system',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
onInvalid: false,
|
||||
forcedOnly: true,
|
||||
sample: true,
|
||||
title: { en: 'Allow syncing folders with Files', de: 'Synchronisieren von Ordnern mit Dateien zulassen' },
|
||||
description: {
|
||||
en: 'When enabled or not configured, people can keep a folder on the computer and a folder in Files the same, in both directions. When disabled, this is not offered and folders that sync now stop. The files in those folders stay where they are.',
|
||||
de: 'Wenn aktiviert oder nicht konfiguriert, können Benutzer einen Ordner auf dem Computer und einen Ordner in Dateien in beide Richtungen gleich halten. Wenn deaktiviert, wird dies nicht angeboten, und Ordner, die gerade synchronisiert werden, hören damit auf. Die Dateien in diesen Ordnern bleiben, wo sie sind.',
|
||||
},
|
||||
},
|
||||
FilesDriveLetter: {
|
||||
category: 'system',
|
||||
forcedOnly: true,
|
||||
type: 'string',
|
||||
format: 'driveLetter',
|
||||
default: null,
|
||||
maxLength: 8,
|
||||
sample: 'none',
|
||||
label: { en: 'Drive letter', de: 'Laufwerksbuchstabe' },
|
||||
title: { en: 'Drive letter for Files', de: 'Laufwerksbuchstabe für Dateien' },
|
||||
description: {
|
||||
en: 'Windows only. A letter from D to Z gives the Files drive that letter for every user, and they can\'t change it. Enter none to never give it a letter. When not configured, people choose under Settings, and there is no letter until they do. A value the app can\'t read counts as none.',
|
||||
de: 'Nur unter Windows. Ein Buchstabe von D bis Z gibt dem Laufwerk Dateien für jeden Benutzer diesen Buchstaben, und Benutzer können ihn nicht ändern. Geben Sie none ein, damit es nie einen Buchstaben bekommt. Wenn nicht konfiguriert, wählen Benutzer in den Einstellungen, und bis dahin gibt es keinen Buchstaben. Ein Wert, den die App nicht lesen kann, gilt als none.',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const POLICY_KEYS = Object.keys(POLICY_SCHEMA) as PolicyKey[];
|
||||
@@ -631,6 +675,16 @@ export function pluginAllowedByPolicy(mode: PluginsMode, allowlist: readonly str
|
||||
|
||||
const SHORTCUT = /^(?:(?:Command|Cmd|Control|Ctrl|CommandOrControl|CmdOrCtrl|Alt|Option|AltGr|Shift|Super|Meta)\+){1,4}(?:[A-Z0-9]|F[1-9]|F1[0-9]|F2[0-4]|Space|Tab|Enter|Backspace|Delete|Insert|Home|End|PageUp|PageDown|Up|Down|Left|Right|Plus|[-=,./;'`[\]\\])$/i;
|
||||
|
||||
/** A drive letter from D to Z, upper case, or `none`. */
|
||||
function parseDriveLetter(raw: unknown): Parsed<string> {
|
||||
if (typeof raw !== 'string') return fail('not_text');
|
||||
const text = raw.trim();
|
||||
if (text.toLowerCase() === 'none') return { ok: true, value: 'none' };
|
||||
const match = /^([D-Za-z]):?$/.exec(text);
|
||||
if (!match || !/^[D-Z]$/i.test(match[1])) return fail('invalid_drive_letter');
|
||||
return { ok: true, value: match[1].toUpperCase() };
|
||||
}
|
||||
|
||||
function parseShortcut(raw: unknown): Parsed<string> {
|
||||
if (typeof raw !== 'string') return fail('not_text');
|
||||
const text = raw.trim();
|
||||
@@ -810,6 +864,8 @@ export function parsePolicyValue(key: PolicyKey, raw: unknown, allowInsecure = f
|
||||
return parseHostList(raw);
|
||||
case 'nonce':
|
||||
return parseNonce(raw);
|
||||
case 'driveLetter':
|
||||
return parseDriveLetter(raw);
|
||||
}
|
||||
break;
|
||||
case 'list':
|
||||
@@ -835,6 +891,8 @@ function failClosedValue(key: PolicyKey): PolicyValues[PolicyKey] {
|
||||
if (definition.type === 'list') return [] as PolicyValues[PolicyKey];
|
||||
// A shortcut nobody can read doesn't get the built-in one instead.
|
||||
if (definition.type === 'string' && definition.format === 'shortcut') return 'off' as PolicyValues[PolicyKey];
|
||||
// A drive letter nobody can read means no letter, not the user's own.
|
||||
if (definition.type === 'string' && definition.format === 'driveLetter') return 'none' as PolicyValues[PolicyKey];
|
||||
// A limit nobody can read is the tightest one, not the user's own.
|
||||
if (definition.type === 'integer') return (definition.onInvalid !== undefined ? definition.onInvalid : definition.min) as PolicyValues[PolicyKey];
|
||||
return definition.default as PolicyValues[PolicyKey];
|
||||
@@ -931,6 +989,8 @@ const PAGE_POLICY_KEYS: readonly PolicyKey[] = [
|
||||
'AppLockTimeoutMinutes',
|
||||
'CrashReportsAllowed',
|
||||
'RecentFilesInAttach',
|
||||
'FilesDriveEnabled',
|
||||
'FilesFolderSyncEnabled',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -981,6 +1041,9 @@ export const POLICY_CONSUMERS: Record<PolicyKey, PolicyConsumer> = {
|
||||
OpenWithEnabled: { repo: 'shell', file: 'src/main/features/os-default-app.ts' },
|
||||
DeveloperToolsAvailability: { repo: 'shell', file: 'src/main/features/dev-tools.ts' },
|
||||
RecentFilesInAttach: { repo: 'shell', file: 'src/main/features/os-recent.ts' },
|
||||
FilesDriveEnabled: { repo: 'shell', file: 'src/main/features/files-drive.ts' },
|
||||
FilesFolderSyncEnabled: { repo: 'shell', file: 'src/main/features/files-folders.ts' },
|
||||
FilesDriveLetter: { repo: 'shell', file: 'src/main/features/files-drive.ts' },
|
||||
};
|
||||
|
||||
/** The part the embedded server enforces. Sent to it by message. */
|
||||
|
||||
@@ -936,6 +936,223 @@ export interface DesktopEditBridge {
|
||||
onChange: (listener: (sessions: DesktopEditSession[]) => void) => () => void;
|
||||
}
|
||||
|
||||
/*
|
||||
* Files on this computer: folders kept the same as a Files folder, and on Windows the
|
||||
* Files drive (Cloud Files API placeholders). The sync engine is the page's
|
||||
* (lib/files-sync in the webmail): it holds the JMAP session and decides. Main only does
|
||||
* what the page can't: the disk, the folder picker, the OS's sync root, and the
|
||||
* callbacks Windows makes when someone opens a file that isn't on the disk yet.
|
||||
*
|
||||
* Paths here are always relative to a root, with `/` between parts, never `..`, never
|
||||
* absolute. Main resolves them inside the root and refuses anything that leaves it,
|
||||
* through a link or otherwise.
|
||||
*/
|
||||
|
||||
/** A place on this computer kept the same as Files: a folder the user picked, or the drive. */
|
||||
export interface FilesRoot {
|
||||
/** Main's id for it. Random, never a path. */
|
||||
id: string;
|
||||
kind: 'folder' | 'drive';
|
||||
/** The page's local account id it belongs to. */
|
||||
account: string;
|
||||
/** Where it is on disk, to show and nothing else. */
|
||||
path: string;
|
||||
/** A folder: the Files folder it pairs with (null: the top of Files). The drive: null. */
|
||||
remoteId: string | null;
|
||||
/** What the page called the Files side when it was added, to show. */
|
||||
remoteLabel: string;
|
||||
paused: boolean;
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
/** One file or folder under a root, as it is on disk now. */
|
||||
export interface FilesLocalEntry {
|
||||
/** Relative to the root, `/` between parts. */
|
||||
path: string;
|
||||
kind: 'file' | 'directory';
|
||||
size: number;
|
||||
mtimeMs: number;
|
||||
/** The same across a rename on the same volume (file id, inode), to tell a move from a delete and a create. */
|
||||
fileId: string;
|
||||
/** The drive only: what the placeholder says. */
|
||||
placeholder?: FilesPlaceholderState;
|
||||
}
|
||||
|
||||
export interface FilesPlaceholderState {
|
||||
/** The FileNode id written into it. Null for something made in Explorer that isn't a placeholder yet. */
|
||||
identity: string | null;
|
||||
/** Main or the page marked it in sync and nobody changed it since. */
|
||||
inSync: boolean;
|
||||
/** The content is on this disk. */
|
||||
hydrated: boolean;
|
||||
pin: 'pinned' | 'unpinned' | 'unspecified';
|
||||
}
|
||||
|
||||
/** What the page expects a path to be, so main refuses to act on something that changed meanwhile. */
|
||||
export interface FilesExpect {
|
||||
fileId: string;
|
||||
size: number;
|
||||
mtimeMs: number;
|
||||
}
|
||||
|
||||
export type FilesError =
|
||||
/** Not there. */
|
||||
| 'missing'
|
||||
/** Something is already at the target. */
|
||||
| 'exists'
|
||||
/** It changed since the page looked (`expect` didn't match). */
|
||||
| 'changed'
|
||||
/** Another program has it open. */
|
||||
| 'busy'
|
||||
| 'denied'
|
||||
/** The path leaves the root, or goes through a link. */
|
||||
| 'outside'
|
||||
/** A name this file system can't hold. */
|
||||
| 'name'
|
||||
/** The disk is full. */
|
||||
| 'full'
|
||||
/** The organisation's policy says no. */
|
||||
| 'policy'
|
||||
/** No real click came with a call that needs one. */
|
||||
| 'gesture'
|
||||
/** The user closed the picker. */
|
||||
| 'cancelled'
|
||||
/** The folder is inside another root, holds one, or is a system folder. */
|
||||
| 'overlap'
|
||||
/** The root is paused, gone, or the app is locked. */
|
||||
| 'inactive'
|
||||
| 'unsupported'
|
||||
| 'failed';
|
||||
|
||||
export type FilesResult<T> = { ok: true; value: T } | { ok: false; error: FilesError };
|
||||
|
||||
/** Something on disk under a root changed. `paths: null`: too much at once, scan it all. */
|
||||
export interface FilesChangeEvent {
|
||||
rootId: string;
|
||||
paths: string[] | null;
|
||||
}
|
||||
|
||||
/** Windows wants bytes of a file that isn't on the disk yet: someone opened it. */
|
||||
export interface FilesFetchRequest {
|
||||
fetchId: string;
|
||||
rootId: string;
|
||||
/** The FileNode id in the placeholder. */
|
||||
identity: string;
|
||||
path: string;
|
||||
/** What Windows asked for. Supplying from 0 to the end is always fine. */
|
||||
offset: number;
|
||||
length: number;
|
||||
/** The size in the placeholder. */
|
||||
total: number;
|
||||
}
|
||||
|
||||
/** A remote file or folder the drive should show, before any content is fetched. */
|
||||
export interface FilesPlaceholder {
|
||||
path: string;
|
||||
kind: 'file' | 'directory';
|
||||
size: number;
|
||||
mtimeMs: number;
|
||||
identity: string;
|
||||
}
|
||||
|
||||
export interface FilesDriveLetterState {
|
||||
/** In use now. */
|
||||
letter: string | null;
|
||||
/** The user's own choice, kept even while a policy overrides it. */
|
||||
chosen: string | null;
|
||||
/** `FilesDriveLetter` forces it (a letter, or `none`). */
|
||||
locked: boolean;
|
||||
/** Letters free now, D to Z. */
|
||||
available: string[];
|
||||
}
|
||||
|
||||
export interface FilesDriveState {
|
||||
/** Windows 10 1809 or later with the helper loaded. */
|
||||
supported: boolean;
|
||||
/** `FilesDriveEnabled` is off. */
|
||||
forcedOff: boolean;
|
||||
/** Accounts the user turned the drive on for, whether or not it's registered right now. */
|
||||
wanted: string[];
|
||||
letter: FilesDriveLetterState;
|
||||
}
|
||||
|
||||
/**
|
||||
* What the main page takes once, in its first render (`files.claim()`), like `auth.claim`:
|
||||
* a same-origin frame reaches the bridge through `parent`, and main can't tell its calls
|
||||
* apart. Main also takes these calls only from the main window.
|
||||
*/
|
||||
export interface FilesControls {
|
||||
roots: () => Promise<FilesRoot[]>;
|
||||
/** Shows the OS folder picker. Needs a real click. */
|
||||
addFolder: (request: { account: string; remoteId: string | null; remoteLabel: string }) => Promise<FilesResult<FilesRoot>>;
|
||||
/** A folder: forgotten, its files stay. The drive: as `drive.disable(account, 'user')`. */
|
||||
removeRoot: (rootId: string) => Promise<void>;
|
||||
setPaused: (rootId: string, paused: boolean) => Promise<void>;
|
||||
/** Everything under `under` (default: the whole root). Skips links and main's own temporary files. */
|
||||
scan: (rootId: string, under?: string) => Promise<FilesResult<FilesLocalEntry[]>>;
|
||||
stat: (rootId: string, path: string) => Promise<FilesResult<FilesLocalEntry | null>>;
|
||||
/** A URL the page fetches once for the file's bytes (Range works). Refused for a drive file that isn't on the disk. */
|
||||
openRead: (rootId: string, path: string) => Promise<FilesResult<{ url: string; entry: FilesLocalEntry }>>;
|
||||
/**
|
||||
* Writing a file: chunks go to a temporary file next to it, `commitWrite` puts it in place
|
||||
* if what's there is still `expect` (null: nothing may be there), and sets `mtimeMs`.
|
||||
*/
|
||||
beginWrite: (rootId: string, path: string, options: { expect: FilesExpect | null; mtimeMs: number; size: number }) => Promise<FilesResult<string>>;
|
||||
writeChunk: (writeId: string, data: Uint8Array) => Promise<FilesResult<null>>;
|
||||
commitWrite: (writeId: string) => Promise<FilesResult<FilesLocalEntry>>;
|
||||
abortWrite: (writeId: string) => Promise<void>;
|
||||
mkdir: (rootId: string, path: string) => Promise<FilesResult<FilesLocalEntry>>;
|
||||
/** Never overwrites. A case-only rename works on a case-insensitive disk. */
|
||||
move: (rootId: string, from: string, to: string, expect: FilesExpect | null) => Promise<FilesResult<FilesLocalEntry>>;
|
||||
/** A folder: to the OS's trash where it has one. Refused when it changed since `expect`. */
|
||||
remove: (rootId: string, path: string, expect: FilesExpect | null) => Promise<FilesResult<'trash' | 'deleted'>>;
|
||||
onChange: (listener: (event: FilesChangeEvent) => void) => () => void;
|
||||
/** The engine's own record of a root (what both sides looked like at the last sync). */
|
||||
loadState: (rootId: string) => Promise<string | null>;
|
||||
saveState: (rootId: string, state: string) => Promise<void>;
|
||||
/** Opens Explorer, Finder or the file manager on it. */
|
||||
showInFolder: (rootId: string, path: string) => Promise<boolean>;
|
||||
/** Windows only. Absent elsewhere. */
|
||||
drive?: FilesDriveControls;
|
||||
}
|
||||
|
||||
export interface FilesDriveControls {
|
||||
state: () => Promise<FilesDriveState>;
|
||||
onStateChange: (listener: (state: FilesDriveState) => void) => () => void;
|
||||
/**
|
||||
* Registers and connects the account's sync root. Needs a real click unless the user
|
||||
* turned it on before (a sign-in brings it back). `label` is the address, shown when
|
||||
* there are several accounts.
|
||||
*/
|
||||
enable: (account: string, label: string) => Promise<FilesResult<FilesRoot>>;
|
||||
/**
|
||||
* `user`: turned off. `signed-out`: the account signed out, and comes back at the next
|
||||
* sign-in. `wipe` and `refused`: a wipe or a refused login. Each unregisters the sync root
|
||||
* and deletes it with everything in it; only `signed-out` keeps the wish.
|
||||
*/
|
||||
disable: (account: string, reason: 'user' | 'signed-out' | 'wipe' | 'refused') => Promise<void>;
|
||||
/** New placeholders, parents first. One answer per entry. */
|
||||
place: (rootId: string, entries: FilesPlaceholder[]) => Promise<FilesResult<{ path: string; error?: FilesError }[]>>;
|
||||
/**
|
||||
* New metadata from the server for a placeholder that is in sync. `dehydrate`: the
|
||||
* content changed, drop the copy on disk (a pinned one is fetched again). Refused
|
||||
* with `changed` when someone edited it here meanwhile.
|
||||
*/
|
||||
update: (rootId: string, path: string, meta: { size: number; mtimeMs: number; identity: string; dehydrate: boolean }, expect: FilesExpect | null) => Promise<FilesResult<FilesLocalEntry>>;
|
||||
/** After an upload: makes it a placeholder with this identity if it isn't one, and marks it in sync. */
|
||||
markInSync: (rootId: string, path: string, identity: string, expect: FilesExpect) => Promise<FilesResult<FilesLocalEntry>>;
|
||||
onFetch: (listener: (request: FilesFetchRequest) => void) => () => void;
|
||||
onFetchCancel: (listener: (fetchId: string) => void) => () => void;
|
||||
/** Bytes for a fetch, in order from `offset`. False when Windows no longer wants them. */
|
||||
supply: (fetchId: string, offset: number, data: Uint8Array) => Promise<boolean>;
|
||||
fail: (fetchId: string, error: 'offline' | 'missing' | 'failed') => void;
|
||||
setLetter: (letter: string | null) => Promise<FilesResult<FilesDriveLetterState>>;
|
||||
}
|
||||
|
||||
export interface FilesBridge {
|
||||
claim: () => FilesControls | null;
|
||||
}
|
||||
|
||||
export interface BulwarkDesktopBridge {
|
||||
version: number;
|
||||
platform: 'win32' | 'darwin' | 'linux';
|
||||
@@ -965,6 +1182,8 @@ export interface BulwarkDesktopBridge {
|
||||
edit?: DesktopEditBridge;
|
||||
/** Absent on older shells. */
|
||||
devTools?: DesktopDevToolsBridge;
|
||||
/** Files on this computer. Absent on older shells. */
|
||||
files?: FilesBridge;
|
||||
/** Absent on older shells. */
|
||||
recentFiles?: DesktopRecentFilesBridge;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,627 @@
|
||||
// @vitest-environment node
|
||||
/**
|
||||
* The sync engine against an in-memory disk (main's answers) and a fake FileNode server
|
||||
* (Stalwart's). Each test changes one side or both and checks both sides afterwards.
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type { FilesRoot } from '@/lib/desktop/types';
|
||||
import { FilesSyncEngine, type EngineTiming } from '../engine';
|
||||
import { namingFor } from '../names';
|
||||
import { parseRecord } from '../state';
|
||||
import { FakeDisk, str, text } from './helpers/fake-disk';
|
||||
import { FakeServer, type FakeServerOptions } from './helpers/fake-server';
|
||||
|
||||
const FAST: Partial<EngineTiming> = { localDelayMs: 0, remoteDelayMs: 0, pollMs: 1e9, rescanMs: 1e9, retryMs: [1e9], soonMs: 5, fetchWaitMs: 2000 };
|
||||
|
||||
interface Setup {
|
||||
server: FakeServer;
|
||||
disk: FakeDisk;
|
||||
engine: FilesSyncEngine;
|
||||
root: FilesRoot;
|
||||
sync: () => Promise<void>;
|
||||
kinds: () => string[];
|
||||
}
|
||||
|
||||
async function setup(options: { server?: FakeServerOptions; drive?: boolean; remoteFolder?: string | null; platform?: string; seed?: (server: FakeServer, disk: FakeDisk, rootId: string) => void } = {}): Promise<Setup> {
|
||||
const server = new FakeServer(options.server);
|
||||
const platform = options.platform ?? 'win32';
|
||||
const disk = new FakeDisk({ caseInsensitive: platform !== 'linux', drive: options.drive });
|
||||
let remoteId: string | null = null;
|
||||
if (options.remoteFolder !== null && !options.drive) remoteId = server.folder(options.remoteFolder ?? 'Sync').id;
|
||||
const root = disk.addRoot({ id: 'r1', account: 'a1', kind: options.drive ? 'drive' : 'folder', remoteId });
|
||||
options.seed?.(server, disk, root.id);
|
||||
const engine = new FilesSyncEngine({ controls: disk, naming: namingFor(platform), device: 'Laptop', readUrl: disk.readUrl, timing: FAST, now: () => disk.clock });
|
||||
engine.start();
|
||||
engine.setAccount('a1', server.remote());
|
||||
const sync = async () => {
|
||||
await engine.refreshRoots();
|
||||
engine.syncNow();
|
||||
await engine.settled();
|
||||
};
|
||||
await sync();
|
||||
return { server, disk, engine, root, sync, kinds: () => engine.activity.map((entry) => `${entry.kind} ${entry.path}${entry.detail ? ` (${entry.detail})` : ''}`).reverse() };
|
||||
}
|
||||
|
||||
/** What's under the root's Files folder, as paths relative to it. */
|
||||
function remoteUnder(server: FakeServer, folder = 'Sync'): string[] {
|
||||
return server.listing().filter((path) => path.startsWith(`${folder}/`)).map((path) => path.slice(folder.length + 1)).filter(Boolean);
|
||||
}
|
||||
|
||||
describe('first sync', () => {
|
||||
it('puts both sides together without deleting anything', async () => {
|
||||
const { server, disk } = await setup({
|
||||
seed: (s, d, rootId) => {
|
||||
const sync = s.find('Sync')!;
|
||||
const docs = s.folder('Docs', sync.id);
|
||||
s.file('a.txt', docs.id, 'remote a');
|
||||
s.file('top.txt', sync.id, 'top');
|
||||
d.write(rootId, 'notes.txt', 'local notes');
|
||||
d.write(rootId, 'Pics/p.png', 'png');
|
||||
},
|
||||
});
|
||||
expect(disk.listing('r1')).toEqual(['Docs/', 'Docs/a.txt', 'Pics/', 'Pics/p.png', 'notes.txt', 'top.txt']);
|
||||
expect(remoteUnder(server)).toEqual(['Docs/', 'Docs/a.txt', 'Pics/', 'Pics/p.png', 'notes.txt', 'top.txt']);
|
||||
expect(disk.read('r1', 'Docs/a.txt')).toBe('remote a');
|
||||
expect(server.content(server.find('Sync/notes.txt')!.id)).toBe('local notes');
|
||||
expect(disk.trashed).toEqual([]);
|
||||
const record = parseRecord(disk.states.get('r1') ?? null, server.find('Sync')!.id);
|
||||
expect(record.items.map((item) => item.path).sort()).toEqual(['Docs', 'Docs/a.txt', 'Pics', 'Pics/p.png', 'notes.txt', 'top.txt']);
|
||||
});
|
||||
|
||||
it('takes the same file on both sides as one, and keeps both when they differ', async () => {
|
||||
const { server, disk, kinds } = await setup({
|
||||
seed: (s, d, rootId) => {
|
||||
const sync = s.find('Sync')!;
|
||||
s.file('same.txt', sync.id, 'identical');
|
||||
s.file('differ.txt', sync.id, 'from files');
|
||||
d.write(rootId, 'same.txt', 'identical');
|
||||
d.write(rootId, 'differ.txt', 'from here');
|
||||
},
|
||||
});
|
||||
expect(server.uploads).toEqual([9]);
|
||||
expect(disk.read('r1', 'differ.txt')).toBe('from files');
|
||||
const copy = disk.listing('r1').find((path) => path.startsWith('differ (conflict, Laptop, '));
|
||||
expect(copy).toBeDefined();
|
||||
expect(disk.read('r1', copy!)).toBe('from here');
|
||||
expect(server.content(server.find(`Sync/${copy}`)!.id)).toBe('from here');
|
||||
expect(kinds()).toContain(`conflict differ.txt (${copy})`);
|
||||
});
|
||||
|
||||
it('syncs the top of Files, without the trash, when the pair names no folder', async () => {
|
||||
const s = await setup({
|
||||
remoteFolder: null,
|
||||
seed: (server) => {
|
||||
server.file('root.txt', null, 'at the top');
|
||||
server.file('old.txt', server.folder('.Trash').id, 'deleted');
|
||||
},
|
||||
});
|
||||
expect(s.disk.listing('r1')).toEqual(['root.txt']);
|
||||
s.disk.write('r1', 'up.txt', 'new');
|
||||
await s.sync();
|
||||
expect(s.server.listing()).toEqual(['root.txt', 'up.txt']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('files the computer makes for itself', () => {
|
||||
it('never uploads them', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => { disk.write(rootId, 'desktop.ini', 'x'); disk.write(rootId, 'Docs/~$report.docx', 'lock'); disk.write(rootId, 'Docs/report.docx', 'r'); } });
|
||||
expect(remoteUnder(s.server)).toEqual(['Docs/', 'Docs/report.docx']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('renames and moves', () => {
|
||||
it('sends a rename and a move made here, without uploading again', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => { disk.write(rootId, 'a.txt', 'aaa'); disk.mkdirUser(rootId, 'Folder'); } });
|
||||
const id = s.server.find('Sync/a.txt')!.id;
|
||||
const uploads = s.server.uploads.length;
|
||||
s.disk.moveUser('r1', 'a.txt', 'Folder/b.txt');
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['Folder/', 'Folder/b.txt']);
|
||||
expect(s.server.find('Sync/Folder/b.txt')!.id).toBe(id);
|
||||
expect(s.server.uploads.length).toBe(uploads);
|
||||
expect(s.kinds()).toContain('moved Folder/b.txt (a.txt)');
|
||||
});
|
||||
|
||||
it('moves a file here when it moved in Files, keeping the same file', async () => {
|
||||
const s = await setup({ seed: (server) => { const sync = server.find('Sync')!; server.folder('Other', sync.id); server.file('x.txt', sync.id, 'xx'); } });
|
||||
const fileId = s.disk.node('r1', 'x.txt').fileId;
|
||||
const downloads = s.server.downloads.length;
|
||||
s.server.rename(s.server.find('Sync/x.txt')!.id, 'y.txt', s.server.find('Sync/Other')!.id);
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['Other/', 'Other/y.txt']);
|
||||
expect(s.disk.node('r1', 'Other/y.txt').fileId).toBe(fileId);
|
||||
expect(s.server.downloads.length).toBe(downloads);
|
||||
});
|
||||
|
||||
it('moves a whole folder either way with what is in it', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => { disk.write(rootId, 'A/one.txt', '1'); disk.write(rootId, 'A/B/two.txt', '2'); } });
|
||||
s.disk.moveUser('r1', 'A', 'Renamed');
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['Renamed/', 'Renamed/B/', 'Renamed/B/two.txt', 'Renamed/one.txt']);
|
||||
s.server.rename(s.server.find('Sync/Renamed')!.id, 'Back');
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['Back/', 'Back/B/', 'Back/B/two.txt', 'Back/one.txt']);
|
||||
expect(s.disk.trashed).toEqual([]);
|
||||
});
|
||||
|
||||
it('lets the place in Files win when both sides renamed the same file', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'doc.txt', 'd') });
|
||||
s.disk.moveUser('r1', 'doc.txt', 'mine.txt');
|
||||
s.server.rename(s.server.find('Sync/doc.txt')!.id, 'theirs.txt');
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['theirs.txt']);
|
||||
expect(remoteUnder(s.server)).toEqual(['theirs.txt']);
|
||||
});
|
||||
|
||||
it('does case-only renames both ways', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'readme.txt', 'r') });
|
||||
s.disk.moveUser('r1', 'readme.txt', 'README.txt');
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['README.txt']);
|
||||
s.server.rename(s.server.find('Sync/README.txt')!.id, 'ReadMe.txt');
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['ReadMe.txt']);
|
||||
expect(s.server.uploads.length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('conflicts', () => {
|
||||
it('keeps both versions when both sides changed a file', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'report.txt', 'v1') });
|
||||
const id = s.server.find('Sync/report.txt')!.id;
|
||||
s.disk.write('r1', 'report.txt', 'mine, longer');
|
||||
s.server.edit(id, 'theirs');
|
||||
await s.sync();
|
||||
expect(s.disk.read('r1', 'report.txt')).toBe('theirs');
|
||||
expect(s.server.content(id)).toBe('theirs');
|
||||
const copy = s.disk.listing('r1').find((path) => path.startsWith('report (conflict, Laptop, '))!;
|
||||
expect(copy).toMatch(/^report \(conflict, Laptop, \d{4}-\d\d-\d\d \d\d\.\d\d\)\.txt$/);
|
||||
expect(s.disk.read('r1', copy)).toBe('mine, longer');
|
||||
expect(s.server.content(s.server.find(`Sync/${copy}`)!.id)).toBe('mine, longer');
|
||||
expect(s.engine.activity.some((entry) => entry.kind === 'conflict' && entry.detail === copy)).toBe(true);
|
||||
});
|
||||
|
||||
it('brings back a file deleted here that was changed in Files', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'keep.txt', 'v1') });
|
||||
const id = s.server.find('Sync/keep.txt')!.id;
|
||||
s.disk.deleteUser('r1', 'keep.txt');
|
||||
s.server.edit(id, 'edited elsewhere');
|
||||
await s.sync();
|
||||
expect(s.disk.read('r1', 'keep.txt')).toBe('edited elsewhere');
|
||||
expect(s.server.find('Sync/keep.txt')!.id).toBe(id);
|
||||
});
|
||||
|
||||
it('uploads again a file changed here that was deleted in Files', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'mine.txt', 'v1') });
|
||||
s.server.destroyTree(s.server.find('Sync/mine.txt')!.id);
|
||||
s.disk.write('r1', 'mine.txt', 'v2 here');
|
||||
await s.sync();
|
||||
expect(s.server.content(s.server.find('Sync/mine.txt')!.id)).toBe('v2 here');
|
||||
expect(s.disk.read('r1', 'mine.txt')).toBe('v2 here');
|
||||
});
|
||||
|
||||
it('keeps a folder deleted in Files when something new was put in it here', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'F/old.txt', 'old') });
|
||||
s.server.destroyTree(s.server.find('Sync/F')!.id);
|
||||
s.disk.write('r1', 'F/new.txt', 'new');
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['F/', 'F/new.txt', 'F/old.txt']);
|
||||
expect(s.disk.trashed).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('deletes', () => {
|
||||
it('puts a file deleted here into the Files trash', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => { disk.write(rootId, 'gone.txt', 'g'); disk.write(rootId, 'stay.txt', 's'); } });
|
||||
const id = s.server.find('Sync/gone.txt')!.id;
|
||||
s.disk.deleteUser('r1', 'gone.txt');
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['stay.txt']);
|
||||
const trashed = s.server.listing(true).find((path) => path.endsWith('/gone.txt'))!;
|
||||
expect(trashed).toMatch(new RegExp(`^\\.Trash/\\d+~${s.server.find('Sync')!.id}/gone\\.txt$`));
|
||||
expect(s.server.nodes.has(id)).toBe(true);
|
||||
expect(s.kinds()).toContain('trashed gone.txt');
|
||||
});
|
||||
|
||||
it('puts a file deleted in Files into the computer trash', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => { disk.write(rootId, 'x.txt', 'x'); disk.write(rootId, 'y.txt', 'y'); } });
|
||||
s.server.destroyTree(s.server.find('Sync/x.txt')!.id);
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['y.txt']);
|
||||
expect(s.disk.trashed).toEqual(['x.txt']);
|
||||
});
|
||||
|
||||
function many(server: FakeServer, disk: FakeDisk, rootId: string): void {
|
||||
void server;
|
||||
for (let i = 0; i < 60; i += 1) disk.write(rootId, `bulk/f${i}.txt`, `file ${i}`);
|
||||
disk.write(rootId, 'other.txt', 'o');
|
||||
}
|
||||
|
||||
it('asks before many deletes made here, and brings them back on no', async () => {
|
||||
const s = await setup({ seed: many });
|
||||
s.disk.deleteUser('r1', 'bulk');
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1).toMatchObject({ state: 'confirm-delete', massDelete: { count: 61, side: 'remote' } });
|
||||
expect(remoteUnder(s.server)).toContain('bulk/f0.txt');
|
||||
expect(s.kinds()).toContain('mass-delete (61)');
|
||||
s.engine.confirmMassDelete('r1', false);
|
||||
await s.engine.settled();
|
||||
expect(s.disk.listing('r1').filter((path) => path.startsWith('bulk/')).length).toBe(61);
|
||||
expect(s.engine.status().r1.state).toBe('idle');
|
||||
});
|
||||
|
||||
it('deletes them on yes', async () => {
|
||||
const s = await setup({ seed: many });
|
||||
s.disk.deleteUser('r1', 'bulk');
|
||||
await s.sync();
|
||||
s.engine.confirmMassDelete('r1', true);
|
||||
await s.engine.settled();
|
||||
expect(remoteUnder(s.server)).toEqual(['other.txt']);
|
||||
expect(s.server.listing(true).filter((path) => path.startsWith('.Trash/')).length).toBe(63);
|
||||
});
|
||||
|
||||
it('asks before many deletes from Files, and uploads them again on no', async () => {
|
||||
const s = await setup({ seed: many });
|
||||
s.server.destroyTree(s.server.find('Sync/bulk')!.id);
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1).toMatchObject({ state: 'confirm-delete', massDelete: { count: 61, side: 'local' } });
|
||||
expect(s.disk.trashed).toEqual([]);
|
||||
s.engine.confirmMassDelete('r1', false);
|
||||
await s.engine.settled();
|
||||
expect(remoteUnder(s.server).filter((path) => path.startsWith('bulk/')).length).toBe(61);
|
||||
});
|
||||
|
||||
it('removes them here on yes', async () => {
|
||||
const s = await setup({ seed: many });
|
||||
s.server.destroyTree(s.server.find('Sync/bulk')!.id);
|
||||
await s.sync();
|
||||
s.engine.confirmMassDelete('r1', true);
|
||||
await s.engine.settled();
|
||||
expect(s.disk.listing('r1')).toEqual(['other.txt']);
|
||||
expect(s.disk.trashed).toEqual(['bulk']);
|
||||
});
|
||||
|
||||
it('asks when more than half of a root goes at once', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => { for (let i = 0; i < 12; i += 1) disk.write(rootId, `f${i}.txt`, `${i}`); } });
|
||||
for (let i = 0; i < 7; i += 1) s.disk.deleteUser('r1', `f${i}.txt`);
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1.state).toBe('confirm-delete');
|
||||
});
|
||||
});
|
||||
|
||||
describe('names the disk cannot hold', () => {
|
||||
it('shows them under another name here and never renames them in Files', async () => {
|
||||
const s = await setup({
|
||||
seed: (server) => {
|
||||
const sync = server.find('Sync')!;
|
||||
server.file('a:b?.txt', sync.id, 'colon');
|
||||
server.file('CON.txt', sync.id, 'device');
|
||||
server.file('trail.', sync.id, 'dot');
|
||||
server.file('Report.txt', sync.id, 'upper');
|
||||
server.file('report.txt', sync.id, 'lower');
|
||||
},
|
||||
});
|
||||
expect(s.disk.listing('r1')).toEqual(['CON_.txt', 'Report.txt', 'a:b?.txt', 'report (2).txt', 'trail._']);
|
||||
expect(s.kinds()).toEqual(expect.arrayContaining(['renamed-for-disk a:b?.txt (a:b?.txt)', 'renamed-for-disk report (2).txt (report (2).txt)']));
|
||||
const id = s.server.find('Sync/a:b?.txt')!.id;
|
||||
// An edit here goes to the same node, under the name it has in Files.
|
||||
s.disk.write('r1', 'a:b?.txt', 'edited');
|
||||
s.disk.write('r1', 'report (2).txt', 'lower edited');
|
||||
await s.sync();
|
||||
expect(s.server.content(id)).toBe('edited');
|
||||
expect(s.server.content(s.server.find('Sync/report.txt')!.id)).toBe('lower edited');
|
||||
expect(remoteUnder(s.server)).toEqual(['CON.txt', 'Report.txt', 'a:b?.txt', 'report.txt', 'trail.']);
|
||||
// Another pass changes nothing on either side.
|
||||
const sets = s.server.sets.length;
|
||||
await s.sync();
|
||||
expect(s.server.sets.length).toBe(sets);
|
||||
});
|
||||
|
||||
it('keeps the name in Files when the disk name is renamed back and forth', async () => {
|
||||
const s = await setup({ seed: (server) => server.file('q?.txt', server.find('Sync')!.id, 'q') });
|
||||
s.server.rename(s.server.find('Sync/q?.txt')!.id, 'r?.txt');
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['r?.txt']);
|
||||
expect(remoteUnder(s.server)).toEqual(['r?.txt']);
|
||||
});
|
||||
|
||||
it('leaves names alone on a disk that takes them', async () => {
|
||||
const s = await setup({ platform: 'linux', seed: (server) => { server.file('a:b.txt', server.find('Sync')!.id, '1'); server.file('A:b.txt', server.find('Sync')!.id, '2'); } });
|
||||
expect(s.disk.listing('r1')).toEqual(['A:b.txt', 'a:b.txt']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('reading and uploading', () => {
|
||||
it('carries on when a file is renamed while it uploads', async () => {
|
||||
const s = await setup();
|
||||
s.disk.write('r1', 'big.txt', 'content');
|
||||
s.server.beforeRequest = () => {
|
||||
if (s.server.uploads.length === 1 && s.disk.has('r1', 'big.txt')) s.disk.moveUser('r1', 'big.txt', 'renamed.txt');
|
||||
};
|
||||
await s.sync();
|
||||
s.server.beforeRequest = null;
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['renamed.txt']);
|
||||
expect(s.server.uploads.length).toBe(1);
|
||||
expect(s.disk.listing('r1')).toEqual(['renamed.txt']);
|
||||
});
|
||||
|
||||
it('does not upload a file that changed while it was read, and uploads it once it holds still', async () => {
|
||||
const s = await setup();
|
||||
s.disk.write('r1', 'live.log', 'first');
|
||||
let writes = 0;
|
||||
s.disk.onRead = (rootId, path) => {
|
||||
if (writes < 1) {
|
||||
writes += 1;
|
||||
s.disk.write(rootId, path, 'first and more');
|
||||
}
|
||||
};
|
||||
await s.sync();
|
||||
expect(s.server.uploads).toEqual([14]);
|
||||
expect(s.server.content(s.server.find('Sync/live.log')!.id)).toBe('first and more');
|
||||
});
|
||||
|
||||
it('keeps a file over the upload limit here, says so once, and uploads it once it fits', async () => {
|
||||
const s = await setup({ server: { maxSizeUpload: 10 } });
|
||||
s.disk.write('r1', 'huge.bin', 'x'.repeat(20));
|
||||
await s.sync();
|
||||
await s.sync();
|
||||
expect(s.server.uploads).toEqual([]);
|
||||
expect(s.engine.activity.filter((entry) => entry.kind === 'too-large')).toEqual([expect.objectContaining({ path: 'huge.bin', detail: '10', messageKey: 'errors.too_large' })]);
|
||||
s.disk.write('r1', 'huge.bin', 'small');
|
||||
await s.sync();
|
||||
expect(s.server.content(s.server.find('Sync/huge.bin')!.id)).toBe('small');
|
||||
});
|
||||
|
||||
it('writes a downloaded file in pieces and leaves nothing half written', async () => {
|
||||
const big = new Uint8Array(2_600_000).map((_, i) => i % 251);
|
||||
const s = await setup({ seed: (server) => server.file('big.bin', server.find('Sync')!.id, big) });
|
||||
const node = s.disk.node('r1', 'big.bin');
|
||||
expect(node.data?.length).toBe(big.length);
|
||||
expect(node.data?.[2_599_999]).toBe(2_599_999 % 251);
|
||||
expect(s.disk.openWrites).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('offline', () => {
|
||||
it('keeps the changes while the server is away and sends them when it is back', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'a.txt', 'v1') });
|
||||
s.server.offline = true;
|
||||
s.disk.write('r1', 'a.txt', 'v2');
|
||||
s.disk.write('r1', 'b.txt', 'new');
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1.state).toBe('offline');
|
||||
expect(s.engine.activity[0]).toMatchObject({ kind: 'waiting', messageKey: 'errors.offline' });
|
||||
await s.sync();
|
||||
expect(s.engine.activity.filter((entry) => entry.kind === 'waiting')).toHaveLength(1);
|
||||
s.server.offline = false;
|
||||
s.engine.retryNow();
|
||||
await s.engine.settled();
|
||||
expect(s.engine.status().r1.state).toBe('idle');
|
||||
expect(s.server.content(s.server.find('Sync/a.txt')!.id)).toBe('v2');
|
||||
expect(s.server.content(s.server.find('Sync/b.txt')!.id)).toBe('new');
|
||||
});
|
||||
|
||||
it('keeps the record when an upload breaks off, and finishes it later', async () => {
|
||||
const s = await setup();
|
||||
s.disk.write('r1', 'u.txt', 'up');
|
||||
s.server.failUploads = 1;
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1.state).toBe('offline');
|
||||
s.engine.retryNow();
|
||||
await s.engine.settled();
|
||||
expect(remoteUnder(s.server)).toEqual(['u.txt']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('changes in Files', () => {
|
||||
it('reads FileNode/changes, and lists everything again only when the server cannot say', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'a.txt', 'a') });
|
||||
const fullListings = () => s.server.calls.filter(([name, args]) => name === 'FileNode/get' && (args as { ids: unknown }).ids === null).length;
|
||||
const before = fullListings();
|
||||
s.server.file('b.txt', s.server.find('Sync')!.id, 'b');
|
||||
s.engine.remoteChanged('a1');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
await s.engine.settled();
|
||||
expect(s.disk.read('r1', 'b.txt')).toBe('b');
|
||||
expect(fullListings()).toBe(before);
|
||||
s.server.file('c.txt', s.server.find('Sync')!.id, 'c');
|
||||
s.server.account().coll.truncatedBelow = s.server.account().coll.log.length;
|
||||
s.engine.remoteChanged('a1');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
await s.engine.settled();
|
||||
expect(s.disk.read('r1', 'c.txt')).toBe('c');
|
||||
expect(fullListings()).toBe(before + 1);
|
||||
});
|
||||
|
||||
it('ignores changes outside the pair', async () => {
|
||||
const s = await setup();
|
||||
const passes = s.server.calls.length;
|
||||
s.server.file('elsewhere.txt', null, 'x');
|
||||
s.engine.remoteChanged('a1');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
await s.engine.settled();
|
||||
// One /changes and one get of the new node, and no pass of the root.
|
||||
expect(s.server.calls.length - passes).toBe(2);
|
||||
});
|
||||
|
||||
it('says so when the paired folder is gone from Files, and deletes nothing', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'a.txt', 'a') });
|
||||
s.server.destroyTree(s.server.find('Sync')!.id);
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1).toMatchObject({ state: 'error', errorKey: 'errors.not_found' });
|
||||
expect(s.disk.listing('r1')).toEqual(['a.txt']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('pause', () => {
|
||||
it('does nothing while paused and catches up on resume', async () => {
|
||||
const s = await setup();
|
||||
await s.engine.setPaused('r1', true);
|
||||
s.disk.write('r1', 'while-paused.txt', 'p');
|
||||
await s.sync();
|
||||
expect(s.engine.status().r1.state).toBe('paused');
|
||||
expect(remoteUnder(s.server)).toEqual([]);
|
||||
await s.engine.setPaused('r1', false);
|
||||
await s.engine.settled();
|
||||
expect(remoteUnder(s.server)).toEqual(['while-paused.txt']);
|
||||
});
|
||||
|
||||
it('runs nothing while the app is locked, and loses no record', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'a.txt', 'a') });
|
||||
const record = s.disk.states.get('r1');
|
||||
s.disk.locked = true;
|
||||
await s.sync();
|
||||
expect(s.disk.states.get('r1')).toBe(record);
|
||||
s.disk.locked = false;
|
||||
s.disk.emit('r1', null);
|
||||
await s.engine.settled();
|
||||
s.disk.write('r1', 'b.txt', 'b');
|
||||
await s.sync();
|
||||
expect(remoteUnder(s.server)).toEqual(['a.txt', 'b.txt']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the drive', () => {
|
||||
async function drive(seed?: (server: FakeServer) => void) {
|
||||
return setup({ drive: true, seed: (server) => seed?.(server) });
|
||||
}
|
||||
|
||||
it('places every node of the account but the trash, and downloads nothing', async () => {
|
||||
const s = await drive((server) => {
|
||||
const docs = server.folder('Docs');
|
||||
server.file('a.txt', docs.id, 'aaa');
|
||||
server.file('top.txt', null, 'top');
|
||||
const trash = server.folder('.Trash');
|
||||
server.file('old.txt', trash.id, 'old');
|
||||
});
|
||||
expect(s.disk.listing('r1')).toEqual(['Docs/', 'Docs/a.txt', 'top.txt']);
|
||||
expect(s.disk.node('r1', 'Docs/a.txt').placeholder).toMatchObject({ identity: s.server.find('Docs/a.txt')!.id, hydrated: false, inSync: true });
|
||||
expect(s.server.downloads).toEqual([]);
|
||||
expect(s.engine.items('a1')[s.server.find('Docs/a.txt')!.id]).toBe('online-only');
|
||||
});
|
||||
|
||||
it('streams a file opened in Explorer from where Windows asked, to the end', async () => {
|
||||
const content = new Uint8Array(3 * 1024 * 1024).map((_, i) => i % 199);
|
||||
const s = await drive((server) => server.file('big.bin', null, content));
|
||||
const request = s.disk.requestFetch('r1', 'big.bin', 10_000);
|
||||
expect(request.offset).toBe(8192);
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
const got = s.disk.suppliedBytes(request.fetchId);
|
||||
expect(got.length).toBe(content.length - 8192);
|
||||
expect(got[0]).toBe(content[8192]);
|
||||
expect(got.at(-1)).toBe(content.at(-1));
|
||||
expect(s.disk.fetchFailed.size).toBe(0);
|
||||
});
|
||||
|
||||
it('stops streaming when the fetch is cancelled, and fails one it cannot answer', async () => {
|
||||
const content = new Uint8Array(4 * 1024 * 1024);
|
||||
const s = await drive((server) => { server.file('big.bin', null, content); server.file('gone.txt', null, 'g'); });
|
||||
s.server.partBytes = 64 * 1024;
|
||||
s.disk.refuseSupplyAfter = 1024 * 1024;
|
||||
const request = s.disk.requestFetch('r1', 'big.bin');
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
expect(s.disk.suppliedBytes(request.fetchId).length).toBe(1024 * 1024);
|
||||
// Cancelled while the download runs: the rest isn't fetched, and nothing is failed.
|
||||
s.disk.refuseSupplyAfter = null;
|
||||
let second = '';
|
||||
let parts = 0;
|
||||
s.server.onPart = () => {
|
||||
parts += 1;
|
||||
if (parts === 2) s.disk.cancelFetch(second);
|
||||
};
|
||||
second = s.disk.requestFetch('r1', 'big.bin').fetchId;
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
s.server.onPart = null;
|
||||
expect(parts).toBeLessThan(5);
|
||||
expect(s.disk.suppliedBytes(second).length).toBeLessThan(content.length);
|
||||
expect(s.disk.fetchFailed.has(second)).toBe(false);
|
||||
// Deleted in Files meanwhile.
|
||||
s.server.destroyTree(s.server.find('gone.txt')!.id);
|
||||
const third = s.disk.requestFetch('r1', 'gone.txt');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
expect(s.disk.fetchFailed.get(third.fetchId)).toBe('missing');
|
||||
s.server.offline = true;
|
||||
s.disk.supplied.clear();
|
||||
});
|
||||
|
||||
it('updates a placeholder when the file changed in Files', async () => {
|
||||
const s = await drive((server) => server.file('a.txt', null, 'v1'));
|
||||
s.server.edit(s.server.find('a.txt')!.id, 'version two');
|
||||
await s.sync();
|
||||
expect(s.disk.driveCalls.filter((call) => call.call === 'update')).toEqual([{ call: 'update', args: ['r1', 'a.txt', true] }]);
|
||||
expect(s.disk.node('r1', 'a.txt')).toMatchObject({ size: 11, placeholder: { hydrated: false, inSync: true } });
|
||||
});
|
||||
|
||||
it('uploads a file made in Explorer and marks it in sync', async () => {
|
||||
const s = await drive();
|
||||
s.disk.write('r1', 'new.txt', 'from explorer');
|
||||
await s.sync();
|
||||
const node = s.server.find('new.txt')!;
|
||||
expect(s.server.content(node.id)).toBe('from explorer');
|
||||
expect(s.disk.node('r1', 'new.txt').placeholder).toMatchObject({ identity: node.id, inSync: true });
|
||||
});
|
||||
|
||||
it('uploads a file made in Explorer inside a placed folder, next to a file opened there', async () => {
|
||||
const s = await drive((server) => { const docs = server.folder('Docs'); server.file('seen.txt', docs.id, 'seen'); });
|
||||
const request = s.disk.requestFetch('r1', 'Docs/seen.txt');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
expect(s.disk.fetchFailed.has(request.fetchId)).toBe(false);
|
||||
s.disk.write('r1', 'Docs/new.txt', 'from explorer');
|
||||
await s.sync();
|
||||
const node = s.server.find('Docs/new.txt');
|
||||
expect(node && s.server.content(node.id)).toBe('from explorer');
|
||||
});
|
||||
|
||||
it('takes a save over a placeholder as an edit here', async () => {
|
||||
const s = await drive((server) => server.file('doc.txt', null, 'v1'));
|
||||
const id = s.server.find('doc.txt')!.id;
|
||||
s.disk.write('r1', 'doc.txt', 'saved over');
|
||||
await s.sync();
|
||||
expect(s.server.content(id)).toBe('saved over');
|
||||
expect(s.disk.node('r1', 'doc.txt').placeholder).toMatchObject({ identity: id, inSync: true });
|
||||
});
|
||||
|
||||
it('keeps both when a file edited here also changed in Files', async () => {
|
||||
const s = await drive((server) => server.file('doc.txt', null, 'v1'));
|
||||
const id = s.server.find('doc.txt')!.id;
|
||||
s.disk.write('r1', 'doc.txt', 'here');
|
||||
s.server.edit(id, 'there');
|
||||
await s.sync();
|
||||
const copy = s.disk.listing('r1').find((path) => path.includes('(conflict, Laptop,'))!;
|
||||
expect(s.server.content(id)).toBe('there');
|
||||
expect(s.disk.node('r1', 'doc.txt').placeholder).toMatchObject({ identity: id, hydrated: false });
|
||||
expect(s.server.content(s.server.find(copy)!.id)).toBe('here');
|
||||
});
|
||||
|
||||
it('finds a placeholder moved in Explorer by its identity', async () => {
|
||||
const s = await drive((server) => { server.folder('A'); server.file('f.txt', null, 'f'); });
|
||||
const id = s.server.find('f.txt')!.id;
|
||||
s.disk.moveUser('r1', 'f.txt', 'A/g.txt');
|
||||
await s.sync();
|
||||
expect(s.server.find('A/g.txt')!.id).toBe(id);
|
||||
expect(s.server.uploads).toEqual([]);
|
||||
});
|
||||
|
||||
it('starts afresh when its folder came back empty', async () => {
|
||||
const s = await drive((server) => server.file('a.txt', null, 'a'));
|
||||
s.disk.trees.set('r1', new Map());
|
||||
await s.sync();
|
||||
expect(s.disk.listing('r1')).toEqual(['a.txt']);
|
||||
expect(s.server.listing()).toEqual(['a.txt']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('coverage', () => {
|
||||
it('maps a node to its root and path', async () => {
|
||||
const s = await setup({ seed: (server, disk, rootId) => disk.write(rootId, 'Docs/a.txt', 'a') });
|
||||
const id = s.server.find('Sync/Docs/a.txt')!.id;
|
||||
expect(s.engine.coverage('a1', id)).toEqual({ rootId: 'r1', kind: 'folder', path: 'Docs/a.txt' });
|
||||
expect(s.engine.coverage('a1', s.server.find('Sync')!.id)).toEqual({ rootId: 'r1', kind: 'folder', path: '' });
|
||||
expect(s.engine.coverage('a2', id)).toBeNull();
|
||||
expect(s.engine.items('a1')[id]).toBe('synced');
|
||||
});
|
||||
});
|
||||
|
||||
void str;
|
||||
void text;
|
||||
@@ -0,0 +1,532 @@
|
||||
/**
|
||||
* The desktop app's disk side of Files on this computer, in memory, answering as main does
|
||||
* (desktop src/main/files/disk.ts, drive-controller.ts, features/files-folders.ts):
|
||||
* - `expect` is checked on write, move and remove; null on a write means nothing may be there;
|
||||
* - a move never overwrites, and a case-only rename works on a case-insensitive disk;
|
||||
* - a folder root's remove goes to the trash, the drive's deletes;
|
||||
* - `openRead` refuses folders and drive files whose content isn't here;
|
||||
* - while locked, `roots()` is empty, everything else `inactive`, and the state calls reject;
|
||||
* - the drive: placeholders with an identity, `update` refused with `changed` once someone wrote
|
||||
* over one, `markInSync` making a file a placeholder again, fetches answered by `supply`.
|
||||
*/
|
||||
|
||||
import type {
|
||||
FilesChangeEvent,
|
||||
FilesControls,
|
||||
FilesDriveControls,
|
||||
FilesDriveState,
|
||||
FilesExpect,
|
||||
FilesFetchRequest,
|
||||
FilesLocalEntry,
|
||||
FilesPlaceholder,
|
||||
FilesPlaceholderState,
|
||||
FilesResult,
|
||||
FilesRoot,
|
||||
} from '@/lib/desktop/types';
|
||||
|
||||
interface DiskNode {
|
||||
kind: 'file' | 'directory';
|
||||
data: Uint8Array | null;
|
||||
/** For a dehydrated placeholder, its size. */
|
||||
size: number;
|
||||
fileId: string;
|
||||
mtimeMs: number;
|
||||
placeholder?: FilesPlaceholderState;
|
||||
}
|
||||
|
||||
const ok = <T>(value: T): FilesResult<T> => ({ ok: true, value });
|
||||
const fail = <T = never>(error: Parameters<typeof failOf>[0]): FilesResult<T> => failOf(error) as FilesResult<T>;
|
||||
function failOf(error: Exclude<FilesResult<never>, { ok: true }>['error']) {
|
||||
return { ok: false as const, error };
|
||||
}
|
||||
|
||||
export const text = (value: string) => new TextEncoder().encode(value);
|
||||
export const str = (value: Uint8Array | null | undefined) => (value ? new TextDecoder().decode(value) : '');
|
||||
|
||||
let fileIds = 1;
|
||||
|
||||
export interface FakeDiskOptions {
|
||||
caseInsensitive?: boolean;
|
||||
drive?: boolean;
|
||||
}
|
||||
|
||||
export class FakeDisk implements FilesControls {
|
||||
readonly rootsList: FilesRoot[] = [];
|
||||
readonly trees = new Map<string, Map<string, DiskNode>>();
|
||||
readonly states = new Map<string, string>();
|
||||
readonly trashed: string[] = [];
|
||||
readonly shown: { rootId: string; path: string }[] = [];
|
||||
readonly calls: string[] = [];
|
||||
locked = false;
|
||||
clock = Date.UTC(2026, 10, 1);
|
||||
private readonly listeners = new Set<(event: FilesChangeEvent) => void>();
|
||||
private readonly fetchListeners = new Set<(request: FilesFetchRequest) => void>();
|
||||
private readonly cancelListeners = new Set<(fetchId: string) => void>();
|
||||
private readonly reads = new Map<string, { rootId: string; path: string }>();
|
||||
private readonly writes = new Map<string, { rootId: string; path: string; expect: FilesExpect | null; mtimeMs: number; size: number; parts: Uint8Array[] }>();
|
||||
/** Called when a read URL is fetched, before the bytes go: to change the file meanwhile. */
|
||||
onRead: ((rootId: string, path: string) => void) | null = null;
|
||||
/** Bytes supplied per fetch. */
|
||||
readonly supplied = new Map<string, { offset: number; length: number; parts: Uint8Array[] }>();
|
||||
readonly fetchFailed = new Map<string, string>();
|
||||
/** Supply answers false from this many bytes on (Windows no longer wants them). */
|
||||
refuseSupplyAfter: number | null = null;
|
||||
readonly driveCalls: { call: string; args: unknown[] }[] = [];
|
||||
driveWanted: string[] = [];
|
||||
readonly drive?: FilesDriveControls;
|
||||
private nextWrite = 1;
|
||||
|
||||
constructor(private readonly options: FakeDiskOptions = {}) {
|
||||
if (options.drive) this.drive = this.makeDrive();
|
||||
}
|
||||
|
||||
// ─── Test setup and what a user does ────────────────────────
|
||||
|
||||
addRoot(root: Partial<FilesRoot> & { id: string; account: string }): FilesRoot {
|
||||
const full: FilesRoot = { kind: 'folder', path: `C:\\sync\\${root.id}`, remoteId: null, remoteLabel: '', paused: false, createdAt: 1, ...root };
|
||||
this.rootsList.push(full);
|
||||
this.trees.set(full.id, new Map());
|
||||
return full;
|
||||
}
|
||||
|
||||
private tree(rootId: string): Map<string, DiskNode> {
|
||||
const tree = this.trees.get(rootId);
|
||||
if (!tree) throw new Error(`no root ${rootId}`);
|
||||
return tree;
|
||||
}
|
||||
|
||||
private key(path: string): string {
|
||||
return this.options.caseInsensitive ? path.toLowerCase() : path;
|
||||
}
|
||||
|
||||
/** The stored path for `path`, as cased on disk. */
|
||||
private find(rootId: string, path: string): string | null {
|
||||
const tree = this.tree(rootId);
|
||||
if (tree.has(path)) return path;
|
||||
if (!this.options.caseInsensitive) return null;
|
||||
const wanted = this.key(path);
|
||||
for (const stored of tree.keys()) if (this.key(stored) === wanted) return stored;
|
||||
return null;
|
||||
}
|
||||
|
||||
private tick(): number {
|
||||
this.clock += 1000;
|
||||
return this.clock;
|
||||
}
|
||||
|
||||
private parentOk(rootId: string, path: string): boolean {
|
||||
const slash = path.lastIndexOf('/');
|
||||
if (slash < 0) return true;
|
||||
const parent = this.find(rootId, path.slice(0, slash));
|
||||
return !!parent && this.tree(rootId).get(parent)?.kind === 'directory';
|
||||
}
|
||||
|
||||
/** A user writes a file: a new one, or over the old one in place (same file id). */
|
||||
write(rootId: string, path: string, content: string | Uint8Array): void {
|
||||
const data = typeof content === 'string' ? text(content) : content;
|
||||
this.ensureParents(rootId, path);
|
||||
const tree = this.tree(rootId);
|
||||
const stored = this.find(rootId, path);
|
||||
const old = stored ? tree.get(stored) : undefined;
|
||||
const node: DiskNode = { kind: 'file', data, size: data.length, fileId: old?.fileId ?? `f${fileIds++}`, mtimeMs: this.tick() };
|
||||
if (old?.placeholder) {
|
||||
// Saved over with a plain write: no longer a placeholder.
|
||||
node.placeholder = { identity: null, inSync: false, hydrated: true, pin: 'unspecified' };
|
||||
} else if (this.isDrive(rootId)) {
|
||||
node.placeholder = { identity: null, inSync: false, hydrated: true, pin: 'unspecified' };
|
||||
}
|
||||
tree.set(stored ?? path, node);
|
||||
}
|
||||
|
||||
/** An app that keeps the placeholder edits a hydrated drive file: no longer in sync. */
|
||||
editInPlace(rootId: string, path: string, content: string): void {
|
||||
const node = this.node(rootId, path);
|
||||
node.data = text(content);
|
||||
node.size = node.data.length;
|
||||
node.mtimeMs = this.tick();
|
||||
if (node.placeholder) node.placeholder = { ...node.placeholder, inSync: false, hydrated: true };
|
||||
}
|
||||
|
||||
mkdirUser(rootId: string, path: string): void {
|
||||
this.ensureParents(rootId, `${path}/x`);
|
||||
}
|
||||
|
||||
private ensureParents(rootId: string, path: string): void {
|
||||
const parts = path.split('/');
|
||||
const tree = this.tree(rootId);
|
||||
for (let i = 1; i < parts.length; i += 1) {
|
||||
const dir = parts.slice(0, i).join('/');
|
||||
if (!this.find(rootId, dir)) {
|
||||
tree.set(dir, {
|
||||
kind: 'directory', data: null, size: 0, fileId: `f${fileIds++}`, mtimeMs: this.tick(),
|
||||
...(this.isDrive(rootId) ? { placeholder: { identity: null, inSync: false, hydrated: true, pin: 'unspecified' as const } } : {}),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
moveUser(rootId: string, from: string, to: string): void {
|
||||
const result = this.moveTree(rootId, from, to);
|
||||
if (!result) throw new Error(`move ${from} -> ${to} failed`);
|
||||
}
|
||||
|
||||
deleteUser(rootId: string, path: string): void {
|
||||
const tree = this.tree(rootId);
|
||||
const stored = this.find(rootId, path) ?? path;
|
||||
for (const key of [...tree.keys()]) if (key === stored || key.startsWith(`${stored}/`)) tree.delete(key);
|
||||
}
|
||||
|
||||
node(rootId: string, path: string): DiskNode {
|
||||
const stored = this.find(rootId, path);
|
||||
const node = stored ? this.tree(rootId).get(stored) : undefined;
|
||||
if (!node) throw new Error(`nothing at ${path}`);
|
||||
return node;
|
||||
}
|
||||
|
||||
has(rootId: string, path: string): boolean {
|
||||
return this.find(rootId, path) === path;
|
||||
}
|
||||
|
||||
read(rootId: string, path: string): string {
|
||||
return str(this.node(rootId, path).data);
|
||||
}
|
||||
|
||||
/** Every path in a root, sorted, folders with a trailing slash. */
|
||||
listing(rootId: string): string[] {
|
||||
return [...this.tree(rootId)].map(([path, node]) => (node.kind === 'directory' ? `${path}/` : path)).sort();
|
||||
}
|
||||
|
||||
emit(rootId: string, paths: string[] | null = null): void {
|
||||
for (const listener of [...this.listeners]) listener({ rootId, paths });
|
||||
}
|
||||
|
||||
private isDrive(rootId: string): boolean {
|
||||
return this.rootsList.find((root) => root.id === rootId)?.kind === 'drive';
|
||||
}
|
||||
|
||||
private active(rootId: string): boolean {
|
||||
const root = this.rootsList.find((entry) => entry.id === rootId);
|
||||
return !this.locked && !!root && !root.paused;
|
||||
}
|
||||
|
||||
private entry(path: string, node: DiskNode): FilesLocalEntry {
|
||||
return {
|
||||
path,
|
||||
kind: node.kind,
|
||||
size: node.kind === 'directory' ? 0 : node.size,
|
||||
mtimeMs: node.mtimeMs,
|
||||
fileId: node.fileId,
|
||||
...(node.placeholder ? { placeholder: { ...node.placeholder } } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
private matches(node: DiskNode | undefined, expect: FilesExpect | null): boolean {
|
||||
if (expect === null) return !node;
|
||||
if (!node) return false;
|
||||
return node.fileId === expect.fileId && (node.kind === 'directory' ? 0 : node.size) === expect.size && node.mtimeMs === expect.mtimeMs;
|
||||
}
|
||||
|
||||
private moveTree(rootId: string, from: string, to: string): DiskNode | null {
|
||||
const tree = this.tree(rootId);
|
||||
const source = this.find(rootId, from);
|
||||
if (!source) return null;
|
||||
const target = this.find(rootId, to);
|
||||
if (target && this.key(target) !== this.key(source)) return null;
|
||||
if (!this.parentOk(rootId, to)) return null;
|
||||
const moving = [...tree].filter(([key]) => key === source || key.startsWith(`${source}/`));
|
||||
for (const [key] of moving) tree.delete(key);
|
||||
for (const [key, node] of moving) tree.set(to + key.slice(source.length), node);
|
||||
return tree.get(to) ?? null;
|
||||
}
|
||||
|
||||
// ─── FilesControls ──────────────────────────────────────────
|
||||
|
||||
async roots(): Promise<FilesRoot[]> {
|
||||
return this.locked ? [] : this.rootsList.map((root) => ({ ...root }));
|
||||
}
|
||||
|
||||
async addFolder(request: { account: string; remoteId: string | null; remoteLabel: string }): Promise<FilesResult<FilesRoot>> {
|
||||
this.calls.push(`addFolder ${request.account} ${request.remoteId}`);
|
||||
const root = this.addRoot({ id: `r${this.rootsList.length + 1}`, account: request.account, remoteId: request.remoteId, remoteLabel: request.remoteLabel });
|
||||
return ok(root);
|
||||
}
|
||||
|
||||
async removeRoot(rootId: string): Promise<void> {
|
||||
this.calls.push(`removeRoot ${rootId}`);
|
||||
const at = this.rootsList.findIndex((root) => root.id === rootId);
|
||||
if (at >= 0) this.rootsList.splice(at, 1);
|
||||
}
|
||||
|
||||
async setPaused(rootId: string, paused: boolean): Promise<void> {
|
||||
const root = this.rootsList.find((entry) => entry.id === rootId);
|
||||
if (root) root.paused = paused;
|
||||
if (!paused) this.emit(rootId, null);
|
||||
}
|
||||
|
||||
async scan(rootId: string): Promise<FilesResult<FilesLocalEntry[]>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
return ok([...this.tree(rootId)].map(([path, node]) => this.entry(path, node)));
|
||||
}
|
||||
|
||||
async stat(rootId: string, path: string): Promise<FilesResult<FilesLocalEntry | null>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
const stored = this.find(rootId, path);
|
||||
return ok(stored ? this.entry(stored, this.tree(rootId).get(stored) as DiskNode) : null);
|
||||
}
|
||||
|
||||
async openRead(rootId: string, path: string): Promise<FilesResult<{ url: string; entry: FilesLocalEntry }>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
const stored = this.find(rootId, path);
|
||||
const node = stored ? this.tree(rootId).get(stored) : undefined;
|
||||
if (!node) return fail('missing');
|
||||
if (node.kind !== 'file' || !node.data || (node.placeholder && !node.placeholder.hydrated)) return fail('unsupported');
|
||||
const token = `mem://${this.reads.size + 1}-${Math.random().toString(36).slice(2)}`;
|
||||
this.reads.set(token, { rootId, path: stored as string });
|
||||
return ok({ url: token, entry: this.entry(stored as string, node) });
|
||||
}
|
||||
|
||||
/** What the page's fetch of a read URL gets. */
|
||||
readUrl = async (url: string): Promise<Uint8Array> => {
|
||||
const grant = this.reads.get(url);
|
||||
this.reads.delete(url);
|
||||
if (!grant) throw new Error('404');
|
||||
const node = this.node(grant.rootId, grant.path);
|
||||
const data = node.data as Uint8Array;
|
||||
this.onRead?.(grant.rootId, grant.path);
|
||||
return data;
|
||||
};
|
||||
|
||||
async beginWrite(rootId: string, path: string, options: { expect: FilesExpect | null; mtimeMs: number; size: number }): Promise<FilesResult<string>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
if (!this.parentOk(rootId, path)) return fail('missing');
|
||||
const stored = this.find(rootId, path);
|
||||
const node = stored ? this.tree(rootId).get(stored) : undefined;
|
||||
if (node?.kind === 'directory') return fail('exists');
|
||||
if (!this.matches(node, options.expect)) return fail(options.expect ? 'changed' : 'exists');
|
||||
const id = `w${this.nextWrite++}`;
|
||||
this.writes.set(id, { rootId, path, expect: options.expect, mtimeMs: options.mtimeMs, size: options.size, parts: [] });
|
||||
return ok(id);
|
||||
}
|
||||
|
||||
async writeChunk(writeId: string, data: Uint8Array): Promise<FilesResult<null>> {
|
||||
const write = this.writes.get(writeId);
|
||||
if (!write) return fail('missing');
|
||||
write.parts.push(new Uint8Array(data));
|
||||
return ok(null);
|
||||
}
|
||||
|
||||
async commitWrite(writeId: string): Promise<FilesResult<FilesLocalEntry>> {
|
||||
const write = this.writes.get(writeId);
|
||||
this.writes.delete(writeId);
|
||||
if (!write) return fail('missing');
|
||||
if (!this.active(write.rootId)) return fail('inactive');
|
||||
const size = write.parts.reduce((sum, part) => sum + part.length, 0);
|
||||
if (size !== write.size) return fail('failed');
|
||||
const stored = this.find(write.rootId, write.path);
|
||||
const tree = this.tree(write.rootId);
|
||||
const old = stored ? tree.get(stored) : undefined;
|
||||
if (!this.matches(old, write.expect)) return fail(write.expect ? 'changed' : 'exists');
|
||||
const data = new Uint8Array(size);
|
||||
let at = 0;
|
||||
for (const part of write.parts) {
|
||||
data.set(part, at);
|
||||
at += part.length;
|
||||
}
|
||||
const node: DiskNode = { kind: 'file', data, size, fileId: `f${fileIds++}`, mtimeMs: write.mtimeMs };
|
||||
tree.set(stored ?? write.path, node);
|
||||
return ok(this.entry(stored ?? write.path, node));
|
||||
}
|
||||
|
||||
async abortWrite(writeId: string): Promise<void> {
|
||||
this.writes.delete(writeId);
|
||||
}
|
||||
|
||||
get openWrites(): number {
|
||||
return this.writes.size;
|
||||
}
|
||||
|
||||
async mkdir(rootId: string, path: string): Promise<FilesResult<FilesLocalEntry>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
if (!this.parentOk(rootId, path)) return fail('missing');
|
||||
const stored = this.find(rootId, path);
|
||||
const tree = this.tree(rootId);
|
||||
if (stored) {
|
||||
const node = tree.get(stored) as DiskNode;
|
||||
return node.kind === 'directory' ? ok(this.entry(stored, node)) : fail('exists');
|
||||
}
|
||||
const node: DiskNode = { kind: 'directory', data: null, size: 0, fileId: `f${fileIds++}`, mtimeMs: this.tick() };
|
||||
tree.set(path, node);
|
||||
return ok(this.entry(path, node));
|
||||
}
|
||||
|
||||
async move(rootId: string, from: string, to: string, expect: FilesExpect | null): Promise<FilesResult<FilesLocalEntry>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
const source = this.find(rootId, from);
|
||||
if (!source) return fail('missing');
|
||||
const node = this.tree(rootId).get(source) as DiskNode;
|
||||
if (expect && !this.matches(node, expect)) return fail('changed');
|
||||
const target = this.find(rootId, to);
|
||||
if (target && this.key(target) !== this.key(source)) return fail('exists');
|
||||
if (!this.parentOk(rootId, to)) return fail('missing');
|
||||
const moved = this.moveTree(rootId, source, to);
|
||||
return moved ? ok(this.entry(to, moved)) : fail('failed');
|
||||
}
|
||||
|
||||
async remove(rootId: string, path: string, expect: FilesExpect | null): Promise<FilesResult<'trash' | 'deleted'>> {
|
||||
if (!this.active(rootId)) return fail('inactive');
|
||||
const stored = this.find(rootId, path);
|
||||
if (!stored) return fail('missing');
|
||||
const node = this.tree(rootId).get(stored) as DiskNode;
|
||||
if (expect && !this.matches(node, expect)) return fail('changed');
|
||||
this.deleteUser(rootId, stored);
|
||||
this.trashed.push(stored);
|
||||
return ok(this.isDrive(rootId) ? 'deleted' : 'trash');
|
||||
}
|
||||
|
||||
onChange(listener: (event: FilesChangeEvent) => void): () => void {
|
||||
this.listeners.add(listener);
|
||||
return () => this.listeners.delete(listener);
|
||||
}
|
||||
|
||||
async loadState(rootId: string): Promise<string | null> {
|
||||
if (this.locked) throw new Error('Locked');
|
||||
return this.states.get(rootId) ?? null;
|
||||
}
|
||||
|
||||
async saveState(rootId: string, state: string): Promise<void> {
|
||||
if (this.locked) throw new Error('Locked');
|
||||
if (!this.rootsList.some((root) => root.id === rootId)) throw new Error('No such root');
|
||||
this.states.set(rootId, state);
|
||||
}
|
||||
|
||||
async showInFolder(rootId: string, path: string): Promise<boolean> {
|
||||
this.shown.push({ rootId, path });
|
||||
return true;
|
||||
}
|
||||
|
||||
// ─── The drive ──────────────────────────────────────────────
|
||||
|
||||
/** Windows asks for a file someone opened. */
|
||||
requestFetch(rootId: string, path: string, offset = 0): FilesFetchRequest {
|
||||
const node = this.node(rootId, path);
|
||||
const fetchId = `fetch${this.supplied.size + this.fetchFailed.size + 1}-${Math.random().toString(36).slice(2, 6)}`;
|
||||
const start = Math.floor(offset / 4096) * 4096;
|
||||
const request: FilesFetchRequest = { fetchId, rootId, identity: node.placeholder?.identity ?? '', path, offset: start, length: node.size - start, total: node.size };
|
||||
this.supplied.set(fetchId, { offset: start, length: 0, parts: [] });
|
||||
for (const listener of [...this.fetchListeners]) listener(request);
|
||||
return request;
|
||||
}
|
||||
|
||||
/** Everything supplied for a fetch, in one piece. */
|
||||
suppliedBytes(fetchId: string): Uint8Array {
|
||||
const got = this.supplied.get(fetchId);
|
||||
const out = new Uint8Array(got?.length ?? 0);
|
||||
let at = 0;
|
||||
for (const part of got?.parts ?? []) {
|
||||
out.set(part, at);
|
||||
at += part.length;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
cancelFetch(fetchId: string): void {
|
||||
for (const listener of [...this.cancelListeners]) listener(fetchId);
|
||||
}
|
||||
|
||||
private makeDrive(): FilesDriveControls {
|
||||
// The bridge hands these out as plain functions, as the preload does.
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
const disk = this;
|
||||
const record = (call: string, ...args: unknown[]) => disk.driveCalls.push({ call, args });
|
||||
const state = (): FilesDriveState => ({ supported: true, forcedOff: false, wanted: [...disk.driveWanted], letter: { letter: null, chosen: null, locked: false, available: ['E'] } });
|
||||
return {
|
||||
state: async () => state(),
|
||||
onStateChange: () => () => {},
|
||||
enable: async (account, label) => {
|
||||
record('enable', account, label);
|
||||
if (!disk.driveWanted.includes(account)) disk.driveWanted.push(account);
|
||||
const existing = disk.rootsList.find((root) => root.kind === 'drive' && root.account === account);
|
||||
return ok(existing ?? disk.addRoot({ id: `drive-${account}`, account, kind: 'drive', remoteId: null, remoteLabel: label }));
|
||||
},
|
||||
disable: async (account, reason) => {
|
||||
record('disable', account, reason);
|
||||
if (reason !== 'signed-out') disk.driveWanted = disk.driveWanted.filter((entry) => entry !== account);
|
||||
const at = disk.rootsList.findIndex((root) => root.kind === 'drive' && root.account === account);
|
||||
if (at >= 0) {
|
||||
const [root] = disk.rootsList.splice(at, 1);
|
||||
disk.trees.set(root.id, new Map());
|
||||
}
|
||||
},
|
||||
place: async (rootId, entries: FilesPlaceholder[]) => {
|
||||
record('place', rootId, entries.length);
|
||||
if (!disk.active(rootId)) return fail('inactive');
|
||||
const tree = disk.tree(rootId);
|
||||
const answers = entries.map((entry) => {
|
||||
if (!disk.parentOk(rootId, entry.path)) return { path: entry.path, error: 'missing' as const };
|
||||
if (disk.find(rootId, entry.path)) return { path: entry.path, error: 'exists' as const };
|
||||
tree.set(entry.path, {
|
||||
kind: entry.kind,
|
||||
data: null,
|
||||
size: entry.kind === 'file' ? entry.size : 0,
|
||||
fileId: `f${fileIds++}`,
|
||||
mtimeMs: entry.mtimeMs,
|
||||
placeholder: { identity: entry.identity, inSync: true, hydrated: entry.kind === 'directory', pin: 'unspecified' },
|
||||
});
|
||||
return { path: entry.path };
|
||||
});
|
||||
return ok(answers);
|
||||
},
|
||||
update: async (rootId, path, meta, expect) => {
|
||||
record('update', rootId, path, meta.dehydrate);
|
||||
if (!disk.active(rootId)) return fail('inactive');
|
||||
const stored = disk.find(rootId, path);
|
||||
const node = stored ? disk.tree(rootId).get(stored) : undefined;
|
||||
if (!node) return fail('missing');
|
||||
if (expect && !disk.matches(node, expect)) return fail('changed');
|
||||
if (!node.placeholder?.identity || !node.placeholder.inSync) return fail('changed');
|
||||
node.size = meta.size;
|
||||
node.mtimeMs = meta.mtimeMs;
|
||||
node.placeholder = { ...node.placeholder, identity: meta.identity, inSync: true };
|
||||
if (meta.dehydrate) {
|
||||
node.data = null;
|
||||
node.placeholder.hydrated = false;
|
||||
}
|
||||
return ok(disk.entry(stored as string, node));
|
||||
},
|
||||
markInSync: async (rootId, path, identity, expect) => {
|
||||
record('markInSync', rootId, path, identity);
|
||||
if (!disk.active(rootId)) return fail('inactive');
|
||||
const stored = disk.find(rootId, path);
|
||||
const node = stored ? disk.tree(rootId).get(stored) : undefined;
|
||||
if (!node) return fail('missing');
|
||||
if (!disk.matches(node, expect)) return fail('changed');
|
||||
node.placeholder = { identity, inSync: true, hydrated: true, pin: node.placeholder?.pin ?? 'unspecified' };
|
||||
return ok(disk.entry(stored as string, node));
|
||||
},
|
||||
onFetch: (listener) => {
|
||||
disk.fetchListeners.add(listener);
|
||||
return () => disk.fetchListeners.delete(listener);
|
||||
},
|
||||
onFetchCancel: (listener) => {
|
||||
disk.cancelListeners.add(listener);
|
||||
return () => disk.cancelListeners.delete(listener);
|
||||
},
|
||||
supply: async (fetchId, offset, data) => {
|
||||
const got = disk.supplied.get(fetchId);
|
||||
if (!got) return false;
|
||||
if (offset !== got.offset + got.length) return false;
|
||||
if (disk.refuseSupplyAfter !== null && got.length >= disk.refuseSupplyAfter) return false;
|
||||
got.parts.push(new Uint8Array(data));
|
||||
got.length += data.length;
|
||||
return true;
|
||||
},
|
||||
fail: (fetchId, error) => {
|
||||
disk.fetchFailed.set(fetchId, error);
|
||||
},
|
||||
setLetter: async (letter) => {
|
||||
record('setLetter', letter);
|
||||
return ok({ letter, chosen: letter, locked: false, available: ['E'] });
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
/**
|
||||
* Files on a fake server for the engine: lib/store's FakeFiles (FileNode/get, query and changes
|
||||
* as both Stalwarts answer them) with FileNode/set and uploads added, as Stalwart does them:
|
||||
* - a folder is a node without blobId; a node can only go under a folder;
|
||||
* - two siblings with the same name are refused (`alreadyExists`);
|
||||
* - a destroy with onDestroyRemoveChildren takes the subtree;
|
||||
* - an upload over maxSizeUpload is an HTTP 413;
|
||||
* - the session's filenode capability names forbidden characters (0.16.6+ style).
|
||||
*/
|
||||
|
||||
import { TransportError, type StoreSession } from '@/lib/store/engine/transport';
|
||||
import { FakeFiles, FILES, FILES_SESSION, type FakeFilesOptions, type FakeNode } from '@/lib/store/__tests__/helpers/fake-files';
|
||||
import { JMAP_ACCOUNT } from '@/lib/store/__tests__/helpers/fake-jmap';
|
||||
import { FilesRemote } from '../../remote';
|
||||
|
||||
export { JMAP_ACCOUNT };
|
||||
|
||||
export interface FakeServerOptions extends FakeFilesOptions {
|
||||
maxSizeUpload?: number;
|
||||
forbiddenNameChars?: string;
|
||||
}
|
||||
|
||||
export class FakeServer extends FakeFiles {
|
||||
readonly session: StoreSession;
|
||||
readonly sets: Record<string, unknown>[] = [];
|
||||
readonly uploads: number[] = [];
|
||||
/** Fails the next N uploads like a network drop. */
|
||||
failUploads = 0;
|
||||
private serverClock = Date.UTC(2026, 9, 1);
|
||||
private nextNodeId = 1000;
|
||||
private nextBlob = 1;
|
||||
|
||||
constructor(options: FakeServerOptions = {}) {
|
||||
super(options);
|
||||
this.session = {
|
||||
...FILES_SESSION,
|
||||
capabilities: {
|
||||
...FILES_SESSION.capabilities,
|
||||
'urn:ietf:params:jmap:core': { maxSizeUpload: options.maxSizeUpload ?? 50_000_000, maxObjectsInGet: 500, maxObjectsInSet: 500, maxCallsInRequest: 16 },
|
||||
},
|
||||
accounts: {
|
||||
...FILES_SESSION.accounts,
|
||||
[JMAP_ACCOUNT]: {
|
||||
...FILES_SESSION.accounts[JMAP_ACCOUNT],
|
||||
accountCapabilities: { [FILES]: { forbiddenNameChars: options.forbiddenNameChars ?? '/', forbiddenNodeNames: ['.', '..'], maxSizeFileNodeName: 255 } },
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
remote(): FilesRemote {
|
||||
return new FilesRemote(this, () => this.session);
|
||||
}
|
||||
|
||||
private stamp(): string {
|
||||
this.serverClock += 1000;
|
||||
return new Date(this.serverClock).toISOString();
|
||||
}
|
||||
|
||||
get nodes(): Map<string, FakeNode> {
|
||||
return this.account().nodes;
|
||||
}
|
||||
|
||||
/** What another device does in Files. */
|
||||
folder(name: string, parentId: string | null = null): FakeNode {
|
||||
const node = this.addFolder(name, parentId, `n${this.nextNodeId++}`);
|
||||
node.modified = this.stamp();
|
||||
return node;
|
||||
}
|
||||
|
||||
file(name: string, parentId: string | null, content: string | Uint8Array): FakeNode {
|
||||
const data = typeof content === 'string' ? new TextEncoder().encode(content) : content;
|
||||
const node = this.addFile(name, parentId, data, { id: `n${this.nextNodeId++}`, blobId: `b${this.nextBlob++}`, modified: this.stamp() });
|
||||
return node;
|
||||
}
|
||||
|
||||
edit(id: string, content: string): void {
|
||||
const data = new TextEncoder().encode(content);
|
||||
const blobId = `b${this.nextBlob++}`;
|
||||
this.blobs.set(blobId, data);
|
||||
const node = this.nodes.get(id) as FakeNode;
|
||||
node.blobId = blobId;
|
||||
node.size = data.length;
|
||||
node.modified = this.stamp();
|
||||
this.account().coll.push('updated', id);
|
||||
}
|
||||
|
||||
rename(id: string, name: string, parentId?: string | null): void {
|
||||
const node = this.nodes.get(id) as FakeNode;
|
||||
node.name = name;
|
||||
if (parentId !== undefined) node.parentId = parentId;
|
||||
this.account().coll.push('updated', id);
|
||||
}
|
||||
|
||||
destroyTree(id: string): void {
|
||||
for (const child of [...this.nodes.values()].filter((node) => node.parentId === id)) this.destroyTree(child.id);
|
||||
this.removeNode(id);
|
||||
}
|
||||
|
||||
/** The content of a node, as text. */
|
||||
content(id: string): string {
|
||||
const node = this.nodes.get(id);
|
||||
return node?.blobId ? new TextDecoder().decode(this.blobs.get(node.blobId)) : '';
|
||||
}
|
||||
|
||||
/** Path from the top to each node, sorted, folders with a slash. Without the trash unless asked. */
|
||||
listing(withTrash = false): string[] {
|
||||
const out: string[] = [];
|
||||
const pathOf = (node: FakeNode): string | null => {
|
||||
const parts = [node.name];
|
||||
let parent = node.parentId;
|
||||
while (parent) {
|
||||
const up = this.nodes.get(parent);
|
||||
if (!up) return null;
|
||||
parts.unshift(up.name);
|
||||
parent = up.parentId;
|
||||
}
|
||||
return parts.join('/');
|
||||
};
|
||||
for (const node of this.nodes.values()) {
|
||||
const path = pathOf(node);
|
||||
if (path === null) continue;
|
||||
if (!withTrash && (path === '.Trash' || path.startsWith('.Trash/'))) continue;
|
||||
out.push(node.blobId === null ? `${path}/` : path);
|
||||
}
|
||||
return out.sort();
|
||||
}
|
||||
|
||||
find(path: string): FakeNode | undefined {
|
||||
const parts = path.split('/');
|
||||
let parent: string | null = null;
|
||||
let found: FakeNode | undefined;
|
||||
for (const part of parts) {
|
||||
found = [...this.nodes.values()].find((node) => node.parentId === parent && node.name === part);
|
||||
if (!found) return undefined;
|
||||
parent = found.id;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
override async upload(_jmap?: string, data?: Uint8Array, type?: string): Promise<{ blobId: string; type: string; size: number }> {
|
||||
if (this.offline) throw new TransportError('network', 'Failed to fetch');
|
||||
if (this.failUploads > 0) {
|
||||
this.failUploads -= 1;
|
||||
throw new TransportError('network', 'Connection reset');
|
||||
}
|
||||
const bytes = data ?? new Uint8Array();
|
||||
const max = (this.session.capabilities['urn:ietf:params:jmap:core'] as { maxSizeUpload: number }).maxSizeUpload;
|
||||
if (bytes.length > max) throw new TransportError('http', 'Upload failed: 413', 413);
|
||||
const blobId = `up${this.nextBlob++}`;
|
||||
this.blobs.set(blobId, new Uint8Array(bytes));
|
||||
this.uploads.push(bytes.length);
|
||||
return { blobId, type: type ?? 'application/octet-stream', size: bytes.length };
|
||||
}
|
||||
|
||||
protected override handle(name: string, args: Record<string, unknown>): Record<string, unknown> {
|
||||
if (name !== 'FileNode/set') return super.handle(name, args);
|
||||
this.sets.push(args);
|
||||
const account = this.account(String(args.accountId));
|
||||
const nodes = account.nodes;
|
||||
const forbidden = String(((this.session.accounts[JMAP_ACCOUNT].accountCapabilities as Record<string, Record<string, unknown>>)[FILES]).forbiddenNameChars ?? '');
|
||||
const clash = (parentId: string | null, nodeName: string, except?: string) =>
|
||||
[...nodes.values()].some((node) => node.parentId === parentId && node.name === nodeName && node.id !== except);
|
||||
const isFolder = (id: string | null) => id === null || nodes.get(id)?.blobId === null;
|
||||
const created: Record<string, unknown> = {};
|
||||
const notCreated: Record<string, unknown> = {};
|
||||
for (const [key, raw] of Object.entries((args.create ?? {}) as Record<string, Record<string, unknown>>)) {
|
||||
const parentId = (raw.parentId as string | undefined) ?? null;
|
||||
const nodeName = String(raw.name ?? '');
|
||||
if (!nodeName || [...nodeName].some((ch) => forbidden.includes(ch))) {
|
||||
notCreated[key] = { type: 'invalidProperties', description: 'Name contains a forbidden character.' };
|
||||
continue;
|
||||
}
|
||||
if (parentId !== null && !nodes.has(parentId)) {
|
||||
notCreated[key] = { type: 'invalidProperties', description: 'Parent ID does not exist or is not a folder.' };
|
||||
continue;
|
||||
}
|
||||
if (!isFolder(parentId)) {
|
||||
notCreated[key] = { type: 'invalidProperties', description: 'Parent ID does not exist or is not a folder.' };
|
||||
continue;
|
||||
}
|
||||
if (clash(parentId, nodeName)) {
|
||||
notCreated[key] = { type: 'alreadyExists', description: 'A node with the same name already exists.' };
|
||||
continue;
|
||||
}
|
||||
const id = `n${this.nextNodeId++}`;
|
||||
const blobId = (raw.blobId as string | undefined) ?? null;
|
||||
const type = (raw.type as string | undefined) ?? (raw.mediaType as string | undefined) ?? null;
|
||||
const node: FakeNode = { id, parentId, name: nodeName, blobId, type: blobId ? type : null, size: blobId ? (this.blobs.get(blobId)?.length ?? 0) : null, modified: this.stamp() };
|
||||
nodes.set(id, node);
|
||||
account.coll.push('created', id);
|
||||
created[key] = { id };
|
||||
}
|
||||
const updated: Record<string, unknown> = {};
|
||||
const notUpdated: Record<string, unknown> = {};
|
||||
for (const [id, patch] of Object.entries((args.update ?? {}) as Record<string, Record<string, unknown>>)) {
|
||||
const node = nodes.get(id);
|
||||
if (!node) {
|
||||
notUpdated[id] = { type: 'notFound' };
|
||||
continue;
|
||||
}
|
||||
const parentId = 'parentId' in patch ? ((patch.parentId as string | null) ?? null) : node.parentId;
|
||||
const nodeName = 'name' in patch ? String(patch.name) : node.name;
|
||||
if ('parentId' in patch && !isFolder(parentId)) {
|
||||
notUpdated[id] = { type: 'invalidProperties', description: 'Parent ID does not exist or is not a folder.' };
|
||||
continue;
|
||||
}
|
||||
if (clash(parentId, nodeName, id)) {
|
||||
notUpdated[id] = { type: 'alreadyExists' };
|
||||
continue;
|
||||
}
|
||||
node.parentId = parentId;
|
||||
node.name = nodeName;
|
||||
if ('blobId' in patch) {
|
||||
node.blobId = patch.blobId as string;
|
||||
node.size = this.blobs.get(node.blobId)?.length ?? 0;
|
||||
}
|
||||
node.modified = this.stamp();
|
||||
account.coll.push('updated', id);
|
||||
updated[id] = null;
|
||||
}
|
||||
const destroyed: string[] = [];
|
||||
const notDestroyed: Record<string, unknown> = {};
|
||||
for (const id of (args.destroy ?? []) as string[]) {
|
||||
if (!nodes.has(id)) {
|
||||
notDestroyed[id] = { type: 'notFound' };
|
||||
continue;
|
||||
}
|
||||
if (!args.onDestroyRemoveChildren && [...nodes.values()].some((node) => node.parentId === id)) {
|
||||
notDestroyed[id] = { type: 'nodeHasChildren' };
|
||||
continue;
|
||||
}
|
||||
this.destroyTree(id);
|
||||
destroyed.push(id);
|
||||
}
|
||||
return {
|
||||
accountId: args.accountId,
|
||||
newState: account.coll.state(),
|
||||
created,
|
||||
notCreated,
|
||||
updated,
|
||||
notUpdated,
|
||||
destroyed,
|
||||
notDestroyed,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
/**
|
||||
* The host of Files on this computer: claiming the bridge once, the accounts it runs for, what
|
||||
* it publishes, the controller, and what sign-out, a wipe and a refused login do.
|
||||
*/
|
||||
import { render } from '@testing-library/react';
|
||||
import { createElement } from 'react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { FilesControls } from '@/lib/desktop/types';
|
||||
import { WindowControlsHost } from '@/components/layout/window-controls-host';
|
||||
import { noteCredentialsRejected } from '@/lib/offline/credentials-rejected';
|
||||
import { runWipeCleaners } from '@/lib/offline/wipe-registry';
|
||||
import { runBeforeSignOut } from '@/lib/sign-out-cleanup';
|
||||
import type { FilesSyncController, FilesSyncSnapshot } from '../types';
|
||||
import { claimFilesControls, resetFilesControlsForTests } from '../controls';
|
||||
import { FilesSyncHost, type HostAccount } from '../host';
|
||||
import { registerFilesSyncLifecycle, resetFilesSyncLifecycleForTests, setRunningFilesSyncHost } from '../lifecycle';
|
||||
import { FakeDisk } from './helpers/fake-disk';
|
||||
import { FakeServer } from './helpers/fake-server';
|
||||
|
||||
const FAST = { localDelayMs: 0, remoteDelayMs: 0, pollMs: 1e9, rescanMs: 1e9, retryMs: [1e9], soonMs: 5, fetchWaitMs: 1000 };
|
||||
|
||||
function fakeBridge(controls: FilesControls) {
|
||||
const claim = vi.fn<() => FilesControls | null>();
|
||||
let taken = false;
|
||||
claim.mockImplementation(() => {
|
||||
if (taken) return null;
|
||||
taken = true;
|
||||
return controls;
|
||||
});
|
||||
return { version: 1, platform: 'win32' as const, files: { claim } };
|
||||
}
|
||||
|
||||
describe('claiming the bridge', () => {
|
||||
afterEach(() => {
|
||||
delete (window as { bulwarkDesktop?: unknown }).bulwarkDesktop;
|
||||
resetFilesControlsForTests();
|
||||
});
|
||||
|
||||
it('takes the controls in the first render, once, so a frame coming later gets nothing', () => {
|
||||
const controls = new FakeDisk();
|
||||
const bridge = fakeBridge(controls);
|
||||
(window as { bulwarkDesktop?: unknown }).bulwarkDesktop = bridge;
|
||||
const { rerender } = render(createElement(WindowControlsHost));
|
||||
rerender(createElement(WindowControlsHost));
|
||||
expect(bridge.files.claim).toHaveBeenCalledTimes(1);
|
||||
expect(claimFilesControls()).toBe(controls);
|
||||
// A same-origin frame reaching the bridge through parent.
|
||||
expect(bridge.files.claim()).toBeNull();
|
||||
});
|
||||
|
||||
it('takes nothing in a browser', () => {
|
||||
render(createElement(WindowControlsHost));
|
||||
expect(claimFilesControls()).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
interface Rig {
|
||||
host: FilesSyncHost;
|
||||
disk: FakeDisk;
|
||||
server: FakeServer;
|
||||
snapshot: () => Partial<FilesSyncSnapshot>;
|
||||
controller: () => FilesSyncController | null;
|
||||
folderOff: { value: boolean };
|
||||
account: HostAccount;
|
||||
}
|
||||
|
||||
function rig(options: { drive?: boolean; wanted?: string[] } = {}): Rig {
|
||||
const disk = new FakeDisk({ caseInsensitive: true, drive: options.drive });
|
||||
disk.driveWanted = options.wanted ?? [];
|
||||
const server = new FakeServer();
|
||||
let published: Partial<FilesSyncSnapshot> = {};
|
||||
let controller: FilesSyncController | null = null;
|
||||
const folderOff = { value: false };
|
||||
const host = new FilesSyncHost({
|
||||
controls: disk,
|
||||
platform: 'win32',
|
||||
publish: (patch) => {
|
||||
published = { ...published, ...patch };
|
||||
},
|
||||
setController: (next) => {
|
||||
controller = next;
|
||||
},
|
||||
folderSyncForcedOff: () => folderOff.value,
|
||||
downloadsForbidden: () => false,
|
||||
remoteFor: () => server.remote(),
|
||||
readUrl: disk.readUrl,
|
||||
timing: FAST,
|
||||
});
|
||||
const account: HostAccount = { id: 'a1', label: 'a@example.org', client: { getSessionSnapshot: () => server.session, getAuthHeader: () => 'Basic x' } };
|
||||
return { host, disk, server, snapshot: () => published, controller: () => controller, folderOff, account };
|
||||
}
|
||||
|
||||
async function settle(host: FilesSyncHost): Promise<void> {
|
||||
await new Promise((resolve) => setTimeout(resolve, 10));
|
||||
await host.engine.settled();
|
||||
await new Promise((resolve) => setTimeout(resolve, 60));
|
||||
}
|
||||
|
||||
describe('the host', () => {
|
||||
it('runs the roots of signed-in accounts, publishes the current one, and registers the controller', async () => {
|
||||
const r = rig();
|
||||
r.disk.addRoot({ id: 'r1', account: 'a1', remoteId: null });
|
||||
r.disk.addRoot({ id: 'r2', account: 'other', remoteId: null });
|
||||
r.disk.write('r1', 'a.txt', 'a');
|
||||
r.host.start();
|
||||
r.host.setAccounts([r.account], 'a1');
|
||||
await settle(r.host);
|
||||
expect(r.server.listing()).toEqual(['a.txt']);
|
||||
expect(r.snapshot()).toMatchObject({ available: true, account: 'a1', folderSyncForcedOff: false });
|
||||
expect(r.snapshot().roots?.map((root) => root.id)).toEqual(['r1']);
|
||||
expect(r.snapshot().status?.r1).toMatchObject({ state: 'idle' });
|
||||
expect(r.snapshot().activity?.[0]).toMatchObject({ kind: 'uploaded', path: 'a.txt' });
|
||||
expect(Object.values(r.snapshot().items ?? {})).toEqual(['synced']);
|
||||
expect(r.controller()).not.toBeNull();
|
||||
r.host.stop();
|
||||
expect(r.controller()).toBeNull();
|
||||
});
|
||||
|
||||
it('keeps folders out of sync while the policy forbids them', async () => {
|
||||
const r = rig();
|
||||
r.folderOff.value = true;
|
||||
r.disk.addRoot({ id: 'r1', account: 'a1', remoteId: null });
|
||||
r.disk.write('r1', 'a.txt', 'a');
|
||||
r.host.start();
|
||||
r.host.setAccounts([r.account], 'a1');
|
||||
await settle(r.host);
|
||||
expect(r.server.listing()).toEqual([]);
|
||||
expect(r.snapshot().status?.r1).toMatchObject({ state: 'blocked', errorKey: 'errors.policy' });
|
||||
expect(r.snapshot().folderSyncForcedOff).toBe(true);
|
||||
r.host.stop();
|
||||
});
|
||||
|
||||
it('turns the drive back on at sign-in without a click, and off at sign-out keeping the wish', async () => {
|
||||
const r = rig({ drive: true, wanted: ['a1'] });
|
||||
r.server.file('a.txt', null, 'a');
|
||||
r.host.start();
|
||||
r.host.setAccounts([r.account], 'a1');
|
||||
await settle(r.host);
|
||||
await settle(r.host);
|
||||
expect(r.disk.driveCalls[0]).toEqual({ call: 'enable', args: ['a1', 'a@example.org'] });
|
||||
expect(r.disk.listing('drive-a1')).toEqual(['a.txt']);
|
||||
expect(r.disk.states.get('drive-a1')).toContain('a.txt');
|
||||
await r.host.signedOut('a1');
|
||||
expect(r.disk.driveCalls.at(-1)).toEqual({ call: 'disable', args: ['a1', 'signed-out'] });
|
||||
expect(r.disk.driveWanted).toEqual(['a1']);
|
||||
// The record went before the folder did: the next sign-in starts from an empty one.
|
||||
expect(r.disk.states.get('drive-a1')).not.toContain('a.txt');
|
||||
r.host.stop();
|
||||
});
|
||||
|
||||
it('removes the drive and forgets the folders of a wiped account, and keeps their files', async () => {
|
||||
const r = rig({ drive: true, wanted: ['a1', 'a2'] });
|
||||
r.disk.addRoot({ id: 'r1', account: 'a1', remoteId: null });
|
||||
r.disk.addRoot({ id: 'r2', account: 'a2', remoteId: null });
|
||||
r.disk.write('r1', 'mine.txt', 'mine');
|
||||
r.host.start();
|
||||
await r.host.removeAccountData('a1', 'wipe');
|
||||
expect(r.disk.driveCalls).toContainEqual({ call: 'disable', args: ['a1', 'wipe'] });
|
||||
expect(r.disk.driveCalls.some((call) => call.args[0] === 'a2')).toBe(false);
|
||||
expect(r.disk.calls).toEqual(['removeRoot r1']);
|
||||
expect(r.disk.read('r1', 'mine.txt')).toBe('mine');
|
||||
r.host.stop();
|
||||
});
|
||||
|
||||
it('answers the controller: shared folders refused, the drive switch, show in folder', async () => {
|
||||
const r = rig({ drive: true });
|
||||
r.disk.addRoot({ id: 'r1', account: 'a1', remoteId: null });
|
||||
r.disk.write('r1', 'Docs/a.txt', 'a');
|
||||
r.host.start();
|
||||
r.host.setAccounts([r.account], 'a1');
|
||||
await settle(r.host);
|
||||
const controller = r.controller()!;
|
||||
expect(await controller.addFolder('shared1:n5', 'Team')).toEqual({ ok: false, error: 'unsupported' });
|
||||
expect(r.disk.calls).toEqual([]);
|
||||
const id = r.server.find('Docs/a.txt')!.id;
|
||||
expect(controller.coverage(id)).toEqual({ rootId: 'r1', kind: 'folder', path: 'Docs/a.txt' });
|
||||
expect(await controller.showInFolder(id)).toBe(true);
|
||||
expect(r.disk.shown).toEqual([{ rootId: 'r1', path: 'Docs/a.txt' }]);
|
||||
expect(await controller.showInFolder('unknown')).toBe(false);
|
||||
expect((await controller.setDriveEnabled(true)).ok).toBe(true);
|
||||
expect(r.disk.driveCalls.at(-1)).toEqual({ call: 'enable', args: ['a1', 'a@example.org'] });
|
||||
expect(await controller.setDriveEnabled(false)).toEqual({ ok: true, value: null });
|
||||
expect(r.disk.driveCalls.at(-1)).toEqual({ call: 'disable', args: ['a1', 'user'] });
|
||||
r.host.stop();
|
||||
});
|
||||
});
|
||||
|
||||
describe('sign-out, wipe and refused logins', () => {
|
||||
let r: Rig;
|
||||
beforeEach(async () => {
|
||||
resetFilesSyncLifecycleForTests();
|
||||
registerFilesSyncLifecycle();
|
||||
r = rig({ drive: true, wanted: ['a1'] });
|
||||
r.disk.addRoot({ id: 'r1', account: 'a1', remoteId: null });
|
||||
r.host.start();
|
||||
setRunningFilesSyncHost(r.host);
|
||||
});
|
||||
afterEach(() => {
|
||||
r.host.stop();
|
||||
resetFilesSyncLifecycleForTests();
|
||||
});
|
||||
|
||||
it('a wipe removes the drive and forgets the folders', async () => {
|
||||
await runWipeCleaners('a1');
|
||||
expect(r.disk.driveCalls).toContainEqual({ call: 'disable', args: ['a1', 'wipe'] });
|
||||
expect(r.disk.calls).toContain('removeRoot r1');
|
||||
});
|
||||
|
||||
it('a refused login the server is sure of does the same, an unsure one nothing', async () => {
|
||||
noteCredentialsRejected('a1', false, 'refused');
|
||||
noteCredentialsRejected('a1', true, 'session');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
expect(r.disk.driveCalls.filter((call) => call.call === 'disable')).toEqual([]);
|
||||
noteCredentialsRejected('a1', true, 'refused');
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
expect(r.disk.driveCalls).toContainEqual({ call: 'disable', args: ['a1', 'refused'] });
|
||||
expect(r.disk.calls).toContain('removeRoot r1');
|
||||
});
|
||||
|
||||
it('a sign-out takes the drive down and keeps the folders', async () => {
|
||||
await runBeforeSignOut('a1');
|
||||
expect(r.disk.driveCalls).toContainEqual({ call: 'disable', args: ['a1', 'signed-out'] });
|
||||
expect(r.disk.calls).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,225 @@
|
||||
// @vitest-environment node
|
||||
/**
|
||||
* The engine against a real Stalwart, with the in-memory disk. Skipped unless asked for:
|
||||
*
|
||||
* FILES_SYNC_REAL_URL=https://stalwart.internal.bulwarkmail.org FILES_SYNC_REAL_LABEL=0.16 \
|
||||
* vw exec --env FILES_SYNC_REAL_PASSWORD="vault://<dso-* item>/password" -- npx vitest run lib/files-sync/__tests__/real-server.test.ts
|
||||
*
|
||||
* Uses the throwaway accounts dso-fs and dso-fs-b (VM 106 ~/desktop-offline/dso_fs_provision.py,
|
||||
* which also seeds dso-fs's "Seed" folder; dso_fs_dav_seed.py adds names Windows can't hold over
|
||||
* WebDAV). It signs in once per account and stops there if that's refused: nothing polls as a
|
||||
* missing user.
|
||||
*/
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
||||
import { FetchTransport, type StoreSession } from '@/lib/store/engine/transport';
|
||||
import { FilesSyncEngine, type EngineTiming } from '../engine';
|
||||
import { namingFor } from '../names';
|
||||
import { FilesRemote, type RemoteNode } from '../remote';
|
||||
import { FakeDisk, str, text } from './helpers/fake-disk';
|
||||
|
||||
const URL_BASE = process.env.FILES_SYNC_REAL_URL ?? '';
|
||||
const LABEL = process.env.FILES_SYNC_REAL_LABEL ?? '';
|
||||
const PASSWORD = process.env.FILES_SYNC_REAL_PASSWORD ?? '';
|
||||
const run = !!URL_BASE && !!PASSWORD;
|
||||
const FAST: Partial<EngineTiming> = { localDelayMs: 0, remoteDelayMs: 0, pollMs: 1e9, rescanMs: 1e9, retryMs: [1e9], soonMs: 50, fetchWaitMs: 30_000 };
|
||||
|
||||
function basic(user: string): string {
|
||||
return `Basic ${Buffer.from(`${user}@example.org:${PASSWORD}`).toString('base64')}`;
|
||||
}
|
||||
|
||||
async function signIn(user: string): Promise<FilesRemote> {
|
||||
const response = await fetch(`${URL_BASE}/jmap/session`, { headers: { Authorization: basic(user) } });
|
||||
if (response.status !== 200) throw new Error(`${user} on ${LABEL}: session ${response.status}; run dso_fs_provision.py first`);
|
||||
const session = (await response.json()) as StoreSession;
|
||||
const transport = new FetchTransport({ session: () => session, auth: () => basic(user), refreshAuth: async () => basic(user) });
|
||||
return new FilesRemote(transport, () => session);
|
||||
}
|
||||
|
||||
async function tree(remote: FilesRemote): Promise<Map<string, RemoteNode>> {
|
||||
return new Map((await remote.listAll()).nodes.map((node) => [node.id, node]));
|
||||
}
|
||||
|
||||
/** Paths below a folder, as Files has them, folders with a slash. */
|
||||
function pathsUnder(nodes: Map<string, RemoteNode>, folderId: string): string[] {
|
||||
const out: string[] = [];
|
||||
const walk = (parent: string, prefix: string) => {
|
||||
for (const node of nodes.values()) {
|
||||
if (node.parentId !== parent) continue;
|
||||
const path = prefix ? `${prefix}/${node.name}` : node.name;
|
||||
out.push(node.kind === 'directory' ? `${path}/` : path);
|
||||
if (node.kind === 'directory') walk(node.id, path);
|
||||
}
|
||||
};
|
||||
walk(folderId, '');
|
||||
return out.sort();
|
||||
}
|
||||
|
||||
function find(nodes: Map<string, RemoteNode>, parentId: string | null, name: string): RemoteNode | undefined {
|
||||
return [...nodes.values()].find((node) => node.parentId === parentId && node.name === name);
|
||||
}
|
||||
|
||||
async function download(remote: FilesRemote, node: RemoteNode): Promise<Uint8Array> {
|
||||
const parts: Uint8Array[] = [];
|
||||
await remote.download(node, (part) => parts.push(new Uint8Array(part)));
|
||||
return new Uint8Array(Buffer.concat(parts));
|
||||
}
|
||||
|
||||
describe.runIf(run)(`files sync against Stalwart ${LABEL}`, () => {
|
||||
let a: FilesRemote;
|
||||
let b: FilesRemote;
|
||||
let other: FilesRemote;
|
||||
let testFolder: RemoteNode;
|
||||
let disk: FakeDisk;
|
||||
let engine: FilesSyncEngine;
|
||||
const created: string[] = [];
|
||||
|
||||
const sync = async () => {
|
||||
await engine.refreshRoots();
|
||||
engine.syncNow();
|
||||
await engine.settled();
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
a = await signIn('dso-fs');
|
||||
b = await signIn('dso-fs-b');
|
||||
// "Another device" of dso-fs: its own session and transport.
|
||||
other = await signIn('dso-fs');
|
||||
const nodes = await tree(a);
|
||||
// What an earlier run left.
|
||||
const old = [...nodes.values()].filter((node) => node.parentId === null && node.name.startsWith('Sync test '));
|
||||
if (old.length > 0) await a.destroy(old.map((node) => node.id));
|
||||
testFolder = await a.createFolder(`Sync test ${Date.now()}`, null);
|
||||
created.push(testFolder.id);
|
||||
disk = new FakeDisk({ caseInsensitive: true, drive: true });
|
||||
engine = new FilesSyncEngine({ controls: disk, naming: namingFor('win32'), device: 'Test', readUrl: disk.readUrl, timing: FAST });
|
||||
engine.start();
|
||||
engine.setAccount('fs', a);
|
||||
engine.setAccount('fs-b', b);
|
||||
}, 120_000);
|
||||
|
||||
afterAll(async () => {
|
||||
engine?.stop();
|
||||
if (a && created.length > 0) await a.destroy(created).catch(() => {});
|
||||
if (a) {
|
||||
const nodes = await tree(a).catch(() => new Map<string, RemoteNode>());
|
||||
const trash = find(nodes, null, '.Trash');
|
||||
if (trash) await a.destroy([trash.id]).catch(() => {});
|
||||
}
|
||||
}, 120_000);
|
||||
|
||||
it('brings the seeded folder down whole, with names the disk can hold, and changes nothing in Files', async () => {
|
||||
const before = await tree(a);
|
||||
const seed = find(before, null, 'Seed');
|
||||
expect(seed, 'run dso_fs_provision.py create').toBeDefined();
|
||||
disk.addRoot({ id: 'seed', account: 'fs', remoteId: seed!.id });
|
||||
await sync();
|
||||
const listing = disk.listing('seed');
|
||||
expect(listing).toEqual(expect.arrayContaining([
|
||||
'Documents/', 'Documents/Level 1/Level 2/deep note.md', 'Documents/Quarterly report 2026.txt', 'Empty folder/',
|
||||
'Pictures/photo 1.png', 'Ärger und Grüße/Übersicht März.txt', 'Large/large 1.bin', 'Large/large 2.bin',
|
||||
'Report.txt', 'report (2).txt', 'trailing dot._',
|
||||
'a:b.txt', 'what?.txt', 'quote".txt', 'pipe|star*.txt', 'less<more>.txt', 'back\slash.txt',
|
||||
]));
|
||||
if (LABEL === '0.16') expect(listing).toContain('CON_.txt');
|
||||
expect(disk.read('seed', 'Ärger und Grüße/Übersicht März.txt')).toBe('Grüße aus Köln\n');
|
||||
const large = find(before, find(before, seed!.id, 'Large')!.id, 'large 2.bin')!;
|
||||
expect(disk.node('seed', 'Large/large 2.bin').size).toBe(large.size);
|
||||
expect(Buffer.from(disk.node('seed', 'Large/large 2.bin').data!).equals(Buffer.from(await download(a, large)))).toBe(true);
|
||||
const after = await tree(a);
|
||||
expect(pathsUnder(after, seed!.id)).toEqual(pathsUnder(before, seed!.id));
|
||||
expect(engine.status().seed.state).toBe('idle');
|
||||
await engine.removeRoot('seed');
|
||||
}, 180_000);
|
||||
|
||||
it('sends what is made here, with a large file, and keeps one over the limit here', async () => {
|
||||
disk.addRoot({ id: 'pair', account: 'fs', remoteId: testFolder.id });
|
||||
const big = new Uint8Array(3 * 1024 * 1024 + 11).map((_, i) => (i * 7) % 256);
|
||||
disk.write('pair', 'Docs/Notes/plan.txt', 'the plan');
|
||||
disk.write('pair', 'Grüße/übung.txt', 'Umlaute');
|
||||
disk.write('pair', 'with space.txt', 'spaces');
|
||||
disk.write('pair', 'big.bin', big);
|
||||
const limit = a.maxUpload();
|
||||
expect(limit).toBeGreaterThan(0);
|
||||
disk.write('pair', 'too big.bin', new Uint8Array(limit + 1));
|
||||
await sync();
|
||||
const nodes = await tree(a);
|
||||
expect(pathsUnder(nodes, testFolder.id)).toEqual(['Docs/', 'Docs/Notes/', 'Docs/Notes/plan.txt', 'Grüße/', 'Grüße/übung.txt', 'big.bin', 'with space.txt']);
|
||||
expect(Buffer.from(await download(a, find(nodes, testFolder.id, 'big.bin')!)).equals(Buffer.from(big))).toBe(true);
|
||||
expect(engine.activity.filter((entry) => entry.kind === 'too-large').map((entry) => entry.path)).toEqual(['too big.bin']);
|
||||
}, 180_000);
|
||||
|
||||
it('follows renames, moves, edits, conflicts and deletes both ways', async () => {
|
||||
let nodes = await tree(a);
|
||||
const plan = find(nodes, find(nodes, find(nodes, testFolder.id, 'Docs')!.id, 'Notes')!.id, 'plan.txt')!;
|
||||
// Here: rename and move.
|
||||
disk.moveUser('pair', 'Docs/Notes/plan.txt', 'Grüße/Plan.txt');
|
||||
await sync();
|
||||
nodes = await tree(a);
|
||||
expect(find(nodes, find(nodes, testFolder.id, 'Grüße')!.id, 'Plan.txt')?.id).toBe(plan.id);
|
||||
// Another device: rename a folder and edit a file.
|
||||
const spaced = find(nodes, testFolder.id, 'with space.txt')!;
|
||||
await other.move(find(nodes, testFolder.id, 'Docs')!.id, { name: 'Documents' });
|
||||
const blob = await other.upload(text('edited elsewhere'), 'text/plain');
|
||||
await other.replaceBlob(spaced.id, blob.blobId);
|
||||
engine.remoteChanged('fs');
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
await sync();
|
||||
expect(disk.listing('pair')).toEqual(expect.arrayContaining(['Documents/', 'Documents/Notes/']));
|
||||
expect(disk.read('pair', 'with space.txt')).toBe('edited elsewhere');
|
||||
// Both sides edit one file.
|
||||
disk.write('pair', 'with space.txt', 'edited here, longer');
|
||||
const blob2 = await other.upload(text('edited there'), 'text/plain');
|
||||
await other.replaceBlob(spaced.id, blob2.blobId);
|
||||
await sync();
|
||||
const copy = disk.listing('pair').find((path) => path.startsWith('with space (conflict, Test, '))!;
|
||||
expect(copy).toBeDefined();
|
||||
expect(disk.read('pair', 'with space.txt')).toBe('edited there');
|
||||
nodes = await tree(a);
|
||||
expect(str(await download(a, find(nodes, testFolder.id, copy)!))).toBe('edited here, longer');
|
||||
// Deleted here: into the Files trash.
|
||||
disk.deleteUser('pair', 'big.bin');
|
||||
await sync();
|
||||
nodes = await tree(a);
|
||||
expect(find(nodes, testFolder.id, 'big.bin')).toBeUndefined();
|
||||
const trash = find(nodes, null, '.Trash')!;
|
||||
expect(pathsUnder(nodes, trash.id).some((path) => path.endsWith('/big.bin'))).toBe(true);
|
||||
// Deleted in Files: into the computer's trash.
|
||||
await other.destroy([find(nodes, testFolder.id, 'Grüße')!.id]);
|
||||
engine.remoteChanged('fs');
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
await sync();
|
||||
expect(disk.trashed).toContain('Grüße');
|
||||
expect(disk.listing('pair').some((path) => path.startsWith('Grüße'))).toBe(false);
|
||||
}, 240_000);
|
||||
|
||||
it('places the drive for the whole account and streams a file from where Windows asks', async () => {
|
||||
disk.addRoot({ id: 'drive', account: 'fs', kind: 'drive', remoteId: null });
|
||||
await sync();
|
||||
const listing = disk.listing('drive');
|
||||
expect(listing).toEqual(expect.arrayContaining(['Seed/', 'Seed/Large/large 2.bin', 'Seed/Pictures/photo 2.png']));
|
||||
expect(listing.some((path) => path.startsWith('.Trash'))).toBe(false);
|
||||
expect(disk.node('drive', 'Seed/Large/large 2.bin').placeholder).toMatchObject({ hydrated: false, inSync: true });
|
||||
const request = disk.requestFetch('drive', 'Seed/Large/large 2.bin', 1024 * 1024 + 5);
|
||||
const nodes = await tree(a);
|
||||
const node = find(nodes, find(nodes, find(nodes, null, 'Seed')!.id, 'Large')!.id, 'large 2.bin')!;
|
||||
const whole = await download(a, node);
|
||||
for (let i = 0; i < 300 && disk.suppliedBytes(request.fetchId).length < node.size - request.offset; i += 1) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
}
|
||||
const got = disk.suppliedBytes(request.fetchId);
|
||||
expect(request.offset).toBe(1024 * 1024);
|
||||
expect(got.length).toBe(node.size - request.offset);
|
||||
expect(Buffer.from(got).equals(Buffer.from(whole.subarray(request.offset)))).toBe(true);
|
||||
await engine.removeRoot('drive');
|
||||
}, 240_000);
|
||||
|
||||
it('keeps each account to its own Files', async () => {
|
||||
const own = await b.createFolder(`Sync test ${Date.now()}`, null);
|
||||
disk.addRoot({ id: 'pair-b', account: 'fs-b', remoteId: own.id });
|
||||
disk.write('pair-b', 'only b.txt', 'b');
|
||||
await sync();
|
||||
expect(pathsUnder(await tree(b), own.id)).toEqual(['only b.txt']);
|
||||
expect([...(await tree(a)).values()].some((node) => node.name === 'only b.txt')).toBe(false);
|
||||
await b.destroy([own.id]);
|
||||
}, 120_000);
|
||||
});
|
||||
@@ -0,0 +1,111 @@
|
||||
// @vitest-environment node
|
||||
/** The Files side over JMAP, against the fake server's 0.16 and 1.0 behaviours, and names on disk. */
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { conflictName, diskName, freeLocalName, namingFor, nameKey } from '../names';
|
||||
import { RemoteTree } from '../remote';
|
||||
import { FakeServer } from './helpers/fake-server';
|
||||
|
||||
describe('listing the whole tree', () => {
|
||||
function big(options: ConstructorParameters<typeof FakeServer>[0]): FakeServer {
|
||||
const server = new FakeServer(options);
|
||||
for (let f = 0; f < 6; f += 1) {
|
||||
const folder = server.folder(`folder ${f}`);
|
||||
for (let i = 0; i < 120; i += 1) server.file(`f${i}.txt`, folder.id, `${f}/${i}`);
|
||||
}
|
||||
return server;
|
||||
}
|
||||
|
||||
it('finds every folder past the /get ceiling where the query leaves folders out (0.16 before 0.16.6)', async () => {
|
||||
const server = big({ queryOmitsFolders: true, style: 'blob' });
|
||||
const { nodes } = await server.remote().listAll();
|
||||
expect(nodes.length).toBe(6 + 720);
|
||||
expect(nodes.filter((node) => node.kind === 'directory').length).toBe(6);
|
||||
});
|
||||
|
||||
it('lists everything where the return-all /get is refused (1.0)', async () => {
|
||||
const server = big({ getAll: 'refuse', style: 'draft' });
|
||||
const { nodes, state } = await server.remote().listAll();
|
||||
expect(nodes.length).toBe(726);
|
||||
expect(nodes.filter((node) => node.kind === 'directory').length).toBe(6);
|
||||
expect(state).toBe(server.account().coll.state());
|
||||
});
|
||||
|
||||
it('fails rather than give part of the tree', async () => {
|
||||
const server = big({});
|
||||
let calls = 0;
|
||||
server.beforeRequest = () => {
|
||||
calls += 1;
|
||||
if (calls === 3) server.offline = true;
|
||||
};
|
||||
await expect(server.remote().listAll()).rejects.toMatchObject({ name: 'TransportError' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('writes', () => {
|
||||
it('creates in the draft Stalwart 1.0 wants, and folders without content', async () => {
|
||||
const server = new FakeServer();
|
||||
const accountCaps = server.session.accounts.acc1.accountCapabilities as Record<string, Record<string, unknown>>;
|
||||
accountCaps['urn:ietf:params:jmap:filenode'].supportedNodeTypes = ['File', 'Directory'];
|
||||
const remote = server.remote();
|
||||
const folder = await remote.createFolder('Docs', null);
|
||||
const blob = await remote.upload(new TextEncoder().encode('hi'), 'text/plain; charset=utf-8');
|
||||
await remote.createFile('a.txt', folder.id, blob);
|
||||
const creates = server.sets.map((set) => Object.values(set.create as Record<string, unknown>)[0]);
|
||||
expect(creates[0]).toEqual({ '@type': 'Directory', name: 'Docs' });
|
||||
expect(creates[1]).toEqual({ '@type': 'File', name: 'a.txt', parentId: folder.id, blobId: blob.blobId, mediaType: 'text/plain' });
|
||||
});
|
||||
|
||||
it('moves into the Files trash the way the Files screen does', async () => {
|
||||
const server = new FakeServer();
|
||||
const remote = server.remote();
|
||||
const a = server.file('a.txt', null, 'a');
|
||||
const { trashId, batchId } = await remote.trash([a.id], null, null, 1_790_000_000_000);
|
||||
expect(server.nodes.get(trashId)?.name).toBe('.Trash');
|
||||
expect(server.nodes.get(batchId)?.name).toBe('1790000000000~');
|
||||
expect(server.nodes.get(a.id)?.parentId).toBe(batchId);
|
||||
});
|
||||
|
||||
it('keeps the tree in order as changes come', () => {
|
||||
const tree = new RemoteTree();
|
||||
tree.reset([
|
||||
{ id: 'd', parentId: null, name: 'D', kind: 'directory', blobId: null, size: 0, modifiedMs: 0, type: '' },
|
||||
{ id: 'f', parentId: 'd', name: 'f', kind: 'file', blobId: 'b', size: 1, modifiedMs: 0, type: '' },
|
||||
{ id: 't', parentId: null, name: '.Trash', kind: 'directory', blobId: null, size: 0, modifiedMs: 0, type: '' },
|
||||
{ id: 'x', parentId: 't', name: 'x', kind: 'file', blobId: 'b', size: 1, modifiedMs: 0, type: '' },
|
||||
], 's1');
|
||||
expect(tree.subtree(null)?.map((node) => node.id)).toEqual(['d', 'f']);
|
||||
expect(tree.inTrash('x')).toBe(true);
|
||||
tree.apply({ changed: [], destroyed: ['d'] });
|
||||
expect(tree.get('f')).toBeUndefined();
|
||||
expect(tree.subtree('d')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('names on disk', () => {
|
||||
const win = namingFor('win32');
|
||||
|
||||
it('maps what Windows refuses and leaves the rest', () => {
|
||||
expect(diskName('a<b>c:d"e|f?g*h\\i.txt', win)).toBe('a<b>c:d"e|f?g*h\i.txt');
|
||||
expect(diskName('CON', win)).toBe('CON_');
|
||||
expect(diskName('nul.tar.gz', win)).toBe('nul_.tar.gz');
|
||||
expect(diskName('com1.txt', win)).toBe('com1_.txt');
|
||||
expect(diskName('console.txt', win)).toBe('console.txt');
|
||||
expect(diskName('ends with dot.', win)).toBe('ends with dot._');
|
||||
expect(diskName('ends with space ', win)).toBe('ends with space _');
|
||||
expect(diskName('tab\there', win)).toBe('tab␉here');
|
||||
expect(diskName('Grüße, Ärger.txt', win)).toBe('Grüße, Ärger.txt');
|
||||
expect(diskName('a:b', namingFor('linux'))).toBe('a:b');
|
||||
});
|
||||
|
||||
it('numbers a second name that differs only in case', () => {
|
||||
const taken = new Set([nameKey('Report.txt', win)]);
|
||||
expect(freeLocalName('report.txt', taken, win)).toBe('report (2).txt');
|
||||
const linux = namingFor('linux');
|
||||
expect(freeLocalName('report.txt', new Set([nameKey('Report.txt', linux)]), linux)).toBe('report.txt');
|
||||
});
|
||||
|
||||
it('names a conflict copy with the device and the time', () => {
|
||||
expect(conflictName('report.final.pdf', 'Windows', new Date(2026, 10, 4, 9, 5))).toBe('report.final (conflict, Windows, 2026-11-04 09.05).pdf');
|
||||
expect(conflictName('.env', 'Mac', new Date(2026, 0, 1, 0, 0))).toBe('.env (conflict, Mac, 2026-01-01 00.00)');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* The desktop app's Files on this computer calls, taken once per document in its first render
|
||||
* (WindowControlsHost), as auth.claim and appLock.claim are: a same-origin plugin frame
|
||||
* reaches `bulwarkDesktop` through `parent`, and main can't tell its calls from the page's.
|
||||
* Whoever comes after the page gets nothing from the preload. Main also answers only the main
|
||||
* window, so a pop-out's own claim is just its share of nothing.
|
||||
*/
|
||||
|
||||
import { getDesktopBridge } from '@/lib/desktop/bridge';
|
||||
import type { FilesBridge, FilesControls } from '@/lib/desktop/types';
|
||||
|
||||
let claimedFrom: FilesBridge | null | undefined;
|
||||
let claimed: FilesControls | null = null;
|
||||
|
||||
export function claimFilesControls(): FilesControls | null {
|
||||
const member = getDesktopBridge()?.files ?? null;
|
||||
if (member !== claimedFrom) {
|
||||
claimedFrom = member;
|
||||
claimed = member?.claim?.() ?? null;
|
||||
}
|
||||
return claimed;
|
||||
}
|
||||
|
||||
/** Tests only. */
|
||||
export function resetFilesControlsForTests(): void {
|
||||
claimedFrom = undefined;
|
||||
claimed = null;
|
||||
}
|
||||
@@ -0,0 +1,688 @@
|
||||
/**
|
||||
* Files on this computer: the engine for every root of the signed-in accounts. It keeps each
|
||||
* account's FileNode tree current (a listing once, then FileNode/changes on push and on a slow
|
||||
* poll), runs a RootSync per root when either side changed, and answers the drive's fetches.
|
||||
*
|
||||
* Main only does the disk (lib/desktop/types.ts FilesControls); everything that decides is here,
|
||||
* in the page, with the app's own JMAP session. The host (host.ts) starts it in the main window
|
||||
* and tells it which accounts are signed in.
|
||||
*
|
||||
* When a pass runs:
|
||||
* - main's `onChange` for a root: soon after, so a burst of writes is one pass. `paths: null` is
|
||||
* what a new, resumed or re-armed watch says first. A root id nobody knows: ask for the roots.
|
||||
* - FileNode changes that touch a root: at once.
|
||||
* - offline: again after 5 s, then longer, up to 5 minutes, and at once when the host hears the
|
||||
* network is back.
|
||||
* - every 10 minutes regardless, in case a change went unheard.
|
||||
*/
|
||||
|
||||
import type { FilesControls, FilesFetchRequest, FilesRoot } from '@/lib/desktop/types';
|
||||
import { isOffline, type FilesSyncErrorName } from './errors';
|
||||
import type { DiskNaming } from './names';
|
||||
import { RemoteTree, type FilesRemote } from './remote';
|
||||
import { RootSync, type AccountLink, type ActivityInput } from './root-sync';
|
||||
import type { FilesSyncActivity, FilesSyncCoverage, FilesSyncItemStatus, FilesSyncRootStatus } from './types';
|
||||
|
||||
export const ACTIVITY_LIMIT = 200;
|
||||
const PIECE = 1024 * 1024;
|
||||
const MOST_SOON = 5;
|
||||
|
||||
export interface EngineTiming {
|
||||
/** After main says something changed on disk. */
|
||||
localDelayMs: number;
|
||||
/** After a push says Files changed. */
|
||||
remoteDelayMs: number;
|
||||
/** /changes without a push, per account. */
|
||||
pollMs: number;
|
||||
/** A full pass of every root regardless. */
|
||||
rescanMs: number;
|
||||
/** Waits while offline, one after another; the last repeats. */
|
||||
retryMs: number[];
|
||||
/** Again after a pass where something changed while it was read. */
|
||||
soonMs: number;
|
||||
/** How long a drive fetch waits for the first listing. */
|
||||
fetchWaitMs: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_TIMING: EngineTiming = {
|
||||
localDelayMs: 1500,
|
||||
remoteDelayMs: 300,
|
||||
pollMs: 60_000,
|
||||
rescanMs: 10 * 60_000,
|
||||
retryMs: [5_000, 15_000, 30_000, 60_000, 120_000, 300_000],
|
||||
soonMs: 3_000,
|
||||
fetchWaitMs: 20_000,
|
||||
};
|
||||
|
||||
export interface EngineOptions {
|
||||
controls: FilesControls;
|
||||
naming: DiskNaming;
|
||||
device: string;
|
||||
readUrl?: (url: string) => Promise<Uint8Array>;
|
||||
now?: () => number;
|
||||
timing?: Partial<EngineTiming>;
|
||||
/** The organisation's word on a root: null when it may sync. */
|
||||
blocked?: (root: FilesRoot) => FilesSyncErrorName | null;
|
||||
/** May this account's files be downloaded to this computer? */
|
||||
downloadsAllowed?: (account: string) => boolean;
|
||||
/** Something the UI shows changed. */
|
||||
onUpdate?: () => void;
|
||||
}
|
||||
|
||||
async function fetchBytes(url: string): Promise<Uint8Array> {
|
||||
const response = await fetch(url, { cache: 'no-store' });
|
||||
if (!response.ok) throw new Error(`read failed: ${response.status}`);
|
||||
return new Uint8Array(await response.arrayBuffer());
|
||||
}
|
||||
|
||||
class Account implements AccountLink {
|
||||
readonly tree = new RemoteTree();
|
||||
private loaded = false;
|
||||
private running: Promise<void> | null = null;
|
||||
private again = false;
|
||||
private poll: ReturnType<typeof setInterval> | null = null;
|
||||
private readyWaiters: (() => void)[] = [];
|
||||
|
||||
constructor(
|
||||
readonly account: string,
|
||||
public remote: FilesRemote,
|
||||
private readonly changed: (account: Account, ids: Set<string>, origin: string | null) => void,
|
||||
) {}
|
||||
|
||||
get isLoaded(): boolean {
|
||||
return this.loaded;
|
||||
}
|
||||
|
||||
startPolling(ms: number, run: () => void): void {
|
||||
this.stopPolling();
|
||||
this.poll = setInterval(run, ms);
|
||||
(this.poll as { unref?: () => void }).unref?.();
|
||||
}
|
||||
|
||||
stopPolling(): void {
|
||||
if (this.poll) clearInterval(this.poll);
|
||||
this.poll = null;
|
||||
}
|
||||
|
||||
/** Waits for the first listing, up to `ms`. */
|
||||
ready(ms: number): Promise<boolean> {
|
||||
if (this.loaded) return Promise.resolve(true);
|
||||
return new Promise((resolve) => {
|
||||
const timer = setTimeout(() => resolve(false), ms);
|
||||
this.readyWaiters.push(() => {
|
||||
clearTimeout(timer);
|
||||
resolve(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
refresh(origin: string | null = null): Promise<void> {
|
||||
if (this.running) {
|
||||
this.again = true;
|
||||
return this.running;
|
||||
}
|
||||
this.running = (async () => {
|
||||
try {
|
||||
do {
|
||||
this.again = false;
|
||||
await this.catchUp(origin);
|
||||
} while (this.again);
|
||||
} finally {
|
||||
this.running = null;
|
||||
}
|
||||
})();
|
||||
return this.running;
|
||||
}
|
||||
|
||||
private async catchUp(origin: string | null): Promise<void> {
|
||||
const ids = new Set<string>();
|
||||
if (!this.loaded || !this.tree.state) {
|
||||
await this.listAll(ids);
|
||||
} else {
|
||||
const written = [...this.tree.written];
|
||||
const heard = new Set<string>();
|
||||
const outcome = await this.remote.changes(this.tree.state, (batch, state) => {
|
||||
for (const node of batch.changed) {
|
||||
ids.add(node.id);
|
||||
heard.add(node.id);
|
||||
}
|
||||
for (const id of batch.destroyed) {
|
||||
ids.add(id);
|
||||
heard.add(id);
|
||||
}
|
||||
this.tree.apply(batch);
|
||||
this.tree.state = state;
|
||||
});
|
||||
// The server can't say what changed since then: read it all again. Only here.
|
||||
if (outcome.outcome === 'resync') {
|
||||
await this.listAll(ids);
|
||||
} else {
|
||||
for (const id of written) this.tree.written.delete(id);
|
||||
// Made here and deleted elsewhere since: /changes says neither.
|
||||
const unheard = written.filter((id) => !heard.has(id) && this.tree.get(id));
|
||||
if (unheard.length > 0) {
|
||||
const still = new Set((await this.remote.get(unheard)).map((node) => node.id));
|
||||
for (const id of unheard) {
|
||||
if (still.has(id)) continue;
|
||||
this.tree.remove(id);
|
||||
ids.add(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ids.size > 0) this.changed(this, ids, origin);
|
||||
}
|
||||
|
||||
private async listAll(ids: Set<string>): Promise<void> {
|
||||
const before = new Map(this.tree.nodes);
|
||||
const { nodes, state } = await this.remote.listAll();
|
||||
this.tree.reset(nodes, state);
|
||||
// Whatever changed while it was read.
|
||||
await this.remote.changes(state, (batch, next) => {
|
||||
this.tree.apply(batch);
|
||||
this.tree.state = next;
|
||||
}).then((outcome) => {
|
||||
if (outcome.outcome === 'resync') throw new Error('The FileNode state was refused right after a listing');
|
||||
});
|
||||
for (const [id, node] of this.tree.nodes) {
|
||||
const old = before.get(id);
|
||||
if (!old || old.parentId !== node.parentId || old.name !== node.name || old.blobId !== node.blobId) ids.add(id);
|
||||
}
|
||||
for (const id of before.keys()) if (!this.tree.nodes.has(id)) ids.add(id);
|
||||
const first = !this.loaded;
|
||||
this.loaded = true;
|
||||
if (first) for (const waiter of this.readyWaiters.splice(0)) waiter();
|
||||
}
|
||||
}
|
||||
|
||||
class Runner {
|
||||
private timer: ReturnType<typeof setTimeout> | null = null;
|
||||
private due = 0;
|
||||
private running: Promise<void> | null = null;
|
||||
private again = false;
|
||||
private retryAt = 0;
|
||||
private soon = 0;
|
||||
private stopped = false;
|
||||
|
||||
constructor(readonly sync: RootSync, private readonly timing: EngineTiming) {}
|
||||
|
||||
get busy(): boolean {
|
||||
return this.running !== null || (this.timer !== null && this.due - Date.now() <= Math.max(this.timing.localDelayMs, this.timing.soonMs));
|
||||
}
|
||||
|
||||
get offline(): boolean {
|
||||
return this.sync.status.state === 'offline';
|
||||
}
|
||||
|
||||
request(delay: number): void {
|
||||
if (this.stopped) return;
|
||||
if (this.running) {
|
||||
this.again = true;
|
||||
return;
|
||||
}
|
||||
const due = Date.now() + delay;
|
||||
if (this.timer) {
|
||||
if (this.due <= due) return;
|
||||
clearTimeout(this.timer);
|
||||
}
|
||||
this.due = due;
|
||||
this.timer = setTimeout(() => {
|
||||
this.timer = null;
|
||||
void this.run();
|
||||
}, delay);
|
||||
}
|
||||
|
||||
private async run(): Promise<void> {
|
||||
if (this.stopped || this.running) return;
|
||||
const pass = this.sync.pass().catch((error: unknown) => {
|
||||
console.warn('[files-sync] A pass stopped:', error);
|
||||
return 'retry' as const;
|
||||
});
|
||||
this.running = pass.then(() => {});
|
||||
const outcome = await pass;
|
||||
this.running = null;
|
||||
if (this.stopped) return;
|
||||
if (this.again) {
|
||||
this.again = false;
|
||||
this.request(0);
|
||||
return;
|
||||
}
|
||||
if (outcome === 'retry') {
|
||||
const waits = this.timing.retryMs;
|
||||
this.request(waits[Math.min(this.retryAt, waits.length - 1)]);
|
||||
this.retryAt += 1;
|
||||
return;
|
||||
}
|
||||
this.retryAt = 0;
|
||||
if (outcome === 'soon' && this.soon < MOST_SOON) {
|
||||
this.soon += 1;
|
||||
this.request(this.timing.soonMs);
|
||||
return;
|
||||
}
|
||||
this.soon = 0;
|
||||
}
|
||||
|
||||
/** Waits for what's running and whatever is due within the short delays. For tests and shutdown. */
|
||||
async settle(): Promise<void> {
|
||||
for (let i = 0; i < 1000; i += 1) {
|
||||
if (this.running) {
|
||||
await this.running;
|
||||
continue;
|
||||
}
|
||||
if (this.timer && this.due - Date.now() <= Math.max(this.timing.localDelayMs, this.timing.soonMs, this.timing.remoteDelayMs)) {
|
||||
await new Promise((resolve) => setTimeout(resolve, Math.max(0, this.due - Date.now()) + 1));
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
this.stopped = true;
|
||||
this.sync.stopped = true;
|
||||
if (this.timer) clearTimeout(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
export class FilesSyncEngine {
|
||||
roots: FilesRoot[] = [];
|
||||
activity: FilesSyncActivity[] = [];
|
||||
private readonly accounts = new Map<string, Account>();
|
||||
private readonly runners = new Map<string, Runner>();
|
||||
private readonly timing: EngineTiming;
|
||||
private readonly fetches = new Map<string, { cancelled: boolean }>();
|
||||
private unsubscribe: (() => void)[] = [];
|
||||
private rescan: ReturnType<typeof setInterval> | null = null;
|
||||
private rootsRun: Promise<void> | null = null;
|
||||
private rootsAgain = false;
|
||||
private activitySeq = 0;
|
||||
private stopped = false;
|
||||
private readonly readUrl: (url: string) => Promise<Uint8Array>;
|
||||
private readonly now: () => number;
|
||||
|
||||
constructor(private readonly options: EngineOptions) {
|
||||
this.timing = { ...DEFAULT_TIMING, ...options.timing };
|
||||
this.readUrl = options.readUrl ?? fetchBytes;
|
||||
this.now = options.now ?? Date.now;
|
||||
}
|
||||
|
||||
get controls(): FilesControls {
|
||||
return this.options.controls;
|
||||
}
|
||||
|
||||
start(): void {
|
||||
const { controls } = this.options;
|
||||
this.unsubscribe.push(controls.onChange((event) => {
|
||||
const runner = this.runners.get(event.rootId);
|
||||
if (!runner) {
|
||||
void this.refreshRoots();
|
||||
return;
|
||||
}
|
||||
runner.request(event.paths === null ? 0 : this.timing.localDelayMs);
|
||||
}));
|
||||
const drive = controls.drive;
|
||||
if (drive) {
|
||||
this.unsubscribe.push(drive.onFetch((request) => void this.fetch(request)));
|
||||
this.unsubscribe.push(drive.onFetchCancel((fetchId) => {
|
||||
const fetch = this.fetches.get(fetchId);
|
||||
if (fetch) fetch.cancelled = true;
|
||||
}));
|
||||
}
|
||||
this.rescan = setInterval(() => {
|
||||
for (const runner of this.runners.values()) runner.request(0);
|
||||
}, this.timing.rescanMs);
|
||||
(this.rescan as { unref?: () => void }).unref?.();
|
||||
void this.refreshRoots();
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
this.stopped = true;
|
||||
for (const stop of this.unsubscribe.splice(0)) stop();
|
||||
if (this.rescan) clearInterval(this.rescan);
|
||||
for (const runner of this.runners.values()) runner.stop();
|
||||
this.runners.clear();
|
||||
for (const account of this.accounts.values()) account.stopPolling();
|
||||
this.accounts.clear();
|
||||
for (const fetch of this.fetches.values()) fetch.cancelled = true;
|
||||
}
|
||||
|
||||
// ─── Accounts ───────────────────────────────────────────────
|
||||
|
||||
/** A signed-in account and its way to Files. Its roots start. */
|
||||
setAccount(account: string, remote: FilesRemote): void {
|
||||
if (this.stopped) return;
|
||||
const known = this.accounts.get(account);
|
||||
if (known) {
|
||||
known.remote = remote;
|
||||
return;
|
||||
}
|
||||
const entry = new Account(account, remote, (from, ids, origin) => this.remoteTouched(from, ids, origin));
|
||||
this.accounts.set(account, entry);
|
||||
entry.startPolling(this.timing.pollMs, () => void this.pollAccount(account));
|
||||
this.applyRoots();
|
||||
}
|
||||
|
||||
/** Signed out, or gone: its roots stop. Nothing on disk changes. */
|
||||
dropAccount(account: string): void {
|
||||
const entry = this.accounts.get(account);
|
||||
if (!entry) return;
|
||||
entry.stopPolling();
|
||||
this.accounts.delete(account);
|
||||
for (const [id, runner] of this.runners) {
|
||||
if (runner.sync.root.account !== account) continue;
|
||||
runner.stop();
|
||||
this.runners.delete(id);
|
||||
}
|
||||
this.update();
|
||||
}
|
||||
|
||||
hasAccount(account: string): boolean {
|
||||
return this.accounts.has(account);
|
||||
}
|
||||
|
||||
/** A push said FileNode changed in this account. */
|
||||
remoteChanged(account: string): void {
|
||||
void this.pollAccount(account);
|
||||
}
|
||||
|
||||
private async pollAccount(account: string): Promise<void> {
|
||||
const entry = this.accounts.get(account);
|
||||
if (!entry?.isLoaded) {
|
||||
// Nothing listed yet: a root's pass lists it.
|
||||
for (const runner of this.runnersOf(account)) runner.request(this.timing.remoteDelayMs);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await entry.refresh();
|
||||
} catch (error) {
|
||||
if (!isOffline(error)) console.warn('[files-sync] Reading changes failed:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/** The network is back: whatever waits goes now. */
|
||||
retryNow(): void {
|
||||
for (const runner of this.runners.values()) if (runner.offline) runner.request(0);
|
||||
}
|
||||
|
||||
private runnersOf(account: string): Runner[] {
|
||||
return [...this.runners.values()].filter((runner) => runner.sync.root.account === account);
|
||||
}
|
||||
|
||||
private remoteTouched(account: Account, ids: Set<string>, origin: string | null): void {
|
||||
for (const runner of this.runnersOf(account.account)) {
|
||||
if (runner.sync.root.id === origin) continue;
|
||||
const remoteId = runner.sync.root.remoteId;
|
||||
const touched = [...ids].some((id) => !!runner.sync.item(id) || account.tree.isUnder(id, remoteId) || id === remoteId);
|
||||
if (touched) runner.request(this.timing.remoteDelayMs);
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Roots ──────────────────────────────────────────────────
|
||||
|
||||
/** Asks main for the roots again and starts, changes or stops runners to match. */
|
||||
refreshRoots(): Promise<void> {
|
||||
if (this.rootsRun) {
|
||||
this.rootsAgain = true;
|
||||
return this.rootsRun;
|
||||
}
|
||||
this.rootsRun = (async () => {
|
||||
try {
|
||||
do {
|
||||
this.rootsAgain = false;
|
||||
try {
|
||||
this.roots = await this.options.controls.roots();
|
||||
} catch {
|
||||
this.roots = [];
|
||||
}
|
||||
this.applyRoots();
|
||||
} while (this.rootsAgain && !this.stopped);
|
||||
} finally {
|
||||
this.rootsRun = null;
|
||||
}
|
||||
})();
|
||||
return this.rootsRun;
|
||||
}
|
||||
|
||||
private applyRoots(): void {
|
||||
if (this.stopped) return;
|
||||
const live = new Map(this.roots.map((root) => [root.id, root]));
|
||||
for (const [id, runner] of this.runners) {
|
||||
const root = live.get(id);
|
||||
if (!root || !this.accounts.has(root.account)) {
|
||||
runner.stop();
|
||||
this.runners.delete(id);
|
||||
continue;
|
||||
}
|
||||
const wasPaused = runner.sync.root.paused;
|
||||
runner.sync.setRoot(root);
|
||||
if (wasPaused && !root.paused) runner.request(0);
|
||||
}
|
||||
for (const root of this.roots) {
|
||||
if (this.runners.has(root.id)) continue;
|
||||
const account = this.accounts.get(root.account);
|
||||
if (!account) continue;
|
||||
const sync = new RootSync(root, {
|
||||
account: account.account,
|
||||
tree: account.tree,
|
||||
get remote() {
|
||||
return account.remote;
|
||||
},
|
||||
refresh: () => account.refresh(root.id),
|
||||
}, {
|
||||
controls: this.options.controls,
|
||||
naming: this.options.naming,
|
||||
device: this.options.device,
|
||||
now: this.now,
|
||||
readUrl: this.readUrl,
|
||||
activity: (entry) => this.addActivity(entry),
|
||||
changed: () => this.update(),
|
||||
blocked: (current) => this.options.blocked?.(current) ?? null,
|
||||
});
|
||||
const runner = new Runner(sync, this.timing);
|
||||
this.runners.set(root.id, runner);
|
||||
runner.request(0);
|
||||
}
|
||||
this.update();
|
||||
}
|
||||
|
||||
root(rootId: string): RootSync | null {
|
||||
return this.runners.get(rootId)?.sync ?? null;
|
||||
}
|
||||
|
||||
/** Runs a pass of a root (all of them without an id) now. */
|
||||
syncNow(rootId?: string): void {
|
||||
for (const [id, runner] of this.runners) if (!rootId || id === rootId) runner.request(0);
|
||||
}
|
||||
|
||||
/** Waits until nothing runs or is due shortly. For tests and the sign-out. */
|
||||
async settled(): Promise<void> {
|
||||
for (let i = 0; i < 50; i += 1) {
|
||||
if (this.rootsRun) await this.rootsRun;
|
||||
await Promise.all([...this.runners.values()].map((runner) => runner.settle()));
|
||||
if (!this.rootsRun && [...this.runners.values()].every((runner) => !runner.busy)) return;
|
||||
}
|
||||
}
|
||||
|
||||
async setPaused(rootId: string, paused: boolean): Promise<void> {
|
||||
await this.options.controls.setPaused(rootId, paused);
|
||||
await this.refreshRoots();
|
||||
}
|
||||
|
||||
async removeRoot(rootId: string): Promise<void> {
|
||||
await this.options.controls.removeRoot(rootId);
|
||||
await this.refreshRoots();
|
||||
}
|
||||
|
||||
confirmMassDelete(rootId: string, allow: boolean): void {
|
||||
const runner = this.runners.get(rootId);
|
||||
if (!runner) return;
|
||||
runner.sync.answerMassDelete(allow);
|
||||
runner.request(0);
|
||||
}
|
||||
|
||||
/** The drive's record goes before its folder does (sign-out): the next sign-in starts from an empty folder. */
|
||||
async forgetRoot(rootId: string): Promise<void> {
|
||||
const runner = this.runners.get(rootId);
|
||||
if (!runner) return;
|
||||
runner.stop();
|
||||
await runner.sync.forget();
|
||||
this.runners.delete(rootId);
|
||||
}
|
||||
|
||||
// ─── What the UI reads ──────────────────────────────────────
|
||||
|
||||
status(): Record<string, FilesSyncRootStatus> {
|
||||
const out: Record<string, FilesSyncRootStatus> = {};
|
||||
for (const [id, runner] of this.runners) out[id] = runner.sync.status;
|
||||
return out;
|
||||
}
|
||||
|
||||
items(account: string): Record<string, FilesSyncItemStatus> {
|
||||
const out: Record<string, FilesSyncItemStatus> = {};
|
||||
for (const runner of this.runnersOf(account)) Object.assign(out, runner.sync.items);
|
||||
return out;
|
||||
}
|
||||
|
||||
coverage(account: string, nodeId: string): FilesSyncCoverage | null {
|
||||
for (const runner of this.runnersOf(account)) {
|
||||
const { root } = runner.sync;
|
||||
if (root.remoteId === nodeId) return { rootId: root.id, kind: root.kind, path: '' };
|
||||
const item = runner.sync.item(nodeId);
|
||||
if (item) return { rootId: root.id, kind: root.kind, path: item.path };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
clearActivity(): void {
|
||||
this.activity = [];
|
||||
this.update();
|
||||
}
|
||||
|
||||
private addActivity(entry: ActivityInput): void {
|
||||
this.activitySeq += 1;
|
||||
this.activity = [{ id: `${this.now()}-${this.activitySeq}`, at: this.now(), ...entry }, ...this.activity].slice(0, ACTIVITY_LIMIT);
|
||||
this.update();
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
this.options.onUpdate?.();
|
||||
}
|
||||
|
||||
// ─── The drive's fetches ────────────────────────────────────
|
||||
|
||||
/**
|
||||
* Someone opened a file on the drive that isn't on the disk: stream its content to main, from
|
||||
* where Windows asked (rounded down to 4 KB) to the end, in order. Main fails a fetch it hears
|
||||
* nothing of for 30 s, and Windows cancels after 60 s.
|
||||
*/
|
||||
async fetch(request: FilesFetchRequest): Promise<void> {
|
||||
const drive = this.options.controls.drive;
|
||||
if (!drive) return;
|
||||
const handle = { cancelled: false };
|
||||
this.fetches.set(request.fetchId, handle);
|
||||
try {
|
||||
let runner = this.runners.get(request.rootId);
|
||||
if (!runner) {
|
||||
await this.refreshRoots();
|
||||
runner = this.runners.get(request.rootId);
|
||||
}
|
||||
if (!runner || runner.sync.root.kind !== 'drive') {
|
||||
drive.fail(request.fetchId, this.accountsKnown(request.rootId) ? 'failed' : 'offline');
|
||||
return;
|
||||
}
|
||||
const { root } = runner.sync;
|
||||
if (this.options.downloadsAllowed && !this.options.downloadsAllowed(root.account)) {
|
||||
drive.fail(request.fetchId, 'failed');
|
||||
return;
|
||||
}
|
||||
const account = this.accounts.get(root.account);
|
||||
if (!account || !(await account.ready(this.timing.fetchWaitMs))) {
|
||||
drive.fail(request.fetchId, 'offline');
|
||||
return;
|
||||
}
|
||||
// The newest version, not one deleted or replaced since the last push. Offline: what's known.
|
||||
await account.refresh().catch(() => {});
|
||||
const node = account.tree.get(request.identity);
|
||||
if (!node || node.kind !== 'file' || account.tree.inTrash(node.id)) {
|
||||
drive.fail(request.fetchId, 'missing');
|
||||
runner.request(this.timing.remoteDelayMs);
|
||||
return;
|
||||
}
|
||||
if (node.size !== request.total) {
|
||||
// The placeholder is older than the file: the pass puts the new one there.
|
||||
drive.fail(request.fetchId, 'failed');
|
||||
runner.request(0);
|
||||
return;
|
||||
}
|
||||
await this.stream(request, node, account, handle);
|
||||
} catch (error) {
|
||||
if (!handle.cancelled) drive.fail(request.fetchId, isOffline(error) ? 'offline' : 'failed');
|
||||
} finally {
|
||||
this.fetches.delete(request.fetchId);
|
||||
}
|
||||
}
|
||||
|
||||
private accountsKnown(rootId: string): boolean {
|
||||
const root = this.roots.find((entry) => entry.id === rootId);
|
||||
return !!root && this.accounts.has(root.account);
|
||||
}
|
||||
|
||||
private async stream(request: FilesFetchRequest, node: { blobId: string | null; type: string; name: string; size: number }, account: Account, handle: { cancelled: boolean }): Promise<void> {
|
||||
const drive = this.options.controls.drive;
|
||||
if (!drive) return;
|
||||
const start = Math.max(0, request.offset);
|
||||
let at = 0;
|
||||
let sent = start;
|
||||
let pending: Uint8Array[] = [];
|
||||
let pendingBytes = 0;
|
||||
let chain: Promise<boolean> = Promise.resolve(true);
|
||||
let refused = false;
|
||||
const STOP = 'files-sync:fetch-stopped';
|
||||
const flush = (all: boolean) => {
|
||||
if (pendingBytes === 0 || (!all && pendingBytes < PIECE)) return;
|
||||
const piece = joinParts(pending, pendingBytes);
|
||||
pending = [];
|
||||
pendingBytes = 0;
|
||||
const offset = sent;
|
||||
sent += piece.length;
|
||||
chain = chain.then(async (good) => {
|
||||
if (!good || handle.cancelled) return false;
|
||||
const taken = await drive.supply(request.fetchId, offset, piece);
|
||||
if (!taken) refused = true;
|
||||
return taken;
|
||||
});
|
||||
};
|
||||
try {
|
||||
await account.remote.download(node, (part) => {
|
||||
if (handle.cancelled || refused) throw new Error(STOP);
|
||||
let slice = part;
|
||||
if (at + part.length <= start) {
|
||||
at += part.length;
|
||||
return;
|
||||
}
|
||||
if (at < start) slice = part.subarray(start - at);
|
||||
at += part.length;
|
||||
pending.push(slice);
|
||||
pendingBytes += slice.length;
|
||||
flush(false);
|
||||
});
|
||||
} catch (error) {
|
||||
if ((error as Error)?.message === STOP) return;
|
||||
throw error;
|
||||
}
|
||||
flush(true);
|
||||
await chain;
|
||||
}
|
||||
}
|
||||
|
||||
function joinParts(parts: Uint8Array[], size: number): Uint8Array {
|
||||
if (parts.length === 1) return parts[0];
|
||||
const out = new Uint8Array(size);
|
||||
let at = 0;
|
||||
for (const part of parts) {
|
||||
out.set(part, at);
|
||||
at += part.length;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* What went wrong, in the words the settings page shows: keys under `files_sync.errors.`
|
||||
* (the ui writes the strings). Errors are told apart by name, not instanceof: Next has more
|
||||
* than one copy of a module.
|
||||
*/
|
||||
|
||||
import type { FilesError } from '@/lib/desktop/types';
|
||||
|
||||
export type FilesSyncErrorName =
|
||||
| 'offline'
|
||||
| 'server_refused'
|
||||
| 'too_large'
|
||||
| 'name_invalid'
|
||||
| 'disk_full'
|
||||
| 'denied'
|
||||
| 'busy'
|
||||
| 'quota'
|
||||
| 'not_found'
|
||||
| 'policy'
|
||||
| 'failed';
|
||||
|
||||
/** The key in the `files_sync` namespace. */
|
||||
export function errorKey(name: FilesSyncErrorName): string {
|
||||
return `errors.${name}`;
|
||||
}
|
||||
|
||||
/** A disk answer the engine can't go on from for this item. */
|
||||
export class LocalError extends Error {
|
||||
constructor(readonly error: FilesError) {
|
||||
super(`files:${error}`);
|
||||
this.name = 'LocalError';
|
||||
}
|
||||
}
|
||||
|
||||
export function localErrorName(error: FilesError): FilesSyncErrorName {
|
||||
switch (error) {
|
||||
case 'full':
|
||||
return 'disk_full';
|
||||
case 'denied':
|
||||
case 'outside':
|
||||
case 'gesture':
|
||||
return 'denied';
|
||||
case 'busy':
|
||||
return 'busy';
|
||||
case 'name':
|
||||
return 'name_invalid';
|
||||
case 'policy':
|
||||
return 'policy';
|
||||
case 'missing':
|
||||
return 'not_found';
|
||||
default:
|
||||
return 'failed';
|
||||
}
|
||||
}
|
||||
|
||||
/** The server can't be reached, or is too busy now: the work waits, nothing failed. */
|
||||
export function isOffline(error: unknown): boolean {
|
||||
const e = error as { name?: string; kind?: string; status?: number } | null;
|
||||
if (e?.name !== 'TransportError') return false;
|
||||
if (e.kind === 'network' || e.kind === 'rate') return true;
|
||||
return e.kind === 'http' && typeof e.status === 'number' && e.status >= 500;
|
||||
}
|
||||
|
||||
/** The server no longer takes this login. */
|
||||
export function isAuthRefused(error: unknown): boolean {
|
||||
const e = error as { name?: string; kind?: string } | null;
|
||||
return e?.name === 'TransportError' && e.kind === 'auth';
|
||||
}
|
||||
|
||||
/** What a server error on one item means. */
|
||||
export function remoteErrorName(error: unknown): FilesSyncErrorName {
|
||||
const e = error as { name?: string; type?: string; status?: number } | null;
|
||||
if (isOffline(error)) return 'offline';
|
||||
if (isAuthRefused(error)) return 'server_refused';
|
||||
if (e?.name === 'TransportError' && e.status === 413) return 'too_large';
|
||||
switch (e?.type) {
|
||||
case 'overQuota':
|
||||
return 'quota';
|
||||
case 'forbidden':
|
||||
case 'accountReadOnly':
|
||||
return 'denied';
|
||||
case 'notFound':
|
||||
return 'not_found';
|
||||
case 'tooLarge':
|
||||
return 'too_large';
|
||||
case 'invalidProperties':
|
||||
case 'alreadyExists':
|
||||
return 'name_invalid';
|
||||
default:
|
||||
return 'failed';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
/**
|
||||
* Files on this computer in the page: starts the engine in the desktop app's main window, for
|
||||
* the signed-in accounts, publishes what it does to stores/files-sync-store.ts and registers the
|
||||
* controller the settings page and the Files screen use. The React side
|
||||
* (components/providers/files-sync-host.tsx) feeds it the accounts, push and the policies.
|
||||
*
|
||||
* Each account reaches Files through the app's own JMAP session: the session resource and
|
||||
* Authorization header the app's client holds, read when a request goes and renewed through
|
||||
* it (as offline mode does). Nothing here writes a token or a password anywhere.
|
||||
*
|
||||
* What happens to an account's roots when it leaves (FILES-SYNC-BRIEF.md):
|
||||
* - sign-out: the drive goes (`signed-out` keeps the wish, so the next sign-in brings it back
|
||||
* without a click), and the folders stop syncing until then;
|
||||
* - a wipe (lib/offline/wipe-registry.ts): the drive goes with everything in it, and the
|
||||
* folders are forgotten; their files stay, they were the user's;
|
||||
* - a refused login the server was sure of: the same as a wipe for these.
|
||||
*/
|
||||
|
||||
import type { FilesControls, FilesDriveState, FilesResult, FilesRoot } from '@/lib/desktop/types';
|
||||
import { FetchTransport, type StoreSession } from '@/lib/store/engine/transport';
|
||||
import { FilesSyncEngine, type EngineTiming } from './engine';
|
||||
import type { FilesSyncErrorName } from './errors';
|
||||
import { namingFor } from './names';
|
||||
import { FilesRemote } from './remote';
|
||||
import type { FilesSyncController, FilesSyncSnapshot } from './types';
|
||||
|
||||
/** What the host needs of the app's JMAP client. */
|
||||
export interface SessionClient {
|
||||
getSessionSnapshot(): unknown;
|
||||
getAuthHeader(): string;
|
||||
isOfflineOnly?(): boolean;
|
||||
requestNetworkOnly?(calls: [string, Record<string, unknown>, string][]): Promise<unknown>;
|
||||
}
|
||||
|
||||
export interface HostAccount {
|
||||
id: string;
|
||||
/** Shown with the drive when there are several accounts. */
|
||||
label: string;
|
||||
client: SessionClient;
|
||||
}
|
||||
|
||||
export interface HostDeps {
|
||||
controls: FilesControls;
|
||||
platform: string;
|
||||
publish: (patch: Partial<FilesSyncSnapshot>) => void;
|
||||
setController: (controller: FilesSyncController | null) => void;
|
||||
/** `FilesFolderSyncEnabled` is off. */
|
||||
folderSyncForcedOff: () => boolean;
|
||||
/** The organisation said no to downloads for this account. */
|
||||
downloadsForbidden: (account: string) => boolean;
|
||||
/** Tests give their own. */
|
||||
remoteFor?: (account: HostAccount) => FilesRemote | null;
|
||||
timing?: Partial<EngineTiming>;
|
||||
readUrl?: (url: string) => Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
const DEVICE: Record<string, string> = { win32: 'Windows', darwin: 'Mac', linux: 'Linux' };
|
||||
|
||||
/** The app's client as a transport: its session and header, read each time, renewed through it. */
|
||||
export function remoteForClient(client: SessionClient): FilesRemote | null {
|
||||
if (client.isOfflineOnly?.()) return null;
|
||||
const session = client.getSessionSnapshot() as StoreSession | undefined;
|
||||
if (!session?.apiUrl || !session.uploadUrl || !session.downloadUrl) return null;
|
||||
const transport = new FetchTransport({
|
||||
session: () => (client.getSessionSnapshot() as StoreSession | undefined) ?? session,
|
||||
auth: () => client.getAuthHeader() || null,
|
||||
refreshAuth: async () => {
|
||||
// Through the client: a 401 there runs its own renewal or re-login.
|
||||
await client.requestNetworkOnly?.([['Core/echo', {}, '0']]).catch(() => null);
|
||||
return client.getAuthHeader() || null;
|
||||
},
|
||||
});
|
||||
const remote = new FilesRemote(transport, () => (client.getSessionSnapshot() as StoreSession | undefined) ?? session);
|
||||
return remote.supported() ? remote : null;
|
||||
}
|
||||
|
||||
const fail = <T>(error: Exclude<FilesResult<T>, { ok: true }>['error']): FilesResult<T> => ({ ok: false, error });
|
||||
|
||||
export class FilesSyncHost {
|
||||
readonly engine: FilesSyncEngine;
|
||||
private readonly accounts = new Map<string, HostAccount>();
|
||||
private current: string | null = null;
|
||||
private drive: FilesDriveState | null = null;
|
||||
private publishTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
private readonly unsubscribe: (() => void)[] = [];
|
||||
/** Accounts the drive was turned on for at this sign-in already. */
|
||||
private readonly driveStarted = new Set<string>();
|
||||
private stopped = false;
|
||||
|
||||
constructor(private readonly deps: HostDeps) {
|
||||
this.engine = new FilesSyncEngine({
|
||||
controls: deps.controls,
|
||||
naming: namingFor(deps.platform),
|
||||
device: DEVICE[deps.platform] ?? 'this computer',
|
||||
readUrl: deps.readUrl,
|
||||
timing: deps.timing,
|
||||
blocked: (root) => this.blocked(root),
|
||||
downloadsAllowed: (account) => !deps.downloadsForbidden(account),
|
||||
onUpdate: () => this.schedulePublish(),
|
||||
});
|
||||
}
|
||||
|
||||
get controls(): FilesControls {
|
||||
return this.deps.controls;
|
||||
}
|
||||
|
||||
start(): void {
|
||||
this.engine.start();
|
||||
const drive = this.deps.controls.drive;
|
||||
if (drive) {
|
||||
void drive.state().then((state) => {
|
||||
this.drive = state;
|
||||
this.schedulePublish();
|
||||
this.startDrives();
|
||||
}).catch(() => {});
|
||||
this.unsubscribe.push(drive.onStateChange((state) => {
|
||||
this.drive = state;
|
||||
this.schedulePublish();
|
||||
void this.engine.refreshRoots();
|
||||
}));
|
||||
}
|
||||
this.deps.setController(this.controller());
|
||||
this.publishNow();
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
this.stopped = true;
|
||||
for (const stop of this.unsubscribe.splice(0)) stop();
|
||||
if (this.publishTimer) clearTimeout(this.publishTimer);
|
||||
this.engine.stop();
|
||||
this.deps.setController(null);
|
||||
}
|
||||
|
||||
private blocked(root: FilesRoot): FilesSyncErrorName | null {
|
||||
if (root.kind === 'folder' && this.deps.folderSyncForcedOff()) return 'policy';
|
||||
if (this.deps.downloadsForbidden(root.account)) return 'policy';
|
||||
return null;
|
||||
}
|
||||
|
||||
// ─── Accounts ───────────────────────────────────────────────
|
||||
|
||||
/** The signed-in accounts with a connected client, and the one on screen. */
|
||||
setAccounts(accounts: HostAccount[], current: string | null): void {
|
||||
if (this.stopped) return;
|
||||
this.current = current;
|
||||
const now = new Map(accounts.map((account) => [account.id, account]));
|
||||
for (const id of [...this.accounts.keys()]) {
|
||||
if (now.has(id)) continue;
|
||||
// Not connected now (signed out goes through signedOut): its roots wait.
|
||||
this.accounts.delete(id);
|
||||
this.engine.dropAccount(id);
|
||||
}
|
||||
for (const account of accounts) {
|
||||
const known = this.accounts.get(account.id);
|
||||
if (known && known.client === account.client) continue;
|
||||
const remote = (this.deps.remoteFor ?? ((entry: HostAccount) => remoteForClient(entry.client)))(account);
|
||||
if (!remote) continue;
|
||||
this.accounts.set(account.id, account);
|
||||
this.engine.setAccount(account.id, remote);
|
||||
}
|
||||
this.startDrives();
|
||||
void this.engine.refreshRoots();
|
||||
this.schedulePublish();
|
||||
}
|
||||
|
||||
/** A sign-in brings back the drive of an account that had it, without a click. */
|
||||
private startDrives(): void {
|
||||
const drive = this.deps.controls.drive;
|
||||
const state = this.drive;
|
||||
if (!drive || !state || !state.supported || state.forcedOff) return;
|
||||
for (const account of this.accounts.values()) {
|
||||
if (!state.wanted.includes(account.id) || this.driveStarted.has(account.id)) continue;
|
||||
this.driveStarted.add(account.id);
|
||||
void drive.enable(account.id, account.label).then((result) => {
|
||||
if (!result.ok) this.driveStarted.delete(account.id);
|
||||
void this.engine.refreshRoots();
|
||||
}, () => this.driveStarted.delete(account.id));
|
||||
}
|
||||
}
|
||||
|
||||
/** A push for this account said FileNode changed. */
|
||||
remoteChanged(account: string): void {
|
||||
this.engine.remoteChanged(account);
|
||||
}
|
||||
|
||||
online(): void {
|
||||
this.engine.retryNow();
|
||||
}
|
||||
|
||||
policyChanged(): void {
|
||||
this.engine.syncNow();
|
||||
this.schedulePublish();
|
||||
}
|
||||
|
||||
private async driveRootOf(account: string): Promise<FilesRoot | null> {
|
||||
const roots = await this.deps.controls.roots().catch(() => [] as FilesRoot[]);
|
||||
return roots.find((root) => root.kind === 'drive' && root.account === account) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signed out ('all': everyone). The drive goes, and comes back at the next sign-in; its record
|
||||
* goes first, since its folder goes with it. The folders stop until then.
|
||||
*/
|
||||
async signedOut(account: string): Promise<void> {
|
||||
const ids = account === 'all' ? [...new Set([...this.accounts.keys(), ...this.engine.roots.map((root) => root.account)])] : [account];
|
||||
for (const id of ids) {
|
||||
const drive = await this.driveRootOf(id);
|
||||
if (drive) await this.engine.forgetRoot(drive.id);
|
||||
this.accounts.delete(id);
|
||||
this.driveStarted.delete(id);
|
||||
this.engine.dropAccount(id);
|
||||
await this.deps.controls.drive?.disable(id, 'signed-out').catch(() => {});
|
||||
}
|
||||
await this.engine.refreshRoots();
|
||||
}
|
||||
|
||||
/**
|
||||
* A wipe or a refused login the server was sure of: the drive goes with everything in it,
|
||||
* the folders are forgotten and their files stay. `null`: every account.
|
||||
*/
|
||||
async removeAccountData(account: string | null, reason: 'wipe' | 'refused'): Promise<void> {
|
||||
await removeAccountData(this.deps.controls, account, reason, [...this.accounts.keys(), ...this.engine.roots.map((root) => root.account)]);
|
||||
for (const id of account === null ? [...this.accounts.keys()] : [account]) {
|
||||
this.accounts.delete(id);
|
||||
this.driveStarted.delete(id);
|
||||
this.engine.dropAccount(id);
|
||||
}
|
||||
await this.engine.refreshRoots();
|
||||
}
|
||||
|
||||
// ─── The store ──────────────────────────────────────────────
|
||||
|
||||
private schedulePublish(): void {
|
||||
if (this.publishTimer || this.stopped) return;
|
||||
this.publishTimer = setTimeout(() => {
|
||||
this.publishTimer = null;
|
||||
this.publishNow();
|
||||
}, 50);
|
||||
}
|
||||
|
||||
/** What the UI shows: the account on screen's roots, their status and activity. */
|
||||
publishNow(): void {
|
||||
if (this.stopped) return;
|
||||
const current = this.current;
|
||||
const roots = current ? this.engine.roots.filter((root) => root.account === current) : [];
|
||||
const ids = new Set(roots.map((root) => root.id));
|
||||
const status = Object.fromEntries(Object.entries(this.engine.status()).filter(([id]) => ids.has(id)));
|
||||
this.deps.publish({
|
||||
available: true,
|
||||
account: current,
|
||||
roots,
|
||||
status,
|
||||
activity: this.engine.activity.filter((entry) => ids.has(entry.rootId)),
|
||||
drive: this.drive,
|
||||
folderSyncForcedOff: this.deps.folderSyncForcedOff(),
|
||||
items: current ? this.engine.items(current) : {},
|
||||
});
|
||||
}
|
||||
|
||||
controller(): FilesSyncController {
|
||||
const controls = this.deps.controls;
|
||||
return {
|
||||
// Main wants the click this came from: the bridge call goes first, before any await.
|
||||
addFolder: async (remoteId, remoteLabel) => {
|
||||
const account = this.current;
|
||||
if (!account) return fail('inactive');
|
||||
// A folder of someone else's shared drive: the engine syncs the account's own Files.
|
||||
if (remoteId !== null && remoteId.includes(':')) return fail('unsupported');
|
||||
const result = await controls.addFolder({ account, remoteId, remoteLabel });
|
||||
await this.engine.refreshRoots();
|
||||
return result;
|
||||
},
|
||||
removeRoot: (rootId) => this.engine.removeRoot(rootId),
|
||||
setPaused: (rootId, paused) => this.engine.setPaused(rootId, paused),
|
||||
confirmMassDelete: async (rootId, allow) => {
|
||||
this.engine.confirmMassDelete(rootId, allow);
|
||||
},
|
||||
setDriveEnabled: async (enabled) => {
|
||||
const account = this.current;
|
||||
const drive = controls.drive;
|
||||
if (!drive) return fail('unsupported');
|
||||
if (!account) return fail('inactive');
|
||||
if (enabled) {
|
||||
const label = this.accounts.get(account)?.label ?? account;
|
||||
const result = await drive.enable(account, label);
|
||||
if (result.ok) this.driveStarted.add(account);
|
||||
await this.engine.refreshRoots();
|
||||
return result;
|
||||
}
|
||||
await drive.disable(account, 'user');
|
||||
this.driveStarted.delete(account);
|
||||
await this.engine.refreshRoots();
|
||||
return { ok: true, value: null };
|
||||
},
|
||||
setDriveLetter: async (letter) => {
|
||||
const drive = controls.drive;
|
||||
if (!drive) return fail('unsupported');
|
||||
return drive.setLetter(letter);
|
||||
},
|
||||
coverage: (nodeId) => (this.current ? this.engine.coverage(this.current, nodeId) : null),
|
||||
showInFolder: async (nodeId) => {
|
||||
const coverage = this.current ? this.engine.coverage(this.current, nodeId) : null;
|
||||
if (!coverage) return false;
|
||||
return controls.showInFolder(coverage.rootId, coverage.path);
|
||||
},
|
||||
clearActivity: () => this.engine.clearActivity(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For a wipe or a refused login, with or without a running host: the drive goes with
|
||||
* everything in it, the folders are forgotten (their files stay). Bridge calls only: a wipe
|
||||
* often runs because the server said no.
|
||||
*/
|
||||
export async function removeAccountData(controls: FilesControls, account: string | null, reason: 'wipe' | 'refused', known: string[] = []): Promise<void> {
|
||||
const roots = await controls.roots().catch(() => [] as FilesRoot[]);
|
||||
const drive = controls.drive;
|
||||
const wanted = drive ? await drive.state().then((state) => state.wanted, () => [] as string[]) : [];
|
||||
const accounts = account === null ? [...new Set([...known, ...wanted, ...roots.map((root) => root.account)])] : [account];
|
||||
for (const id of accounts) {
|
||||
if (drive && (wanted.includes(id) || roots.some((root) => root.kind === 'drive' && root.account === id))) {
|
||||
await drive.disable(id, reason).catch(() => {});
|
||||
}
|
||||
for (const root of roots) {
|
||||
if (root.kind === 'folder' && root.account === id) await controls.removeRoot(root.id).catch(() => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* How Files on this computer follows an account out: sign-out, a wipe, a refused login. Hooked
|
||||
* in where edit-in-place's copies are (lib/desktop/edit-attachments.ts): the wipe registry, the
|
||||
* sign-out tasks, the auth store's word on a refused login, and the account list.
|
||||
*
|
||||
* - Sign-out: the drive goes (`signed-out`: the next sign-in brings it back) and the account's
|
||||
* folders stop syncing until then; nothing is deleted from them.
|
||||
* - A wipe (remote, from settings, the organisation's): `wipe`. The drive goes with everything
|
||||
* in it; the folders are forgotten, their files stay.
|
||||
* - A refused login the server was sure of (`invalid_grant`, a lasting 401): `refused`, as a
|
||||
* wipe for these. An unsure one, or the organisation's idle limit, is a sign-out: a single
|
||||
* bad answer at a start can be a server in trouble, and deleting the drive's unsynced edits
|
||||
* for that would lose work.
|
||||
*/
|
||||
|
||||
import { onCredentialsRejected } from '@/lib/offline/credentials-rejected';
|
||||
import { onDeviceWipe } from '@/lib/offline/wipe-registry';
|
||||
import { isPopoutWindow } from '@/lib/popout/window-role';
|
||||
import { onBeforeSignOut } from '@/lib/sign-out-cleanup';
|
||||
import { onAccountRemoved } from '@/stores/account-store';
|
||||
import { claimFilesControls } from './controls';
|
||||
import { removeAccountData, type FilesSyncHost } from './host';
|
||||
|
||||
let running: FilesSyncHost | null = null;
|
||||
|
||||
export function setRunningFilesSyncHost(host: FilesSyncHost | null): void {
|
||||
running = host;
|
||||
}
|
||||
|
||||
/** Signed out without a host running: the drive still goes. */
|
||||
async function signedOutWithoutHost(account: string): Promise<void> {
|
||||
const drive = claimFilesControls()?.drive;
|
||||
if (!drive) return;
|
||||
const wanted = account === 'all' ? await drive.state().then((state) => state.wanted, () => [] as string[]) : [account];
|
||||
for (const id of wanted) await drive.disable(id, 'signed-out').catch(() => {});
|
||||
}
|
||||
|
||||
async function remove(account: string | null, reason: 'wipe' | 'refused'): Promise<void> {
|
||||
if (running) {
|
||||
await running.removeAccountData(account, reason);
|
||||
return;
|
||||
}
|
||||
const controls = claimFilesControls();
|
||||
if (controls) await removeAccountData(controls, account, reason);
|
||||
}
|
||||
|
||||
let registered = false;
|
||||
|
||||
export function registerFilesSyncLifecycle(): void {
|
||||
if (registered || typeof window === 'undefined' || isPopoutWindow()) return;
|
||||
registered = true;
|
||||
onDeviceWipe((account) => remove(account, 'wipe').catch(() => {}));
|
||||
onCredentialsRejected((account, certain, kind) => {
|
||||
if (certain && kind === 'refused') void remove(account, 'refused').catch(() => {});
|
||||
});
|
||||
onBeforeSignOut(async (account) => {
|
||||
if (running) await running.signedOut(account).catch(() => {});
|
||||
else await signedOutWithoutHost(account);
|
||||
});
|
||||
onAccountRemoved((account, reason) => {
|
||||
// A wipe has its own way out, above.
|
||||
if (reason === 'wiped') return;
|
||||
if (running) void running.signedOut(account).catch(() => {});
|
||||
else void signedOutWithoutHost(account);
|
||||
});
|
||||
}
|
||||
|
||||
/** Tests only. */
|
||||
export function resetFilesSyncLifecycleForTests(): void {
|
||||
registered = false;
|
||||
running = null;
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Names and paths on the computer's side of Files on this computer.
|
||||
*
|
||||
* A name in Files can be one the disk can't hold. Windows refuses `< > : " / \ | ? *`, control
|
||||
* characters, a trailing dot or space, and the device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9,
|
||||
* with any extension). Such a name gets a local one: the forbidden characters become their
|
||||
* fullwidth forms, and a trailing dot or space or a device name gets `_`. Two names in one folder
|
||||
* that differ only in case can't both be on a case-insensitive disk (Windows, macOS by default):
|
||||
* the second gets ` (2)`. The engine keeps both names in its record, so the local name never
|
||||
* reads as a rename, and the name in Files never changes for the disk's sake.
|
||||
*
|
||||
* Paths are relative to a root, `/` between parts, as main takes them.
|
||||
*/
|
||||
|
||||
export interface DiskNaming {
|
||||
/** The disk takes only what Windows takes (Windows itself; any disk the drive is on). */
|
||||
windowsNames: boolean;
|
||||
/** Two names differing only in case are one name on this disk. */
|
||||
caseInsensitive: boolean;
|
||||
}
|
||||
|
||||
export function namingFor(platform: 'win32' | 'darwin' | 'linux' | string): DiskNaming {
|
||||
if (platform === 'win32') return { windowsNames: true, caseInsensitive: true };
|
||||
if (platform === 'darwin') return { windowsNames: false, caseInsensitive: true };
|
||||
return { windowsNames: false, caseInsensitive: false };
|
||||
}
|
||||
|
||||
const FULLWIDTH: Record<string, string> = {
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
':': ':',
|
||||
'"': '"',
|
||||
'/': '/',
|
||||
'\\': '\',
|
||||
'|': '|',
|
||||
'?': '?',
|
||||
'*': '*',
|
||||
};
|
||||
|
||||
const RESERVED = /^(con|prn|aux|nul|com[1-9¹²³]|lpt[1-9¹²³])$/i;
|
||||
|
||||
function stemOf(name: string): string {
|
||||
const dot = name.indexOf('.');
|
||||
return dot > 0 ? name.slice(0, dot) : name;
|
||||
}
|
||||
|
||||
/** The name as the disk can hold it. The same name back when it already can. */
|
||||
export function diskName(name: string, naming: DiskNaming): string {
|
||||
let out = name;
|
||||
if (naming.windowsNames) {
|
||||
out = [...out].map((ch) => {
|
||||
if (FULLWIDTH[ch]) return FULLWIDTH[ch];
|
||||
const code = ch.codePointAt(0) ?? 0;
|
||||
// Control characters: the Control Pictures block keeps them visible and distinct.
|
||||
if (code < 0x20) return String.fromCodePoint(0x2400 + code);
|
||||
return ch;
|
||||
}).join('');
|
||||
if (/[. ]$/.test(out)) out = `${out}_`;
|
||||
const stem = stemOf(out);
|
||||
if (RESERVED.test(stem.trimEnd())) out = `${stem}_${out.slice(stem.length)}`;
|
||||
} else {
|
||||
out = out.replace(/\//g, FULLWIDTH['/']).replace(/\0/g, '␀');
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Whether the disk would refuse this name as it is. */
|
||||
export function needsDiskName(name: string, naming: DiskNaming): boolean {
|
||||
return diskName(name, naming) !== name;
|
||||
}
|
||||
|
||||
/** The key two names on this disk share when they are the same name. */
|
||||
export function nameKey(name: string, naming: DiskNaming): string {
|
||||
return naming.caseInsensitive ? name.normalize('NFC').toLocaleLowerCase('en-US') : name.normalize('NFC');
|
||||
}
|
||||
|
||||
export function pathKey(path: string, naming: DiskNaming): string {
|
||||
return path.split('/').map((part) => nameKey(part, naming)).join('/');
|
||||
}
|
||||
|
||||
/** "report.pdf" with n = 2: "report (2).pdf". A dot at the start is a hidden name, not an extension. */
|
||||
export function numberedName(name: string, n: number): string {
|
||||
const dot = name.lastIndexOf('.');
|
||||
if (dot > 0) return `${name.slice(0, dot)} (${n})${name.slice(dot)}`;
|
||||
return `${name} (${n})`;
|
||||
}
|
||||
|
||||
/**
|
||||
* A free local name for `wanted` in a folder whose other names are `taken` (as nameKey gives
|
||||
* them): the disk's form of it, numbered when that's already there.
|
||||
*/
|
||||
export function freeLocalName(wanted: string, taken: ReadonlySet<string>, naming: DiskNaming): string {
|
||||
const base = diskName(wanted, naming);
|
||||
if (!taken.has(nameKey(base, naming))) return base;
|
||||
for (let n = 2; ; n += 1) {
|
||||
const candidate = numberedName(base, n);
|
||||
if (!taken.has(nameKey(candidate, naming))) return candidate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The name the copy that lost a conflict is kept under, next to the other:
|
||||
* "report (conflict, Laptop, 2026-11-04 15.30).pdf".
|
||||
*/
|
||||
export function conflictName(name: string, device: string, at: Date): string {
|
||||
const pad = (n: number) => String(n).padStart(2, '0');
|
||||
const stamp = `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())} ${pad(at.getHours())}.${pad(at.getMinutes())}`;
|
||||
const label = `conflict, ${device.replace(/[<>:"/\\|?*]/g, '').trim() || 'this computer'}, ${stamp}`;
|
||||
const dot = name.lastIndexOf('.');
|
||||
if (dot > 0) return `${name.slice(0, dot)} (${label})${name.slice(dot)}`;
|
||||
return `${name} (${label})`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Files the computer makes for itself in any folder: Explorer's and Finder's folder settings and
|
||||
* thumbnails, Office's owner files while a document is open, macOS's resource forks on other
|
||||
* disks. They never go up; the same names coming down from Files are written like any other.
|
||||
*/
|
||||
export function isSystemFileName(name: string): boolean {
|
||||
const lower = name.toLowerCase();
|
||||
return lower === 'desktop.ini' || lower === 'thumbs.db' || lower === '.ds_store' || name.startsWith('~$') || name.startsWith('._');
|
||||
}
|
||||
|
||||
export function parentPath(path: string): string {
|
||||
const slash = path.lastIndexOf('/');
|
||||
return slash < 0 ? '' : path.slice(0, slash);
|
||||
}
|
||||
|
||||
export function baseName(path: string): string {
|
||||
const slash = path.lastIndexOf('/');
|
||||
return slash < 0 ? path : path.slice(slash + 1);
|
||||
}
|
||||
|
||||
export function joinPath(parent: string, name: string): string {
|
||||
return parent ? `${parent}/${name}` : name;
|
||||
}
|
||||
|
||||
export function depthOf(path: string): number {
|
||||
return path ? path.split('/').length : 0;
|
||||
}
|
||||
|
||||
/** Whether `path` is `folder` or inside it. */
|
||||
export function isUnderPath(path: string, folder: string, naming?: DiskNaming): boolean {
|
||||
if (folder === '') return true;
|
||||
const a = naming ? pathKey(path, naming) : path;
|
||||
const b = naming ? pathKey(folder, naming) : folder;
|
||||
return a === b || a.startsWith(`${b}/`);
|
||||
}
|
||||
@@ -0,0 +1,450 @@
|
||||
/**
|
||||
* The Files side of Files on this computer: one account's FileNode tree, read once and then
|
||||
* kept current with FileNode/changes, and the writes the engine makes.
|
||||
*
|
||||
* It goes through a JmapTransport (lib/store/engine/transport.ts): the host gives it one that
|
||||
* borrows the app's own JMAP session and Authorization header, so nothing new holds a token or a
|
||||
* password. Tests give it a fake server, and the real-server tests a FetchTransport.
|
||||
*
|
||||
* Reading the whole tree is done as lib/store/files/sync.ts does it, because neither server
|
||||
* gives it in one call: `FileNode/get` with ids null stops at maxObjectsInGet on 0.16 and is
|
||||
* refused on 1.0 (`requestTooLarge`); past that, ids come from paging FileNode/query from the
|
||||
* last id read (`anchor`), and before 0.16.6 that query leaves out folders, so parents still
|
||||
* unknown afterwards are read by id. Unlike the Files screen, a listing that breaks off fails:
|
||||
* a partial tree would read as files deleted.
|
||||
*
|
||||
* Writes follow lib/jmap/client.ts: a folder is a node without blobId, type or size (0.16 makes
|
||||
* a 0-byte file of anything else); Stalwart 1.0 wants `@type` and `mediaType` in a create; size
|
||||
* is never sent; `onExists: "rename"` is not used here, since a name the engine didn't choose
|
||||
* would be a second copy the disk doesn't know about.
|
||||
*/
|
||||
|
||||
import { acceptedFileName, fileNameRulesFrom, type FileNameRules } from '@/lib/file-name-rules';
|
||||
import { fileNodeKind, fromDraftFileNode, toDraftFileNodeCreate } from '@/lib/jmap/filenode-kind';
|
||||
import { decodeFileNodeName } from '@/lib/jmap/filenode-name';
|
||||
import type { FileNode } from '@/lib/jmap/types';
|
||||
import { mediaTypeEssence, OCTET_STREAM } from '@/lib/media-type';
|
||||
import { TRASH_FOLDER_NAME, trashBatchName } from '@/lib/files-trash';
|
||||
import { runChangesLoop } from '@/lib/store/engine/changes';
|
||||
import { requestLimits } from '@/lib/store/engine/limits';
|
||||
import { JmapMethodError, responseFor, type JmapTransport, type MethodCall, type StoreSession } from '@/lib/store/engine/transport';
|
||||
|
||||
export const FILES_CAPABILITY = 'urn:ietf:params:jmap:filenode';
|
||||
export const FILES_USING = ['urn:ietf:params:jmap:core', FILES_CAPABILITY];
|
||||
const PROPERTIES = ['id', 'parentId', 'name', 'type', 'blobId', 'size', 'created', 'modified', 'nodeType', '@type', 'mediaType'];
|
||||
const QUERY_PAGE = 5000;
|
||||
const MOST_GETS_PER_REQUEST = 8;
|
||||
const MOST_IDS = 2_000_000;
|
||||
|
||||
export interface RemoteNode {
|
||||
id: string;
|
||||
parentId: string | null;
|
||||
name: string;
|
||||
kind: 'file' | 'directory';
|
||||
blobId: string | null;
|
||||
size: number;
|
||||
/** Milliseconds; 0 when the server gave none. */
|
||||
modifiedMs: number;
|
||||
type: string;
|
||||
}
|
||||
|
||||
/** A set call the server refused for one object. */
|
||||
export class RemoteSetError extends Error {
|
||||
constructor(readonly type: string, description?: string) {
|
||||
super(description ? `${type}: ${description}` : type);
|
||||
this.name = 'RemoteSetError';
|
||||
}
|
||||
}
|
||||
|
||||
type Wire = Record<string, unknown> & { id: string };
|
||||
|
||||
/** A node as the engine uses it, from either draft. Symlinks (1.0) are left out: nothing to sync. */
|
||||
export function nodeFromWire(raw: Wire): RemoteNode | null {
|
||||
const node = fromDraftFileNode(raw as unknown as FileNode & { '@type'?: unknown; mediaType?: unknown });
|
||||
const kind = fileNodeKind(node);
|
||||
if (kind === 'symlink') return null;
|
||||
const modified = typeof node.modified === 'string' ? Date.parse(node.modified) : NaN;
|
||||
return {
|
||||
id: String(node.id),
|
||||
parentId: node.parentId == null ? null : String(node.parentId),
|
||||
name: decodeFileNodeName(String(node.name ?? '')),
|
||||
kind,
|
||||
blobId: kind === 'file' ? (node.blobId ?? null) : null,
|
||||
size: kind === 'file' && typeof node.size === 'number' ? node.size : 0,
|
||||
modifiedMs: Number.isFinite(modified) ? modified : 0,
|
||||
type: typeof node.type === 'string' && node.type ? node.type : OCTET_STREAM,
|
||||
};
|
||||
}
|
||||
|
||||
export interface ChangeBatch {
|
||||
changed: RemoteNode[];
|
||||
destroyed: string[];
|
||||
}
|
||||
|
||||
export class FilesRemote {
|
||||
constructor(
|
||||
readonly transport: JmapTransport,
|
||||
private readonly session: () => StoreSession,
|
||||
) {}
|
||||
|
||||
/** The account Files lives in. */
|
||||
jmap(): string {
|
||||
const session = this.session();
|
||||
return session.primaryAccounts[FILES_CAPABILITY] ?? session.primaryAccounts['urn:ietf:params:jmap:core'] ?? Object.keys(session.accounts)[0] ?? '';
|
||||
}
|
||||
|
||||
supported(): boolean {
|
||||
const session = this.session();
|
||||
const account = session.accounts[this.jmap()];
|
||||
return !!session.capabilities[FILES_CAPABILITY] && !!account?.accountCapabilities?.[FILES_CAPABILITY];
|
||||
}
|
||||
|
||||
/** The largest upload the server takes, in bytes. 0: it doesn't say. */
|
||||
maxUpload(): number {
|
||||
const core = this.session().capabilities['urn:ietf:params:jmap:core'] as { maxSizeUpload?: unknown } | undefined;
|
||||
return typeof core?.maxSizeUpload === 'number' && core.maxSizeUpload > 0 ? core.maxSizeUpload : 0;
|
||||
}
|
||||
|
||||
private limits(): Record<string, unknown> | undefined {
|
||||
const session = this.session();
|
||||
return (session.accounts[this.jmap()]?.accountCapabilities?.[FILES_CAPABILITY] ?? session.capabilities[FILES_CAPABILITY]) as Record<string, unknown> | undefined;
|
||||
}
|
||||
|
||||
nameRules(): FileNameRules | null {
|
||||
return fileNameRulesFrom(this.limits());
|
||||
}
|
||||
|
||||
/** Stalwart 1.0 (File Storage draft 18): `@type` and `mediaType` in a create. */
|
||||
private usesDraftCreate(): boolean {
|
||||
const limits = this.limits();
|
||||
return !!limits && 'supportedNodeTypes' in limits;
|
||||
}
|
||||
|
||||
/** Before 0.16.6: 30 characters of media type at most. */
|
||||
private legacy(): boolean {
|
||||
const limits = this.limits();
|
||||
return !!limits && !('forbiddenNameChars' in limits);
|
||||
}
|
||||
|
||||
private mediaType(type: string): string {
|
||||
const essence = mediaTypeEssence(type);
|
||||
return this.legacy() && essence.length > 30 ? OCTET_STREAM : essence;
|
||||
}
|
||||
|
||||
/** The name a new node gets on this server: what the disk had, made acceptable. */
|
||||
acceptedName(name: string): string {
|
||||
return acceptedFileName(name, this.nameRules());
|
||||
}
|
||||
|
||||
private async fetchByIds(ids: string[]): Promise<Wire[]> {
|
||||
const jmap = this.jmap();
|
||||
const { maxObjectsInGet, maxCallsInRequest } = requestLimits(this.session());
|
||||
const perRequest = Math.min(MOST_GETS_PER_REQUEST, maxCallsInRequest);
|
||||
const out: Wire[] = [];
|
||||
for (let at = 0; at < ids.length;) {
|
||||
const calls: MethodCall[] = [];
|
||||
for (let i = 0; i < perRequest && at < ids.length; i += 1, at += maxObjectsInGet) {
|
||||
calls.push(['FileNode/get', { accountId: jmap, ids: ids.slice(at, at + maxObjectsInGet), properties: PROPERTIES }, `g${i}`]);
|
||||
}
|
||||
const response = await this.transport.request(calls, FILES_USING);
|
||||
for (const [, , callId] of calls) out.push(...(responseFor(response, callId)[1].list as Wire[]));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
async get(ids: string[]): Promise<RemoteNode[]> {
|
||||
if (ids.length === 0) return [];
|
||||
return (await this.fetchByIds(ids)).map(nodeFromWire).filter((node): node is RemoteNode => !!node);
|
||||
}
|
||||
|
||||
/** The state to go on from: read before the listing, so nothing that changes meanwhile is missed. */
|
||||
async currentState(): Promise<string> {
|
||||
const response = await this.transport.request([['FileNode/get', { accountId: this.jmap(), ids: [], properties: ['id'] }, 's']], FILES_USING);
|
||||
return String(responseFor(response, 's')[1].state);
|
||||
}
|
||||
|
||||
/** Every node of the account, and the state it was read at. Throws rather than give part of it. */
|
||||
async listAll(): Promise<{ nodes: RemoteNode[]; state: string }> {
|
||||
const jmap = this.jmap();
|
||||
const state = await this.currentState();
|
||||
const known = new Map<string, Wire>();
|
||||
const { maxObjectsInGet } = requestLimits(this.session());
|
||||
let complete = false;
|
||||
try {
|
||||
const response = await this.transport.request([['FileNode/get', { accountId: jmap, ids: null, properties: PROPERTIES }, 'a']], FILES_USING);
|
||||
const list = responseFor(response, 'a')[1].list as Wire[];
|
||||
for (const node of list) known.set(String(node.id), node);
|
||||
complete = list.length < maxObjectsInGet;
|
||||
} catch (error) {
|
||||
if (!((error as Error)?.name === 'JmapMethodError' && (error as JmapMethodError).type === 'requestTooLarge')) throw error;
|
||||
}
|
||||
if (!complete) {
|
||||
let anchor: string | null = null;
|
||||
let position = 0;
|
||||
for (let pages = 0; position < MOST_IDS; pages += 1) {
|
||||
const from: Record<string, unknown> = anchor === null ? { position: 0 } : { anchor, anchorOffset: 1 };
|
||||
const response = await this.transport.request([['FileNode/query', { accountId: jmap, filter: {}, ...from, limit: QUERY_PAGE, calculateTotal: true }, 'q']], FILES_USING);
|
||||
let query: { ids: string[]; position?: number; total?: number };
|
||||
try {
|
||||
[, query] = responseFor(response, 'q');
|
||||
} catch (error) {
|
||||
if ((error as JmapMethodError)?.type === 'anchorNotFound' && pages < 50) {
|
||||
anchor = null;
|
||||
position = 0;
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const ids = query.ids ?? [];
|
||||
const missing = ids.filter((id) => !known.has(id));
|
||||
for (const node of await this.fetchByIds(missing)) known.set(String(node.id), node);
|
||||
position = Number(query.position ?? 0) + ids.length;
|
||||
if (ids.length > 0) anchor = ids[ids.length - 1];
|
||||
if (ids.length === 0 || (typeof query.total === 'number' && position >= query.total)) break;
|
||||
}
|
||||
const asked = new Set<string>();
|
||||
for (;;) {
|
||||
const parents = new Set<string>();
|
||||
for (const node of known.values()) {
|
||||
const parent = node.parentId == null ? null : String(node.parentId);
|
||||
if (parent && !known.has(parent) && !asked.has(parent)) parents.add(parent);
|
||||
}
|
||||
if (parents.size === 0) break;
|
||||
for (const id of parents) asked.add(id);
|
||||
for (const node of await this.fetchByIds([...parents])) known.set(String(node.id), node);
|
||||
}
|
||||
}
|
||||
const nodes = [...known.values()].map(nodeFromWire).filter((node): node is RemoteNode => !!node);
|
||||
return { nodes, state };
|
||||
}
|
||||
|
||||
/**
|
||||
* What changed since `since`, page by page. `resync`: the server can't say (the state is too
|
||||
* old or unknown), and the tree has to be read again.
|
||||
*/
|
||||
async changes(since: string, apply: (batch: ChangeBatch, newState: string) => void): Promise<{ outcome: 'done' | 'resync'; state: string }> {
|
||||
const outcome = await runChangesLoop({
|
||||
transport: this.transport,
|
||||
type: 'FileNode',
|
||||
jmap: this.jmap(),
|
||||
using: FILES_USING,
|
||||
since,
|
||||
apply: async (page) => {
|
||||
const ids = [...new Set([...page.created, ...page.updated])];
|
||||
const wires = await this.fetchByIds(ids);
|
||||
const seen = new Set(wires.map((node) => String(node.id)));
|
||||
const changed = wires.map(nodeFromWire).filter((node): node is RemoteNode => !!node);
|
||||
// Asked for and gone already: as good as destroyed. A symlink is nothing to this side either.
|
||||
const gone = ids.filter((id) => !seen.has(id) || !changed.some((node) => node.id === id));
|
||||
apply({ changed, destroyed: [...page.destroyed, ...gone] }, page.newState);
|
||||
},
|
||||
});
|
||||
return { outcome: outcome.outcome === 'resync' ? 'resync' : 'done', state: outcome.state };
|
||||
}
|
||||
|
||||
private async set(args: Record<string, unknown>): Promise<Record<string, unknown>> {
|
||||
const response = await this.transport.request([['FileNode/set', { accountId: this.jmap(), ...args }, 's']], FILES_USING);
|
||||
return responseFor(response, 's')[1] as Record<string, unknown>;
|
||||
}
|
||||
|
||||
private async createNode(props: Record<string, unknown>): Promise<RemoteNode> {
|
||||
const wire = this.usesDraftCreate() ? toDraftFileNodeCreate(props) : props;
|
||||
const result = await this.set({ create: { c: wire } });
|
||||
const created = (result.created as Record<string, Wire> | undefined)?.c;
|
||||
if (!created) {
|
||||
const error = (result.notCreated as Record<string, { type?: string; description?: string }> | undefined)?.c;
|
||||
throw new RemoteSetError(error?.type ?? 'serverFail', error?.description);
|
||||
}
|
||||
// A create answers with what the server set; the rest is what was sent.
|
||||
const [node] = await this.get([String(created.id)]);
|
||||
if (node) return node;
|
||||
const merged = nodeFromWire({ ...wire, ...created, id: String(created.id) } as Wire);
|
||||
if (!merged) throw new RemoteSetError('serverFail', 'The new node is gone');
|
||||
return merged;
|
||||
}
|
||||
|
||||
createFolder(name: string, parentId: string | null): Promise<RemoteNode> {
|
||||
return this.createNode({ name, ...(parentId !== null ? { parentId } : {}) });
|
||||
}
|
||||
|
||||
createFile(name: string, parentId: string | null, blob: { blobId: string; type: string }): Promise<RemoteNode> {
|
||||
return this.createNode({ name, type: this.mediaType(blob.type), blobId: blob.blobId, ...(parentId !== null ? { parentId } : {}) });
|
||||
}
|
||||
|
||||
private async updateOne(id: string, patch: Record<string, unknown>): Promise<void> {
|
||||
const result = await this.set({ update: { [id]: patch } });
|
||||
const refused = (result.notUpdated as Record<string, { type?: string; description?: string }> | undefined)?.[id];
|
||||
if (refused) throw new RemoteSetError(refused.type ?? 'serverFail', refused.description);
|
||||
}
|
||||
|
||||
async move(id: string, change: { name?: string; parentId?: string | null }): Promise<RemoteNode> {
|
||||
await this.updateOne(id, change);
|
||||
const [node] = await this.get([id]);
|
||||
if (!node) throw new RemoteSetError('notFound');
|
||||
return node;
|
||||
}
|
||||
|
||||
/** New content for a file. `modified: null` has the server stamp it (1.0 keeps a set one otherwise). */
|
||||
async replaceBlob(id: string, blobId: string): Promise<RemoteNode> {
|
||||
await this.updateOne(id, { blobId, modified: null });
|
||||
const [node] = await this.get([id]);
|
||||
if (!node) throw new RemoteSetError('notFound');
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Into Files' trash, the way the Files screen does it (lib/files-trash.ts): a folder per delete
|
||||
* inside `/.Trash`, named after when and where from, so Restore puts the items back.
|
||||
*/
|
||||
async trash(ids: string[], fromParentId: string | null, trashId: string | null, now = Date.now()): Promise<{ trashId: string; batchId: string }> {
|
||||
let trash = trashId;
|
||||
if (!trash) trash = (await this.createFolder(TRASH_FOLDER_NAME, null)).id;
|
||||
const batch = await this.createFolder(trashBatchName(fromParentId, now), trash);
|
||||
const result = await this.set({ update: Object.fromEntries(ids.map((id) => [id, { parentId: batch.id }])) });
|
||||
const refused = Object.entries((result.notUpdated as Record<string, { type?: string; description?: string }> | undefined) ?? {});
|
||||
if (refused.length > 0) {
|
||||
const gone = refused.every(([, error]) => error?.type === 'notFound');
|
||||
if (refused.length === ids.length) await this.destroy([batch.id]).catch(() => {});
|
||||
if (!gone) throw new RemoteSetError(refused[0][1]?.type ?? 'serverFail', refused[0][1]?.description);
|
||||
}
|
||||
return { trashId: trash, batchId: batch.id };
|
||||
}
|
||||
|
||||
async destroy(ids: string[]): Promise<void> {
|
||||
const result = await this.set({ destroy: ids, onDestroyRemoveChildren: true });
|
||||
const refused = Object.values((result.notDestroyed as Record<string, { type?: string; description?: string }> | undefined) ?? {})
|
||||
.filter((error) => error?.type !== 'notFound');
|
||||
if (refused.length > 0) throw new RemoteSetError(refused[0]?.type ?? 'serverFail', refused[0]?.description);
|
||||
}
|
||||
|
||||
upload(data: Uint8Array, type: string): Promise<{ blobId: string; type: string; size: number }> {
|
||||
return this.transport.upload(this.jmap(), data, type || OCTET_STREAM);
|
||||
}
|
||||
|
||||
/** A file's bytes, piece by piece. An error thrown by `sink` stops it and comes out as it is. */
|
||||
async download(node: Pick<RemoteNode, 'blobId' | 'type' | 'name'>, sink: (part: Uint8Array) => void): Promise<void> {
|
||||
if (!node.blobId) throw new RemoteSetError('notFound', 'No content');
|
||||
const jmap = this.jmap();
|
||||
if (this.transport.downloadStream) {
|
||||
await this.transport.downloadStream(jmap, node.blobId, node.type || OCTET_STREAM, node.name || 'file', sink);
|
||||
return;
|
||||
}
|
||||
sink(await this.transport.download(jmap, node.blobId, node.type || OCTET_STREAM, node.name || 'file'));
|
||||
}
|
||||
}
|
||||
|
||||
/** One account's tree in memory, with where each node is. */
|
||||
export class RemoteTree {
|
||||
readonly nodes = new Map<string, RemoteNode>();
|
||||
private childIndex: Map<string, Set<string>> | null = null;
|
||||
state: string | null = null;
|
||||
/**
|
||||
* Nodes the engine wrote since `state`. FileNode/changes leaves out a node created and
|
||||
* destroyed after the state it starts from, so one of these gone meanwhile is never said
|
||||
* to be gone: they are looked at once the changes are read.
|
||||
*/
|
||||
readonly written = new Set<string>();
|
||||
|
||||
reset(nodes: RemoteNode[], state: string): void {
|
||||
this.nodes.clear();
|
||||
this.written.clear();
|
||||
for (const node of nodes) this.nodes.set(node.id, node);
|
||||
this.state = state;
|
||||
this.childIndex = null;
|
||||
}
|
||||
|
||||
apply(batch: ChangeBatch): void {
|
||||
for (const id of batch.destroyed) this.nodes.delete(id);
|
||||
for (const node of batch.changed) this.nodes.set(node.id, node);
|
||||
// A folder destroyed takes what was in it; the server says so too, but not always in the same page.
|
||||
if (batch.destroyed.length > 0) {
|
||||
let removed = true;
|
||||
while (removed) {
|
||||
removed = false;
|
||||
for (const node of this.nodes.values()) {
|
||||
if (node.parentId && !this.nodes.has(node.parentId)) {
|
||||
this.nodes.delete(node.id);
|
||||
removed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.childIndex = null;
|
||||
}
|
||||
|
||||
/** What the engine itself wrote. */
|
||||
put(node: RemoteNode): void {
|
||||
this.nodes.set(node.id, node);
|
||||
this.written.add(node.id);
|
||||
this.childIndex = null;
|
||||
}
|
||||
|
||||
remove(id: string): void {
|
||||
for (const child of this.children(id)) this.remove(child.id);
|
||||
this.nodes.delete(id);
|
||||
this.childIndex = null;
|
||||
}
|
||||
|
||||
get(id: string): RemoteNode | undefined {
|
||||
return this.nodes.get(id);
|
||||
}
|
||||
|
||||
children(parentId: string | null): RemoteNode[] {
|
||||
if (!this.childIndex) {
|
||||
this.childIndex = new Map();
|
||||
for (const node of this.nodes.values()) {
|
||||
const key = node.parentId ?? '';
|
||||
let set = this.childIndex.get(key);
|
||||
if (!set) this.childIndex.set(key, (set = new Set()));
|
||||
set.add(node.id);
|
||||
}
|
||||
}
|
||||
return [...(this.childIndex.get(parentId ?? '') ?? [])].map((id) => this.nodes.get(id)).filter((node): node is RemoteNode => !!node);
|
||||
}
|
||||
|
||||
/** The Files trash folder (`/.Trash`), if there is one. */
|
||||
trashId(): string | null {
|
||||
for (const node of this.children(null)) {
|
||||
if (node.name === TRASH_FOLDER_NAME && node.kind === 'directory') return node.id;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Whether `id` is `ancestor` or below it. `ancestor` null: the top of Files. */
|
||||
isUnder(id: string, ancestor: string | null): boolean {
|
||||
let current: string | null = id;
|
||||
for (let hops = 0; current !== null && hops < 10_000; hops += 1) {
|
||||
if (current === ancestor) return true;
|
||||
const node = this.nodes.get(current);
|
||||
if (!node) return false;
|
||||
current = node.parentId;
|
||||
}
|
||||
return ancestor === null && current === null;
|
||||
}
|
||||
|
||||
/** Whether the node is in the trash. */
|
||||
inTrash(id: string): boolean {
|
||||
const trash = this.trashId();
|
||||
return !!trash && this.isUnder(id, trash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Everything below `rootId` (null: the whole account, minus the trash), parents before
|
||||
* children. Null when the root folder itself is gone or in the trash.
|
||||
*/
|
||||
subtree(rootId: string | null): RemoteNode[] | null {
|
||||
if (rootId !== null && (!this.nodes.has(rootId) || this.inTrash(rootId))) return null;
|
||||
const trash = this.trashId();
|
||||
const out: RemoteNode[] = [];
|
||||
const queue: (string | null)[] = [rootId];
|
||||
while (queue.length > 0) {
|
||||
const parent = queue.shift() as string | null;
|
||||
for (const child of this.children(parent)) {
|
||||
if (child.id === trash) continue;
|
||||
out.push(child);
|
||||
if (child.kind === 'directory') queue.push(child.id);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* The engine's record of one root: what both sides were at the last sync, per item. Main keeps
|
||||
* it (`loadState`/`saveState`), next to the root, as an opaque string.
|
||||
*
|
||||
* An item is a FileNode the root holds, with its place on both sides. `path` is the local path,
|
||||
* `name` the name in Files: the two differ where the disk needed another name (names.ts), and
|
||||
* keeping both is what keeps that from reading as a rename either way.
|
||||
*/
|
||||
|
||||
export interface BaseItem {
|
||||
/** The FileNode id. */
|
||||
id: string;
|
||||
kind: 'file' | 'directory';
|
||||
/** Local, relative to the root. */
|
||||
path: string;
|
||||
/** In Files. */
|
||||
name: string;
|
||||
/** The node's parent in Files. The root's folder (or null, the top of Files) for an item at the top. */
|
||||
parentId: string | null;
|
||||
// Files, at the last sync.
|
||||
blobId: string | null;
|
||||
size: number;
|
||||
modifiedMs: number;
|
||||
// This computer, at the last sync. An empty fileId: not known yet (a placeholder just placed).
|
||||
fileId: string;
|
||||
localSize: number;
|
||||
mtimeMs: number;
|
||||
}
|
||||
|
||||
export interface TooLarge {
|
||||
size: number;
|
||||
mtimeMs: number;
|
||||
}
|
||||
|
||||
export interface RootRecord {
|
||||
v: 1;
|
||||
/** The Files folder it was made for: a record of another one says nothing about this root. */
|
||||
remoteId: string | null;
|
||||
items: BaseItem[];
|
||||
/** Local files over the server's upload limit, as they were when that was found. */
|
||||
tooLarge: Record<string, TooLarge>;
|
||||
}
|
||||
|
||||
export function emptyRecord(remoteId: string | null): RootRecord {
|
||||
return { v: 1, remoteId, items: [], tooLarge: {} };
|
||||
}
|
||||
|
||||
function validItem(value: unknown): value is BaseItem {
|
||||
const item = value as BaseItem;
|
||||
return !!item
|
||||
&& typeof item.id === 'string' && item.id.length > 0
|
||||
&& (item.kind === 'file' || item.kind === 'directory')
|
||||
&& typeof item.path === 'string' && item.path.length > 0
|
||||
&& typeof item.name === 'string'
|
||||
&& (item.parentId === null || typeof item.parentId === 'string')
|
||||
&& (item.blobId === null || typeof item.blobId === 'string')
|
||||
&& Number.isFinite(item.size) && Number.isFinite(item.modifiedMs)
|
||||
&& typeof item.fileId === 'string' && Number.isFinite(item.localSize) && Number.isFinite(item.mtimeMs);
|
||||
}
|
||||
|
||||
/**
|
||||
* The record, or an empty one when there's none, it can't be read, or it was made for another
|
||||
* Files folder. Empty means "never synced": both sides are then put together without deleting
|
||||
* anything.
|
||||
*/
|
||||
export function parseRecord(raw: string | null, remoteId: string | null): RootRecord {
|
||||
if (!raw) return emptyRecord(remoteId);
|
||||
try {
|
||||
const parsed = JSON.parse(raw) as Partial<RootRecord>;
|
||||
if (parsed?.v !== 1 || parsed.remoteId !== remoteId || !Array.isArray(parsed.items)) return emptyRecord(remoteId);
|
||||
const tooLarge: Record<string, TooLarge> = {};
|
||||
for (const [path, entry] of Object.entries(parsed.tooLarge ?? {})) {
|
||||
if (entry && Number.isFinite(entry.size) && Number.isFinite(entry.mtimeMs)) tooLarge[path] = { size: entry.size, mtimeMs: entry.mtimeMs };
|
||||
}
|
||||
return { v: 1, remoteId, items: parsed.items.filter(validItem), tooLarge };
|
||||
} catch {
|
||||
return emptyRecord(remoteId);
|
||||
}
|
||||
}
|
||||
|
||||
export function serializeRecord(record: RootRecord): string {
|
||||
return JSON.stringify(record);
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* Files on this computer, the page's side: what the sync engine reports and what the
|
||||
* settings page and the Files screen can ask of it. The engine (lib/files-sync) keeps
|
||||
* folders on disk and the Windows drive the same as Files; the desktop shell does the
|
||||
* disk work (FilesControls in lib/desktop/types.ts).
|
||||
*
|
||||
* The store (stores/files-sync-store.ts) holds this state for the UI. The engine sets
|
||||
* it and registers a controller there; the UI never talks to the bridge itself.
|
||||
*/
|
||||
|
||||
import type { FilesDriveLetterState, FilesDriveState, FilesResult, FilesRoot } from '@/lib/desktop/types';
|
||||
|
||||
export type FilesSyncRootState =
|
||||
/** Reading both sides for the first time since the app started. */
|
||||
| 'starting'
|
||||
| 'syncing'
|
||||
/** Both sides are the same. */
|
||||
| 'idle'
|
||||
| 'paused'
|
||||
/** The server can't be reached; changes wait. */
|
||||
| 'offline'
|
||||
| 'error'
|
||||
/** A mass delete stopped it: the user has to say yes or no (`massDelete`). */
|
||||
| 'confirm-delete'
|
||||
/** The organisation's policy stopped it. */
|
||||
| 'blocked';
|
||||
|
||||
export interface FilesSyncRootStatus {
|
||||
rootId: string;
|
||||
state: FilesSyncRootState;
|
||||
/** Changes waiting to go either way. */
|
||||
pending: number;
|
||||
/** Done in the current run. */
|
||||
done: number;
|
||||
lastSyncedAt: number | null;
|
||||
/** For `error`: a key in the `files_sync` namespace saying what went wrong. */
|
||||
errorKey?: string;
|
||||
/** For `confirm-delete`: how many items would go, and where. */
|
||||
massDelete?: { count: number; side: 'local' | 'remote' };
|
||||
}
|
||||
|
||||
export type FilesSyncActivityKind =
|
||||
| 'uploaded'
|
||||
| 'downloaded'
|
||||
| 'folder-created'
|
||||
| 'renamed'
|
||||
| 'moved'
|
||||
/** Deleted for good: the server has no trash, or it was deleted on this computer by the other side. */
|
||||
| 'deleted'
|
||||
/** Into Files' trash, or the computer's. */
|
||||
| 'trashed'
|
||||
/** Both sides changed. Neither is lost: `detail` is the name of the copy kept next to it. */
|
||||
| 'conflict'
|
||||
/** A name this computer can't hold, shown under another name (`detail`). */
|
||||
| 'renamed-for-disk'
|
||||
/** Bigger than the server takes. Stays on this computer only. `detail`: the limit in bytes. */
|
||||
| 'too-large'
|
||||
/** Waiting for the server. */
|
||||
| 'waiting'
|
||||
/** Stopped before deleting many items, see FilesSyncRootStatus.massDelete. */
|
||||
| 'mass-delete'
|
||||
| 'error';
|
||||
|
||||
export interface FilesSyncActivity {
|
||||
id: string;
|
||||
at: number;
|
||||
rootId: string;
|
||||
kind: FilesSyncActivityKind;
|
||||
/** `up`: to Files. `down`: to this computer. */
|
||||
direction: 'up' | 'down' | null;
|
||||
/** Relative to the root, `/` between parts. */
|
||||
path: string;
|
||||
detail?: string;
|
||||
/** For `error` and `waiting`: a key in the `files_sync` namespace. */
|
||||
messageKey?: string;
|
||||
}
|
||||
|
||||
/** Where a FileNode is on this computer. */
|
||||
export interface FilesSyncCoverage {
|
||||
rootId: string;
|
||||
kind: 'folder' | 'drive';
|
||||
/** Relative to the root. */
|
||||
path: string;
|
||||
}
|
||||
|
||||
export type FilesSyncItemStatus =
|
||||
/** The same on both sides. */
|
||||
| 'synced'
|
||||
/** Going one way right now. */
|
||||
| 'syncing'
|
||||
/** Waiting to go. */
|
||||
| 'pending'
|
||||
| 'error'
|
||||
/** The drive: only in Files, fetched when opened. */
|
||||
| 'online-only';
|
||||
|
||||
/** What the UI can ask of the engine. Registered by the engine in the store. */
|
||||
export interface FilesSyncController {
|
||||
/** Shows the folder picker; needs the click it came from. */
|
||||
addFolder: (remoteId: string | null, remoteLabel: string) => Promise<FilesResult<FilesRoot>>;
|
||||
/** A folder stops syncing; its files stay. The drive: turned off. */
|
||||
removeRoot: (rootId: string) => Promise<void>;
|
||||
setPaused: (rootId: string, paused: boolean) => Promise<void>;
|
||||
/** Answer to `confirm-delete`. No: the deleted items come back from the other side. */
|
||||
confirmMassDelete: (rootId: string, allow: boolean) => Promise<void>;
|
||||
/** The current account's drive. */
|
||||
setDriveEnabled: (enabled: boolean) => Promise<FilesResult<FilesRoot | null>>;
|
||||
setDriveLetter: (letter: string | null) => Promise<FilesResult<FilesDriveLetterState>>;
|
||||
/** Where a FileNode of the current account is on this computer, if a root covers it. */
|
||||
coverage: (nodeId: string) => FilesSyncCoverage | null;
|
||||
/** Explorer, Finder or the file manager, on that file or folder. */
|
||||
showInFolder: (nodeId: string) => Promise<boolean>;
|
||||
clearActivity: () => void;
|
||||
}
|
||||
|
||||
export interface FilesSyncSnapshot {
|
||||
/** In the desktop app, with a shell that has the files bridge, in the main window. */
|
||||
available: boolean;
|
||||
/** The local account the engine runs for, or null when nobody is signed in. */
|
||||
account: string | null;
|
||||
roots: FilesRoot[];
|
||||
status: Record<string, FilesSyncRootStatus>;
|
||||
/** Newest first, capped. */
|
||||
activity: FilesSyncActivity[];
|
||||
/** Null off Windows or on an older shell. */
|
||||
drive: FilesDriveState | null;
|
||||
/** `FilesFolderSyncEnabled` is off. */
|
||||
folderSyncForcedOff: boolean;
|
||||
/** Per FileNode id of the current account, for rows in the Files screen. */
|
||||
items: Record<string, FilesSyncItemStatus>;
|
||||
}
|
||||
@@ -20,6 +20,8 @@ export type SettingsSearchTab =
|
||||
| 'calendar'
|
||||
| 'contacts'
|
||||
| 'files'
|
||||
/** Files on this computer, in the desktop app. */
|
||||
| 'files_sync'
|
||||
| 'addons'
|
||||
| 'offline'
|
||||
| 'privacy'
|
||||
@@ -369,6 +371,13 @@ export const tabSearchEntries: Record<Tab, SettingsSearchEntry[]> = {
|
||||
{ label: 'settings.files.behavior.title', advanced: true },
|
||||
{ label: 'settings.files.show_hidden.label', advanced: true },
|
||||
],
|
||||
// Desktop app only; the page is in the nav only while the sync engine runs.
|
||||
files_sync: [
|
||||
{ label: 'files_sync.drive.title', when: 'desktop' },
|
||||
{ label: 'files_sync.drive.label', when: 'desktop' },
|
||||
{ label: 'files_sync.folders.title', when: 'desktop' },
|
||||
{ label: 'files_sync.activity.title', when: 'desktop' },
|
||||
],
|
||||
addons: [
|
||||
{ label: 'settings.sidebar_apps.title' },
|
||||
{ label: 'settings.sidebar_apps.keep_loaded', advanced: true },
|
||||
@@ -417,6 +426,7 @@ export const tabSearchEntries: Record<Tab, SettingsSearchEntry[]> = {
|
||||
/** Pages added after `settings.tabs` keep their names in their own namespace. */
|
||||
const NEW_TAB_LABELS: Partial<Record<Tab, string>> = {
|
||||
offline: 'uxs_structure.tabs.offline',
|
||||
files_sync: 'files_sync.title',
|
||||
privacy: 'uxs_structure.tabs.privacy',
|
||||
about: 'uxs_structure.tabs.about',
|
||||
};
|
||||
@@ -449,6 +459,7 @@ export const tabKeywords: Record<Tab, string> = {
|
||||
calendar: 'event schedule appointment meeting timezone invitation ics ical webcal subscribe subscription tasks birthday working hours',
|
||||
contacts: 'address book contact',
|
||||
files: 'attachments cloud drive storage upload',
|
||||
files_sync: 'sync synchronize folder drive explorer finder computer local disk letter',
|
||||
addons: 'apps webview iframe plugins extensions addons sidebar',
|
||||
offline: 'offline connection storage device sync outbox local kept',
|
||||
privacy: 'privacy tracking remote images content read receipts favicons pictures telemetry crash reports',
|
||||
|
||||
@@ -8,7 +8,7 @@ export const SETTINGS_TAB_IDS: readonly SettingsSearchTab[] = [
|
||||
'account', 'general', 'notifications', 'appearance', 'accessibility',
|
||||
'message_list', 'reading', 'composing', 'vacation', 'filters', 'organize',
|
||||
'security', 'sharing', 'recovery', 'calendar', 'contacts', 'files',
|
||||
'addons', 'offline', 'privacy', 'backup', 'about',
|
||||
'files_sync', 'addons', 'offline', 'privacy', 'backup', 'about',
|
||||
];
|
||||
|
||||
// Map legacy tab IDs to current ones; runs once on read of localStorage and
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "لم تُرفق أو تُحفظ بعد، وتُحذف الآن: {names}.",
|
||||
"signout_held": "ما زالت مفتوحة في برنامج آخر، لذا لن تُحذف إلا بعد إغلاقها هناك: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "الملفات على هذا الحاسوب",
|
||||
"drive": {
|
||||
"title": "محرك أقراص الملفات",
|
||||
"label": "إظهار الملفات كمحرك أقراص",
|
||||
"description": "تظهر ملفاتك في مستكشف الملفات كمحرك أقراص. يُنزَّل الملف عندما تفتحه.",
|
||||
"unsupported": "يتطلب Windows 10 الإصدار 1809 أو أحدث.",
|
||||
"root_name": "محرك أقراص الملفات",
|
||||
"letter_label": "حرف محرك الأقراص",
|
||||
"letter_description": "يمنح محرك الأقراص حرفًا خاصًا به في مستكشف الملفات.",
|
||||
"letter_none": "بلا حرف"
|
||||
},
|
||||
"folders": {
|
||||
"title": "المجلدات المتزامنة",
|
||||
"description": "يبقى مجلد على هذا الحاسوب ومجلد في الملفات متطابقين، وتنتقل التغييرات في الاتجاهين.",
|
||||
"empty": "لا توجد مجلدات متزامنة بعد.",
|
||||
"forced_off": "أوقفت مؤسستك مزامنة المجلدات. تبقى الملفات الموجودة فيها على هذا الحاسوب.",
|
||||
"add": "إضافة مجلد…",
|
||||
"loading": "جارٍ تحميل مجلداتك…",
|
||||
"load_failed": "تعذّر تحميل مجلداتك في الملفات. حاول مرة أخرى.",
|
||||
"pick_title": "أي مجلد في الملفات؟",
|
||||
"pick_confirm": "اختيار مجلد على هذا الحاسوب…",
|
||||
"paired_with": "مع {folder} في الملفات",
|
||||
"pause": "إيقاف مؤقت",
|
||||
"resume": "استئناف",
|
||||
"remove": "إزالة…",
|
||||
"remove_title": "إيقاف مزامنة هذا المجلد؟",
|
||||
"remove_message": "تبقى الملفات على هذا الحاسوب في مكانها، وكذلك الملفات في الملفات. لن تنتقل التغييرات بينهما بعد الآن.",
|
||||
"remove_confirm": "إيقاف المزامنة",
|
||||
"add_failed": {
|
||||
"overlap": "هذا المجلد داخل مجلد متزامن، أو يحتوي على مجلد متزامن، أو هو مجلد نظام. اختر مجلدًا آخر.",
|
||||
"denied": "لا يستطيع التطبيق استخدام هذا المجلد. اختر مجلدًا آخر.",
|
||||
"policy": "لا تسمح مؤسستك بذلك.",
|
||||
"failed": "تعذّرت إضافة المجلد. حاول مرة أخرى."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "جارٍ البدء…",
|
||||
"idle": "محدَّث. آخر مزامنة {time}",
|
||||
"idle_never": "محدَّث",
|
||||
"syncing": "جارٍ المزامنة: اكتمل {done}، ويتبقى {pending}",
|
||||
"paused": "متوقف مؤقتًا",
|
||||
"offline": "غير متصل. {count, plural, =0 {التغييرات بانتظار الخادم} zero {# تغيير بانتظار الخادم} one {تغيير واحد بانتظار الخادم} two {تغييران بانتظار الخادم} few {# تغييرات بانتظار الخادم} many {# تغييرًا بانتظار الخادم} other {# تغيير بانتظار الخادم}}",
|
||||
"error": "متوقف: {reason}",
|
||||
"confirm_delete": "متوقف مؤقتًا حتى تجيب عن السؤال أدناه",
|
||||
"blocked": "أوقفته مؤسستك"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "حذف {count, plural, zero {# عنصر} one {عنصر واحد} two {عنصرين} few {# عناصر} many {# عنصرًا} other {# عنصر}}؟",
|
||||
"local": "{count, plural, zero {حُذف # عنصر} one {حُذف عنصر واحد} two {حُذف عنصران} few {حُذفت # عناصر} many {حُذف # عنصرًا} other {حُذف # عنصر}} من {folder} على هذا الحاسوب. هل تريد {count, plural, zero {حذفها} one {حذفه} two {حذفهما} few {حذفها} many {حذفها} other {حذفها}} في الملفات أيضًا؟",
|
||||
"remote": "{count, plural, zero {حُذف # عنصر} one {حُذف عنصر واحد} two {حُذف عنصران} few {حُذفت # عناصر} many {حُذف # عنصرًا} other {حُذف # عنصر}} من {folder} في الملفات. هل تريد {count, plural, zero {حذفها} one {حذفه} two {حذفهما} few {حذفها} many {حذفها} other {حذفها}} على هذا الحاسوب أيضًا؟",
|
||||
"allow": "{count, plural, zero {حذفها} one {حذفه} two {حذفهما} few {حذفها} many {حذفها} other {حذفها}}",
|
||||
"restore": "{count, plural, zero {استعادتها} one {استعادته} two {استعادتهما} few {استعادتها} many {استعادتها} other {استعادتها}}",
|
||||
"later": "القرار لاحقًا"
|
||||
},
|
||||
"activity": {
|
||||
"title": "النشاط الأخير",
|
||||
"empty": "لم يحدث شيء بعد.",
|
||||
"clear": "مسح",
|
||||
"to_files": "إلى الملفات",
|
||||
"to_computer": "إلى هذا الحاسوب",
|
||||
"mark_conflict": "تعارض",
|
||||
"mark_error": "خطأ",
|
||||
"mark_question": "بانتظار إجابتك",
|
||||
"uploaded": "رُفع {path}",
|
||||
"downloaded": "نُزّل {path}",
|
||||
"folder-created": "أُنشئ المجلد {path}",
|
||||
"renamed": "أُعيدت تسمية {detail} إلى {path}",
|
||||
"moved": "نُقل {detail} إلى {path}",
|
||||
"deleted": "حُذف {path}",
|
||||
"trashed": "نُقل {path} إلى سلة المهملات",
|
||||
"conflict": "تغيّر {path} في المكانين. حُفظت النسخة الأخرى باسم {detail}",
|
||||
"renamed-for-disk": "اسم {path} على هذا الحاسوب هو {detail}، لأن اسمه غير مسموح به هنا",
|
||||
"too-large": "{path} أكبر مما تسمح به الملفات ({detail}). يبقى على هذا الحاسوب فقط",
|
||||
"waiting": "{path} بانتظار الخادم",
|
||||
"mass-delete": "توقف مؤقتًا قبل حذف عناصر كثيرة",
|
||||
"error": "تعذّرت مزامنة {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "تعذّر الوصول إلى الخادم",
|
||||
"server_refused": "رفض الخادم التغيير",
|
||||
"too_large": "الملف كبير جدًا بالنسبة للملفات",
|
||||
"name_invalid": "هذا الاسم غير مسموح به",
|
||||
"disk_full": "القرص ممتلئ",
|
||||
"denied": "غير مسموح",
|
||||
"busy": "يستخدمه برنامج آخر",
|
||||
"quota": "مساحة التخزين الخاصة بك في الملفات ممتلئة",
|
||||
"not_found": "لم يعد موجودًا",
|
||||
"policy": "لا تسمح مؤسستك بذلك",
|
||||
"failed": "حدث خطأ ما"
|
||||
},
|
||||
"item": {
|
||||
"label": "على هذا الحاسوب",
|
||||
"synced": "متزامن",
|
||||
"syncing": "جارٍ المزامنة",
|
||||
"pending": "بانتظار المزامنة",
|
||||
"error": "تعذّرت المزامنة",
|
||||
"online-only": "في الملفات فقط، ويُنزَّل عند فتحه"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "إظهار في مستكشف الملفات",
|
||||
"finder": "إظهار في Finder",
|
||||
"file_manager": "إظهار في مدير الملفات",
|
||||
"failed": "تعذّر فتح المجلد."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "كتابة سريعة",
|
||||
"menu": "كتابة سريعة",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Encara sense adjuntar ni desar, i eliminats ara: {names}.",
|
||||
"signout_held": "Encara oberts en un altre programa, així que no s’eliminen fins que els tanqueu allà: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Fitxers en aquest ordinador",
|
||||
"drive": {
|
||||
"title": "Unitat Fitxers",
|
||||
"label": "Mostra Fitxers com una unitat",
|
||||
"description": "Els vostres Fitxers apareixen a l'Explorador de fitxers com una unitat. Un fitxer es baixa quan l'obriu.",
|
||||
"unsupported": "Cal el Windows 10 versió 1809 o posterior.",
|
||||
"root_name": "Unitat Fitxers",
|
||||
"letter_label": "Lletra d'unitat",
|
||||
"letter_description": "Dona a la unitat una lletra pròpia a l'Explorador de fitxers.",
|
||||
"letter_none": "Sense lletra"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Carpetes sincronitzades",
|
||||
"description": "Una carpeta d'aquest ordinador i una carpeta de Fitxers es mantenen iguals, en tots dos sentits.",
|
||||
"empty": "Encara no se sincronitza cap carpeta.",
|
||||
"forced_off": "La vostra organització ha desactivat la sincronització de carpetes. Els fitxers que contenen es queden en aquest ordinador.",
|
||||
"add": "Afegeix una carpeta…",
|
||||
"loading": "S'estan carregant les vostres carpetes…",
|
||||
"load_failed": "No s'han pogut carregar les vostres carpetes de Fitxers. Torneu-ho a provar.",
|
||||
"pick_title": "Quina carpeta de Fitxers?",
|
||||
"pick_confirm": "Trieu una carpeta d'aquest ordinador…",
|
||||
"paired_with": "Amb {folder} a Fitxers",
|
||||
"pause": "Posa en pausa",
|
||||
"resume": "Reprèn",
|
||||
"remove": "Elimina…",
|
||||
"remove_title": "Voleu deixar de sincronitzar aquesta carpeta?",
|
||||
"remove_message": "Els fitxers d'aquest ordinador es queden on són, i els de Fitxers també. Els canvis ja no passen de l'un a l'altre.",
|
||||
"remove_confirm": "Deixa de sincronitzar",
|
||||
"add_failed": {
|
||||
"overlap": "Aquesta carpeta és dins d'una carpeta sincronitzada, en conté una o és una carpeta del sistema. Trieu-ne una altra.",
|
||||
"denied": "L'aplicació no pot fer servir aquesta carpeta. Trieu-ne una altra.",
|
||||
"policy": "La vostra organització no ho permet.",
|
||||
"failed": "No s'ha pogut afegir la carpeta. Torneu-ho a provar."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "S'està iniciant…",
|
||||
"idle": "Al dia. Darrera sincronització {time}",
|
||||
"idle_never": "Al dia",
|
||||
"syncing": "S'està sincronitzant: {done} fets, {pending} pendents",
|
||||
"paused": "En pausa",
|
||||
"offline": "Sense connexió. {count, plural, =0 {Els canvis esperen el servidor} one {# canvi espera el servidor} other {# canvis esperen el servidor}}",
|
||||
"error": "Aturat: {reason}",
|
||||
"confirm_delete": "En pausa fins que respongueu la pregunta de sota",
|
||||
"blocked": "Desactivat per la vostra organització"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Voleu suprimir {count, plural, one {# element} other {# elements}}?",
|
||||
"local": "{count, plural, one {S'ha suprimit # element} other {S'han suprimit # elements}} de {folder} en aquest ordinador. Voleu {count, plural, one {suprimir-lo} other {suprimir-los}} també a Fitxers?",
|
||||
"remote": "{count, plural, one {S'ha suprimit # element} other {S'han suprimit # elements}} de {folder} a Fitxers. Voleu {count, plural, one {suprimir-lo} other {suprimir-los}} també en aquest ordinador?",
|
||||
"allow": "{count, plural, one {Suprimeix-lo} other {Suprimeix-los}}",
|
||||
"restore": "{count, plural, one {Recupera'l} other {Recupera'ls}}",
|
||||
"later": "Decideix més tard"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Activitat recent",
|
||||
"empty": "Encara no ha passat res.",
|
||||
"clear": "Esborra",
|
||||
"to_files": "Cap a Fitxers",
|
||||
"to_computer": "Cap a aquest ordinador",
|
||||
"mark_conflict": "Conflicte",
|
||||
"mark_error": "Ha fallat",
|
||||
"mark_question": "Cal la vostra resposta",
|
||||
"uploaded": "S'ha pujat {path}",
|
||||
"downloaded": "S'ha baixat {path}",
|
||||
"folder-created": "S'ha creat la carpeta {path}",
|
||||
"renamed": "S'ha canviat el nom de {detail} a {path}",
|
||||
"moved": "S'ha mogut {detail} a {path}",
|
||||
"deleted": "S'ha suprimit {path}",
|
||||
"trashed": "S'ha mogut {path} a la paperera",
|
||||
"conflict": "{path} s'ha canviat als dos llocs. L'altra versió es desa com a {detail}",
|
||||
"renamed-for-disk": "{path} es diu {detail} en aquest ordinador, perquè el seu nom no s'hi permet",
|
||||
"too-large": "{path} supera la mida que permet Fitxers ({detail}). Es queda només en aquest ordinador",
|
||||
"waiting": "{path} espera el servidor",
|
||||
"mass-delete": "En pausa abans de suprimir molts elements",
|
||||
"error": "No s'ha pogut sincronitzar {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "No es pot connectar amb el servidor",
|
||||
"server_refused": "El servidor ha rebutjat el canvi",
|
||||
"too_large": "El fitxer és massa gran per a Fitxers",
|
||||
"name_invalid": "El nom no està permès",
|
||||
"disk_full": "El disc és ple",
|
||||
"denied": "Accés denegat",
|
||||
"busy": "Un altre programa l'està fent servir",
|
||||
"quota": "L'emmagatzematge de Fitxers és ple",
|
||||
"not_found": "Ja no hi és",
|
||||
"policy": "La vostra organització no ho permet",
|
||||
"failed": "Alguna cosa ha anat malament"
|
||||
},
|
||||
"item": {
|
||||
"label": "En aquest ordinador",
|
||||
"synced": "Sincronitzat",
|
||||
"syncing": "S'està sincronitzant",
|
||||
"pending": "Pendent de sincronitzar",
|
||||
"error": "No s'ha pogut sincronitzar",
|
||||
"online-only": "Només a Fitxers, es baixa en obrir-lo"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Mostra a l'Explorador de fitxers",
|
||||
"finder": "Mostra al Finder",
|
||||
"file_manager": "Mostra al gestor de fitxers",
|
||||
"failed": "No s'ha pogut obrir la carpeta."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Redacció ràpida",
|
||||
"menu": "Redacció ràpida",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Zatím nepřipojené ani neuložené, a teď smazané: {names}.",
|
||||
"signout_held": "Stále otevřené v jiném programu, takže se smažou až po zavření: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Soubory v tomto počítači",
|
||||
"drive": {
|
||||
"title": "Jednotka Soubory",
|
||||
"label": "Zobrazit Soubory jako jednotku",
|
||||
"description": "Vaše Soubory se v Průzkumníkovi souborů zobrazí jako jednotka. Soubor se stáhne, až ho otevřete.",
|
||||
"unsupported": "Vyžaduje Windows 10 verze 1809 nebo novější.",
|
||||
"root_name": "Jednotka Soubory",
|
||||
"letter_label": "Písmeno jednotky",
|
||||
"letter_description": "Přidělí jednotce vlastní písmeno v Průzkumníkovi souborů.",
|
||||
"letter_none": "Bez písmene"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synchronizované složky",
|
||||
"description": "Složka v tomto počítači a složka v Souborech zůstávají stejné, změny jdou oběma směry.",
|
||||
"empty": "Zatím se nesynchronizují žádné složky.",
|
||||
"forced_off": "Vaše organizace vypnula synchronizaci složek. Soubory v nich zůstanou v tomto počítači.",
|
||||
"add": "Přidat složku…",
|
||||
"loading": "Načítání vašich složek…",
|
||||
"load_failed": "Vaše složky v Souborech se nepodařilo načíst. Zkuste to znovu.",
|
||||
"pick_title": "Kterou složku v Souborech?",
|
||||
"pick_confirm": "Vybrat složku v tomto počítači…",
|
||||
"paired_with": "Se složkou {folder} v Souborech",
|
||||
"pause": "Pozastavit",
|
||||
"resume": "Pokračovat",
|
||||
"remove": "Odebrat…",
|
||||
"remove_title": "Přestat synchronizovat tuto složku?",
|
||||
"remove_message": "Soubory v tomto počítači zůstanou, kde jsou, a stejně tak soubory v Souborech. Změny se mezi nimi už nebudou přenášet.",
|
||||
"remove_confirm": "Přestat synchronizovat",
|
||||
"add_failed": {
|
||||
"overlap": "Tato složka leží v synchronizované složce, takovou složku obsahuje nebo je to systémová složka. Vyberte jinou.",
|
||||
"denied": "Aplikace tuto složku nemůže používat. Vyberte jinou.",
|
||||
"policy": "Vaše organizace to nepovoluje.",
|
||||
"failed": "Složku se nepodařilo přidat. Zkuste to znovu."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Spouštění…",
|
||||
"idle": "Aktuální. Naposledy synchronizováno {time}",
|
||||
"idle_never": "Aktuální",
|
||||
"syncing": "Synchronizace: hotovo {done}, zbývá {pending}",
|
||||
"paused": "Pozastaveno",
|
||||
"offline": "Offline. {count, plural, =0 {Změny čekají na server} one {# změna čeká na server} few {# změny čekají na server} many {# změny čeká na server} other {# změn čeká na server}}",
|
||||
"error": "Zastaveno: {reason}",
|
||||
"confirm_delete": "Pozastaveno, dokud neodpovíte na otázku níže",
|
||||
"blocked": "Vypnuto vaší organizací"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Smazat {count, plural, one {# položku} few {# položky} many {# položky} other {# položek}}?",
|
||||
"local": "{count, plural, one {# položka byla smazána} few {# položky byly smazány} many {# položky bylo smazáno} other {# položek bylo smazáno}} ze složky {folder} v tomto počítači. Smazat {count, plural, one {ji} few {je} many {je} other {je}} i v Souborech?",
|
||||
"remote": "{count, plural, one {# položka byla smazána} few {# položky byly smazány} many {# položky bylo smazáno} other {# položek bylo smazáno}} ze složky {folder} v Souborech. Smazat {count, plural, one {ji} few {je} many {je} other {je}} i v tomto počítači?",
|
||||
"allow": "{count, plural, one {Smazat ji} few {Smazat je} many {Smazat je} other {Smazat je}}",
|
||||
"restore": "{count, plural, one {Vrátit ji zpět} few {Vrátit je zpět} many {Vrátit je zpět} other {Vrátit je zpět}}",
|
||||
"later": "Rozhodnout později"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Nedávná aktivita",
|
||||
"empty": "Zatím se nic nestalo.",
|
||||
"clear": "Vymazat",
|
||||
"to_files": "Do Souborů",
|
||||
"to_computer": "Do tohoto počítače",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Chyba",
|
||||
"mark_question": "Čeká na vaši odpověď",
|
||||
"uploaded": "Nahráno: {path}",
|
||||
"downloaded": "Staženo: {path}",
|
||||
"folder-created": "Vytvořena složka {path}",
|
||||
"renamed": "Přejmenováno: {detail} na {path}",
|
||||
"moved": "Přesunuto: {detail} do {path}",
|
||||
"deleted": "Smazáno: {path}",
|
||||
"trashed": "Přesunuto do koše: {path}",
|
||||
"conflict": "{path} se změnilo na obou místech. Druhá verze je uložena jako {detail}",
|
||||
"renamed-for-disk": "{path} se v tomto počítači jmenuje {detail}, protože tento název tu není povolený",
|
||||
"too-large": "{path} je větší, než Soubory povolují ({detail}). Zůstává jen v tomto počítači",
|
||||
"waiting": "{path} čeká na server",
|
||||
"mass-delete": "Pozastaveno před smazáním mnoha položek",
|
||||
"error": "{path} se nepodařilo synchronizovat"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Server není dostupný",
|
||||
"server_refused": "Server změnu odmítl",
|
||||
"too_large": "Soubor je pro Soubory příliš velký",
|
||||
"name_invalid": "Tento název není povolený",
|
||||
"disk_full": "Disk je plný",
|
||||
"denied": "Nepovoleno",
|
||||
"busy": "Používá ho jiný program",
|
||||
"quota": "Vaše úložiště v Souborech je plné",
|
||||
"not_found": "Už neexistuje",
|
||||
"policy": "Vaše organizace to nepovoluje",
|
||||
"failed": "Něco se pokazilo"
|
||||
},
|
||||
"item": {
|
||||
"label": "V tomto počítači",
|
||||
"synced": "Synchronizováno",
|
||||
"syncing": "Synchronizuje se",
|
||||
"pending": "Čeká na synchronizaci",
|
||||
"error": "Nepodařilo se synchronizovat",
|
||||
"online-only": "Jen v Souborech, stáhne se při otevření"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Zobrazit v Průzkumníkovi souborů",
|
||||
"finder": "Zobrazit ve Finderu",
|
||||
"file_manager": "Zobrazit ve správci souborů",
|
||||
"failed": "Složku se nepodařilo otevřít."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Rychlá zpráva",
|
||||
"menu": "Rychlá zpráva",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Endnu ikke vedhæftet eller gemt, og slettet nu: {names}.",
|
||||
"signout_held": "Stadig åbne i et andet program, så de slettes først, når du lukker dem der: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Filer på denne computer",
|
||||
"drive": {
|
||||
"title": "Filer-drev",
|
||||
"label": "Vis Filer som et drev",
|
||||
"description": "Dine Filer vises i Stifinder som et drev. En fil hentes, når du åbner den.",
|
||||
"unsupported": "Kræver Windows 10 version 1809 eller nyere.",
|
||||
"root_name": "Filer-drev",
|
||||
"letter_label": "Drevbogstav",
|
||||
"letter_description": "Giver drevet sit eget bogstav i Stifinder.",
|
||||
"letter_none": "Intet bogstav"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synkroniserede mapper",
|
||||
"description": "En mappe på denne computer og en mappe i Filer holdes ens, i begge retninger.",
|
||||
"empty": "Ingen mapper synkroniseres endnu.",
|
||||
"forced_off": "Din organisation har slået synkronisering af mapper fra. Filerne i dem bliver på denne computer.",
|
||||
"add": "Tilføj mappe…",
|
||||
"loading": "Indlæser dine mapper…",
|
||||
"load_failed": "Dine mapper i Filer kunne ikke indlæses. Prøv igen.",
|
||||
"pick_title": "Hvilken mappe i Filer?",
|
||||
"pick_confirm": "Vælg mappe på denne computer…",
|
||||
"paired_with": "Med {folder} i Filer",
|
||||
"pause": "Sæt på pause",
|
||||
"resume": "Genoptag",
|
||||
"remove": "Fjern…",
|
||||
"remove_title": "Stop synkronisering af denne mappe?",
|
||||
"remove_message": "Filerne på denne computer bliver, hvor de er, og det samme gør filerne i Filer. Ændringer går ikke længere fra den ene til den anden.",
|
||||
"remove_confirm": "Stop synkronisering",
|
||||
"add_failed": {
|
||||
"overlap": "Denne mappe ligger i en synkroniseret mappe, indeholder en eller er en systemmappe. Vælg en anden.",
|
||||
"denied": "Appen kan ikke bruge denne mappe. Vælg en anden.",
|
||||
"policy": "Din organisation tillader ikke dette.",
|
||||
"failed": "Mappen kunne ikke tilføjes. Prøv igen."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Starter…",
|
||||
"idle": "Opdateret. Sidst synkroniseret {time}",
|
||||
"idle_never": "Opdateret",
|
||||
"syncing": "Synkroniserer: {done} færdige, {pending} tilbage",
|
||||
"paused": "På pause",
|
||||
"offline": "Offline. {count, plural, =0 {Ændringer venter på serveren} one {# ændring venter på serveren} other {# ændringer venter på serveren}}",
|
||||
"error": "Stoppet: {reason}",
|
||||
"confirm_delete": "På pause, indtil du svarer på spørgsmålet nedenfor",
|
||||
"blocked": "Slået fra af din organisation"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Slet {count, plural, one {# element} other {# elementer}}?",
|
||||
"local": "{count, plural, one {# element blev} other {# elementer blev}} slettet fra {folder} på denne computer. Slet {count, plural, one {det} other {dem}} i Filer også?",
|
||||
"remote": "{count, plural, one {# element blev} other {# elementer blev}} slettet fra {folder} i Filer. Slet {count, plural, one {det} other {dem}} på denne computer også?",
|
||||
"allow": "{count, plural, one {Slet det} other {Slet dem}}",
|
||||
"restore": "{count, plural, one {Gendan det} other {Gendan dem}}",
|
||||
"later": "Beslut senere"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Seneste aktivitet",
|
||||
"empty": "Der er ikke sket noget endnu.",
|
||||
"clear": "Ryd",
|
||||
"to_files": "Til Filer",
|
||||
"to_computer": "Til denne computer",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Fejl",
|
||||
"mark_question": "Venter på dit svar",
|
||||
"uploaded": "Uploadede {path}",
|
||||
"downloaded": "Downloadede {path}",
|
||||
"folder-created": "Oprettede mappen {path}",
|
||||
"renamed": "Omdøbte {detail} til {path}",
|
||||
"moved": "Flyttede {detail} til {path}",
|
||||
"deleted": "Slettede {path}",
|
||||
"trashed": "Flyttede {path} til papirkurven",
|
||||
"conflict": "{path} blev ændret begge steder. Den anden version er gemt som {detail}",
|
||||
"renamed-for-disk": "{path} hedder {detail} på denne computer, fordi navnet ikke er tilladt her",
|
||||
"too-large": "{path} er større, end Filer tillader ({detail}). Den bliver kun på denne computer",
|
||||
"waiting": "{path} venter på serveren",
|
||||
"mass-delete": "Sat på pause før sletning af mange elementer",
|
||||
"error": "{path} kunne ikke synkroniseres"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Serveren kan ikke nås",
|
||||
"server_refused": "Serveren afviste ændringen",
|
||||
"too_large": "Filen er for stor til Filer",
|
||||
"name_invalid": "Navnet er ikke tilladt",
|
||||
"disk_full": "Disken er fuld",
|
||||
"denied": "Ingen adgang",
|
||||
"busy": "Et andet program bruger den",
|
||||
"quota": "Din lagerplads i Filer er fuld",
|
||||
"not_found": "Den findes ikke længere",
|
||||
"policy": "Din organisation tillader ikke dette",
|
||||
"failed": "Noget gik galt"
|
||||
},
|
||||
"item": {
|
||||
"label": "På denne computer",
|
||||
"synced": "Synkroniseret",
|
||||
"syncing": "Synkroniserer",
|
||||
"pending": "Venter på synkronisering",
|
||||
"error": "Kunne ikke synkronisere",
|
||||
"online-only": "Kun i Filer, hentes ved åbning"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Vis i Stifinder",
|
||||
"finder": "Vis i Finder",
|
||||
"file_manager": "Vis i filhåndtering",
|
||||
"failed": "Mappen kunne ikke åbnes."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Hurtig skrivning",
|
||||
"menu": "Hurtig skrivning",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Noch nicht angehängt oder gespeichert, und jetzt gelöscht: {names}.",
|
||||
"signout_held": "Noch in einem anderen Programm geöffnet, daher erst gelöscht, wenn Sie sie dort schließen: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Dateien auf diesem Computer",
|
||||
"drive": {
|
||||
"title": "Dateien-Laufwerk",
|
||||
"label": "Dateien als Laufwerk anzeigen",
|
||||
"description": "Ihre Dateien erscheinen im Explorer wie ein Laufwerk. Eine Datei wird heruntergeladen, wenn Sie sie öffnen.",
|
||||
"unsupported": "Erfordert Windows 10 Version 1809 oder neuer.",
|
||||
"root_name": "Dateien-Laufwerk",
|
||||
"letter_label": "Laufwerksbuchstabe",
|
||||
"letter_description": "Gibt dem Laufwerk einen eigenen Buchstaben im Explorer.",
|
||||
"letter_none": "Kein Buchstabe"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synchronisierte Ordner",
|
||||
"description": "Ein Ordner auf diesem Computer und ein Ordner in Dateien werden gleich gehalten, in beide Richtungen.",
|
||||
"empty": "Es werden noch keine Ordner synchronisiert.",
|
||||
"forced_off": "Ihre Organisation hat das Synchronisieren von Ordnern ausgeschaltet. Die Dateien darin bleiben auf diesem Computer.",
|
||||
"add": "Ordner hinzufügen…",
|
||||
"loading": "Ihre Ordner werden geladen…",
|
||||
"load_failed": "Ihre Ordner in Dateien konnten nicht geladen werden. Versuchen Sie es erneut.",
|
||||
"pick_title": "Welcher Ordner in Dateien?",
|
||||
"pick_confirm": "Ordner auf diesem Computer wählen…",
|
||||
"paired_with": "Mit {folder} in Dateien",
|
||||
"pause": "Pausieren",
|
||||
"resume": "Fortsetzen",
|
||||
"remove": "Entfernen…",
|
||||
"remove_title": "Synchronisierung dieses Ordners beenden?",
|
||||
"remove_message": "Die Dateien auf diesem Computer bleiben, wo sie sind, und die in Dateien auch. Änderungen werden nicht mehr übertragen.",
|
||||
"remove_confirm": "Synchronisierung beenden",
|
||||
"add_failed": {
|
||||
"overlap": "Dieser Ordner liegt in einem synchronisierten Ordner, enthält einen oder ist ein Systemordner. Wählen Sie einen anderen.",
|
||||
"denied": "Die App kann diesen Ordner nicht verwenden. Wählen Sie einen anderen.",
|
||||
"policy": "Ihre Organisation erlaubt das nicht.",
|
||||
"failed": "Der Ordner konnte nicht hinzugefügt werden. Versuchen Sie es erneut."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Wird gestartet…",
|
||||
"idle": "Aktuell. Zuletzt synchronisiert {time}",
|
||||
"idle_never": "Aktuell",
|
||||
"syncing": "Wird synchronisiert: {done} erledigt, {pending} ausstehend",
|
||||
"paused": "Pausiert",
|
||||
"offline": "Offline. {count, plural, =0 {Änderungen warten auf den Server} one {# Änderung wartet auf den Server} other {# Änderungen warten auf den Server}}",
|
||||
"error": "Gestoppt: {reason}",
|
||||
"confirm_delete": "Pausiert, bis Sie die Frage unten beantworten",
|
||||
"blocked": "Von Ihrer Organisation ausgeschaltet"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, one {# Element} other {# Elemente}} löschen?",
|
||||
"local": "{count, plural, one {# Element wurde} other {# Elemente wurden}} auf diesem Computer aus {folder} gelöscht. {count, plural, one {Soll es} other {Sollen sie}} auch in Dateien gelöscht werden?",
|
||||
"remote": "{count, plural, one {# Element wurde} other {# Elemente wurden}} in Dateien aus {folder} gelöscht. {count, plural, one {Soll es} other {Sollen sie}} auch auf diesem Computer gelöscht werden?",
|
||||
"allow": "{count, plural, one {Löschen} other {Alle löschen}}",
|
||||
"restore": "{count, plural, one {Wiederherstellen} other {Alle wiederherstellen}}",
|
||||
"later": "Später entscheiden"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Letzte Aktivitäten",
|
||||
"empty": "Bisher ist nichts passiert.",
|
||||
"clear": "Leeren",
|
||||
"to_files": "Nach Dateien",
|
||||
"to_computer": "Auf diesen Computer",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Fehler",
|
||||
"mark_question": "Wartet auf Ihre Antwort",
|
||||
"uploaded": "{path} hochgeladen",
|
||||
"downloaded": "{path} heruntergeladen",
|
||||
"folder-created": "Ordner {path} erstellt",
|
||||
"renamed": "{detail} in {path} umbenannt",
|
||||
"moved": "{detail} nach {path} verschoben",
|
||||
"deleted": "{path} gelöscht",
|
||||
"trashed": "{path} in den Papierkorb verschoben",
|
||||
"conflict": "{path} wurde an beiden Stellen geändert. Die andere Version bleibt als {detail} erhalten",
|
||||
"renamed-for-disk": "{path} heißt auf diesem Computer {detail}, weil der Name hier nicht erlaubt ist",
|
||||
"too-large": "{path} ist größer, als Dateien erlaubt ({detail}). Die Datei bleibt nur auf diesem Computer",
|
||||
"waiting": "{path} wartet auf den Server",
|
||||
"mass-delete": "Vor dem Löschen vieler Elemente angehalten",
|
||||
"error": "{path} konnte nicht synchronisiert werden"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Der Server ist nicht erreichbar",
|
||||
"server_refused": "Der Server hat die Änderung abgelehnt",
|
||||
"too_large": "Die Datei ist zu groß für Dateien",
|
||||
"name_invalid": "Der Name ist nicht erlaubt",
|
||||
"disk_full": "Der Datenträger ist voll",
|
||||
"denied": "Kein Zugriff",
|
||||
"busy": "Wird von einem anderen Programm verwendet",
|
||||
"quota": "Ihr Speicher in Dateien ist voll",
|
||||
"not_found": "Nicht mehr vorhanden",
|
||||
"policy": "Ihre Organisation erlaubt das nicht",
|
||||
"failed": "Etwas ist schiefgelaufen"
|
||||
},
|
||||
"item": {
|
||||
"label": "Auf diesem Computer",
|
||||
"synced": "Synchronisiert",
|
||||
"syncing": "Wird synchronisiert",
|
||||
"pending": "Wartet auf Synchronisierung",
|
||||
"error": "Synchronisierung fehlgeschlagen",
|
||||
"online-only": "Nur in Dateien, wird beim Öffnen heruntergeladen"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Im Explorer anzeigen",
|
||||
"finder": "Im Finder anzeigen",
|
||||
"file_manager": "Im Dateimanager anzeigen",
|
||||
"failed": "Der Ordner konnte nicht geöffnet werden."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Schnell schreiben",
|
||||
"menu": "Schnell schreiben",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Not attached or saved yet, and deleted now: {names}.",
|
||||
"signout_held": "Still open in another program, so not deleted until you close it there: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Files on this computer",
|
||||
"drive": {
|
||||
"title": "Files drive",
|
||||
"label": "Show Files as a drive",
|
||||
"description": "Your Files show in File Explorer like a drive. A file is downloaded when you open it.",
|
||||
"unsupported": "Needs Windows 10 version 1809 or later.",
|
||||
"root_name": "Files drive",
|
||||
"letter_label": "Drive letter",
|
||||
"letter_description": "Gives the drive its own letter in File Explorer.",
|
||||
"letter_none": "No letter"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synced folders",
|
||||
"description": "A folder on this computer and a folder in Files are kept the same, in both directions.",
|
||||
"empty": "No folders are synced yet.",
|
||||
"forced_off": "Your organisation turned off syncing folders. The files in them stay on this computer.",
|
||||
"add": "Add folder…",
|
||||
"loading": "Loading your folders…",
|
||||
"load_failed": "Your folders in Files couldn't be loaded. Try again.",
|
||||
"pick_title": "Which folder in Files?",
|
||||
"pick_confirm": "Choose folder on this computer…",
|
||||
"paired_with": "With {folder} in Files",
|
||||
"pause": "Pause",
|
||||
"resume": "Resume",
|
||||
"remove": "Remove…",
|
||||
"remove_title": "Stop syncing this folder?",
|
||||
"remove_message": "The files on this computer stay where they are, and so do the files in Files. Changes no longer go from one to the other.",
|
||||
"remove_confirm": "Stop syncing",
|
||||
"add_failed": {
|
||||
"overlap": "This folder is inside a synced folder, holds one, or is a system folder. Choose another one.",
|
||||
"denied": "The app can't use this folder. Choose another one.",
|
||||
"policy": "Your organisation doesn't allow this.",
|
||||
"failed": "The folder couldn't be added. Try again."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Starting…",
|
||||
"idle": "Up to date. Last synced {time}",
|
||||
"idle_never": "Up to date",
|
||||
"syncing": "Syncing: {done} done, {pending} to go",
|
||||
"paused": "Paused",
|
||||
"offline": "Offline. {count, plural, =0 {Changes wait for the server} one {# change waits for the server} other {# changes wait for the server}}",
|
||||
"error": "Stopped: {reason}",
|
||||
"confirm_delete": "Paused until you answer the question below",
|
||||
"blocked": "Turned off by your organisation"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Delete {count, plural, one {# item} other {# items}}?",
|
||||
"local": "{count, plural, one {# item was} other {# items were}} deleted from {folder} on this computer. Delete {count, plural, one {it} other {them}} in Files too?",
|
||||
"remote": "{count, plural, one {# item was} other {# items were}} deleted from {folder} in Files. Delete {count, plural, one {it} other {them}} on this computer too?",
|
||||
"allow": "{count, plural, one {Delete it} other {Delete them}}",
|
||||
"restore": "{count, plural, one {Bring it back} other {Bring them back}}",
|
||||
"later": "Decide later"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Recent activity",
|
||||
"empty": "Nothing has happened yet.",
|
||||
"clear": "Clear",
|
||||
"to_files": "To Files",
|
||||
"to_computer": "To this computer",
|
||||
"mark_conflict": "Conflict",
|
||||
"mark_error": "Error",
|
||||
"mark_question": "Needs your answer",
|
||||
"uploaded": "Uploaded {path}",
|
||||
"downloaded": "Downloaded {path}",
|
||||
"folder-created": "Created the folder {path}",
|
||||
"renamed": "Renamed {detail} to {path}",
|
||||
"moved": "Moved {detail} to {path}",
|
||||
"deleted": "Deleted {path}",
|
||||
"trashed": "Moved {path} to the trash",
|
||||
"conflict": "{path} was changed in both places. The other version is kept as {detail}",
|
||||
"renamed-for-disk": "{path} is called {detail} on this computer, because its name isn't allowed here",
|
||||
"too-large": "{path} is bigger than Files allows ({detail}). It stays on this computer only",
|
||||
"waiting": "{path} is waiting for the server",
|
||||
"mass-delete": "Paused before deleting many items",
|
||||
"error": "{path} couldn't be synced"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "The server can't be reached",
|
||||
"server_refused": "The server refused the change",
|
||||
"too_large": "The file is too big for Files",
|
||||
"name_invalid": "The name isn't allowed",
|
||||
"disk_full": "The disk is full",
|
||||
"denied": "Not allowed",
|
||||
"busy": "Another program is using it",
|
||||
"quota": "Your storage in Files is full",
|
||||
"not_found": "It's no longer there",
|
||||
"policy": "Your organisation doesn't allow this",
|
||||
"failed": "Something went wrong"
|
||||
},
|
||||
"item": {
|
||||
"label": "On this computer",
|
||||
"synced": "Synced",
|
||||
"syncing": "Syncing",
|
||||
"pending": "Waiting to sync",
|
||||
"error": "Couldn't sync",
|
||||
"online-only": "Only in Files, downloaded when opened"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Show in Explorer",
|
||||
"finder": "Show in Finder",
|
||||
"file_manager": "Show in file manager",
|
||||
"failed": "The folder couldn't be opened."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Quick compose",
|
||||
"menu": "Quick compose",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Aún sin adjuntar ni guardar, y eliminados ahora: {names}.",
|
||||
"signout_held": "Siguen abiertos en otro programa, así que no se eliminan hasta que los cierre allí: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Archivos en este ordenador",
|
||||
"drive": {
|
||||
"title": "Unidad de Archivos",
|
||||
"label": "Mostrar Archivos como una unidad",
|
||||
"description": "Tus Archivos aparecen en el Explorador de archivos como una unidad. Un archivo se descarga cuando lo abres.",
|
||||
"unsupported": "Requiere Windows 10 versión 1809 o posterior.",
|
||||
"root_name": "Unidad de Archivos",
|
||||
"letter_label": "Letra de unidad",
|
||||
"letter_description": "Asigna a la unidad su propia letra en el Explorador de archivos.",
|
||||
"letter_none": "Sin letra"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Carpetas sincronizadas",
|
||||
"description": "Una carpeta de este ordenador y una carpeta de Archivos se mantienen iguales, en los dos sentidos.",
|
||||
"empty": "Todavía no se sincroniza ninguna carpeta.",
|
||||
"forced_off": "Tu organización desactivó la sincronización de carpetas. Los archivos que contienen se quedan en este ordenador.",
|
||||
"add": "Añadir carpeta…",
|
||||
"loading": "Cargando tus carpetas…",
|
||||
"load_failed": "No se pudieron cargar tus carpetas de Archivos. Inténtalo de nuevo.",
|
||||
"pick_title": "¿Qué carpeta de Archivos?",
|
||||
"pick_confirm": "Elegir carpeta en este ordenador…",
|
||||
"paired_with": "Con {folder} en Archivos",
|
||||
"pause": "Pausar",
|
||||
"resume": "Reanudar",
|
||||
"remove": "Quitar…",
|
||||
"remove_title": "¿Dejar de sincronizar esta carpeta?",
|
||||
"remove_message": "Los archivos de este ordenador se quedan donde están, y también los de Archivos. Los cambios ya no pasan de uno a otro.",
|
||||
"remove_confirm": "Dejar de sincronizar",
|
||||
"add_failed": {
|
||||
"overlap": "Esta carpeta está dentro de una carpeta sincronizada, contiene una o es una carpeta del sistema. Elige otra.",
|
||||
"denied": "La aplicación no puede usar esta carpeta. Elige otra.",
|
||||
"policy": "Tu organización no lo permite.",
|
||||
"failed": "No se pudo añadir la carpeta. Inténtalo de nuevo."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Iniciando…",
|
||||
"idle": "Al día. Última sincronización {time}",
|
||||
"idle_never": "Al día",
|
||||
"syncing": "Sincronizando: {done} hechos, {pending} pendientes",
|
||||
"paused": "En pausa",
|
||||
"offline": "Sin conexión. {count, plural, =0 {Los cambios esperan al servidor} one {# cambio espera al servidor} other {# cambios esperan al servidor}}",
|
||||
"error": "Detenido: {reason}",
|
||||
"confirm_delete": "En pausa hasta que respondas la pregunta de abajo",
|
||||
"blocked": "Desactivado por tu organización"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "¿Eliminar {count, plural, one {# elemento} other {# elementos}}?",
|
||||
"local": "{count, plural, one {Se eliminó # elemento} other {Se eliminaron # elementos}} de {folder} en este ordenador. ¿{count, plural, one {Eliminarlo} other {Eliminarlos}} también en Archivos?",
|
||||
"remote": "{count, plural, one {Se eliminó # elemento} other {Se eliminaron # elementos}} de {folder} en Archivos. ¿{count, plural, one {Eliminarlo} other {Eliminarlos}} también en este ordenador?",
|
||||
"allow": "{count, plural, one {Eliminarlo} other {Eliminarlos}}",
|
||||
"restore": "{count, plural, one {Recuperarlo} other {Recuperarlos}}",
|
||||
"later": "Decidir más tarde"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Actividad reciente",
|
||||
"empty": "Todavía no ha pasado nada.",
|
||||
"clear": "Borrar",
|
||||
"to_files": "A Archivos",
|
||||
"to_computer": "A este ordenador",
|
||||
"mark_conflict": "Conflicto",
|
||||
"mark_error": "Fallo",
|
||||
"mark_question": "Necesita tu respuesta",
|
||||
"uploaded": "Se subió {path}",
|
||||
"downloaded": "Se descargó {path}",
|
||||
"folder-created": "Se creó la carpeta {path}",
|
||||
"renamed": "Se cambió el nombre de {detail} a {path}",
|
||||
"moved": "Se movió {detail} a {path}",
|
||||
"deleted": "Se eliminó {path}",
|
||||
"trashed": "Se movió {path} a la papelera",
|
||||
"conflict": "{path} se cambió en los dos sitios. La otra versión se guarda como {detail}",
|
||||
"renamed-for-disk": "{path} se llama {detail} en este ordenador, porque su nombre no está permitido aquí",
|
||||
"too-large": "{path} supera el tamaño que permite Archivos ({detail}). Se queda solo en este ordenador",
|
||||
"waiting": "{path} está esperando al servidor",
|
||||
"mass-delete": "En pausa antes de eliminar muchos elementos",
|
||||
"error": "No se pudo sincronizar {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "No se puede conectar con el servidor",
|
||||
"server_refused": "El servidor rechazó el cambio",
|
||||
"too_large": "El archivo es demasiado grande para Archivos",
|
||||
"name_invalid": "El nombre no está permitido",
|
||||
"disk_full": "El disco está lleno",
|
||||
"denied": "Sin permiso",
|
||||
"busy": "Otro programa lo está usando",
|
||||
"quota": "Tu almacenamiento en Archivos está lleno",
|
||||
"not_found": "Ya no existe",
|
||||
"policy": "Tu organización no lo permite",
|
||||
"failed": "Algo salió mal"
|
||||
},
|
||||
"item": {
|
||||
"label": "En este ordenador",
|
||||
"synced": "Sincronizado",
|
||||
"syncing": "Sincronizando",
|
||||
"pending": "Esperando para sincronizar",
|
||||
"error": "No se pudo sincronizar",
|
||||
"online-only": "Solo en Archivos, se descarga al abrirlo"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Mostrar en el Explorador de archivos",
|
||||
"finder": "Mostrar en Finder",
|
||||
"file_manager": "Mostrar en el gestor de archivos",
|
||||
"failed": "No se pudo abrir la carpeta."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Redacción rápida",
|
||||
"menu": "Redacción rápida",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Veel lisamata ja salvestamata ning nüüd kustutatud: {names}.",
|
||||
"signout_held": "Endiselt teises programmis avatud, seega kustutatakse alles pärast sulgemist: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Failid selles arvutis",
|
||||
"drive": {
|
||||
"title": "Failide draiv",
|
||||
"label": "Näita Faile draivina",
|
||||
"description": "Sinu Failid on Failihalduris näha draivina. Fail laaditakse alla, kui selle avad.",
|
||||
"unsupported": "Vajab Windows 10 versiooni 1809 või uuemat.",
|
||||
"root_name": "Failide draiv",
|
||||
"letter_label": "Draivitäht",
|
||||
"letter_description": "Annab draivile Failihalduris oma tähe.",
|
||||
"letter_none": "Täheta"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Sünkroonitud kaustad",
|
||||
"description": "Kaust selles arvutis ja kaust Failides hoitakse ühesugused, muudatused liiguvad mõlemas suunas.",
|
||||
"empty": "Ühtegi kausta pole veel sünkroonitud.",
|
||||
"forced_off": "Sinu organisatsioon lülitas kaustade sünkroonimise välja. Nendes olevad failid jäävad sellesse arvutisse.",
|
||||
"add": "Lisa kaust…",
|
||||
"loading": "Sinu kaustade laadimine…",
|
||||
"load_failed": "Sinu kaustu Failides ei õnnestunud laadida. Proovi uuesti.",
|
||||
"pick_title": "Milline kaust Failides?",
|
||||
"pick_confirm": "Vali kaust selles arvutis…",
|
||||
"paired_with": "Koos kaustaga {folder} Failides",
|
||||
"pause": "Peata",
|
||||
"resume": "Jätka",
|
||||
"remove": "Eemalda…",
|
||||
"remove_title": "Kas lõpetada selle kausta sünkroonimine?",
|
||||
"remove_message": "Selle arvuti failid jäävad oma kohale, samuti failid Failides. Muudatused ei liigu enam ühest teise.",
|
||||
"remove_confirm": "Lõpeta sünkroonimine",
|
||||
"add_failed": {
|
||||
"overlap": "See kaust asub sünkroonitud kaustas, sisaldab sellist kausta või on süsteemikaust. Vali mõni teine.",
|
||||
"denied": "Rakendus ei saa seda kausta kasutada. Vali mõni teine.",
|
||||
"policy": "Sinu organisatsioon ei luba seda.",
|
||||
"failed": "Kausta ei õnnestunud lisada. Proovi uuesti."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Käivitamine…",
|
||||
"idle": "Ajakohane. Viimati sünkroonitud {time}",
|
||||
"idle_never": "Ajakohane",
|
||||
"syncing": "Sünkroonimine: {done} tehtud, {pending} jäänud",
|
||||
"paused": "Peatatud",
|
||||
"offline": "Võrguühenduseta. {count, plural, =0 {Muudatused ootavad serverit} one {# muudatus ootab serverit} other {# muudatust ootab serverit}}",
|
||||
"error": "Peatunud: {reason}",
|
||||
"confirm_delete": "Peatatud, kuni vastad allolevale küsimusele",
|
||||
"blocked": "Sinu organisatsioon lülitas selle välja"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Kas kustutada {count, plural, one {# üksus} other {# üksust}}?",
|
||||
"local": "{count, plural, one {# üksus kustutati} other {# üksust kustutati}} selle arvuti kaustast {folder}. Kas kustutada {count, plural, one {see} other {need}} ka Failides?",
|
||||
"remote": "{count, plural, one {# üksus kustutati} other {# üksust kustutati}} Failide kaustast {folder}. Kas kustutada {count, plural, one {see} other {need}} ka selles arvutis?",
|
||||
"allow": "{count, plural, one {Kustuta see} other {Kustuta need}}",
|
||||
"restore": "{count, plural, one {Too see tagasi} other {Too need tagasi}}",
|
||||
"later": "Otsusta hiljem"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Viimased tegevused",
|
||||
"empty": "Midagi pole veel juhtunud.",
|
||||
"clear": "Tühjenda",
|
||||
"to_files": "Failidesse",
|
||||
"to_computer": "Sellesse arvutisse",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Viga",
|
||||
"mark_question": "Ootab sinu vastust",
|
||||
"uploaded": "Üles laaditud: {path}",
|
||||
"downloaded": "Alla laaditud: {path}",
|
||||
"folder-created": "Loodud kaust {path}",
|
||||
"renamed": "Ümber nimetatud: {detail} → {path}",
|
||||
"moved": "Teisaldatud: {detail} → {path}",
|
||||
"deleted": "Kustutatud: {path}",
|
||||
"trashed": "Prügikasti teisaldatud: {path}",
|
||||
"conflict": "{path} muutus mõlemas kohas. Teine versioon on alles nimega {detail}",
|
||||
"renamed-for-disk": "{path} on selles arvutis nimega {detail}, sest selle nimi pole siin lubatud",
|
||||
"too-large": "{path} on suurem, kui Failid lubavad ({detail}). See jääb ainult sellesse arvutisse",
|
||||
"waiting": "{path} ootab serverit",
|
||||
"mass-delete": "Peatatud enne paljude üksuste kustutamist",
|
||||
"error": "{path} sünkroonimine ebaõnnestus"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Server pole kättesaadav",
|
||||
"server_refused": "Server lükkas muudatuse tagasi",
|
||||
"too_large": "Fail on Failide jaoks liiga suur",
|
||||
"name_invalid": "See nimi pole lubatud",
|
||||
"disk_full": "Ketas on täis",
|
||||
"denied": "Pole lubatud",
|
||||
"busy": "Mõni teine programm kasutab seda",
|
||||
"quota": "Sinu salvestusruum Failides on täis",
|
||||
"not_found": "Seda pole enam olemas",
|
||||
"policy": "Sinu organisatsioon ei luba seda",
|
||||
"failed": "Midagi läks valesti"
|
||||
},
|
||||
"item": {
|
||||
"label": "Selles arvutis",
|
||||
"synced": "Sünkroonitud",
|
||||
"syncing": "Sünkroonimine",
|
||||
"pending": "Ootab sünkroonimist",
|
||||
"error": "Sünkroonimine ebaõnnestus",
|
||||
"online-only": "Ainult Failides, laaditakse avamisel alla"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Kuva Failihalduris",
|
||||
"finder": "Kuva Finderis",
|
||||
"file_manager": "Kuva failihalduris",
|
||||
"failed": "Kausta ei õnnestunud avada."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Kiirkiri",
|
||||
"menu": "Kiirkiri",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "هنوز پیوست یا ذخیره نشده و اکنون حذف میشود: {names}.",
|
||||
"signout_held": "هنوز در برنامه دیگری باز است، پس فقط پس از بستن در همانجا حذف میشود: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "فایلها روی این رایانه",
|
||||
"drive": {
|
||||
"title": "درایو فایلها",
|
||||
"label": "نمایش فایلها بهصورت درایو",
|
||||
"description": "فایلهای شما مانند یک درایو در کاوشگر فایل نمایش داده میشوند. هر فایل هنگام باز کردن بارگیری میشود.",
|
||||
"unsupported": "به Windows 10 نسخهٔ 1809 یا بالاتر نیاز دارد.",
|
||||
"root_name": "درایو فایلها",
|
||||
"letter_label": "حرف درایو",
|
||||
"letter_description": "به درایو در کاوشگر فایل یک حرف اختصاصی میدهد.",
|
||||
"letter_none": "بدون حرف"
|
||||
},
|
||||
"folders": {
|
||||
"title": "پوشههای همگامشده",
|
||||
"description": "یک پوشه روی این رایانه و یک پوشه در فایلها، در هر دو جهت یکسان نگه داشته میشوند.",
|
||||
"empty": "هنوز هیچ پوشهای همگام نشده است.",
|
||||
"forced_off": "سازمان شما همگامسازی پوشهها را خاموش کرده است. فایلهای داخل آنها روی این رایانه میمانند.",
|
||||
"add": "افزودن پوشه…",
|
||||
"loading": "در حال بارگذاری پوشههای شما…",
|
||||
"load_failed": "پوشههای شما در فایلها بارگذاری نشد. دوباره تلاش کنید.",
|
||||
"pick_title": "کدام پوشه در فایلها؟",
|
||||
"pick_confirm": "انتخاب پوشه روی این رایانه…",
|
||||
"paired_with": "با {folder} در فایلها",
|
||||
"pause": "توقف موقت",
|
||||
"resume": "ادامه",
|
||||
"remove": "حذف…",
|
||||
"remove_title": "همگامسازی این پوشه متوقف شود؟",
|
||||
"remove_message": "فایلهای روی این رایانه سر جای خود میمانند و فایلهای داخل فایلها هم همینطور. تغییرات دیگر از یکی به دیگری منتقل نمیشوند.",
|
||||
"remove_confirm": "توقف همگامسازی",
|
||||
"add_failed": {
|
||||
"overlap": "این پوشه داخل یک پوشهٔ همگامشده است، یک پوشهٔ همگامشده را در خود دارد، یا پوشهٔ سیستمی است. پوشهٔ دیگری انتخاب کنید.",
|
||||
"denied": "برنامه نمیتواند از این پوشه استفاده کند. پوشهٔ دیگری انتخاب کنید.",
|
||||
"policy": "سازمان شما اجازهٔ این کار را نمیدهد.",
|
||||
"failed": "پوشه اضافه نشد. دوباره تلاش کنید."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "در حال شروع…",
|
||||
"idle": "بهروز است. آخرین همگامسازی {time}",
|
||||
"idle_never": "بهروز است",
|
||||
"syncing": "در حال همگامسازی: {done} انجام شد، {pending} مانده",
|
||||
"paused": "متوقفشده",
|
||||
"offline": "آفلاین. {count, plural, =0 {تغییرات منتظر سرور هستند} other {# تغییر منتظر سرور است}}",
|
||||
"error": "متوقف شد: {reason}",
|
||||
"confirm_delete": "تا وقتی به پرسش زیر پاسخ دهید متوقف است",
|
||||
"blocked": "سازمان شما آن را خاموش کرده است"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, other {# مورد}} حذف شود؟",
|
||||
"local": "{count, plural, other {# مورد}} از {folder} روی این رایانه حذف شد. در فایلها هم حذف شود؟",
|
||||
"remote": "{count, plural, other {# مورد}} از {folder} در فایلها حذف شد. روی این رایانه هم حذف شود؟",
|
||||
"allow": "{count, plural, other {حذف}}",
|
||||
"restore": "{count, plural, other {بازگرداندن}}",
|
||||
"later": "بعداً تصمیم میگیرم"
|
||||
},
|
||||
"activity": {
|
||||
"title": "فعالیتهای اخیر",
|
||||
"empty": "هنوز اتفاقی نیفتاده است.",
|
||||
"clear": "پاک کردن",
|
||||
"to_files": "به فایلها",
|
||||
"to_computer": "به این رایانه",
|
||||
"mark_conflict": "تعارض",
|
||||
"mark_error": "خطا",
|
||||
"mark_question": "نیاز به پاسخ شما",
|
||||
"uploaded": "{path} بارگذاری شد",
|
||||
"downloaded": "{path} بارگیری شد",
|
||||
"folder-created": "پوشهٔ {path} ساخته شد",
|
||||
"renamed": "نام {detail} به {path} تغییر کرد",
|
||||
"moved": "{detail} به {path} منتقل شد",
|
||||
"deleted": "{path} حذف شد",
|
||||
"trashed": "{path} به سطل زباله منتقل شد",
|
||||
"conflict": "{path} در هر دو جا تغییر کرد. نسخهٔ دیگر با نام {detail} نگه داشته شد",
|
||||
"renamed-for-disk": "نام {path} روی این رایانه {detail} است، چون نام اصلی آن اینجا مجاز نیست",
|
||||
"too-large": "{path} از حدی که فایلها اجازه میدهد ({detail}) بزرگتر است. فقط روی این رایانه میماند",
|
||||
"waiting": "{path} منتظر سرور است",
|
||||
"mass-delete": "پیش از حذف تعداد زیادی مورد متوقف شد",
|
||||
"error": "{path} همگامسازی نشد"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "دسترسی به سرور ممکن نیست",
|
||||
"server_refused": "سرور تغییر را نپذیرفت",
|
||||
"too_large": "این فایل از حدی که فایلها اجازه میدهد بزرگتر است",
|
||||
"name_invalid": "این نام مجاز نیست",
|
||||
"disk_full": "دیسک پر است",
|
||||
"denied": "مجاز نیست",
|
||||
"busy": "برنامهٔ دیگری از آن استفاده میکند",
|
||||
"quota": "فضای ذخیرهسازی شما در فایلها پر است",
|
||||
"not_found": "دیگر وجود ندارد",
|
||||
"policy": "سازمان شما اجازهٔ این کار را نمیدهد",
|
||||
"failed": "مشکلی پیش آمد"
|
||||
},
|
||||
"item": {
|
||||
"label": "روی این رایانه",
|
||||
"synced": "همگامشده",
|
||||
"syncing": "در حال همگامسازی",
|
||||
"pending": "در انتظار همگامسازی",
|
||||
"error": "همگامسازی نشد",
|
||||
"online-only": "فقط در فایلها، هنگام باز کردن بارگیری میشود"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "نمایش در کاوشگر فایل",
|
||||
"finder": "نمایش در Finder",
|
||||
"file_manager": "نمایش در مدیر فایل",
|
||||
"failed": "پوشه باز نشد."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "نوشتن سریع",
|
||||
"menu": "نوشتن سریع",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Pas encore jointes ni enregistrées, et supprimées maintenant : {names}.",
|
||||
"signout_held": "Encore ouvertes dans un autre programme, donc supprimées seulement une fois fermées : {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Fichiers sur cet ordinateur",
|
||||
"drive": {
|
||||
"title": "Lecteur Fichiers",
|
||||
"label": "Afficher Fichiers comme un lecteur",
|
||||
"description": "Vos Fichiers apparaissent dans l'Explorateur de fichiers comme un lecteur. Un fichier est téléchargé quand vous l'ouvrez.",
|
||||
"unsupported": "Nécessite Windows 10 version 1809 ou ultérieure.",
|
||||
"root_name": "Lecteur Fichiers",
|
||||
"letter_label": "Lettre de lecteur",
|
||||
"letter_description": "Donne au lecteur sa propre lettre dans l'Explorateur de fichiers.",
|
||||
"letter_none": "Aucune lettre"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Dossiers synchronisés",
|
||||
"description": "Un dossier sur cet ordinateur et un dossier dans Fichiers restent identiques, dans les deux sens.",
|
||||
"empty": "Aucun dossier n'est encore synchronisé.",
|
||||
"forced_off": "Votre organisation a désactivé la synchronisation des dossiers. Les fichiers qu'ils contiennent restent sur cet ordinateur.",
|
||||
"add": "Ajouter un dossier…",
|
||||
"loading": "Chargement de vos dossiers…",
|
||||
"load_failed": "Vos dossiers dans Fichiers n'ont pas pu être chargés. Réessayez.",
|
||||
"pick_title": "Quel dossier dans Fichiers ?",
|
||||
"pick_confirm": "Choisir un dossier sur cet ordinateur…",
|
||||
"paired_with": "Avec {folder} dans Fichiers",
|
||||
"pause": "Suspendre",
|
||||
"resume": "Reprendre",
|
||||
"remove": "Retirer…",
|
||||
"remove_title": "Arrêter de synchroniser ce dossier ?",
|
||||
"remove_message": "Les fichiers sur cet ordinateur restent où ils sont, tout comme ceux dans Fichiers. Les modifications ne passent plus de l'un à l'autre.",
|
||||
"remove_confirm": "Arrêter la synchronisation",
|
||||
"add_failed": {
|
||||
"overlap": "Ce dossier se trouve dans un dossier synchronisé, en contient un ou est un dossier système. Choisissez-en un autre.",
|
||||
"denied": "L'application ne peut pas utiliser ce dossier. Choisissez-en un autre.",
|
||||
"policy": "Votre organisation ne l'autorise pas.",
|
||||
"failed": "Le dossier n'a pas pu être ajouté. Réessayez."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Démarrage…",
|
||||
"idle": "À jour. Dernière synchronisation {time}",
|
||||
"idle_never": "À jour",
|
||||
"syncing": "Synchronisation : {done} terminés, {pending} restants",
|
||||
"paused": "Suspendu",
|
||||
"offline": "Hors ligne. {count, plural, =0 {Les modifications attendent le serveur} one {# modification attend le serveur} other {# modifications attendent le serveur}}",
|
||||
"error": "Arrêté : {reason}",
|
||||
"confirm_delete": "Suspendu jusqu'à ce que vous répondiez à la question ci-dessous",
|
||||
"blocked": "Désactivé par votre organisation"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Supprimer {count, plural, one {# élément} other {# éléments}} ?",
|
||||
"local": "{count, plural, one {# élément a été supprimé} other {# éléments ont été supprimés}} de {folder} sur cet ordinateur. {count, plural, one {Le supprimer} other {Les supprimer}} aussi dans Fichiers ?",
|
||||
"remote": "{count, plural, one {# élément a été supprimé} other {# éléments ont été supprimés}} de {folder} dans Fichiers. {count, plural, one {Le supprimer} other {Les supprimer}} aussi sur cet ordinateur ?",
|
||||
"allow": "{count, plural, one {Le supprimer} other {Les supprimer}}",
|
||||
"restore": "{count, plural, one {Le restaurer} other {Les restaurer}}",
|
||||
"later": "Décider plus tard"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Activité récente",
|
||||
"empty": "Rien ne s'est encore passé.",
|
||||
"clear": "Effacer",
|
||||
"to_files": "Vers Fichiers",
|
||||
"to_computer": "Vers cet ordinateur",
|
||||
"mark_conflict": "Conflit",
|
||||
"mark_error": "Erreur",
|
||||
"mark_question": "Attend votre réponse",
|
||||
"uploaded": "{path} téléversé",
|
||||
"downloaded": "{path} téléchargé",
|
||||
"folder-created": "Dossier {path} créé",
|
||||
"renamed": "{detail} renommé en {path}",
|
||||
"moved": "{detail} déplacé vers {path}",
|
||||
"deleted": "{path} supprimé",
|
||||
"trashed": "{path} placé dans la corbeille",
|
||||
"conflict": "{path} a été modifié aux deux endroits. L'autre version est conservée sous le nom {detail}",
|
||||
"renamed-for-disk": "{path} s'appelle {detail} sur cet ordinateur, car son nom n'y est pas autorisé",
|
||||
"too-large": "{path} dépasse la taille autorisée par Fichiers ({detail}). Il reste uniquement sur cet ordinateur",
|
||||
"waiting": "{path} attend le serveur",
|
||||
"mass-delete": "Suspendu avant de supprimer de nombreux éléments",
|
||||
"error": "{path} n'a pas pu être synchronisé"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Le serveur est injoignable",
|
||||
"server_refused": "Le serveur a refusé la modification",
|
||||
"too_large": "Le fichier est trop volumineux pour Fichiers",
|
||||
"name_invalid": "Ce nom n'est pas autorisé",
|
||||
"disk_full": "Le disque est plein",
|
||||
"denied": "Accès refusé",
|
||||
"busy": "Un autre programme l'utilise",
|
||||
"quota": "Votre espace de stockage dans Fichiers est plein",
|
||||
"not_found": "Il n'existe plus",
|
||||
"policy": "Votre organisation ne l'autorise pas",
|
||||
"failed": "Une erreur s'est produite"
|
||||
},
|
||||
"item": {
|
||||
"label": "Sur cet ordinateur",
|
||||
"synced": "Synchronisé",
|
||||
"syncing": "Synchronisation en cours",
|
||||
"pending": "En attente de synchronisation",
|
||||
"error": "Échec de la synchronisation",
|
||||
"online-only": "Uniquement dans Fichiers, téléchargé à l'ouverture"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Afficher dans l'Explorateur de fichiers",
|
||||
"finder": "Afficher dans le Finder",
|
||||
"file_manager": "Afficher dans le gestionnaire de fichiers",
|
||||
"failed": "Le dossier n'a pas pu être ouvert."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Rédaction rapide",
|
||||
"menu": "Rédaction rapide",
|
||||
|
||||
@@ -7651,6 +7651,112 @@
|
||||
"signout_changed": "עדיין לא צורפו או נשמרו, ונמחקים עכשיו: {names}.",
|
||||
"signout_held": "עדיין פתוחים בתוכנה אחרת, ולכן יימחקו רק אחרי שתסגרו אותם שם: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "קבצים במחשב הזה",
|
||||
"drive": {
|
||||
"title": "כונן קבצים",
|
||||
"label": "הצגת קבצים ככונן",
|
||||
"description": "הקבצים שלך מופיעים בסייר הקבצים כמו כונן. כל קובץ יורד כשפותחים אותו.",
|
||||
"unsupported": "נדרש Windows 10 גרסה 1809 ואילך.",
|
||||
"root_name": "כונן קבצים",
|
||||
"letter_label": "אות כונן",
|
||||
"letter_description": "נותן לכונן אות משלו בסייר הקבצים.",
|
||||
"letter_none": "ללא אות"
|
||||
},
|
||||
"folders": {
|
||||
"title": "תיקיות מסונכרנות",
|
||||
"description": "תיקיה במחשב הזה ותיקיה בקבצים נשמרות זהות, בשני הכיוונים.",
|
||||
"empty": "עדיין אין תיקיות מסונכרנות.",
|
||||
"forced_off": "הארגון שלך כיבה את סנכרון התיקיות. הקבצים שבהן נשארים במחשב הזה.",
|
||||
"add": "הוספת תיקיה…",
|
||||
"loading": "התיקיות שלך נטענות…",
|
||||
"load_failed": "לא ניתן לטעון את התיקיות שלך בקבצים. כדאי לנסות שוב.",
|
||||
"pick_title": "איזו תיקיה בקבצים?",
|
||||
"pick_confirm": "בחירת תיקיה במחשב הזה…",
|
||||
"paired_with": "עם {folder} בקבצים",
|
||||
"pause": "השהיה",
|
||||
"resume": "המשך",
|
||||
"remove": "הסרה…",
|
||||
"remove_title": "להפסיק לסנכרן את התיקיה הזו?",
|
||||
"remove_message": "הקבצים במחשב הזה נשארים במקומם, וכך גם הקבצים בקבצים. שינויים כבר לא יעברו מצד אחד לשני.",
|
||||
"remove_confirm": "הפסקת הסנכרון",
|
||||
"add_failed": {
|
||||
"overlap": "התיקיה הזו נמצאת בתוך תיקיה מסונכרנת, מכילה תיקיה מסונכרנת, או שהיא תיקיית מערכת. יש לבחור תיקיה אחרת.",
|
||||
"denied": "היישום לא יכול להשתמש בתיקיה הזו. יש לבחור תיקיה אחרת.",
|
||||
"policy": "הארגון שלך לא מאפשר זאת.",
|
||||
"failed": "לא ניתן להוסיף את התיקיה. כדאי לנסות שוב."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "מתחיל…",
|
||||
"idle": "מעודכן. סונכרן לאחרונה {time}",
|
||||
"idle_never": "מעודכן",
|
||||
"syncing": "מסנכרן: {done} הושלמו, {pending} נותרו",
|
||||
"paused": "מושהה",
|
||||
"offline": "לא מקוון. {count, plural, =0 {שינויים ממתינים לשרת} one {שינוי אחד ממתין לשרת} two {שני שינויים ממתינים לשרת} other {# שינויים ממתינים לשרת}}",
|
||||
"error": "נעצר: {reason}",
|
||||
"confirm_delete": "מושהה עד לתשובה על השאלה למטה",
|
||||
"blocked": "כובה על ידי הארגון שלך"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "למחוק {count, plural, one {פריט אחד} two {שני פריטים} other {# פריטים}}?",
|
||||
"local": "{count, plural, one {פריט אחד נמחק} two {שני פריטים נמחקו} other {# פריטים נמחקו}} מ-{folder} במחשב הזה. למחוק {count, plural, one {אותו} two {אותם} other {אותם}} גם בקבצים?",
|
||||
"remote": "{count, plural, one {פריט אחד נמחק} two {שני פריטים נמחקו} other {# פריטים נמחקו}} מ-{folder} בקבצים. למחוק {count, plural, one {אותו} two {אותם} other {אותם}} גם במחשב הזה?",
|
||||
"allow": "{count, plural, one {למחוק אותו} two {למחוק אותם} other {למחוק אותם}}",
|
||||
"restore": "{count, plural, one {להחזיר אותו} two {להחזיר אותם} other {להחזיר אותם}}",
|
||||
"later": "להחליט אחר כך"
|
||||
},
|
||||
"activity": {
|
||||
"title": "פעילות אחרונה",
|
||||
"empty": "עדיין לא קרה כלום.",
|
||||
"clear": "ניקוי",
|
||||
"to_files": "לקבצים",
|
||||
"to_computer": "למחשב הזה",
|
||||
"mark_conflict": "התנגשות",
|
||||
"mark_error": "שגיאה",
|
||||
"mark_question": "נדרשת תשובה",
|
||||
"uploaded": "{path} הועלה",
|
||||
"downloaded": "{path} הורד",
|
||||
"folder-created": "התיקיה {path} נוצרה",
|
||||
"renamed": "השם של {detail} שונה ל-{path}",
|
||||
"moved": "{detail} הועבר ל-{path}",
|
||||
"deleted": "{path} נמחק",
|
||||
"trashed": "{path} הועבר לאשפה",
|
||||
"conflict": "{path} שונה בשני המקומות. הגרסה השנייה נשמרה בשם {detail}",
|
||||
"renamed-for-disk": "{path} נקרא {detail} במחשב הזה, כי השם שלו לא מותר כאן",
|
||||
"too-large": "{path} גדול יותר ממה שקבצים מאפשר ({detail}). הוא נשאר רק במחשב הזה",
|
||||
"waiting": "{path} ממתין לשרת",
|
||||
"mass-delete": "הושהה לפני מחיקה של פריטים רבים",
|
||||
"error": "לא ניתן לסנכרן את {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "אין גישה לשרת",
|
||||
"server_refused": "השרת דחה את השינוי",
|
||||
"too_large": "הקובץ גדול מדי עבור קבצים",
|
||||
"name_invalid": "השם לא מותר",
|
||||
"disk_full": "הדיסק מלא",
|
||||
"denied": "אין הרשאה",
|
||||
"busy": "תוכנה אחרת משתמשת בו",
|
||||
"quota": "האחסון שלך בקבצים מלא",
|
||||
"not_found": "הוא כבר לא קיים",
|
||||
"policy": "הארגון שלך לא מאפשר זאת",
|
||||
"failed": "משהו השתבש"
|
||||
},
|
||||
"item": {
|
||||
"label": "במחשב הזה",
|
||||
"synced": "מסונכרן",
|
||||
"syncing": "מסנכרן",
|
||||
"pending": "ממתין לסנכרון",
|
||||
"error": "הסנכרון נכשל",
|
||||
"online-only": "רק בקבצים, יורד כשפותחים אותו"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "הצגה בסייר הקבצים",
|
||||
"finder": "הצגה ב-Finder",
|
||||
"file_manager": "הצגה במנהל הקבצים",
|
||||
"failed": "לא ניתן לפתוח את התיקיה."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "כתיבה מהירה",
|
||||
"menu": "כתיבה מהירה",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Még nincs csatolva vagy mentve, és most törlődik: {names}.",
|
||||
"signout_held": "Még nyitva van egy másik programban, ezért csak a bezárása után törlődik: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Fájlok ezen a számítógépen",
|
||||
"drive": {
|
||||
"title": "Fájlok meghajtó",
|
||||
"label": "Fájlok megjelenítése meghajtóként",
|
||||
"description": "A Fájlok meghajtóként jelenik meg a Fájlkezelőben. Egy fájl akkor töltődik le, amikor megnyitod.",
|
||||
"unsupported": "Windows 10 1809-es vagy újabb verzió szükséges.",
|
||||
"root_name": "Fájlok meghajtó",
|
||||
"letter_label": "Meghajtóbetűjel",
|
||||
"letter_description": "Saját betűjelet ad a meghajtónak a Fájlkezelőben.",
|
||||
"letter_none": "Nincs betűjel"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Szinkronizált mappák",
|
||||
"description": "Egy mappa ezen a számítógépen és egy mappa a Fájlokban mindig egyforma marad, a változások mindkét irányba mennek.",
|
||||
"empty": "Még nincs szinkronizált mappa.",
|
||||
"forced_off": "A szervezeted kikapcsolta a mappák szinkronizálását. A bennük lévő fájlok ezen a számítógépen maradnak.",
|
||||
"add": "Mappa hozzáadása…",
|
||||
"loading": "Mappáid betöltése…",
|
||||
"load_failed": "Nem sikerült betölteni a mappáidat a Fájlokból. Próbáld újra.",
|
||||
"pick_title": "Melyik mappa a Fájlokban?",
|
||||
"pick_confirm": "Mappa kiválasztása ezen a számítógépen…",
|
||||
"paired_with": "A Fájlokban lévő {folder} mappával",
|
||||
"pause": "Szüneteltetés",
|
||||
"resume": "Folytatás",
|
||||
"remove": "Eltávolítás…",
|
||||
"remove_title": "Leállítod a mappa szinkronizálását?",
|
||||
"remove_message": "A fájlok ezen a számítógépen a helyükön maradnak, és a Fájlokban lévők is. A változások többé nem kerülnek át egyikből a másikba.",
|
||||
"remove_confirm": "Szinkronizálás leállítása",
|
||||
"add_failed": {
|
||||
"overlap": "Ez a mappa egy szinkronizált mappán belül van, tartalmaz egyet, vagy rendszermappa. Válassz másikat.",
|
||||
"denied": "Az alkalmazás nem használhatja ezt a mappát. Válassz másikat.",
|
||||
"policy": "A szervezeted ezt nem engedélyezi.",
|
||||
"failed": "Nem sikerült hozzáadni a mappát. Próbáld újra."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Indítás…",
|
||||
"idle": "Naprakész. Utolsó szinkronizálás: {time}",
|
||||
"idle_never": "Naprakész",
|
||||
"syncing": "Szinkronizálás: {done} kész, {pending} van hátra",
|
||||
"paused": "Szüneteltetve",
|
||||
"offline": "Offline. {count, plural, =0 {A változások a kiszolgálóra várnak} one {# változás a kiszolgálóra vár} other {# változás a kiszolgálóra vár}}",
|
||||
"error": "Leállt: {reason}",
|
||||
"confirm_delete": "Szüneteltetve, amíg nem válaszolsz a lenti kérdésre",
|
||||
"blocked": "A szervezeted kikapcsolta"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, one {# elem} other {# elem}} törlése?",
|
||||
"local": "{count, plural, one {# elem törlődött} other {# elem törlődött}} a(z) {folder} mappából ezen a számítógépen. A Fájlokban is {count, plural, one {törlöd} other {törlöd őket}}?",
|
||||
"remote": "{count, plural, one {# elem törlődött} other {# elem törlődött}} a(z) {folder} mappából a Fájlokban. Ezen a számítógépen is {count, plural, one {törlöd} other {törlöd őket}}?",
|
||||
"allow": "{count, plural, one {Törlöm} other {Mindet törlöm}}",
|
||||
"restore": "{count, plural, one {Visszaállítom} other {Mindet visszaállítom}}",
|
||||
"later": "Később döntök"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Legutóbbi tevékenység",
|
||||
"empty": "Még nem történt semmi.",
|
||||
"clear": "Törlés",
|
||||
"to_files": "A Fájlokba",
|
||||
"to_computer": "Erre a számítógépre",
|
||||
"mark_conflict": "Ütközés",
|
||||
"mark_error": "Hiba",
|
||||
"mark_question": "Válaszodra vár",
|
||||
"uploaded": "Feltöltve: {path}",
|
||||
"downloaded": "Letöltve: {path}",
|
||||
"folder-created": "Mappa létrehozva: {path}",
|
||||
"renamed": "Átnevezve: {detail} → {path}",
|
||||
"moved": "Áthelyezve: {detail} → {path}",
|
||||
"deleted": "Törölve: {path}",
|
||||
"trashed": "Kukába helyezve: {path}",
|
||||
"conflict": "{path} mindkét helyen megváltozott. A másik verzió {detail} néven megmaradt",
|
||||
"renamed-for-disk": "{path} neve ezen a számítógépen {detail}, mert az eredeti név itt nem engedélyezett",
|
||||
"too-large": "{path} nagyobb, mint amit a Fájlok enged ({detail}). Csak ezen a számítógépen marad",
|
||||
"waiting": "{path} a kiszolgálóra vár",
|
||||
"mass-delete": "Szüneteltetve sok elem törlése előtt",
|
||||
"error": "{path} szinkronizálása nem sikerült"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "A kiszolgáló nem érhető el",
|
||||
"server_refused": "A kiszolgáló elutasította a változást",
|
||||
"too_large": "A fájl túl nagy a Fájlokhoz",
|
||||
"name_invalid": "A név nem engedélyezett",
|
||||
"disk_full": "A lemez megtelt",
|
||||
"denied": "Nem engedélyezett",
|
||||
"busy": "Egy másik program használja",
|
||||
"quota": "Megtelt a tárhelyed a Fájlokban",
|
||||
"not_found": "Már nem létezik",
|
||||
"policy": "A szervezeted ezt nem engedélyezi",
|
||||
"failed": "Hiba történt"
|
||||
},
|
||||
"item": {
|
||||
"label": "Ezen a számítógépen",
|
||||
"synced": "Szinkronizálva",
|
||||
"syncing": "Szinkronizálás",
|
||||
"pending": "Szinkronizálásra vár",
|
||||
"error": "Nem sikerült szinkronizálni",
|
||||
"online-only": "Csak a Fájlokban, megnyitáskor letöltődik"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Megjelenítés a Fájlkezelőben",
|
||||
"finder": "Megjelenítés a Finderben",
|
||||
"file_manager": "Megjelenítés a fájlkezelőben",
|
||||
"failed": "Nem sikerült megnyitni a mappát."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Gyors levélírás",
|
||||
"menu": "Gyors levélírás",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Non ancora allegati o salvati, ed eliminati ora: {names}.",
|
||||
"signout_held": "Ancora aperti in un altro programma, quindi eliminati solo quando li chiudi lì: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "File su questo computer",
|
||||
"drive": {
|
||||
"title": "Unità File",
|
||||
"label": "Mostra File come unità",
|
||||
"description": "I tuoi File appaiono in Esplora file come un'unità. Un file viene scaricato quando lo apri.",
|
||||
"unsupported": "Richiede Windows 10 versione 1809 o successiva.",
|
||||
"root_name": "Unità File",
|
||||
"letter_label": "Lettera di unità",
|
||||
"letter_description": "Assegna all'unità una lettera propria in Esplora file.",
|
||||
"letter_none": "Nessuna lettera"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Cartelle sincronizzate",
|
||||
"description": "Una cartella su questo computer e una cartella in File restano uguali, in entrambe le direzioni.",
|
||||
"empty": "Nessuna cartella è ancora sincronizzata.",
|
||||
"forced_off": "La tua organizzazione ha disattivato la sincronizzazione delle cartelle. I file al loro interno restano su questo computer.",
|
||||
"add": "Aggiungi cartella…",
|
||||
"loading": "Caricamento delle tue cartelle…",
|
||||
"load_failed": "Impossibile caricare le tue cartelle in File. Riprova.",
|
||||
"pick_title": "Quale cartella in File?",
|
||||
"pick_confirm": "Scegli una cartella su questo computer…",
|
||||
"paired_with": "Con {folder} in File",
|
||||
"pause": "Metti in pausa",
|
||||
"resume": "Riprendi",
|
||||
"remove": "Rimuovi…",
|
||||
"remove_title": "Interrompere la sincronizzazione di questa cartella?",
|
||||
"remove_message": "I file su questo computer restano dove sono, e così quelli in File. Le modifiche non passano più dall'uno all'altro.",
|
||||
"remove_confirm": "Interrompi sincronizzazione",
|
||||
"add_failed": {
|
||||
"overlap": "Questa cartella si trova in una cartella sincronizzata, ne contiene una o è una cartella di sistema. Scegline un'altra.",
|
||||
"denied": "L'app non può usare questa cartella. Scegline un'altra.",
|
||||
"policy": "La tua organizzazione non lo consente.",
|
||||
"failed": "Impossibile aggiungere la cartella. Riprova."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Avvio…",
|
||||
"idle": "Aggiornato. Ultima sincronizzazione {time}",
|
||||
"idle_never": "Aggiornato",
|
||||
"syncing": "Sincronizzazione: {done} completati, {pending} rimanenti",
|
||||
"paused": "In pausa",
|
||||
"offline": "Offline. {count, plural, =0 {Le modifiche attendono il server} one {# modifica attende il server} other {# modifiche attendono il server}}",
|
||||
"error": "Interrotto: {reason}",
|
||||
"confirm_delete": "In pausa finché non rispondi alla domanda qui sotto",
|
||||
"blocked": "Disattivato dalla tua organizzazione"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Eliminare {count, plural, one {# elemento} other {# elementi}}?",
|
||||
"local": "{count, plural, one {# elemento è stato eliminato} other {# elementi sono stati eliminati}} da {folder} su questo computer. {count, plural, one {Eliminarlo} other {Eliminarli}} anche in File?",
|
||||
"remote": "{count, plural, one {# elemento è stato eliminato} other {# elementi sono stati eliminati}} da {folder} in File. {count, plural, one {Eliminarlo} other {Eliminarli}} anche su questo computer?",
|
||||
"allow": "{count, plural, one {Eliminalo} other {Eliminali}}",
|
||||
"restore": "{count, plural, one {Ripristinalo} other {Ripristinali}}",
|
||||
"later": "Decidi più tardi"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Attività recente",
|
||||
"empty": "Non è ancora successo nulla.",
|
||||
"clear": "Cancella",
|
||||
"to_files": "Verso File",
|
||||
"to_computer": "Verso questo computer",
|
||||
"mark_conflict": "Conflitto",
|
||||
"mark_error": "Errore",
|
||||
"mark_question": "Serve una tua risposta",
|
||||
"uploaded": "Caricato {path}",
|
||||
"downloaded": "Scaricato {path}",
|
||||
"folder-created": "Creata la cartella {path}",
|
||||
"renamed": "Rinominato {detail} in {path}",
|
||||
"moved": "Spostato {detail} in {path}",
|
||||
"deleted": "Eliminato {path}",
|
||||
"trashed": "Spostato {path} nel cestino",
|
||||
"conflict": "{path} è stato modificato in entrambi i posti. L'altra versione è conservata come {detail}",
|
||||
"renamed-for-disk": "{path} si chiama {detail} su questo computer, perché il suo nome qui non è consentito",
|
||||
"too-large": "{path} è più grande di quanto consente File ({detail}). Resta solo su questo computer",
|
||||
"waiting": "{path} è in attesa del server",
|
||||
"mass-delete": "In pausa prima di eliminare molti elementi",
|
||||
"error": "Impossibile sincronizzare {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Il server non è raggiungibile",
|
||||
"server_refused": "Il server ha rifiutato la modifica",
|
||||
"too_large": "Il file è troppo grande per File",
|
||||
"name_invalid": "Il nome non è consentito",
|
||||
"disk_full": "Il disco è pieno",
|
||||
"denied": "Accesso negato",
|
||||
"busy": "Un altro programma lo sta usando",
|
||||
"quota": "Lo spazio di archiviazione in File è pieno",
|
||||
"not_found": "Non esiste più",
|
||||
"policy": "La tua organizzazione non lo consente",
|
||||
"failed": "Qualcosa è andato storto"
|
||||
},
|
||||
"item": {
|
||||
"label": "Su questo computer",
|
||||
"synced": "Sincronizzato",
|
||||
"syncing": "Sincronizzazione in corso",
|
||||
"pending": "In attesa di sincronizzazione",
|
||||
"error": "Sincronizzazione non riuscita",
|
||||
"online-only": "Solo in File, scaricato all'apertura"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Mostra in Esplora file",
|
||||
"finder": "Mostra nel Finder",
|
||||
"file_manager": "Mostra nel file manager",
|
||||
"failed": "Impossibile aprire la cartella."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Scrittura rapida",
|
||||
"menu": "Scrittura rapida",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "まだ添付も保存もされておらず、今削除されます: {names}。",
|
||||
"signout_held": "まだ別のプログラムで開かれているため、そちらで閉じるまで削除されません: {names}。"
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "このパソコンのファイル",
|
||||
"drive": {
|
||||
"title": "ファイル ドライブ",
|
||||
"label": "ファイルをドライブとして表示",
|
||||
"description": "ファイルがエクスプローラーにドライブのように表示されます。ファイルは開いたときにダウンロードされます。",
|
||||
"unsupported": "Windows 10 バージョン 1809 以降が必要です。",
|
||||
"root_name": "ファイル ドライブ",
|
||||
"letter_label": "ドライブ文字",
|
||||
"letter_description": "エクスプローラーでドライブに専用の文字を割り当てます。",
|
||||
"letter_none": "文字なし"
|
||||
},
|
||||
"folders": {
|
||||
"title": "同期しているフォルダー",
|
||||
"description": "このパソコンのフォルダーとファイルのフォルダーを、双方向で同じ内容に保ちます。",
|
||||
"empty": "同期しているフォルダーはまだありません。",
|
||||
"forced_off": "組織によってフォルダーの同期が無効にされました。フォルダー内のファイルはこのパソコンに残ります。",
|
||||
"add": "フォルダーを追加…",
|
||||
"loading": "フォルダーを読み込んでいます…",
|
||||
"load_failed": "ファイルのフォルダーを読み込めませんでした。もう一度お試しください。",
|
||||
"pick_title": "ファイルのどのフォルダーと同期しますか?",
|
||||
"pick_confirm": "このパソコンのフォルダーを選択…",
|
||||
"paired_with": "ファイルの {folder} と同期",
|
||||
"pause": "一時停止",
|
||||
"resume": "再開",
|
||||
"remove": "削除…",
|
||||
"remove_title": "このフォルダーの同期を停止しますか?",
|
||||
"remove_message": "このパソコン上のファイルも、ファイル側のファイルもそのまま残ります。今後、変更は一方からもう一方に反映されなくなります。",
|
||||
"remove_confirm": "同期を停止",
|
||||
"add_failed": {
|
||||
"overlap": "このフォルダーは同期フォルダーの中にあるか、同期フォルダーを含んでいるか、システム フォルダーです。別のフォルダーを選んでください。",
|
||||
"denied": "アプリはこのフォルダーを使用できません。別のフォルダーを選んでください。",
|
||||
"policy": "組織によって許可されていません。",
|
||||
"failed": "フォルダーを追加できませんでした。もう一度お試しください。"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "起動しています…",
|
||||
"idle": "最新の状態です。最終同期: {time}",
|
||||
"idle_never": "最新の状態です",
|
||||
"syncing": "同期中: {done} 件完了、残り {pending} 件",
|
||||
"paused": "一時停止中",
|
||||
"offline": "オフライン。{count, plural, =0 {変更はサーバーへの接続を待っています} other {# 件の変更がサーバーへの接続を待っています}}",
|
||||
"error": "停止しました: {reason}",
|
||||
"confirm_delete": "下の質問に答えるまで一時停止しています",
|
||||
"blocked": "組織によって無効にされています"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, other {# 個の項目}}を削除しますか?",
|
||||
"local": "このパソコンの {folder} から {count, plural, other {# 個の項目}}が削除されました。ファイルでも削除しますか?",
|
||||
"remote": "ファイルの {folder} から {count, plural, other {# 個の項目}}が削除されました。このパソコンでも削除しますか?",
|
||||
"allow": "{count, plural, other {削除する}}",
|
||||
"restore": "{count, plural, other {元に戻す}}",
|
||||
"later": "後で決める"
|
||||
},
|
||||
"activity": {
|
||||
"title": "最近のアクティビティ",
|
||||
"empty": "まだ何も起きていません。",
|
||||
"clear": "クリア",
|
||||
"to_files": "ファイルへ",
|
||||
"to_computer": "このパソコンへ",
|
||||
"mark_conflict": "競合",
|
||||
"mark_error": "エラー",
|
||||
"mark_question": "回答が必要",
|
||||
"uploaded": "{path} をアップロードしました",
|
||||
"downloaded": "{path} をダウンロードしました",
|
||||
"folder-created": "フォルダー {path} を作成しました",
|
||||
"renamed": "{detail} の名前を {path} に変更しました",
|
||||
"moved": "{detail} を {path} に移動しました",
|
||||
"deleted": "{path} を削除しました",
|
||||
"trashed": "{path} をゴミ箱に移動しました",
|
||||
"conflict": "{path} は両方の場所で変更されました。もう一方のバージョンは {detail} として保存されています",
|
||||
"renamed-for-disk": "{path} の名前はここでは使えないため、このパソコンでは {detail} という名前になっています",
|
||||
"too-large": "{path} はファイルの上限 ({detail}) を超えています。このパソコンにのみ保存されます",
|
||||
"waiting": "{path} はサーバーを待っています",
|
||||
"mass-delete": "多数の項目を削除する前に一時停止しました",
|
||||
"error": "{path} を同期できませんでした"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "サーバーに接続できません",
|
||||
"server_refused": "サーバーが変更を拒否しました",
|
||||
"too_large": "ファイルのサイズがファイルの上限を超えています",
|
||||
"name_invalid": "この名前は使用できません",
|
||||
"disk_full": "ディスクがいっぱいです",
|
||||
"denied": "許可されていません",
|
||||
"busy": "別のプログラムが使用中です",
|
||||
"quota": "ファイルの保存容量がいっぱいです",
|
||||
"not_found": "もう存在しません",
|
||||
"policy": "組織によって許可されていません",
|
||||
"failed": "問題が発生しました"
|
||||
},
|
||||
"item": {
|
||||
"label": "このパソコン上",
|
||||
"synced": "同期済み",
|
||||
"syncing": "同期中",
|
||||
"pending": "同期待ち",
|
||||
"error": "同期できませんでした",
|
||||
"online-only": "ファイルにのみ保存。開くとダウンロードされます"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "エクスプローラーで表示",
|
||||
"finder": "Finder で表示",
|
||||
"file_manager": "ファイル マネージャーで表示",
|
||||
"failed": "フォルダーを開けませんでした。"
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "クイック作成",
|
||||
"menu": "クイック作成",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "아직 첨부하거나 저장하지 않았으며 지금 삭제됩니다: {names}.",
|
||||
"signout_held": "아직 다른 프로그램에서 열려 있어 그곳에서 닫아야 삭제됩니다: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "이 컴퓨터의 파일",
|
||||
"drive": {
|
||||
"title": "파일 드라이브",
|
||||
"label": "파일을 드라이브로 표시",
|
||||
"description": "파일이 파일 탐색기에 드라이브처럼 표시됩니다. 파일은 열 때 다운로드됩니다.",
|
||||
"unsupported": "Windows 10 버전 1809 이상이 필요합니다.",
|
||||
"root_name": "파일 드라이브",
|
||||
"letter_label": "드라이브 문자",
|
||||
"letter_description": "파일 탐색기에서 드라이브에 고유한 문자를 지정합니다.",
|
||||
"letter_none": "문자 없음"
|
||||
},
|
||||
"folders": {
|
||||
"title": "동기화된 폴더",
|
||||
"description": "이 컴퓨터의 폴더와 파일의 폴더를 양방향으로 똑같이 유지합니다.",
|
||||
"empty": "아직 동기화된 폴더가 없습니다.",
|
||||
"forced_off": "조직에서 폴더 동기화를 사용하지 않도록 설정했습니다. 폴더 안의 파일은 이 컴퓨터에 그대로 남습니다.",
|
||||
"add": "폴더 추가…",
|
||||
"loading": "폴더를 불러오는 중…",
|
||||
"load_failed": "파일의 폴더를 불러올 수 없습니다. 다시 시도하세요.",
|
||||
"pick_title": "파일의 어느 폴더와 동기화할까요?",
|
||||
"pick_confirm": "이 컴퓨터의 폴더 선택…",
|
||||
"paired_with": "파일의 {folder}와(과) 동기화",
|
||||
"pause": "일시 중지",
|
||||
"resume": "다시 시작",
|
||||
"remove": "제거…",
|
||||
"remove_title": "이 폴더의 동기화를 중지할까요?",
|
||||
"remove_message": "이 컴퓨터의 파일과 파일에 있는 파일은 모두 그대로 남습니다. 앞으로 한쪽의 변경 사항이 다른 쪽에 반영되지 않습니다.",
|
||||
"remove_confirm": "동기화 중지",
|
||||
"add_failed": {
|
||||
"overlap": "이 폴더는 동기화된 폴더 안에 있거나, 동기화된 폴더를 포함하거나, 시스템 폴더입니다. 다른 폴더를 선택하세요.",
|
||||
"denied": "앱에서 이 폴더를 사용할 수 없습니다. 다른 폴더를 선택하세요.",
|
||||
"policy": "조직에서 허용하지 않습니다.",
|
||||
"failed": "폴더를 추가할 수 없습니다. 다시 시도하세요."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "시작하는 중…",
|
||||
"idle": "최신 상태입니다. 마지막 동기화: {time}",
|
||||
"idle_never": "최신 상태입니다",
|
||||
"syncing": "동기화 중: {done}개 완료, {pending}개 남음",
|
||||
"paused": "일시 중지됨",
|
||||
"offline": "오프라인. {count, plural, =0 {변경 사항이 서버를 기다리고 있습니다} other {변경 사항 #개가 서버를 기다리고 있습니다}}",
|
||||
"error": "중지됨: {reason}",
|
||||
"confirm_delete": "아래 질문에 답할 때까지 일시 중지됨",
|
||||
"blocked": "조직에서 사용하지 않도록 설정함"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, other {항목 #개}}를 삭제할까요?",
|
||||
"local": "이 컴퓨터의 {folder}에서 {count, plural, other {항목 #개가}} 삭제되었습니다. 파일에서도 삭제할까요?",
|
||||
"remote": "파일의 {folder}에서 {count, plural, other {항목 #개가}} 삭제되었습니다. 이 컴퓨터에서도 삭제할까요?",
|
||||
"allow": "{count, plural, other {삭제}}",
|
||||
"restore": "{count, plural, other {되돌리기}}",
|
||||
"later": "나중에 결정"
|
||||
},
|
||||
"activity": {
|
||||
"title": "최근 활동",
|
||||
"empty": "아직 활동이 없습니다.",
|
||||
"clear": "지우기",
|
||||
"to_files": "파일로",
|
||||
"to_computer": "이 컴퓨터로",
|
||||
"mark_conflict": "충돌",
|
||||
"mark_error": "오류",
|
||||
"mark_question": "답변 필요",
|
||||
"uploaded": "{path} 업로드함",
|
||||
"downloaded": "{path} 다운로드함",
|
||||
"folder-created": "{path} 폴더를 만듦",
|
||||
"renamed": "{detail}의 이름을 {path}(으)로 바꿈",
|
||||
"moved": "{detail}을(를) {path}(으)로 이동함",
|
||||
"deleted": "{path} 삭제함",
|
||||
"trashed": "{path}을(를) 휴지통으로 이동함",
|
||||
"conflict": "{path}이(가) 양쪽에서 변경되었습니다. 다른 버전은 {detail}(으)로 보관됩니다",
|
||||
"renamed-for-disk": "{path}의 이름은 여기서 허용되지 않아 이 컴퓨터에서는 {detail}(이)라는 이름을 사용합니다",
|
||||
"too-large": "{path}이(가) 파일에서 허용하는 크기({detail})보다 큽니다. 이 컴퓨터에만 보관됩니다",
|
||||
"waiting": "{path}이(가) 서버를 기다리는 중입니다",
|
||||
"mass-delete": "많은 항목을 삭제하기 전에 일시 중지함",
|
||||
"error": "{path}을(를) 동기화할 수 없습니다"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "서버에 연결할 수 없습니다",
|
||||
"server_refused": "서버에서 변경을 거부했습니다",
|
||||
"too_large": "파일이 너무 커서 파일에 올릴 수 없습니다",
|
||||
"name_invalid": "허용되지 않는 이름입니다",
|
||||
"disk_full": "디스크가 가득 찼습니다",
|
||||
"denied": "허용되지 않음",
|
||||
"busy": "다른 프로그램에서 사용 중입니다",
|
||||
"quota": "파일 저장 공간이 가득 찼습니다",
|
||||
"not_found": "더 이상 존재하지 않습니다",
|
||||
"policy": "조직에서 허용하지 않습니다",
|
||||
"failed": "문제가 발생했습니다"
|
||||
},
|
||||
"item": {
|
||||
"label": "이 컴퓨터에 있음",
|
||||
"synced": "동기화됨",
|
||||
"syncing": "동기화 중",
|
||||
"pending": "동기화 대기 중",
|
||||
"error": "동기화할 수 없음",
|
||||
"online-only": "파일에만 있음, 열 때 다운로드됨"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "파일 탐색기에 표시",
|
||||
"finder": "Finder에서 보기",
|
||||
"file_manager": "파일 관리자에서 보기",
|
||||
"failed": "폴더를 열 수 없습니다."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "빠른 작성",
|
||||
"menu": "빠른 작성",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Vēl nav pievienoti vai saglabāti, un tagad izdzēsti: {names}.",
|
||||
"signout_held": "Joprojām atvērti citā programmā, tāpēc tiks izdzēsti tikai pēc aizvēršanas: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Faili šajā datorā",
|
||||
"drive": {
|
||||
"title": "Failu disks",
|
||||
"label": "Rādīt Failus kā disku",
|
||||
"description": "Jūsu Faili failu pārlūkā ir redzami kā disks. Fails tiek lejupielādēts, kad to atverat.",
|
||||
"unsupported": "Nepieciešama Windows 10 versija 1809 vai jaunāka.",
|
||||
"root_name": "Failu disks",
|
||||
"letter_label": "Diska burts",
|
||||
"letter_description": "Piešķir diskam savu burtu failu pārlūkā.",
|
||||
"letter_none": "Bez burta"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Sinhronizētās mapes",
|
||||
"description": "Mape šajā datorā un mape Failos tiek uzturētas vienādas, izmaiņas notiek abos virzienos.",
|
||||
"empty": "Vēl netiek sinhronizēta neviena mape.",
|
||||
"forced_off": "Jūsu organizācija izslēdza mapju sinhronizēšanu. Faili tajās paliek šajā datorā.",
|
||||
"add": "Pievienot mapi…",
|
||||
"loading": "Ielādē jūsu mapes…",
|
||||
"load_failed": "Neizdevās ielādēt jūsu mapes Failos. Mēģiniet vēlreiz.",
|
||||
"pick_title": "Kura mape Failos?",
|
||||
"pick_confirm": "Izvēlēties mapi šajā datorā…",
|
||||
"paired_with": "Ar mapi {folder} Failos",
|
||||
"pause": "Pauzēt",
|
||||
"resume": "Turpināt",
|
||||
"remove": "Noņemt…",
|
||||
"remove_title": "Pārtraukt šīs mapes sinhronizēšanu?",
|
||||
"remove_message": "Faili šajā datorā paliek savā vietā, tāpat arī faili Failos. Izmaiņas vairs netiek pārnestas no vienas vietas uz otru.",
|
||||
"remove_confirm": "Pārtraukt sinhronizēšanu",
|
||||
"add_failed": {
|
||||
"overlap": "Šī mape atrodas sinhronizētā mapē, satur šādu mapi vai ir sistēmas mape. Izvēlieties citu.",
|
||||
"denied": "Lietotne nevar izmantot šo mapi. Izvēlieties citu.",
|
||||
"policy": "Jūsu organizācija to neatļauj.",
|
||||
"failed": "Neizdevās pievienot mapi. Mēģiniet vēlreiz."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Sāk darbu…",
|
||||
"idle": "Viss aktuāls. Pēdējo reizi sinhronizēts {time}",
|
||||
"idle_never": "Viss aktuāls",
|
||||
"syncing": "Sinhronizē: pabeigti {done}, atlikuši {pending}",
|
||||
"paused": "Pauzēts",
|
||||
"offline": "Bezsaistē. {count, plural, =0 {Izmaiņas gaida serveri} zero {# izmaiņas gaida serveri} one {# izmaiņa gaida serveri} other {# izmaiņas gaida serveri}}",
|
||||
"error": "Apturēts: {reason}",
|
||||
"confirm_delete": "Pauzēts, līdz atbildēsiet uz jautājumu zemāk",
|
||||
"blocked": "Izslēgusi jūsu organizācija"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Dzēst {count, plural, zero {# vienumus} one {# vienumu} other {# vienumus}}?",
|
||||
"local": "{count, plural, zero {# vienumi izdzēsti} one {# vienums izdzēsts} other {# vienumi izdzēsti}} no mapes {folder} šajā datorā. Vai dzēst {count, plural, zero {tos} one {to} other {tos}} arī Failos?",
|
||||
"remote": "{count, plural, zero {# vienumi izdzēsti} one {# vienums izdzēsts} other {# vienumi izdzēsti}} no mapes {folder} Failos. Vai dzēst {count, plural, zero {tos} one {to} other {tos}} arī šajā datorā?",
|
||||
"allow": "{count, plural, zero {Dzēst tos} one {Dzēst to} other {Dzēst tos}}",
|
||||
"restore": "{count, plural, zero {Atjaunot tos} one {Atjaunot to} other {Atjaunot tos}}",
|
||||
"later": "Izlemt vēlāk"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Nesenās darbības",
|
||||
"empty": "Vēl nekas nav noticis.",
|
||||
"clear": "Notīrīt",
|
||||
"to_files": "Uz Failiem",
|
||||
"to_computer": "Uz šo datoru",
|
||||
"mark_conflict": "Konflikts",
|
||||
"mark_error": "Kļūda",
|
||||
"mark_question": "Gaida jūsu atbildi",
|
||||
"uploaded": "Augšupielādēts: {path}",
|
||||
"downloaded": "Lejupielādēts: {path}",
|
||||
"folder-created": "Izveidota mape {path}",
|
||||
"renamed": "Pārdēvēts: {detail} → {path}",
|
||||
"moved": "Pārvietots: {detail} → {path}",
|
||||
"deleted": "Izdzēsts: {path}",
|
||||
"trashed": "Pārvietots uz miskasti: {path}",
|
||||
"conflict": "{path} tika mainīts abās vietās. Otra versija saglabāta kā {detail}",
|
||||
"renamed-for-disk": "{path} šajā datorā saucas {detail}, jo tā nosaukums šeit nav atļauts",
|
||||
"too-large": "{path} ir lielāks, nekā Faili atļauj ({detail}). Tas paliek tikai šajā datorā",
|
||||
"waiting": "{path} gaida serveri",
|
||||
"mass-delete": "Pauzēts pirms daudzu vienumu dzēšanas",
|
||||
"error": "Neizdevās sinhronizēt {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Serveris nav sasniedzams",
|
||||
"server_refused": "Serveris noraidīja izmaiņu",
|
||||
"too_large": "Fails ir pārāk liels Failiem",
|
||||
"name_invalid": "Šis nosaukums nav atļauts",
|
||||
"disk_full": "Disks ir pilns",
|
||||
"denied": "Nav atļauts",
|
||||
"busy": "To izmanto cita programma",
|
||||
"quota": "Jūsu krātuve Failos ir pilna",
|
||||
"not_found": "Tas vairs nepastāv",
|
||||
"policy": "Jūsu organizācija to neatļauj",
|
||||
"failed": "Radās kļūda"
|
||||
},
|
||||
"item": {
|
||||
"label": "Šajā datorā",
|
||||
"synced": "Sinhronizēts",
|
||||
"syncing": "Sinhronizē",
|
||||
"pending": "Gaida sinhronizēšanu",
|
||||
"error": "Neizdevās sinhronizēt",
|
||||
"online-only": "Tikai Failos, tiek lejupielādēts atverot"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Rādīt failu pārlūkā",
|
||||
"finder": "Rādīt programmā Finder",
|
||||
"file_manager": "Rādīt failu pārvaldniekā",
|
||||
"failed": "Neizdevās atvērt mapi."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Ātrā rakstīšana",
|
||||
"menu": "Ātrā rakstīšana",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Хавсаргаагүй, хадгалаагүй бөгөөд одоо устгагдана: {names}.",
|
||||
"signout_held": "Өөр программд нээлттэй хэвээр тул тэнд хаасны дараа л устана: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Энэ компьютер дээрх Файл",
|
||||
"drive": {
|
||||
"title": "Файл диск",
|
||||
"label": "Файлыг диск болгож харуулах",
|
||||
"description": "Таны Файл Файл судлаачид диск шиг харагдана. Файлыг нээхэд татаж авна.",
|
||||
"unsupported": "Windows 10-ийн 1809 буюу түүнээс хойшхи хувилбар шаардлагатай.",
|
||||
"root_name": "Файл диск",
|
||||
"letter_label": "Дискийн үсэг",
|
||||
"letter_description": "Файл судлаачид дискэд өөрийн үсэг өгнө.",
|
||||
"letter_none": "Үсэггүй"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Синхрончлогдсон хавтаснууд",
|
||||
"description": "Энэ компьютер дээрх хавтас болон Файл дахь хавтсыг хоёр чиглэлд адилхан байлгана.",
|
||||
"empty": "Синхрончлогдсон хавтас одоогоор алга.",
|
||||
"forced_off": "Таны байгууллага хавтас синхрончлохыг унтраасан. Доторх файлууд энэ компьютер дээр үлдэнэ.",
|
||||
"add": "Хавтас нэмэх…",
|
||||
"loading": "Хавтаснуудыг ачаалж байна…",
|
||||
"load_failed": "Файл дахь таны хавтаснуудыг ачаалж чадсангүй. Дахин оролдоно уу.",
|
||||
"pick_title": "Файл дахь аль хавтастай синхрончлох вэ?",
|
||||
"pick_confirm": "Энэ компьютер дээрх хавтсыг сонгох…",
|
||||
"paired_with": "Файл дахь {folder}-тай",
|
||||
"pause": "Түр зогсоох",
|
||||
"resume": "Үргэлжлүүлэх",
|
||||
"remove": "Хасах…",
|
||||
"remove_title": "Энэ хавтсыг синхрончлохоо зогсоох уу?",
|
||||
"remove_message": "Энэ компьютер дээрх файлууд байрандаа үлдэнэ, Файл дахь файлууд ч мөн адил. Өөрчлөлт нэг талаас нөгөө рүү дамжихаа болино.",
|
||||
"remove_confirm": "Синхрончлолыг зогсоох",
|
||||
"add_failed": {
|
||||
"overlap": "Энэ хавтас синхрончлогдсон хавтсан дотор байна, синхрончлогдсон хавтас агуулж байна, эсвэл системийн хавтас байна. Өөр хавтас сонгоно уу.",
|
||||
"denied": "Апп энэ хавтсыг ашиглаж чадахгүй. Өөр хавтас сонгоно уу.",
|
||||
"policy": "Таны байгууллага үүнийг зөвшөөрөхгүй.",
|
||||
"failed": "Хавтсыг нэмж чадсангүй. Дахин оролдоно уу."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Эхэлж байна…",
|
||||
"idle": "Шинэчлэгдсэн. Сүүлд синхрончилсон: {time}",
|
||||
"idle_never": "Шинэчлэгдсэн",
|
||||
"syncing": "Синхрончилж байна: {done} дууссан, {pending} үлдсэн",
|
||||
"paused": "Түр зогссон",
|
||||
"offline": "Офлайн. {count, plural, =0 {Өөрчлөлтүүд серверийг хүлээж байна} other {# өөрчлөлт серверийг хүлээж байна}}",
|
||||
"error": "Зогссон: {reason}",
|
||||
"confirm_delete": "Доорх асуултад хариулах хүртэл түр зогссон",
|
||||
"blocked": "Таны байгууллага унтраасан"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, other {# зүйлийг}} устгах уу?",
|
||||
"local": "Энэ компьютер дээрх {folder}-оос {count, plural, other {# зүйл}} устгагдсан. Файл дотроос ч устгах уу?",
|
||||
"remote": "Файл дахь {folder}-оос {count, plural, other {# зүйл}} устгагдсан. Энэ компьютер дээрээс ч устгах уу?",
|
||||
"allow": "{count, plural, other {Устгах}}",
|
||||
"restore": "{count, plural, other {Сэргээх}}",
|
||||
"later": "Дараа шийдэх"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Сүүлийн үйл ажиллагаа",
|
||||
"empty": "Одоогоор юу ч болоогүй байна.",
|
||||
"clear": "Цэвэрлэх",
|
||||
"to_files": "Файл руу",
|
||||
"to_computer": "Энэ компьютер руу",
|
||||
"mark_conflict": "Зөрчил",
|
||||
"mark_error": "Алдаа",
|
||||
"mark_question": "Таны хариулт хэрэгтэй",
|
||||
"uploaded": "{path}-г байршуулсан",
|
||||
"downloaded": "{path}-г татаж авсан",
|
||||
"folder-created": "{path} хавтсыг үүсгэсэн",
|
||||
"renamed": "{detail}-н нэрийг {path} болгож өөрчилсөн",
|
||||
"moved": "{detail}-г {path} руу зөөсөн",
|
||||
"deleted": "{path}-г устгасан",
|
||||
"trashed": "{path}-г хогийн сав руу зөөсөн",
|
||||
"conflict": "{path} хоёр газарт өөрчлөгдсөн. Нөгөө хувилбарыг {detail} нэрээр хадгалсан",
|
||||
"renamed-for-disk": "{path}-н нэр энд зөвшөөрөгдөхгүй тул энэ компьютер дээр {detail} гэж нэрлэгдэнэ",
|
||||
"too-large": "{path} нь Файлын зөвшөөрөх хэмжээнээс ({detail}) том. Зөвхөн энэ компьютер дээр үлдэнэ",
|
||||
"waiting": "{path} серверийг хүлээж байна",
|
||||
"mass-delete": "Олон зүйл устгахаас өмнө түр зогссон",
|
||||
"error": "{path}-г синхрончилж чадсангүй"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Сервертэй холбогдож чадахгүй байна",
|
||||
"server_refused": "Сервер өөрчлөлтийг татгалзсан",
|
||||
"too_large": "Файл нь Файлын зөвшөөрөх хэмжээнээс том байна",
|
||||
"name_invalid": "Энэ нэр зөвшөөрөгдөхгүй",
|
||||
"disk_full": "Диск дүүрсэн",
|
||||
"denied": "Зөвшөөрөгдөөгүй",
|
||||
"busy": "Өөр програм ашиглаж байна",
|
||||
"quota": "Файл дахь таны хадгалах сан дүүрсэн",
|
||||
"not_found": "Энэ нь байхгүй болсон",
|
||||
"policy": "Таны байгууллага үүнийг зөвшөөрөхгүй",
|
||||
"failed": "Алдаа гарлаа"
|
||||
},
|
||||
"item": {
|
||||
"label": "Энэ компьютер дээр",
|
||||
"synced": "Синхрончлогдсон",
|
||||
"syncing": "Синхрончилж байна",
|
||||
"pending": "Синхрончлолыг хүлээж байна",
|
||||
"error": "Синхрончилж чадсангүй",
|
||||
"online-only": "Зөвхөн Файлд, нээхэд татаж авна"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Файл судлаачид харуулах",
|
||||
"finder": "Finder-т харуулах",
|
||||
"file_manager": "Файл менежерт харуулах",
|
||||
"failed": "Хавтсыг нээж чадсангүй."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Хурдан бичих",
|
||||
"menu": "Хурдан бичих",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Ikke lagt ved eller lagret ennå, og slettet nå: {names}.",
|
||||
"signout_held": "Fortsatt åpne i et annet program, så de slettes først når du lukker dem der: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Filer på denne datamaskinen",
|
||||
"drive": {
|
||||
"title": "Filer-stasjon",
|
||||
"label": "Vis Filer som en stasjon",
|
||||
"description": "Filer vises i Filutforsker som en stasjon. En fil lastes ned når du åpner den.",
|
||||
"unsupported": "Krever Windows 10 versjon 1809 eller nyere.",
|
||||
"root_name": "Filer-stasjon",
|
||||
"letter_label": "Stasjonsbokstav",
|
||||
"letter_description": "Gir stasjonen sin egen bokstav i Filutforsker.",
|
||||
"letter_none": "Ingen bokstav"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synkroniserte mapper",
|
||||
"description": "En mappe på denne datamaskinen og en mappe i Filer holdes like, i begge retninger.",
|
||||
"empty": "Ingen mapper synkroniseres ennå.",
|
||||
"forced_off": "Organisasjonen din har slått av synkronisering av mapper. Filene i dem blir værende på denne datamaskinen.",
|
||||
"add": "Legg til mappe…",
|
||||
"loading": "Laster inn mappene dine…",
|
||||
"load_failed": "Mappene dine i Filer kunne ikke lastes inn. Prøv igjen.",
|
||||
"pick_title": "Hvilken mappe i Filer?",
|
||||
"pick_confirm": "Velg mappe på denne datamaskinen…",
|
||||
"paired_with": "Med {folder} i Filer",
|
||||
"pause": "Sett på pause",
|
||||
"resume": "Fortsett",
|
||||
"remove": "Fjern…",
|
||||
"remove_title": "Slutte å synkronisere denne mappen?",
|
||||
"remove_message": "Filene på denne datamaskinen blir der de er, og det samme gjør filene i Filer. Endringer går ikke lenger fra den ene til den andre.",
|
||||
"remove_confirm": "Slutt å synkronisere",
|
||||
"add_failed": {
|
||||
"overlap": "Denne mappen ligger i en synkronisert mappe, inneholder en, eller er en systemmappe. Velg en annen.",
|
||||
"denied": "Appen kan ikke bruke denne mappen. Velg en annen.",
|
||||
"policy": "Organisasjonen din tillater ikke dette.",
|
||||
"failed": "Mappen kunne ikke legges til. Prøv igjen."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Starter…",
|
||||
"idle": "Oppdatert. Sist synkronisert {time}",
|
||||
"idle_never": "Oppdatert",
|
||||
"syncing": "Synkroniserer: {done} ferdig, {pending} gjenstår",
|
||||
"paused": "På pause",
|
||||
"offline": "Frakoblet. {count, plural, =0 {Endringer venter på serveren} one {# endring venter på serveren} other {# endringer venter på serveren}}",
|
||||
"error": "Stoppet: {reason}",
|
||||
"confirm_delete": "På pause til du svarer på spørsmålet nedenfor",
|
||||
"blocked": "Slått av av organisasjonen din"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Slette {count, plural, one {# element} other {# elementer}}?",
|
||||
"local": "{count, plural, one {# element ble} other {# elementer ble}} slettet fra {folder} på denne datamaskinen. Slette {count, plural, one {det} other {dem}} i Filer også?",
|
||||
"remote": "{count, plural, one {# element ble} other {# elementer ble}} slettet fra {folder} i Filer. Slette {count, plural, one {det} other {dem}} på denne datamaskinen også?",
|
||||
"allow": "{count, plural, one {Slett det} other {Slett dem}}",
|
||||
"restore": "{count, plural, one {Gjenopprett det} other {Gjenopprett dem}}",
|
||||
"later": "Bestem senere"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Nylig aktivitet",
|
||||
"empty": "Ingenting har skjedd ennå.",
|
||||
"clear": "Tøm",
|
||||
"to_files": "Til Filer",
|
||||
"to_computer": "Til denne datamaskinen",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Feil",
|
||||
"mark_question": "Venter på svaret ditt",
|
||||
"uploaded": "Lastet opp {path}",
|
||||
"downloaded": "Lastet ned {path}",
|
||||
"folder-created": "Opprettet mappen {path}",
|
||||
"renamed": "Endret navnet på {detail} til {path}",
|
||||
"moved": "Flyttet {detail} til {path}",
|
||||
"deleted": "Slettet {path}",
|
||||
"trashed": "Flyttet {path} til papirkurven",
|
||||
"conflict": "{path} ble endret begge steder. Den andre versjonen er beholdt som {detail}",
|
||||
"renamed-for-disk": "{path} heter {detail} på denne datamaskinen, fordi navnet ikke er tillatt her",
|
||||
"too-large": "{path} er større enn Filer tillater ({detail}). Den blir bare på denne datamaskinen",
|
||||
"waiting": "{path} venter på serveren",
|
||||
"mass-delete": "Satt på pause før sletting av mange elementer",
|
||||
"error": "{path} kunne ikke synkroniseres"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Serveren kan ikke nås",
|
||||
"server_refused": "Serveren avviste endringen",
|
||||
"too_large": "Filen er for stor for Filer",
|
||||
"name_invalid": "Navnet er ikke tillatt",
|
||||
"disk_full": "Disken er full",
|
||||
"denied": "Ingen tilgang",
|
||||
"busy": "Et annet program bruker den",
|
||||
"quota": "Lagringsplassen din i Filer er full",
|
||||
"not_found": "Den finnes ikke lenger",
|
||||
"policy": "Organisasjonen din tillater ikke dette",
|
||||
"failed": "Noe gikk galt"
|
||||
},
|
||||
"item": {
|
||||
"label": "På denne datamaskinen",
|
||||
"synced": "Synkronisert",
|
||||
"syncing": "Synkroniserer",
|
||||
"pending": "Venter på synkronisering",
|
||||
"error": "Kunne ikke synkronisere",
|
||||
"online-only": "Bare i Filer, lastes ned når den åpnes"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Vis i Filutforsker",
|
||||
"finder": "Vis i Finder",
|
||||
"file_manager": "Vis i filbehandler",
|
||||
"failed": "Mappen kunne ikke åpnes."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Rask skriving",
|
||||
"menu": "Rask skriving",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Nog niet bijgevoegd of opgeslagen, en nu verwijderd: {names}.",
|
||||
"signout_held": "Nog geopend in een ander programma, dus pas verwijderd als u ze daar sluit: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Bestanden op deze computer",
|
||||
"drive": {
|
||||
"title": "Station Bestanden",
|
||||
"label": "Bestanden als station tonen",
|
||||
"description": "Je Bestanden verschijnen in Verkenner als een station. Een bestand wordt gedownload als je het opent.",
|
||||
"unsupported": "Vereist Windows 10 versie 1809 of nieuwer.",
|
||||
"root_name": "Station Bestanden",
|
||||
"letter_label": "Stationsletter",
|
||||
"letter_description": "Geeft het station een eigen letter in Verkenner.",
|
||||
"letter_none": "Geen letter"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Gesynchroniseerde mappen",
|
||||
"description": "Een map op deze computer en een map in Bestanden blijven gelijk, in beide richtingen.",
|
||||
"empty": "Er worden nog geen mappen gesynchroniseerd.",
|
||||
"forced_off": "Je organisatie heeft het synchroniseren van mappen uitgezet. De bestanden erin blijven op deze computer.",
|
||||
"add": "Map toevoegen…",
|
||||
"loading": "Je mappen worden geladen…",
|
||||
"load_failed": "Je mappen in Bestanden konden niet worden geladen. Probeer het opnieuw.",
|
||||
"pick_title": "Welke map in Bestanden?",
|
||||
"pick_confirm": "Map op deze computer kiezen…",
|
||||
"paired_with": "Met {folder} in Bestanden",
|
||||
"pause": "Pauzeren",
|
||||
"resume": "Hervatten",
|
||||
"remove": "Verwijderen…",
|
||||
"remove_title": "Deze map niet meer synchroniseren?",
|
||||
"remove_message": "De bestanden op deze computer blijven waar ze zijn, en die in Bestanden ook. Wijzigingen gaan niet meer van de een naar de ander.",
|
||||
"remove_confirm": "Synchronisatie stoppen",
|
||||
"add_failed": {
|
||||
"overlap": "Deze map staat in een gesynchroniseerde map, bevat er een of is een systeemmap. Kies een andere.",
|
||||
"denied": "De app kan deze map niet gebruiken. Kies een andere.",
|
||||
"policy": "Je organisatie staat dit niet toe.",
|
||||
"failed": "De map kon niet worden toegevoegd. Probeer het opnieuw."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Bezig met starten…",
|
||||
"idle": "Bijgewerkt. Laatst gesynchroniseerd {time}",
|
||||
"idle_never": "Bijgewerkt",
|
||||
"syncing": "Synchroniseren: {done} klaar, {pending} te gaan",
|
||||
"paused": "Gepauzeerd",
|
||||
"offline": "Offline. {count, plural, =0 {Wijzigingen wachten op de server} one {# wijziging wacht op de server} other {# wijzigingen wachten op de server}}",
|
||||
"error": "Gestopt: {reason}",
|
||||
"confirm_delete": "Gepauzeerd tot je de vraag hieronder beantwoordt",
|
||||
"blocked": "Uitgezet door je organisatie"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, one {# item} other {# items}} verwijderen?",
|
||||
"local": "{count, plural, one {# item is} other {# items zijn}} verwijderd uit {folder} op deze computer. {count, plural, one {Het} other {Ze}} ook in Bestanden verwijderen?",
|
||||
"remote": "{count, plural, one {# item is} other {# items zijn}} verwijderd uit {folder} in Bestanden. {count, plural, one {Het} other {Ze}} ook op deze computer verwijderen?",
|
||||
"allow": "{count, plural, one {Verwijderen} other {Alle verwijderen}}",
|
||||
"restore": "{count, plural, one {Terugzetten} other {Alle terugzetten}}",
|
||||
"later": "Later beslissen"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Recente activiteit",
|
||||
"empty": "Er is nog niets gebeurd.",
|
||||
"clear": "Wissen",
|
||||
"to_files": "Naar Bestanden",
|
||||
"to_computer": "Naar deze computer",
|
||||
"mark_conflict": "Versieconflict",
|
||||
"mark_error": "Fout",
|
||||
"mark_question": "Wacht op je antwoord",
|
||||
"uploaded": "{path} geüpload",
|
||||
"downloaded": "{path} gedownload",
|
||||
"folder-created": "Map {path} gemaakt",
|
||||
"renamed": "{detail} hernoemd naar {path}",
|
||||
"moved": "{detail} verplaatst naar {path}",
|
||||
"deleted": "{path} verwijderd",
|
||||
"trashed": "{path} naar de prullenbak verplaatst",
|
||||
"conflict": "{path} is op beide plekken gewijzigd. De andere versie is bewaard als {detail}",
|
||||
"renamed-for-disk": "{path} heet {detail} op deze computer, omdat de naam hier niet is toegestaan",
|
||||
"too-large": "{path} is groter dan Bestanden toestaat ({detail}). Het blijft alleen op deze computer",
|
||||
"waiting": "{path} wacht op de server",
|
||||
"mass-delete": "Gepauzeerd voor het verwijderen van veel items",
|
||||
"error": "{path} kon niet worden gesynchroniseerd"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "De server is niet bereikbaar",
|
||||
"server_refused": "De server heeft de wijziging geweigerd",
|
||||
"too_large": "Het bestand is te groot voor Bestanden",
|
||||
"name_invalid": "De naam is niet toegestaan",
|
||||
"disk_full": "De schijf is vol",
|
||||
"denied": "Geen toegang",
|
||||
"busy": "Een ander programma gebruikt het",
|
||||
"quota": "Je opslag in Bestanden is vol",
|
||||
"not_found": "Het bestaat niet meer",
|
||||
"policy": "Je organisatie staat dit niet toe",
|
||||
"failed": "Er ging iets mis"
|
||||
},
|
||||
"item": {
|
||||
"label": "Op deze computer",
|
||||
"synced": "Gesynchroniseerd",
|
||||
"syncing": "Bezig met synchroniseren",
|
||||
"pending": "Wacht op synchronisatie",
|
||||
"error": "Niet gesynchroniseerd",
|
||||
"online-only": "Alleen in Bestanden, wordt gedownload bij openen"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Weergeven in Verkenner",
|
||||
"finder": "Weergeven in Finder",
|
||||
"file_manager": "Weergeven in bestandsbeheer",
|
||||
"failed": "De map kon niet worden geopend."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Snel opstellen",
|
||||
"menu": "Snel opstellen",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Jeszcze niedołączone ani niezapisane, a teraz usunięte: {names}.",
|
||||
"signout_held": "Nadal otwarte w innym programie, więc zostaną usunięte dopiero po zamknięciu: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Pliki na tym komputerze",
|
||||
"drive": {
|
||||
"title": "Dysk Pliki",
|
||||
"label": "Pokazuj Pliki jako dysk",
|
||||
"description": "Twoje Pliki widać w Eksploratorze plików jako dysk. Plik jest pobierany, gdy go otworzysz.",
|
||||
"unsupported": "Wymaga systemu Windows 10 w wersji 1809 lub nowszej.",
|
||||
"root_name": "Dysk Pliki",
|
||||
"letter_label": "Litera dysku",
|
||||
"letter_description": "Nadaje dyskowi własną literę w Eksploratorze plików.",
|
||||
"letter_none": "Bez litery"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synchronizowane foldery",
|
||||
"description": "Folder na tym komputerze i folder w Plikach pozostają takie same, zmiany idą w obie strony.",
|
||||
"empty": "Nie synchronizujesz jeszcze żadnych folderów.",
|
||||
"forced_off": "Twoja organizacja wyłączyła synchronizację folderów. Pliki w nich zostają na tym komputerze.",
|
||||
"add": "Dodaj folder…",
|
||||
"loading": "Wczytywanie Twoich folderów…",
|
||||
"load_failed": "Nie udało się wczytać Twoich folderów w Plikach. Spróbuj ponownie.",
|
||||
"pick_title": "Który folder w Plikach?",
|
||||
"pick_confirm": "Wybierz folder na tym komputerze…",
|
||||
"paired_with": "Z folderem {folder} w Plikach",
|
||||
"pause": "Wstrzymaj",
|
||||
"resume": "Wznów",
|
||||
"remove": "Usuń…",
|
||||
"remove_title": "Przestać synchronizować ten folder?",
|
||||
"remove_message": "Pliki na tym komputerze zostają na miejscu, tak samo jak pliki w Plikach. Zmiany nie będą już przenoszone między nimi.",
|
||||
"remove_confirm": "Przestań synchronizować",
|
||||
"add_failed": {
|
||||
"overlap": "Ten folder leży w synchronizowanym folderze, zawiera taki folder albo jest folderem systemowym. Wybierz inny.",
|
||||
"denied": "Aplikacja nie może używać tego folderu. Wybierz inny.",
|
||||
"policy": "Twoja organizacja na to nie pozwala.",
|
||||
"failed": "Nie udało się dodać folderu. Spróbuj ponownie."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Uruchamianie…",
|
||||
"idle": "Aktualne. Ostatnia synchronizacja: {time}",
|
||||
"idle_never": "Aktualne",
|
||||
"syncing": "Synchronizacja: gotowe {done}, pozostało {pending}",
|
||||
"paused": "Wstrzymano",
|
||||
"offline": "Brak połączenia. {count, plural, =0 {Zmiany czekają na serwer} one {# zmiana czeka na serwer} few {# zmiany czekają na serwer} many {# zmian czeka na serwer} other {# zmiany czeka na serwer}}",
|
||||
"error": "Zatrzymano: {reason}",
|
||||
"confirm_delete": "Wstrzymano, dopóki nie odpowiesz na pytanie poniżej",
|
||||
"blocked": "Wyłączone przez Twoją organizację"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Usunąć {count, plural, one {# element} few {# elementy} many {# elementów} other {# elementu}}?",
|
||||
"local": "{count, plural, one {# element został usunięty} few {# elementy zostały usunięte} many {# elementów zostało usuniętych} other {# elementu zostało usunięte}} z folderu {folder} na tym komputerze. Usunąć {count, plural, one {go} few {je} many {je} other {je}} także w Plikach?",
|
||||
"remote": "{count, plural, one {# element został usunięty} few {# elementy zostały usunięte} many {# elementów zostało usuniętych} other {# elementu zostało usunięte}} z folderu {folder} w Plikach. Usunąć {count, plural, one {go} few {je} many {je} other {je}} także na tym komputerze?",
|
||||
"allow": "{count, plural, one {Usuń go} few {Usuń je} many {Usuń je} other {Usuń je}}",
|
||||
"restore": "{count, plural, one {Przywróć go} few {Przywróć je} many {Przywróć je} other {Przywróć je}}",
|
||||
"later": "Zdecyduj później"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Ostatnia aktywność",
|
||||
"empty": "Jeszcze nic się nie wydarzyło.",
|
||||
"clear": "Wyczyść",
|
||||
"to_files": "Do Plików",
|
||||
"to_computer": "Na ten komputer",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Błąd",
|
||||
"mark_question": "Czeka na Twoją odpowiedź",
|
||||
"uploaded": "Przesłano {path}",
|
||||
"downloaded": "Pobrano {path}",
|
||||
"folder-created": "Utworzono folder {path}",
|
||||
"renamed": "Zmieniono nazwę {detail} na {path}",
|
||||
"moved": "Przeniesiono {detail} do {path}",
|
||||
"deleted": "Usunięto {path}",
|
||||
"trashed": "Przeniesiono {path} do kosza",
|
||||
"conflict": "{path} zmieniono w obu miejscach. Druga wersja została zachowana jako {detail}",
|
||||
"renamed-for-disk": "{path} nazywa się na tym komputerze {detail}, bo jego nazwa jest tu niedozwolona",
|
||||
"too-large": "{path} jest większy, niż pozwalają Pliki ({detail}). Zostaje tylko na tym komputerze",
|
||||
"waiting": "{path} czeka na serwer",
|
||||
"mass-delete": "Wstrzymano przed usunięciem wielu elementów",
|
||||
"error": "Nie udało się zsynchronizować {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Nie można połączyć się z serwerem",
|
||||
"server_refused": "Serwer odrzucił zmianę",
|
||||
"too_large": "Plik jest za duży dla Plików",
|
||||
"name_invalid": "Ta nazwa jest niedozwolona",
|
||||
"disk_full": "Dysk jest pełny",
|
||||
"denied": "Brak uprawnień",
|
||||
"busy": "Używany przez inny program",
|
||||
"quota": "Twoje miejsce w Plikach jest pełne",
|
||||
"not_found": "Już nie istnieje",
|
||||
"policy": "Twoja organizacja na to nie pozwala",
|
||||
"failed": "Coś poszło nie tak"
|
||||
},
|
||||
"item": {
|
||||
"label": "Na tym komputerze",
|
||||
"synced": "Zsynchronizowano",
|
||||
"syncing": "Synchronizacja",
|
||||
"pending": "Czeka na synchronizację",
|
||||
"error": "Nie udało się zsynchronizować",
|
||||
"online-only": "Tylko w Plikach, pobierany po otwarciu"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Pokaż w Eksploratorze plików",
|
||||
"finder": "Pokaż w Finderze",
|
||||
"file_manager": "Pokaż w menedżerze plików",
|
||||
"failed": "Nie udało się otworzyć folderu."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Szybka wiadomość",
|
||||
"menu": "Szybka wiadomość",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Ainda não anexados nem guardados, e eliminados agora: {names}.",
|
||||
"signout_held": "Ainda abertos noutro programa, por isso só são eliminados depois de os fechar lá: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Arquivos neste computador",
|
||||
"drive": {
|
||||
"title": "Unidade Arquivos",
|
||||
"label": "Mostrar Arquivos como uma unidade",
|
||||
"description": "Seus Arquivos aparecem no Explorador de Arquivos como uma unidade. Um arquivo é baixado quando você o abre.",
|
||||
"unsupported": "Requer o Windows 10 versão 1809 ou posterior.",
|
||||
"root_name": "Unidade Arquivos",
|
||||
"letter_label": "Letra da unidade",
|
||||
"letter_description": "Dá à unidade uma letra própria no Explorador de Arquivos.",
|
||||
"letter_none": "Sem letra"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Pastas sincronizadas",
|
||||
"description": "Uma pasta neste computador e uma pasta em Arquivos ficam iguais, nos dois sentidos.",
|
||||
"empty": "Nenhuma pasta está sincronizada ainda.",
|
||||
"forced_off": "Sua organização desativou a sincronização de pastas. Os arquivos nelas continuam neste computador.",
|
||||
"add": "Adicionar pasta…",
|
||||
"loading": "Carregando suas pastas…",
|
||||
"load_failed": "Não foi possível carregar suas pastas em Arquivos. Tente novamente.",
|
||||
"pick_title": "Qual pasta em Arquivos?",
|
||||
"pick_confirm": "Escolher pasta neste computador…",
|
||||
"paired_with": "Com {folder} em Arquivos",
|
||||
"pause": "Pausar",
|
||||
"resume": "Retomar",
|
||||
"remove": "Remover…",
|
||||
"remove_title": "Parar de sincronizar esta pasta?",
|
||||
"remove_message": "Os arquivos neste computador ficam onde estão, assim como os de Arquivos. As alterações deixam de passar de um para o outro.",
|
||||
"remove_confirm": "Parar de sincronizar",
|
||||
"add_failed": {
|
||||
"overlap": "Esta pasta está dentro de uma pasta sincronizada, contém uma ou é uma pasta do sistema. Escolha outra.",
|
||||
"denied": "O aplicativo não pode usar esta pasta. Escolha outra.",
|
||||
"policy": "Sua organização não permite isso.",
|
||||
"failed": "Não foi possível adicionar a pasta. Tente novamente."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Iniciando…",
|
||||
"idle": "Atualizado. Última sincronização {time}",
|
||||
"idle_never": "Atualizado",
|
||||
"syncing": "Sincronizando: {done} concluídos, {pending} restantes",
|
||||
"paused": "Pausado",
|
||||
"offline": "Offline. {count, plural, =0 {As alterações aguardam o servidor} one {# alteração aguarda o servidor} other {# alterações aguardam o servidor}}",
|
||||
"error": "Parado: {reason}",
|
||||
"confirm_delete": "Pausado até você responder à pergunta abaixo",
|
||||
"blocked": "Desativado pela sua organização"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Excluir {count, plural, one {# item} other {# itens}}?",
|
||||
"local": "{count, plural, one {# item foi excluído} other {# itens foram excluídos}} de {folder} neste computador. {count, plural, one {Excluí-lo} other {Excluí-los}} também em Arquivos?",
|
||||
"remote": "{count, plural, one {# item foi excluído} other {# itens foram excluídos}} de {folder} em Arquivos. {count, plural, one {Excluí-lo} other {Excluí-los}} também neste computador?",
|
||||
"allow": "{count, plural, one {Excluir} other {Excluir todos}}",
|
||||
"restore": "{count, plural, one {Restaurar} other {Restaurar todos}}",
|
||||
"later": "Decidir depois"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Atividade recente",
|
||||
"empty": "Nada aconteceu ainda.",
|
||||
"clear": "Limpar",
|
||||
"to_files": "Para Arquivos",
|
||||
"to_computer": "Para este computador",
|
||||
"mark_conflict": "Conflito",
|
||||
"mark_error": "Erro",
|
||||
"mark_question": "Precisa da sua resposta",
|
||||
"uploaded": "{path} enviado",
|
||||
"downloaded": "{path} baixado",
|
||||
"folder-created": "Pasta {path} criada",
|
||||
"renamed": "{detail} renomeado para {path}",
|
||||
"moved": "{detail} movido para {path}",
|
||||
"deleted": "{path} excluído",
|
||||
"trashed": "{path} movido para a lixeira",
|
||||
"conflict": "{path} foi alterado nos dois lugares. A outra versão foi mantida como {detail}",
|
||||
"renamed-for-disk": "{path} se chama {detail} neste computador, porque o nome não é permitido aqui",
|
||||
"too-large": "{path} é maior do que Arquivos permite ({detail}). Fica só neste computador",
|
||||
"waiting": "{path} está aguardando o servidor",
|
||||
"mass-delete": "Pausado antes de excluir muitos itens",
|
||||
"error": "Não foi possível sincronizar {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Não é possível acessar o servidor",
|
||||
"server_refused": "O servidor recusou a alteração",
|
||||
"too_large": "O arquivo é grande demais para Arquivos",
|
||||
"name_invalid": "O nome não é permitido",
|
||||
"disk_full": "O disco está cheio",
|
||||
"denied": "Acesso negado",
|
||||
"busy": "Outro programa está usando",
|
||||
"quota": "Seu armazenamento em Arquivos está cheio",
|
||||
"not_found": "Não existe mais",
|
||||
"policy": "Sua organização não permite isso",
|
||||
"failed": "Algo deu errado"
|
||||
},
|
||||
"item": {
|
||||
"label": "Neste computador",
|
||||
"synced": "Sincronizado",
|
||||
"syncing": "Sincronizando",
|
||||
"pending": "Aguardando sincronização",
|
||||
"error": "Falha na sincronização",
|
||||
"online-only": "Só em Arquivos, baixado ao abrir"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Mostrar no Explorador de Arquivos",
|
||||
"finder": "Mostrar no Finder",
|
||||
"file_manager": "Mostrar no gerenciador de arquivos",
|
||||
"failed": "Não foi possível abrir a pasta."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Escrita rápida",
|
||||
"menu": "Escrita rápida",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Încă neatașate sau nesalvate, și șterse acum: {names}.",
|
||||
"signout_held": "Încă deschise în alt program, așa că se șterg doar după ce le închideți acolo: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Fișiere pe acest computer",
|
||||
"drive": {
|
||||
"title": "Unitatea Fișiere",
|
||||
"label": "Afișează Fișiere ca unitate",
|
||||
"description": "Fișierele dvs. apar în Explorer ca o unitate. Un fișier se descarcă atunci când îl deschideți.",
|
||||
"unsupported": "Necesită Windows 10 versiunea 1809 sau mai nouă.",
|
||||
"root_name": "Unitatea Fișiere",
|
||||
"letter_label": "Literă de unitate",
|
||||
"letter_description": "Atribuie unității o literă proprie în Explorer.",
|
||||
"letter_none": "Fără literă"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Dosare sincronizate",
|
||||
"description": "Un dosar de pe acest computer și un dosar din Fișiere sunt păstrate identice, în ambele direcții.",
|
||||
"empty": "Încă nu se sincronizează niciun dosar.",
|
||||
"forced_off": "Organizația dvs. a dezactivat sincronizarea dosarelor. Fișierele din ele rămân pe acest computer.",
|
||||
"add": "Adăugați un dosar…",
|
||||
"loading": "Se încarcă dosarele…",
|
||||
"load_failed": "Dosarele dvs. din Fișiere nu au putut fi încărcate. Încercați din nou.",
|
||||
"pick_title": "Ce dosar din Fișiere?",
|
||||
"pick_confirm": "Alegeți un dosar de pe acest computer…",
|
||||
"paired_with": "Cu {folder} din Fișiere",
|
||||
"pause": "Întrerupe",
|
||||
"resume": "Reia",
|
||||
"remove": "Elimină…",
|
||||
"remove_title": "Opriți sincronizarea acestui dosar?",
|
||||
"remove_message": "Fișierele de pe acest computer rămân unde sunt, la fel și cele din Fișiere. Modificările nu mai trec de la unul la altul.",
|
||||
"remove_confirm": "Oprește sincronizarea",
|
||||
"add_failed": {
|
||||
"overlap": "Acest dosar se află într-un dosar sincronizat, conține unul sau este un dosar de sistem. Alegeți altul.",
|
||||
"denied": "Aplicația nu poate folosi acest dosar. Alegeți altul.",
|
||||
"policy": "Organizația dvs. nu permite acest lucru.",
|
||||
"failed": "Dosarul nu a putut fi adăugat. Încercați din nou."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Se pornește…",
|
||||
"idle": "Actualizat. Ultima sincronizare {time}",
|
||||
"idle_never": "Actualizat",
|
||||
"syncing": "Se sincronizează: {done} gata, {pending} rămase",
|
||||
"paused": "Întrerupt",
|
||||
"offline": "Offline. {count, plural, =0 {Modificările așteaptă serverul} one {# modificare așteaptă serverul} few {# modificări așteaptă serverul} other {# de modificări așteaptă serverul}}",
|
||||
"error": "Oprit: {reason}",
|
||||
"confirm_delete": "Întrerupt până când răspundeți la întrebarea de mai jos",
|
||||
"blocked": "Dezactivat de organizația dvs."
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Ștergeți {count, plural, one {# element} few {# elemente} other {# de elemente}}?",
|
||||
"local": "{count, plural, one {# element a fost șters} few {# elemente au fost șterse} other {# de elemente au fost șterse}} din {folder} de pe acest computer. {count, plural, one {Îl ștergeți} few {Le ștergeți} other {Le ștergeți}} și din Fișiere?",
|
||||
"remote": "{count, plural, one {# element a fost șters} few {# elemente au fost șterse} other {# de elemente au fost șterse}} din {folder} din Fișiere. {count, plural, one {Îl ștergeți} few {Le ștergeți} other {Le ștergeți}} și de pe acest computer?",
|
||||
"allow": "{count, plural, one {Șterge-l} few {Șterge-le} other {Șterge-le}}",
|
||||
"restore": "{count, plural, one {Restaurează-l} few {Restaurează-le} other {Restaurează-le}}",
|
||||
"later": "Decideți mai târziu"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Activitate recentă",
|
||||
"empty": "Nu s-a întâmplat nimic încă.",
|
||||
"clear": "Golește",
|
||||
"to_files": "Către Fișiere",
|
||||
"to_computer": "Către acest computer",
|
||||
"mark_conflict": "Conflict de versiuni",
|
||||
"mark_error": "Eroare",
|
||||
"mark_question": "Așteaptă răspunsul dvs.",
|
||||
"uploaded": "S-a încărcat {path}",
|
||||
"downloaded": "S-a descărcat {path}",
|
||||
"folder-created": "S-a creat dosarul {path}",
|
||||
"renamed": "{detail} a fost redenumit în {path}",
|
||||
"moved": "{detail} a fost mutat în {path}",
|
||||
"deleted": "S-a șters {path}",
|
||||
"trashed": "{path} a fost mutat în coșul de gunoi",
|
||||
"conflict": "{path} a fost modificat în ambele locuri. Cealaltă versiune este păstrată ca {detail}",
|
||||
"renamed-for-disk": "{path} se numește {detail} pe acest computer, deoarece numele său nu este permis aici",
|
||||
"too-large": "{path} este mai mare decât permite Fișiere ({detail}). Rămâne doar pe acest computer",
|
||||
"waiting": "{path} așteaptă serverul",
|
||||
"mass-delete": "Întrerupt înainte de ștergerea multor elemente",
|
||||
"error": "{path} nu a putut fi sincronizat"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Serverul nu poate fi accesat",
|
||||
"server_refused": "Serverul a refuzat modificarea",
|
||||
"too_large": "Fișierul este prea mare pentru Fișiere",
|
||||
"name_invalid": "Numele nu este permis",
|
||||
"disk_full": "Discul este plin",
|
||||
"denied": "Acces refuzat",
|
||||
"busy": "Un alt program îl folosește",
|
||||
"quota": "Spațiul dvs. de stocare din Fișiere este plin",
|
||||
"not_found": "Nu mai există",
|
||||
"policy": "Organizația dvs. nu permite acest lucru",
|
||||
"failed": "Ceva nu a mers bine"
|
||||
},
|
||||
"item": {
|
||||
"label": "Pe acest computer",
|
||||
"synced": "Sincronizat",
|
||||
"syncing": "Se sincronizează",
|
||||
"pending": "Așteaptă sincronizarea",
|
||||
"error": "Nu s-a putut sincroniza",
|
||||
"online-only": "Doar în Fișiere, se descarcă la deschidere"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Afișează în Explorer",
|
||||
"finder": "Afișează în Finder",
|
||||
"file_manager": "Afișează în managerul de fișiere",
|
||||
"failed": "Dosarul nu a putut fi deschis."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Scriere rapidă",
|
||||
"menu": "Scriere rapidă",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Ещё не вложены и не сохранены, и сейчас удаляются: {names}.",
|
||||
"signout_held": "Ещё открыты в другой программе, поэтому удалятся только после закрытия там: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Файлы на этом компьютере",
|
||||
"drive": {
|
||||
"title": "Диск «Файлы»",
|
||||
"label": "Показывать Файлы как диск",
|
||||
"description": "Ваши Файлы видны в Проводнике как диск. Файл скачивается, когда вы его открываете.",
|
||||
"unsupported": "Нужна Windows 10 версии 1809 или новее.",
|
||||
"root_name": "Диск «Файлы»",
|
||||
"letter_label": "Буква диска",
|
||||
"letter_description": "Даёт диску собственную букву в Проводнике.",
|
||||
"letter_none": "Без буквы"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Синхронизируемые папки",
|
||||
"description": "Папка на этом компьютере и папка в Файлах остаются одинаковыми, изменения идут в обе стороны.",
|
||||
"empty": "Пока нет синхронизируемых папок.",
|
||||
"forced_off": "Ваша организация отключила синхронизацию папок. Файлы в них остаются на этом компьютере.",
|
||||
"add": "Добавить папку…",
|
||||
"loading": "Загрузка ваших папок…",
|
||||
"load_failed": "Не удалось загрузить ваши папки в Файлах. Попробуйте ещё раз.",
|
||||
"pick_title": "Какую папку в Файлах выбрать?",
|
||||
"pick_confirm": "Выбрать папку на этом компьютере…",
|
||||
"paired_with": "С папкой {folder} в Файлах",
|
||||
"pause": "Приостановить",
|
||||
"resume": "Возобновить",
|
||||
"remove": "Убрать…",
|
||||
"remove_title": "Прекратить синхронизацию этой папки?",
|
||||
"remove_message": "Файлы на этом компьютере останутся на месте, как и файлы в Файлах. Изменения больше не будут переноситься между ними.",
|
||||
"remove_confirm": "Прекратить синхронизацию",
|
||||
"add_failed": {
|
||||
"overlap": "Эта папка находится внутри синхронизируемой папки, содержит такую папку или является системной. Выберите другую.",
|
||||
"denied": "Приложение не может использовать эту папку. Выберите другую.",
|
||||
"policy": "Ваша организация это не разрешает.",
|
||||
"failed": "Не удалось добавить папку. Попробуйте ещё раз."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Запуск…",
|
||||
"idle": "Всё актуально. Последняя синхронизация: {time}",
|
||||
"idle_never": "Всё актуально",
|
||||
"syncing": "Синхронизация: готово {done}, осталось {pending}",
|
||||
"paused": "Приостановлено",
|
||||
"offline": "Нет связи. {count, plural, =0 {Изменения ждут сервер} one {# изменение ждёт сервер} few {# изменения ждут сервер} many {# изменений ждут сервер} other {# изменения ждут сервер}}",
|
||||
"error": "Остановлено: {reason}",
|
||||
"confirm_delete": "Приостановлено, пока вы не ответите на вопрос ниже",
|
||||
"blocked": "Отключено вашей организацией"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Удалить {count, plural, one {# элемент} few {# элемента} many {# элементов} other {# элемента}}?",
|
||||
"local": "{count, plural, one {# элемент удалён} few {# элемента удалены} many {# элементов удалены} other {# элемента удалены}} из папки {folder} на этом компьютере. Удалить {count, plural, one {его} few {их} many {их} other {их}} и в Файлах?",
|
||||
"remote": "{count, plural, one {# элемент удалён} few {# элемента удалены} many {# элементов удалены} other {# элемента удалены}} из папки {folder} в Файлах. Удалить {count, plural, one {его} few {их} many {их} other {их}} и на этом компьютере?",
|
||||
"allow": "{count, plural, one {Удалить его} few {Удалить их} many {Удалить их} other {Удалить их}}",
|
||||
"restore": "{count, plural, one {Вернуть его} few {Вернуть их} many {Вернуть их} other {Вернуть их}}",
|
||||
"later": "Решить позже"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Последние действия",
|
||||
"empty": "Пока ничего не произошло.",
|
||||
"clear": "Очистить",
|
||||
"to_files": "В Файлы",
|
||||
"to_computer": "На этот компьютер",
|
||||
"mark_conflict": "Конфликт",
|
||||
"mark_error": "Ошибка",
|
||||
"mark_question": "Нужен ваш ответ",
|
||||
"uploaded": "Загружено: {path}",
|
||||
"downloaded": "Скачано: {path}",
|
||||
"folder-created": "Создана папка {path}",
|
||||
"renamed": "Переименовано: {detail} → {path}",
|
||||
"moved": "Перемещено: {detail} → {path}",
|
||||
"deleted": "Удалено: {path}",
|
||||
"trashed": "Перемещено в корзину: {path}",
|
||||
"conflict": "{path}: изменено в обоих местах. Другая версия сохранена как {detail}",
|
||||
"renamed-for-disk": "{path} на этом компьютере называется {detail}, потому что такое имя здесь не разрешено",
|
||||
"too-large": "{path} больше, чем допускают Файлы ({detail}). Остаётся только на этом компьютере",
|
||||
"waiting": "{path} ждёт сервер",
|
||||
"mass-delete": "Приостановлено перед удалением многих элементов",
|
||||
"error": "Не удалось синхронизировать {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Сервер недоступен",
|
||||
"server_refused": "Сервер отклонил изменение",
|
||||
"too_large": "Файл слишком большой для Файлов",
|
||||
"name_invalid": "Такое имя не разрешено",
|
||||
"disk_full": "Диск заполнен",
|
||||
"denied": "Нет доступа",
|
||||
"busy": "Используется другой программой",
|
||||
"quota": "Ваше хранилище в Файлах заполнено",
|
||||
"not_found": "Больше не существует",
|
||||
"policy": "Ваша организация это не разрешает",
|
||||
"failed": "Что-то пошло не так"
|
||||
},
|
||||
"item": {
|
||||
"label": "На этом компьютере",
|
||||
"synced": "Синхронизировано",
|
||||
"syncing": "Синхронизация",
|
||||
"pending": "Ожидает синхронизации",
|
||||
"error": "Не удалось синхронизировать",
|
||||
"online-only": "Только в Файлах, скачивается при открытии"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Показать в Проводнике",
|
||||
"finder": "Показать в Finder",
|
||||
"file_manager": "Показать в файловом менеджере",
|
||||
"failed": "Не удалось открыть папку."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Быстрое письмо",
|
||||
"menu": "Быстрое письмо",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Zatiaľ nepripojené ani neuložené, a teraz odstránené: {names}.",
|
||||
"signout_held": "Stále otvorené v inom programe, takže sa odstránia až po zatvorení: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Súbory v tomto počítači",
|
||||
"drive": {
|
||||
"title": "Jednotka Súbory",
|
||||
"label": "Zobraziť Súbory ako jednotku",
|
||||
"description": "Vaše Súbory sa v Prieskumníkovi zobrazia ako jednotka. Súbor sa stiahne, keď ho otvoríte.",
|
||||
"unsupported": "Vyžaduje Windows 10 verzie 1809 alebo novší.",
|
||||
"root_name": "Jednotka Súbory",
|
||||
"letter_label": "Písmeno jednotky",
|
||||
"letter_description": "Pridelí jednotke vlastné písmeno v Prieskumníkovi.",
|
||||
"letter_none": "Bez písmena"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Synchronizované priečinky",
|
||||
"description": "Priečinok v tomto počítači a priečinok v Súboroch zostávajú rovnaké, zmeny idú oboma smermi.",
|
||||
"empty": "Zatiaľ sa nesynchronizujú žiadne priečinky.",
|
||||
"forced_off": "Vaša organizácia vypla synchronizáciu priečinkov. Súbory v nich zostanú v tomto počítači.",
|
||||
"add": "Pridať priečinok…",
|
||||
"loading": "Načítavajú sa vaše priečinky…",
|
||||
"load_failed": "Vaše priečinky v Súboroch sa nepodarilo načítať. Skúste to znova.",
|
||||
"pick_title": "Ktorý priečinok v Súboroch?",
|
||||
"pick_confirm": "Vybrať priečinok v tomto počítači…",
|
||||
"paired_with": "S priečinkom {folder} v Súboroch",
|
||||
"pause": "Pozastaviť",
|
||||
"resume": "Pokračovať",
|
||||
"remove": "Odstrániť…",
|
||||
"remove_title": "Prestať synchronizovať tento priečinok?",
|
||||
"remove_message": "Súbory v tomto počítači zostanú, kde sú, a rovnako aj súbory v Súboroch. Zmeny sa medzi nimi už nebudú prenášať.",
|
||||
"remove_confirm": "Prestať synchronizovať",
|
||||
"add_failed": {
|
||||
"overlap": "Tento priečinok je v synchronizovanom priečinku, taký priečinok obsahuje alebo je to systémový priečinok. Vyberte iný.",
|
||||
"denied": "Aplikácia tento priečinok nemôže používať. Vyberte iný.",
|
||||
"policy": "Vaša organizácia to nepovoľuje.",
|
||||
"failed": "Priečinok sa nepodarilo pridať. Skúste to znova."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Spúšťa sa…",
|
||||
"idle": "Aktuálne. Naposledy synchronizované {time}",
|
||||
"idle_never": "Aktuálne",
|
||||
"syncing": "Synchronizácia: hotovo {done}, zostáva {pending}",
|
||||
"paused": "Pozastavené",
|
||||
"offline": "Offline. {count, plural, =0 {Zmeny čakajú na server} one {# zmena čaká na server} few {# zmeny čakajú na server} many {# zmeny čaká na server} other {# zmien čaká na server}}",
|
||||
"error": "Zastavené: {reason}",
|
||||
"confirm_delete": "Pozastavené, kým neodpoviete na otázku nižšie",
|
||||
"blocked": "Vypnuté vašou organizáciou"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Odstrániť {count, plural, one {# položku} few {# položky} many {# položky} other {# položiek}}?",
|
||||
"local": "{count, plural, one {# položka bola odstránená} few {# položky boli odstránené} many {# položky bolo odstránených} other {# položiek bolo odstránených}} z priečinka {folder} v tomto počítači. Odstrániť {count, plural, one {ju} few {ich} many {ich} other {ich}} aj v Súboroch?",
|
||||
"remote": "{count, plural, one {# položka bola odstránená} few {# položky boli odstránené} many {# položky bolo odstránených} other {# položiek bolo odstránených}} z priečinka {folder} v Súboroch. Odstrániť {count, plural, one {ju} few {ich} many {ich} other {ich}} aj v tomto počítači?",
|
||||
"allow": "{count, plural, one {Odstrániť ju} few {Odstrániť ich} many {Odstrániť ich} other {Odstrániť ich}}",
|
||||
"restore": "{count, plural, one {Vrátiť ju späť} few {Vrátiť ich späť} many {Vrátiť ich späť} other {Vrátiť ich späť}}",
|
||||
"later": "Rozhodnúť neskôr"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Nedávna aktivita",
|
||||
"empty": "Zatiaľ sa nič nestalo.",
|
||||
"clear": "Vymazať",
|
||||
"to_files": "Do Súborov",
|
||||
"to_computer": "Do tohto počítača",
|
||||
"mark_conflict": "Konflikt",
|
||||
"mark_error": "Chyba",
|
||||
"mark_question": "Čaká na vašu odpoveď",
|
||||
"uploaded": "Nahrané: {path}",
|
||||
"downloaded": "Stiahnuté: {path}",
|
||||
"folder-created": "Vytvorený priečinok {path}",
|
||||
"renamed": "Premenované: {detail} na {path}",
|
||||
"moved": "Presunuté: {detail} do {path}",
|
||||
"deleted": "Odstránené: {path}",
|
||||
"trashed": "Presunuté do koša: {path}",
|
||||
"conflict": "{path} sa zmenilo na oboch miestach. Druhá verzia je uložená ako {detail}",
|
||||
"renamed-for-disk": "{path} sa v tomto počítači volá {detail}, pretože tento názov tu nie je povolený",
|
||||
"too-large": "{path} je väčšie, než Súbory povoľujú ({detail}). Zostáva len v tomto počítači",
|
||||
"waiting": "{path} čaká na server",
|
||||
"mass-delete": "Pozastavené pred odstránením mnohých položiek",
|
||||
"error": "{path} sa nepodarilo synchronizovať"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Server nie je dostupný",
|
||||
"server_refused": "Server zmenu odmietol",
|
||||
"too_large": "Súbor je pre Súbory príliš veľký",
|
||||
"name_invalid": "Tento názov nie je povolený",
|
||||
"disk_full": "Disk je plný",
|
||||
"denied": "Nepovolené",
|
||||
"busy": "Používa ho iný program",
|
||||
"quota": "Vaše úložisko v Súboroch je plné",
|
||||
"not_found": "Už neexistuje",
|
||||
"policy": "Vaša organizácia to nepovoľuje",
|
||||
"failed": "Niečo sa pokazilo"
|
||||
},
|
||||
"item": {
|
||||
"label": "V tomto počítači",
|
||||
"synced": "Synchronizované",
|
||||
"syncing": "Synchronizuje sa",
|
||||
"pending": "Čaká na synchronizáciu",
|
||||
"error": "Nepodarilo sa synchronizovať",
|
||||
"online-only": "Len v Súboroch, stiahne sa pri otvorení"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Zobraziť v Prieskumníkovi",
|
||||
"finder": "Zobraziť vo Finderi",
|
||||
"file_manager": "Zobraziť v správcovi súborov",
|
||||
"failed": "Priečinok sa nepodarilo otvoriť."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Rýchla správa",
|
||||
"menu": "Rýchla správa",
|
||||
|
||||
@@ -7658,6 +7658,112 @@
|
||||
"signout_changed": "ยังไม่ได้แนบหรือบันทึก และจะถูกลบตอนนี้: {names}",
|
||||
"signout_held": "ยังเปิดอยู่ในโปรแกรมอื่น จึงจะถูกลบหลังจากคุณปิดที่นั่นเท่านั้น: {names}"
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "ไฟล์บนคอมพิวเตอร์เครื่องนี้",
|
||||
"drive": {
|
||||
"title": "ไดรฟ์ไฟล์",
|
||||
"label": "แสดงไฟล์เป็นไดรฟ์",
|
||||
"description": "ไฟล์ของคุณจะแสดงในตัวสำรวจไฟล์เหมือนไดรฟ์ แต่ละไฟล์จะดาวน์โหลดเมื่อคุณเปิด",
|
||||
"unsupported": "ต้องใช้ Windows 10 เวอร์ชัน 1809 ขึ้นไป",
|
||||
"root_name": "ไดรฟ์ไฟล์",
|
||||
"letter_label": "อักษรไดรฟ์",
|
||||
"letter_description": "กำหนดอักษรเฉพาะให้ไดรฟ์ในตัวสำรวจไฟล์",
|
||||
"letter_none": "ไม่มีอักษร"
|
||||
},
|
||||
"folders": {
|
||||
"title": "โฟลเดอร์ที่ซิงค์",
|
||||
"description": "โฟลเดอร์บนคอมพิวเตอร์เครื่องนี้และโฟลเดอร์ในไฟล์จะเหมือนกันเสมอ ทั้งสองทิศทาง",
|
||||
"empty": "ยังไม่มีโฟลเดอร์ที่ซิงค์",
|
||||
"forced_off": "องค์กรของคุณปิดการซิงค์โฟลเดอร์ ไฟล์ในโฟลเดอร์เหล่านั้นยังอยู่บนคอมพิวเตอร์เครื่องนี้",
|
||||
"add": "เพิ่มโฟลเดอร์…",
|
||||
"loading": "กำลังโหลดโฟลเดอร์ของคุณ…",
|
||||
"load_failed": "โหลดโฟลเดอร์ของคุณในไฟล์ไม่ได้ โปรดลองอีกครั้ง",
|
||||
"pick_title": "ซิงค์กับโฟลเดอร์ใดในไฟล์",
|
||||
"pick_confirm": "เลือกโฟลเดอร์บนคอมพิวเตอร์เครื่องนี้…",
|
||||
"paired_with": "กับ {folder} ในไฟล์",
|
||||
"pause": "หยุดชั่วคราว",
|
||||
"resume": "ทำต่อ",
|
||||
"remove": "นำออก…",
|
||||
"remove_title": "หยุดซิงค์โฟลเดอร์นี้หรือไม่",
|
||||
"remove_message": "ไฟล์บนคอมพิวเตอร์เครื่องนี้และไฟล์ในไฟล์จะยังอยู่ที่เดิม การเปลี่ยนแปลงจะไม่ส่งจากฝั่งหนึ่งไปอีกฝั่งอีกต่อไป",
|
||||
"remove_confirm": "หยุดซิงค์",
|
||||
"add_failed": {
|
||||
"overlap": "โฟลเดอร์นี้อยู่ในโฟลเดอร์ที่ซิงค์ มีโฟลเดอร์ที่ซิงค์อยู่ข้างใน หรือเป็นโฟลเดอร์ระบบ โปรดเลือกโฟลเดอร์อื่น",
|
||||
"denied": "แอปใช้โฟลเดอร์นี้ไม่ได้ โปรดเลือกโฟลเดอร์อื่น",
|
||||
"policy": "องค์กรของคุณไม่อนุญาต",
|
||||
"failed": "เพิ่มโฟลเดอร์ไม่ได้ โปรดลองอีกครั้ง"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "กำลังเริ่ม…",
|
||||
"idle": "เป็นปัจจุบันแล้ว ซิงค์ล่าสุด {time}",
|
||||
"idle_never": "เป็นปัจจุบันแล้ว",
|
||||
"syncing": "กำลังซิงค์: เสร็จแล้ว {done} เหลืออีก {pending}",
|
||||
"paused": "หยุดชั่วคราว",
|
||||
"offline": "ออฟไลน์ {count, plural, =0 {การเปลี่ยนแปลงกำลังรอเซิร์ฟเวอร์} other {การเปลี่ยนแปลง # รายการกำลังรอเซิร์ฟเวอร์}}",
|
||||
"error": "หยุดแล้ว: {reason}",
|
||||
"confirm_delete": "หยุดชั่วคราวจนกว่าคุณจะตอบคำถามด้านล่าง",
|
||||
"blocked": "ปิดโดยองค์กรของคุณ"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "ลบ {count, plural, other {# รายการ}}หรือไม่",
|
||||
"local": "{count, plural, other {# รายการ}}ถูกลบออกจาก {folder} บนคอมพิวเตอร์เครื่องนี้ ลบในไฟล์ด้วยหรือไม่",
|
||||
"remote": "{count, plural, other {# รายการ}}ถูกลบออกจาก {folder} ในไฟล์ ลบบนคอมพิวเตอร์เครื่องนี้ด้วยหรือไม่",
|
||||
"allow": "{count, plural, other {ลบ}}",
|
||||
"restore": "{count, plural, other {นำกลับมา}}",
|
||||
"later": "ตัดสินใจภายหลัง"
|
||||
},
|
||||
"activity": {
|
||||
"title": "กิจกรรมล่าสุด",
|
||||
"empty": "ยังไม่มีอะไรเกิดขึ้น",
|
||||
"clear": "ล้าง",
|
||||
"to_files": "ไปยังไฟล์",
|
||||
"to_computer": "ไปยังคอมพิวเตอร์เครื่องนี้",
|
||||
"mark_conflict": "ขัดแย้ง",
|
||||
"mark_error": "ข้อผิดพลาด",
|
||||
"mark_question": "รอคำตอบจากคุณ",
|
||||
"uploaded": "อัปโหลด {path} แล้ว",
|
||||
"downloaded": "ดาวน์โหลด {path} แล้ว",
|
||||
"folder-created": "สร้างโฟลเดอร์ {path} แล้ว",
|
||||
"renamed": "เปลี่ยนชื่อ {detail} เป็น {path} แล้ว",
|
||||
"moved": "ย้าย {detail} ไปยัง {path} แล้ว",
|
||||
"deleted": "ลบ {path} แล้ว",
|
||||
"trashed": "ย้าย {path} ไปที่ถังขยะแล้ว",
|
||||
"conflict": "{path} ถูกเปลี่ยนทั้งสองที่ อีกเวอร์ชันหนึ่งเก็บไว้เป็น {detail}",
|
||||
"renamed-for-disk": "{path} ใช้ชื่อ {detail} บนคอมพิวเตอร์เครื่องนี้ เพราะชื่อเดิมใช้ที่นี่ไม่ได้",
|
||||
"too-large": "{path} ใหญ่เกินกว่าที่ไฟล์อนุญาต ({detail}) จึงอยู่บนคอมพิวเตอร์เครื่องนี้เท่านั้น",
|
||||
"waiting": "{path} กำลังรอเซิร์ฟเวอร์",
|
||||
"mass-delete": "หยุดชั่วคราวก่อนลบหลายรายการ",
|
||||
"error": "ซิงค์ {path} ไม่ได้"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "เชื่อมต่อเซิร์ฟเวอร์ไม่ได้",
|
||||
"server_refused": "เซิร์ฟเวอร์ปฏิเสธการเปลี่ยนแปลง",
|
||||
"too_large": "ไฟล์นี้ใหญ่เกินกว่าที่ไฟล์อนุญาต",
|
||||
"name_invalid": "ใช้ชื่อนี้ไม่ได้",
|
||||
"disk_full": "ดิสก์เต็ม",
|
||||
"denied": "ไม่ได้รับอนุญาต",
|
||||
"busy": "โปรแกรมอื่นกำลังใช้งานอยู่",
|
||||
"quota": "พื้นที่เก็บข้อมูลของคุณในไฟล์เต็มแล้ว",
|
||||
"not_found": "ไม่มีอยู่แล้ว",
|
||||
"policy": "องค์กรของคุณไม่อนุญาต",
|
||||
"failed": "เกิดข้อผิดพลาด"
|
||||
},
|
||||
"item": {
|
||||
"label": "บนคอมพิวเตอร์เครื่องนี้",
|
||||
"synced": "ซิงค์แล้ว",
|
||||
"syncing": "กำลังซิงค์",
|
||||
"pending": "รอซิงค์",
|
||||
"error": "ซิงค์ไม่ได้",
|
||||
"online-only": "อยู่ในไฟล์เท่านั้น ดาวน์โหลดเมื่อเปิด"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "แสดงในตัวสำรวจไฟล์",
|
||||
"finder": "แสดงใน Finder",
|
||||
"file_manager": "แสดงในตัวจัดการไฟล์",
|
||||
"failed": "เปิดโฟลเดอร์ไม่ได้"
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "เขียนด่วน",
|
||||
"menu": "เขียนด่วน",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Henüz eklenmedi veya kaydedilmedi, şimdi siliniyor: {names}.",
|
||||
"signout_held": "Hâlâ başka bir programda açık, bu yüzden ancak orada kapatınca silinir: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Bu bilgisayardaki dosyalar",
|
||||
"drive": {
|
||||
"title": "Dosyalar sürücüsü",
|
||||
"label": "Dosyalar'ı sürücü olarak göster",
|
||||
"description": "Dosyalar'ınız Dosya Gezgini'nde bir sürücü gibi görünür. Bir dosya, onu açtığınızda indirilir.",
|
||||
"unsupported": "Windows 10 sürüm 1809 veya üstü gerekir.",
|
||||
"root_name": "Dosyalar sürücüsü",
|
||||
"letter_label": "Sürücü harfi",
|
||||
"letter_description": "Sürücüye Dosya Gezgini'nde kendi harfini verir.",
|
||||
"letter_none": "Harf yok"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Eşitlenen klasörler",
|
||||
"description": "Bu bilgisayardaki bir klasör ile Dosyalar'daki bir klasör her iki yönde de aynı tutulur.",
|
||||
"empty": "Henüz eşitlenen klasör yok.",
|
||||
"forced_off": "Kuruluşunuz klasör eşitlemeyi kapattı. İçlerindeki dosyalar bu bilgisayarda kalır.",
|
||||
"add": "Klasör ekle…",
|
||||
"loading": "Klasörleriniz yükleniyor…",
|
||||
"load_failed": "Dosyalar'daki klasörleriniz yüklenemedi. Yeniden deneyin.",
|
||||
"pick_title": "Dosyalar'daki hangi klasör?",
|
||||
"pick_confirm": "Bu bilgisayarda klasör seç…",
|
||||
"paired_with": "Dosyalar'daki {folder} ile",
|
||||
"pause": "Duraklat",
|
||||
"resume": "Sürdür",
|
||||
"remove": "Kaldır…",
|
||||
"remove_title": "Bu klasörün eşitlenmesi durdurulsun mu?",
|
||||
"remove_message": "Bu bilgisayardaki dosyalar yerinde kalır, Dosyalar'daki dosyalar da öyle. Değişiklikler artık birinden diğerine aktarılmaz.",
|
||||
"remove_confirm": "Eşitlemeyi durdur",
|
||||
"add_failed": {
|
||||
"overlap": "Bu klasör eşitlenen bir klasörün içinde, böyle bir klasör içeriyor ya da bir sistem klasörü. Başka bir klasör seçin.",
|
||||
"denied": "Uygulama bu klasörü kullanamıyor. Başka bir klasör seçin.",
|
||||
"policy": "Kuruluşunuz buna izin vermiyor.",
|
||||
"failed": "Klasör eklenemedi. Yeniden deneyin."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Başlatılıyor…",
|
||||
"idle": "Güncel. Son eşitleme: {time}",
|
||||
"idle_never": "Güncel",
|
||||
"syncing": "Eşitleniyor: {done} tamamlandı, {pending} kaldı",
|
||||
"paused": "Duraklatıldı",
|
||||
"offline": "Çevrimdışı. {count, plural, =0 {Değişiklikler sunucuyu bekliyor} one {# değişiklik sunucuyu bekliyor} other {# değişiklik sunucuyu bekliyor}}",
|
||||
"error": "Durdu: {reason}",
|
||||
"confirm_delete": "Aşağıdaki soruyu yanıtlayana kadar duraklatıldı",
|
||||
"blocked": "Kuruluşunuz tarafından kapatıldı"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "{count, plural, one {# öğe} other {# öğe}} silinsin mi?",
|
||||
"local": "Bu bilgisayarda {folder} klasöründen {count, plural, one {# öğe} other {# öğe}} silindi. Dosyalar'da da {count, plural, one {silinsin} other {silinsinler}} mi?",
|
||||
"remote": "Dosyalar'da {folder} klasöründen {count, plural, one {# öğe} other {# öğe}} silindi. Bu bilgisayarda da {count, plural, one {silinsin} other {silinsinler}} mi?",
|
||||
"allow": "{count, plural, one {Sil} other {Hepsini sil}}",
|
||||
"restore": "{count, plural, one {Geri getir} other {Hepsini geri getir}}",
|
||||
"later": "Sonra karar ver"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Son etkinlik",
|
||||
"empty": "Henüz bir şey olmadı.",
|
||||
"clear": "Temizle",
|
||||
"to_files": "Dosyalar'a",
|
||||
"to_computer": "Bu bilgisayara",
|
||||
"mark_conflict": "Çakışma",
|
||||
"mark_error": "Hata",
|
||||
"mark_question": "Yanıtınızı bekliyor",
|
||||
"uploaded": "Yüklendi: {path}",
|
||||
"downloaded": "İndirildi: {path}",
|
||||
"folder-created": "Klasör oluşturuldu: {path}",
|
||||
"renamed": "Yeniden adlandırıldı: {detail} → {path}",
|
||||
"moved": "Taşındı: {detail} → {path}",
|
||||
"deleted": "Silindi: {path}",
|
||||
"trashed": "Çöp kutusuna taşındı: {path}",
|
||||
"conflict": "{path} iki yerde de değiştirildi. Diğer sürüm {detail} olarak saklandı",
|
||||
"renamed-for-disk": "{path}, adına burada izin verilmediği için bu bilgisayarda {detail} olarak adlandırıldı",
|
||||
"too-large": "{path}, Dosyalar'ın izin verdiğinden büyük ({detail}). Yalnızca bu bilgisayarda kalır",
|
||||
"waiting": "{path} sunucuyu bekliyor",
|
||||
"mass-delete": "Çok sayıda öğe silinmeden önce duraklatıldı",
|
||||
"error": "{path} eşitlenemedi"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Sunucuya ulaşılamıyor",
|
||||
"server_refused": "Sunucu değişikliği reddetti",
|
||||
"too_large": "Dosya, Dosyalar için çok büyük",
|
||||
"name_invalid": "Bu ada izin verilmiyor",
|
||||
"disk_full": "Disk dolu",
|
||||
"denied": "İzin verilmiyor",
|
||||
"busy": "Başka bir program kullanıyor",
|
||||
"quota": "Dosyalar'daki depolama alanınız dolu",
|
||||
"not_found": "Artık mevcut değil",
|
||||
"policy": "Kuruluşunuz buna izin vermiyor",
|
||||
"failed": "Bir sorun oluştu"
|
||||
},
|
||||
"item": {
|
||||
"label": "Bu bilgisayarda",
|
||||
"synced": "Eşitlendi",
|
||||
"syncing": "Eşitleniyor",
|
||||
"pending": "Eşitlenmeyi bekliyor",
|
||||
"error": "Eşitlenemedi",
|
||||
"online-only": "Yalnızca Dosyalar'da, açıldığında indirilir"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Dosya Gezgini'nde göster",
|
||||
"finder": "Finder'da göster",
|
||||
"file_manager": "Dosya yöneticisinde göster",
|
||||
"failed": "Klasör açılamadı."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Hızlı ileti",
|
||||
"menu": "Hızlı ileti",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "Ще не вкладено й не збережено, і зараз видаляється: {names}.",
|
||||
"signout_held": "Ще відкрито в іншій програмі, тому видалиться лише після закриття там: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Файли на цьому комп’ютері",
|
||||
"drive": {
|
||||
"title": "Диск «Файли»",
|
||||
"label": "Показувати Файли як диск",
|
||||
"description": "Ваші Файли видно в Провіднику як диск. Файл завантажується, коли ви його відкриваєте.",
|
||||
"unsupported": "Потрібна Windows 10 версії 1809 або новіша.",
|
||||
"root_name": "Диск «Файли»",
|
||||
"letter_label": "Літера диска",
|
||||
"letter_description": "Призначає диску власну літеру в Провіднику.",
|
||||
"letter_none": "Без літери"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Синхронізовані папки",
|
||||
"description": "Папка на цьому комп’ютері й папка у Файлах залишаються однаковими, зміни йдуть в обидва боки.",
|
||||
"empty": "Ще немає синхронізованих папок.",
|
||||
"forced_off": "Ваша організація вимкнула синхронізацію папок. Файли в них залишаються на цьому комп’ютері.",
|
||||
"add": "Додати папку…",
|
||||
"loading": "Завантаження ваших папок…",
|
||||
"load_failed": "Не вдалося завантажити ваші папки у Файлах. Спробуйте ще раз.",
|
||||
"pick_title": "Яку папку у Файлах вибрати?",
|
||||
"pick_confirm": "Вибрати папку на цьому комп’ютері…",
|
||||
"paired_with": "З папкою {folder} у Файлах",
|
||||
"pause": "Призупинити",
|
||||
"resume": "Відновити",
|
||||
"remove": "Прибрати…",
|
||||
"remove_title": "Припинити синхронізацію цієї папки?",
|
||||
"remove_message": "Файли на цьому комп’ютері залишаться на місці, як і файли у Файлах. Зміни більше не переноситимуться між ними.",
|
||||
"remove_confirm": "Припинити синхронізацію",
|
||||
"add_failed": {
|
||||
"overlap": "Ця папка лежить усередині синхронізованої папки, містить таку папку або є системною. Виберіть іншу.",
|
||||
"denied": "Застосунок не може використовувати цю папку. Виберіть іншу.",
|
||||
"policy": "Ваша організація цього не дозволяє.",
|
||||
"failed": "Не вдалося додати папку. Спробуйте ще раз."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Запуск…",
|
||||
"idle": "Усе актуально. Остання синхронізація: {time}",
|
||||
"idle_never": "Усе актуально",
|
||||
"syncing": "Синхронізація: готово {done}, залишилося {pending}",
|
||||
"paused": "Призупинено",
|
||||
"offline": "Немає зв’язку. {count, plural, =0 {Зміни чекають на сервер} one {# зміна чекає на сервер} few {# зміни чекають на сервер} many {# змін чекають на сервер} other {# зміни чекають на сервер}}",
|
||||
"error": "Зупинено: {reason}",
|
||||
"confirm_delete": "Призупинено, доки ви не відповісте на запитання нижче",
|
||||
"blocked": "Вимкнено вашою організацією"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Видалити {count, plural, one {# елемент} few {# елементи} many {# елементів} other {# елемента}}?",
|
||||
"local": "{count, plural, one {# елемент видалено} few {# елементи видалено} many {# елементів видалено} other {# елемента видалено}} з папки {folder} на цьому комп’ютері. Видалити {count, plural, one {його} few {їх} many {їх} other {їх}} і у Файлах?",
|
||||
"remote": "{count, plural, one {# елемент видалено} few {# елементи видалено} many {# елементів видалено} other {# елемента видалено}} з папки {folder} у Файлах. Видалити {count, plural, one {його} few {їх} many {їх} other {їх}} і на цьому комп’ютері?",
|
||||
"allow": "{count, plural, one {Видалити його} few {Видалити їх} many {Видалити їх} other {Видалити їх}}",
|
||||
"restore": "{count, plural, one {Повернути його} few {Повернути їх} many {Повернути їх} other {Повернути їх}}",
|
||||
"later": "Вирішити пізніше"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Остання активність",
|
||||
"empty": "Поки нічого не сталося.",
|
||||
"clear": "Очистити",
|
||||
"to_files": "У Файли",
|
||||
"to_computer": "На цей комп’ютер",
|
||||
"mark_conflict": "Конфлікт",
|
||||
"mark_error": "Помилка",
|
||||
"mark_question": "Потрібна ваша відповідь",
|
||||
"uploaded": "Вивантажено: {path}",
|
||||
"downloaded": "Завантажено: {path}",
|
||||
"folder-created": "Створено папку {path}",
|
||||
"renamed": "Перейменовано: {detail} → {path}",
|
||||
"moved": "Переміщено: {detail} → {path}",
|
||||
"deleted": "Видалено: {path}",
|
||||
"trashed": "Переміщено в кошик: {path}",
|
||||
"conflict": "{path}: змінено в обох місцях. Іншу версію збережено як {detail}",
|
||||
"renamed-for-disk": "{path} на цьому комп’ютері називається {detail}, бо таке ім’я тут не дозволене",
|
||||
"too-large": "{path} більший, ніж дозволяють Файли ({detail}). Залишається лише на цьому комп’ютері",
|
||||
"waiting": "{path} чекає на сервер",
|
||||
"mass-delete": "Призупинено перед видаленням багатьох елементів",
|
||||
"error": "Не вдалося синхронізувати {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Сервер недоступний",
|
||||
"server_refused": "Сервер відхилив зміну",
|
||||
"too_large": "Файл завеликий для Файлів",
|
||||
"name_invalid": "Таке ім’я не дозволене",
|
||||
"disk_full": "Диск заповнено",
|
||||
"denied": "Немає доступу",
|
||||
"busy": "Використовується іншою програмою",
|
||||
"quota": "Ваше сховище у Файлах заповнене",
|
||||
"not_found": "Більше не існує",
|
||||
"policy": "Ваша організація цього не дозволяє",
|
||||
"failed": "Щось пішло не так"
|
||||
},
|
||||
"item": {
|
||||
"label": "На цьому комп’ютері",
|
||||
"synced": "Синхронізовано",
|
||||
"syncing": "Синхронізація",
|
||||
"pending": "Очікує синхронізації",
|
||||
"error": "Не вдалося синхронізувати",
|
||||
"online-only": "Лише у Файлах, завантажується під час відкриття"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Показати в Провіднику",
|
||||
"finder": "Показати у Finder",
|
||||
"file_manager": "Показати у файловому менеджері",
|
||||
"failed": "Не вдалося відкрити папку."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Швидкий лист",
|
||||
"menu": "Швидкий лист",
|
||||
|
||||
@@ -7662,6 +7662,112 @@
|
||||
"signout_changed": "Chưa đính kèm hoặc lưu, và bị xóa ngay: {names}.",
|
||||
"signout_held": "Vẫn đang mở trong chương trình khác nên chỉ bị xóa sau khi bạn đóng ở đó: {names}."
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "Tệp trên máy tính này",
|
||||
"drive": {
|
||||
"title": "Ổ đĩa Tệp",
|
||||
"label": "Hiển thị Tệp dưới dạng ổ đĩa",
|
||||
"description": "Tệp của bạn hiển thị trong Trình khám phá Tệp như một ổ đĩa. Mỗi tệp chỉ được tải xuống khi bạn mở nó.",
|
||||
"unsupported": "Cần Windows 10 phiên bản 1809 trở lên.",
|
||||
"root_name": "Ổ đĩa Tệp",
|
||||
"letter_label": "Ký tự ổ đĩa",
|
||||
"letter_description": "Gán cho ổ đĩa một ký tự riêng trong Trình khám phá Tệp.",
|
||||
"letter_none": "Không có ký tự"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Thư mục đồng bộ",
|
||||
"description": "Một thư mục trên máy tính này và một thư mục trong Tệp được giữ giống nhau, theo cả hai chiều.",
|
||||
"empty": "Chưa có thư mục nào được đồng bộ.",
|
||||
"forced_off": "Tổ chức của bạn đã tắt đồng bộ thư mục. Các tệp trong đó vẫn ở trên máy tính này.",
|
||||
"add": "Thêm thư mục…",
|
||||
"loading": "Đang tải thư mục của bạn…",
|
||||
"load_failed": "Không tải được thư mục của bạn trong Tệp. Hãy thử lại.",
|
||||
"pick_title": "Thư mục nào trong Tệp?",
|
||||
"pick_confirm": "Chọn thư mục trên máy tính này…",
|
||||
"paired_with": "Với {folder} trong Tệp",
|
||||
"pause": "Tạm dừng",
|
||||
"resume": "Tiếp tục",
|
||||
"remove": "Gỡ bỏ…",
|
||||
"remove_title": "Ngừng đồng bộ thư mục này?",
|
||||
"remove_message": "Các tệp trên máy tính này vẫn ở nguyên chỗ cũ, các tệp trong Tệp cũng vậy. Thay đổi sẽ không còn được chuyển từ bên này sang bên kia.",
|
||||
"remove_confirm": "Ngừng đồng bộ",
|
||||
"add_failed": {
|
||||
"overlap": "Thư mục này nằm trong một thư mục đồng bộ, chứa một thư mục đồng bộ, hoặc là thư mục hệ thống. Hãy chọn thư mục khác.",
|
||||
"denied": "Ứng dụng không thể dùng thư mục này. Hãy chọn thư mục khác.",
|
||||
"policy": "Tổ chức của bạn không cho phép việc này.",
|
||||
"failed": "Không thêm được thư mục. Hãy thử lại."
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "Đang khởi động…",
|
||||
"idle": "Đã cập nhật. Đồng bộ lần cuối {time}",
|
||||
"idle_never": "Đã cập nhật",
|
||||
"syncing": "Đang đồng bộ: xong {done}, còn {pending}",
|
||||
"paused": "Đã tạm dừng",
|
||||
"offline": "Ngoại tuyến. {count, plural, =0 {Các thay đổi đang chờ máy chủ} other {# thay đổi đang chờ máy chủ}}",
|
||||
"error": "Đã dừng: {reason}",
|
||||
"confirm_delete": "Tạm dừng cho đến khi bạn trả lời câu hỏi bên dưới",
|
||||
"blocked": "Đã bị tổ chức của bạn tắt"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "Xóa {count, plural, other {# mục}}?",
|
||||
"local": "{count, plural, other {# mục}} đã bị xóa khỏi {folder} trên máy tính này. Cũng xóa chúng trong Tệp?",
|
||||
"remote": "{count, plural, other {# mục}} đã bị xóa khỏi {folder} trong Tệp. Cũng xóa chúng trên máy tính này?",
|
||||
"allow": "{count, plural, other {Xóa}}",
|
||||
"restore": "{count, plural, other {Khôi phục}}",
|
||||
"later": "Quyết định sau"
|
||||
},
|
||||
"activity": {
|
||||
"title": "Hoạt động gần đây",
|
||||
"empty": "Chưa có gì xảy ra.",
|
||||
"clear": "Xóa danh sách",
|
||||
"to_files": "Đến Tệp",
|
||||
"to_computer": "Đến máy tính này",
|
||||
"mark_conflict": "Xung đột",
|
||||
"mark_error": "Lỗi",
|
||||
"mark_question": "Cần bạn trả lời",
|
||||
"uploaded": "Đã tải lên {path}",
|
||||
"downloaded": "Đã tải xuống {path}",
|
||||
"folder-created": "Đã tạo thư mục {path}",
|
||||
"renamed": "Đã đổi tên {detail} thành {path}",
|
||||
"moved": "Đã di chuyển {detail} đến {path}",
|
||||
"deleted": "Đã xóa {path}",
|
||||
"trashed": "Đã chuyển {path} vào thùng rác",
|
||||
"conflict": "{path} đã bị thay đổi ở cả hai nơi. Phiên bản kia được giữ với tên {detail}",
|
||||
"renamed-for-disk": "{path} có tên {detail} trên máy tính này, vì tên gốc không được phép ở đây",
|
||||
"too-large": "{path} lớn hơn mức Tệp cho phép ({detail}). Tệp này chỉ ở trên máy tính này",
|
||||
"waiting": "{path} đang chờ máy chủ",
|
||||
"mass-delete": "Đã tạm dừng trước khi xóa nhiều mục",
|
||||
"error": "Không đồng bộ được {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "Không kết nối được máy chủ",
|
||||
"server_refused": "Máy chủ đã từ chối thay đổi",
|
||||
"too_large": "Tệp này lớn hơn mức Tệp cho phép",
|
||||
"name_invalid": "Tên này không được phép",
|
||||
"disk_full": "Ổ đĩa đã đầy",
|
||||
"denied": "Không được phép",
|
||||
"busy": "Một chương trình khác đang dùng nó",
|
||||
"quota": "Dung lượng lưu trữ của bạn trong Tệp đã đầy",
|
||||
"not_found": "Không còn ở đó nữa",
|
||||
"policy": "Tổ chức của bạn không cho phép việc này",
|
||||
"failed": "Đã xảy ra lỗi"
|
||||
},
|
||||
"item": {
|
||||
"label": "Trên máy tính này",
|
||||
"synced": "Đã đồng bộ",
|
||||
"syncing": "Đang đồng bộ",
|
||||
"pending": "Đang chờ đồng bộ",
|
||||
"error": "Không đồng bộ được",
|
||||
"online-only": "Chỉ có trong Tệp, tải xuống khi mở"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "Hiển thị trong Trình khám phá Tệp",
|
||||
"finder": "Hiển thị trong Finder",
|
||||
"file_manager": "Hiển thị trong trình quản lý tệp",
|
||||
"failed": "Không mở được thư mục."
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "Soạn nhanh",
|
||||
"menu": "Soạn nhanh",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "尚未附加或儲存,現在將刪除:{names}。",
|
||||
"signout_held": "仍在其他程式中開啟,因此要在那裡關閉後才會刪除:{names}。"
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "這部電腦上的檔案",
|
||||
"drive": {
|
||||
"title": "檔案磁碟機",
|
||||
"label": "將檔案顯示為磁碟機",
|
||||
"description": "您的檔案會像磁碟機一樣顯示在檔案總管中。檔案在開啟時才會下載。",
|
||||
"unsupported": "需要 Windows 10 版本 1809 或更新版本。",
|
||||
"root_name": "檔案磁碟機",
|
||||
"letter_label": "磁碟機代號",
|
||||
"letter_description": "在檔案總管中為磁碟機指定專屬的代號。",
|
||||
"letter_none": "無代號"
|
||||
},
|
||||
"folders": {
|
||||
"title": "已同步的資料夾",
|
||||
"description": "這部電腦上的一個資料夾和檔案中的一個資料夾會雙向保持一致。",
|
||||
"empty": "尚未同步任何資料夾。",
|
||||
"forced_off": "您的組織已關閉資料夾同步。其中的檔案會保留在這部電腦上。",
|
||||
"add": "新增資料夾…",
|
||||
"loading": "正在載入您的資料夾…",
|
||||
"load_failed": "無法載入您在檔案中的資料夾。請再試一次。",
|
||||
"pick_title": "要與檔案中的哪個資料夾同步?",
|
||||
"pick_confirm": "選擇這部電腦上的資料夾…",
|
||||
"paired_with": "與檔案中的 {folder} 同步",
|
||||
"pause": "暫停",
|
||||
"resume": "繼續",
|
||||
"remove": "移除…",
|
||||
"remove_title": "要停止同步此資料夾嗎?",
|
||||
"remove_message": "這部電腦上的檔案和檔案中的檔案都會保持原樣。變更將不再於兩者之間同步。",
|
||||
"remove_confirm": "停止同步",
|
||||
"add_failed": {
|
||||
"overlap": "此資料夾位於已同步的資料夾中、包含已同步的資料夾,或者是系統資料夾。請選擇其他資料夾。",
|
||||
"denied": "應用程式無法使用此資料夾。請選擇其他資料夾。",
|
||||
"policy": "您的組織不允許此操作。",
|
||||
"failed": "無法新增資料夾。請再試一次。"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "正在啟動…",
|
||||
"idle": "已是最新狀態。上次同步於 {time}",
|
||||
"idle_never": "已是最新狀態",
|
||||
"syncing": "正在同步:已完成 {done} 個,還剩 {pending} 個",
|
||||
"paused": "已暫停",
|
||||
"offline": "離線。{count, plural, =0 {變更正在等待伺服器} other {# 項變更正在等待伺服器}}",
|
||||
"error": "已停止:{reason}",
|
||||
"confirm_delete": "已暫停,請先回答下方的問題",
|
||||
"blocked": "已被您的組織關閉"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "要刪除 {count, plural, other {# 個項目}}嗎?",
|
||||
"local": "已從這部電腦上的 {folder} 中刪除 {count, plural, other {# 個項目}}。也要在檔案中刪除嗎?",
|
||||
"remote": "已從檔案中的 {folder} 刪除 {count, plural, other {# 個項目}}。也要在這部電腦上刪除嗎?",
|
||||
"allow": "{count, plural, other {刪除}}",
|
||||
"restore": "{count, plural, other {復原}}",
|
||||
"later": "稍後決定"
|
||||
},
|
||||
"activity": {
|
||||
"title": "最近活動",
|
||||
"empty": "目前還沒有任何活動。",
|
||||
"clear": "清除",
|
||||
"to_files": "到檔案",
|
||||
"to_computer": "到這部電腦",
|
||||
"mark_conflict": "衝突",
|
||||
"mark_error": "錯誤",
|
||||
"mark_question": "需要您回答",
|
||||
"uploaded": "已上傳 {path}",
|
||||
"downloaded": "已下載 {path}",
|
||||
"folder-created": "已建立資料夾 {path}",
|
||||
"renamed": "已將 {detail} 重新命名為 {path}",
|
||||
"moved": "已將 {detail} 移至 {path}",
|
||||
"deleted": "已刪除 {path}",
|
||||
"trashed": "已將 {path} 移至垃圾桶",
|
||||
"conflict": "{path} 在兩處都被變更。另一個版本已保留為 {detail}",
|
||||
"renamed-for-disk": "{path} 的名稱在此處不允許使用,因此在這部電腦上名為 {detail}",
|
||||
"too-large": "{path} 超出了檔案允許的大小({detail})。它只會保留在這部電腦上",
|
||||
"waiting": "{path} 正在等待伺服器",
|
||||
"mass-delete": "在刪除大量項目前已暫停",
|
||||
"error": "無法同步 {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "無法連線到伺服器",
|
||||
"server_refused": "伺服器拒絕了此變更",
|
||||
"too_large": "此檔案超出了檔案允許的大小",
|
||||
"name_invalid": "不允許使用此名稱",
|
||||
"disk_full": "磁碟已滿",
|
||||
"denied": "不允許",
|
||||
"busy": "另一個程式正在使用它",
|
||||
"quota": "您在檔案中的儲存空間已滿",
|
||||
"not_found": "它已不存在",
|
||||
"policy": "您的組織不允許此操作",
|
||||
"failed": "發生錯誤"
|
||||
},
|
||||
"item": {
|
||||
"label": "在這部電腦上",
|
||||
"synced": "已同步",
|
||||
"syncing": "正在同步",
|
||||
"pending": "等待同步",
|
||||
"error": "無法同步",
|
||||
"online-only": "僅在檔案中,開啟時下載"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "在檔案總管中顯示",
|
||||
"finder": "在 Finder 中顯示",
|
||||
"file_manager": "在檔案管理員中顯示",
|
||||
"failed": "無法開啟資料夾。"
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "快速撰寫",
|
||||
"menu": "快速撰寫",
|
||||
|
||||
@@ -7650,6 +7650,112 @@
|
||||
"signout_changed": "尚未附加或保存,现在将删除:{names}。",
|
||||
"signout_held": "仍在其他程序中打开,因此要在那里关闭后才会删除:{names}。"
|
||||
},
|
||||
"files_sync": {
|
||||
"title": "此电脑上的文件",
|
||||
"drive": {
|
||||
"title": "文件驱动器",
|
||||
"label": "将文件显示为驱动器",
|
||||
"description": "你的文件会像驱动器一样显示在文件资源管理器中。文件在打开时才会下载。",
|
||||
"unsupported": "需要 Windows 10 版本 1809 或更高版本。",
|
||||
"root_name": "文件驱动器",
|
||||
"letter_label": "驱动器号",
|
||||
"letter_description": "在文件资源管理器中为驱动器分配专用的驱动器号。",
|
||||
"letter_none": "无驱动器号"
|
||||
},
|
||||
"folders": {
|
||||
"title": "同步的文件夹",
|
||||
"description": "此电脑上的一个文件夹和文件中的一个文件夹会双向保持一致。",
|
||||
"empty": "还没有同步任何文件夹。",
|
||||
"forced_off": "你的组织已关闭文件夹同步。其中的文件会保留在此电脑上。",
|
||||
"add": "添加文件夹…",
|
||||
"loading": "正在加载你的文件夹…",
|
||||
"load_failed": "无法加载你在文件中的文件夹。请重试。",
|
||||
"pick_title": "与文件中的哪个文件夹同步?",
|
||||
"pick_confirm": "选择此电脑上的文件夹…",
|
||||
"paired_with": "与文件中的 {folder} 同步",
|
||||
"pause": "暂停",
|
||||
"resume": "继续",
|
||||
"remove": "移除…",
|
||||
"remove_title": "停止同步此文件夹?",
|
||||
"remove_message": "此电脑上的文件和文件中的文件都会保持原样。更改将不再在两者之间同步。",
|
||||
"remove_confirm": "停止同步",
|
||||
"add_failed": {
|
||||
"overlap": "此文件夹位于已同步的文件夹中、包含已同步的文件夹,或者是系统文件夹。请选择其他文件夹。",
|
||||
"denied": "应用无法使用此文件夹。请选择其他文件夹。",
|
||||
"policy": "你的组织不允许此操作。",
|
||||
"failed": "无法添加文件夹。请重试。"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"starting": "正在启动…",
|
||||
"idle": "已是最新。上次同步于 {time}",
|
||||
"idle_never": "已是最新",
|
||||
"syncing": "正在同步:已完成 {done} 个,还剩 {pending} 个",
|
||||
"paused": "已暂停",
|
||||
"offline": "离线。{count, plural, =0 {更改正在等待服务器} other {# 项更改正在等待服务器}}",
|
||||
"error": "已停止:{reason}",
|
||||
"confirm_delete": "已暂停,请先回答下面的问题",
|
||||
"blocked": "已被你的组织关闭"
|
||||
},
|
||||
"mass_delete": {
|
||||
"title": "删除 {count, plural, other {# 个项目}}?",
|
||||
"local": "已从此电脑上的 {folder} 中删除 {count, plural, other {# 个项目}}。也要在文件中删除吗?",
|
||||
"remote": "已从文件中的 {folder} 删除 {count, plural, other {# 个项目}}。也要在此电脑上删除吗?",
|
||||
"allow": "{count, plural, other {删除}}",
|
||||
"restore": "{count, plural, other {恢复}}",
|
||||
"later": "稍后决定"
|
||||
},
|
||||
"activity": {
|
||||
"title": "最近活动",
|
||||
"empty": "还没有任何活动。",
|
||||
"clear": "清除",
|
||||
"to_files": "到文件",
|
||||
"to_computer": "到此电脑",
|
||||
"mark_conflict": "冲突",
|
||||
"mark_error": "错误",
|
||||
"mark_question": "需要你回答",
|
||||
"uploaded": "已上传 {path}",
|
||||
"downloaded": "已下载 {path}",
|
||||
"folder-created": "已创建文件夹 {path}",
|
||||
"renamed": "已将 {detail} 重命名为 {path}",
|
||||
"moved": "已将 {detail} 移动到 {path}",
|
||||
"deleted": "已删除 {path}",
|
||||
"trashed": "已将 {path} 移到回收站",
|
||||
"conflict": "{path} 在两处都被更改。另一个版本已保留为 {detail}",
|
||||
"renamed-for-disk": "{path} 的名称在此处不允许使用,因此在此电脑上名为 {detail}",
|
||||
"too-large": "{path} 超出了文件允许的大小({detail})。它只保留在此电脑上",
|
||||
"waiting": "{path} 正在等待服务器",
|
||||
"mass-delete": "在删除大量项目前已暂停",
|
||||
"error": "无法同步 {path}"
|
||||
},
|
||||
"errors": {
|
||||
"offline": "无法连接到服务器",
|
||||
"server_refused": "服务器拒绝了此更改",
|
||||
"too_large": "该文件超出了文件允许的大小",
|
||||
"name_invalid": "不允许使用此名称",
|
||||
"disk_full": "磁盘已满",
|
||||
"denied": "不允许",
|
||||
"busy": "另一个程序正在使用它",
|
||||
"quota": "你在文件中的存储空间已满",
|
||||
"not_found": "它已不存在",
|
||||
"policy": "你的组织不允许此操作",
|
||||
"failed": "出了点问题"
|
||||
},
|
||||
"item": {
|
||||
"label": "在此电脑上",
|
||||
"synced": "已同步",
|
||||
"syncing": "正在同步",
|
||||
"pending": "等待同步",
|
||||
"error": "无法同步",
|
||||
"online-only": "仅在文件中,打开时下载"
|
||||
},
|
||||
"show_in": {
|
||||
"explorer": "在文件资源管理器中显示",
|
||||
"finder": "在 Finder 中显示",
|
||||
"file_manager": "在文件管理器中显示",
|
||||
"failed": "无法打开文件夹。"
|
||||
}
|
||||
},
|
||||
"desktopQuickCompose": {
|
||||
"label": "快速撰写",
|
||||
"menu": "快速撰写",
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { create } from 'zustand';
|
||||
import type { FilesSyncController, FilesSyncSnapshot } from '@/lib/files-sync/types';
|
||||
|
||||
/**
|
||||
* Files on this computer, for the UI: the engine (lib/files-sync) writes the snapshot
|
||||
* and registers its controller; the settings page and the Files screen read it and
|
||||
* call the controller. Nothing here touches the bridge.
|
||||
*/
|
||||
interface FilesSyncStore extends FilesSyncSnapshot {
|
||||
controller: FilesSyncController | null;
|
||||
/** The engine's: replaces what it says changed. */
|
||||
publish: (patch: Partial<FilesSyncSnapshot>) => void;
|
||||
setController: (controller: FilesSyncController | null) => void;
|
||||
/** Back to nothing: signed out, or the engine stopped. */
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
const EMPTY: FilesSyncSnapshot = {
|
||||
available: false,
|
||||
account: null,
|
||||
roots: [],
|
||||
status: {},
|
||||
activity: [],
|
||||
drive: null,
|
||||
folderSyncForcedOff: false,
|
||||
items: {},
|
||||
};
|
||||
|
||||
export const useFilesSyncStore = create<FilesSyncStore>((set) => ({
|
||||
...EMPTY,
|
||||
controller: null,
|
||||
publish: (patch) => set(patch),
|
||||
setController: (controller) => set({ controller }),
|
||||
reset: () => set({ ...EMPTY, controller: null }),
|
||||
}));
|
||||
Reference in New Issue
Block a user