big explorer improvements

This commit is contained in:
Jamie Pine committed 2022-04-12 15:31:17 -07:00
1 parent fc1ccc3800
commit 61a251c000
46 files changed
+11271 -1104

No files matched your search

+6 -1
View File
@@ -1,5 +1,10 @@
{
"cSpell.words": ["ipfs", "repr", "tailwindcss"],
"cSpell.words": [
"ipfs",
"Keepsafe",
"repr",
"tailwindcss"
],
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.diagnostics.enableExperimental": false
}
+2
View File
@@ -32,6 +32,8 @@
"@headlessui/react": "^1.5.0",
"@heroicons/react": "^1.0.6",
"@radix-ui/react-dialog": "^0.1.7",
"@radix-ui/react-dropdown-menu": "^0.1.6",
"@radix-ui/react-icons": "^1.1.0",
"@radix-ui/react-slider": "^0.1.4",
"@sd/client": "workspace:*",
"@sd/core": "workspace:*",
+1 -1
View File
@@ -45,7 +45,7 @@
"allowlist": {
"all": true,
"protocol": {
"assetScope": ["$HOME/Library/Application Support/spacedrive/thumbnails/**/*.webp"]
"assetScope": ["*"]
},
"dialog": {
"all": true,
@@ -0,0 +1,15 @@
<svg width="141" height="110" viewBox="0 0 141 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 15.5273C0 7.15264 6.78899 0.363647 15.1636 0.363647H35.9094C39.3671 0.363647 42.7035 1.63836 45.2803 3.94395C47.8571 6.24955 51.1935 7.52425 54.6512 7.52425H123.836C132.211 7.52425 139 14.3132 139 22.6879V23.9515C139 32.3262 132.211 39.1152 123.836 39.1152H15.1636C6.78899 39.1152 0 32.3262 0 23.9515V15.5273Z" fill="url(#paint0_linear_0_3)"/>
<path d="M0 29.8485C0 23.8001 4.90316 18.897 10.9515 18.897H128.048C134.097 18.897 139 23.8001 139 29.8485V94.7152C139 103.09 132.211 109.879 123.836 109.879H15.1636C6.78899 109.879 0 103.09 0 94.7152V29.8485Z" fill="url(#paint1_linear_0_3)"/>
<path d="M0.582787 99.2818L140.005 100" stroke="white" stroke-opacity="0.03" stroke-width="2"/>
<defs>
<linearGradient id="paint0_linear_0_3" x1="69.5" y1="0.363647" x2="69.5" y2="39.1152" gradientUnits="userSpaceOnUse">
<stop stop-color="#E7E6E6"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<linearGradient id="paint1_linear_0_3" x1="69.5" y1="18.897" x2="69.5" y2="109.879" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#EAEAEA"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+21 -8
View File
@@ -17,7 +17,7 @@ type ExplorerState = {
};
export const useExplorerState = create<ExplorerState>((set) => ({
selectedRowIndex: -1,
selectedRowIndex: 1,
setSelectedRowIndex: (index) => set((state) => ({ ...state, selectedRowIndex: index }))
}));
@@ -52,6 +52,7 @@ export const FileList: React.FC<{ location_id: number; path: string; limit: numb
const path = props.path;
const { selectedRowIndex, setSelectedRowIndex } = useExplorerState();
const [goingUp, setGoingUp] = useState(false);
const { data: currentDir } = useBridgeQuery('LibGetExplorerDir', {
location_id: props.location_id,
@@ -60,16 +61,25 @@ export const FileList: React.FC<{ location_id: number; path: string; limit: numb
});
useEffect(() => {
if (selectedRowIndex != -1) VList.current?.scrollIntoView({ index: selectedRowIndex });
if (selectedRowIndex === 0 && goingUp) {
VList.current?.scrollTo({ top: 0, behavior: 'smooth' });
}
if (selectedRowIndex != -1) {
VList.current?.scrollIntoView({
index: goingUp ? selectedRowIndex - 1 : selectedRowIndex
});
}
}, [selectedRowIndex]);
useKey('ArrowUp', (e) => {
e.preventDefault();
setGoingUp(true);
if (selectedRowIndex != -1 && selectedRowIndex !== 0) setSelectedRowIndex(selectedRowIndex - 1);
});
useKey('ArrowDown', (e) => {
e.preventDefault();
setGoingUp(false);
if (selectedRowIndex != -1 && selectedRowIndex !== (currentDir?.contents.length ?? 1) - 1)
setSelectedRowIndex(selectedRowIndex + 1);
});
@@ -84,7 +94,7 @@ export const FileList: React.FC<{ location_id: number; path: string; limit: numb
const Header = () => (
<div>
<h1 className="p-2 mt-10 ml-1 text-xl font-bold">{currentDir?.directory.name}</h1>
<h1 className="p-2 pt-20 pl-4 text-xl font-bold">{currentDir?.directory.name}</h1>
<div className="table-head">
<div className="flex flex-row p-2 table-head-row">
{columns.map((col) => (
@@ -107,7 +117,7 @@ export const FileList: React.FC<{ location_id: number; path: string; limit: numb
<div
ref={tableContainer}
style={{ marginTop: -44 }}
className="w-full h-full p-3 bg-white cursor-default table-container dark:bg-gray-650"
className="w-full px-2 bg-white cursor-default table-container dark:bg-gray-650"
>
<LocationContext.Provider value={{ location_id: props.location_id }}>
<Virtuoso
@@ -116,8 +126,8 @@ export const FileList: React.FC<{ location_id: number; path: string; limit: numb
style={{ height: size.innerHeight ?? 600 }}
totalCount={currentDir?.contents.length || 0}
itemContent={Row}
// increaseViewportBy={10}
components={{ Header }}
components={{ Header, Footer: () => <div className="w-full " /> }}
increaseViewportBy={{ top: 400, bottom: 200 }}
className="outline-none"
/>
</LocationContext.Provider>
@@ -180,9 +190,12 @@ const RenderCell: React.FC<{ colKey?: ColumnKey; dirId?: number; file?: FilePath
const row = file;
if (!row) return <></>;
// @ts-expect-error
const value = row[colKey];
if (!value) return <></>;
const { data: client } = useBridgeQuery('ClientGetState');
const { data: client } = useBridgeQuery('ClientGetState', undefined, {
refetchOnWindowFocus: false
});
const location = useContext(LocationContext);
switch (colKey) {
@@ -198,7 +211,7 @@ const RenderCell: React.FC<{ colKey?: ColumnKey; dirId?: number; file?: FilePath
<img
className="mt-0.5 pointer-events-none z-90"
src={convertFileSrc(
`${client.data_path}/thumbnails/${location.location_id}/${row.temp_checksum}.webp`
`${client.data_path}/thumbnails/${location.location_id}/${row.temp_cas_id}.webp`
)}
/>
)
+21 -20
View File
@@ -11,24 +11,25 @@ export default function FileThumb(props: {
}) {
const { data: client } = useBridgeQuery('ClientGetState');
return (
<>
{props.file.is_dir ? (
<img
className={clsx('mt-0.5 pointer-events-none z-90', props.className)}
src="/svg/folder.svg"
/>
) : (
props.file.has_local_thumbnail &&
client?.data_path && (
<img
className="mt-0.5 pointer-events-none z-90"
src={convertFileSrc(
`${client.data_path}/thumbnails/${props.locationId}/${props.file.temp_checksum}.webp`
)}
/>
)
)}
</>
);
if (props.file.is_dir) {
return (
<img
className={clsx('mt-0.5 pointer-events-none z-90', props.className)}
src="/svg/folder.svg"
/>
);
}
if (props.file.has_local_thumbnail && client?.data_path) {
return (
<img
className="mt-0.5 pointer-events-none z-90"
src={convertFileSrc(
`${client.data_path}/thumbnails/${props.locationId}/${props.file.temp_cas_id}.webp`
)}
/>
);
}
return <div></div>;
}
+44 -9
View File
@@ -2,33 +2,37 @@ import React from 'react';
import { Transition } from '@headlessui/react';
import { convertFileSrc } from '@tauri-apps/api/tauri';
import moment from 'moment';
import { Button } from '../primitive';
import { Button, Input, TextArea } from '../primitive';
import { ShareIcon } from '@heroicons/react/solid';
import { Heart, Link } from 'phosphor-react';
import { useExplorerState } from './FileList';
import { FilePath } from '@sd/core';
import FileThumb from './FileThumb';
import { default as types } from '../../constants/file-types.json';
interface MetaItemProps {
title: string;
value: string;
value: string | React.ReactNode;
}
const MetaItem = (props: MetaItemProps) => {
return (
<div className="flex flex-col px-3 py-1 meta-item">
<h5 className="text-xs font-bold">{props.title}</h5>
<p className="text-xs text-gray-600 break-all truncate dark:text-gray-300">{props.value}</p>
{typeof props.value === 'string' ? (
<p className="text-xs text-gray-600 break-all truncate dark:text-gray-300">{props.value}</p>
) : (
props.value
)}
</div>
);
};
const Divider = () => <div className="w-full my-1 h-[1px] bg-gray-100 dark:bg-gray-600" />;
const Divider = () => <div className="w-full my-1 h-[1px] bg-gray-100 dark:bg-gray-550" />;
export const Inspector = (props: { selectedFile?: FilePath; locationId: number }) => {
const { selectedRowIndex } = useExplorerState();
const isOpen = !!props.selectedFile;
// const { selectedRowIndex } = useExplorerState();
// const isOpen = !!props.selectedFile;
const file = props.selectedFile;
@@ -44,7 +48,7 @@ export const Inspector = (props: { selectedFile?: FilePath; locationId: number }
>
<div className="top-0 right-0 h-full m-2 border border-gray-100 rounded-lg w-60 dark:border-gray-850 ">
{!!file && (
<div className="flex flex-col h-full overflow-hidden bg-white rounded-lg select-text dark:bg-gray-700">
<div className="flex flex-col h-full overflow-hidden bg-white rounded-lg select-text dark:bg-gray-600 bg-opacity-70">
<div className="flex items-center justify-center w-full h-64 overflow-hidden rounded-t-lg bg-gray-50 dark:bg-gray-900">
<FileThumb
className="!m-0 flex flex-shrink flex-grow-0"
@@ -64,14 +68,45 @@ export const Inspector = (props: { selectedFile?: FilePath; locationId: number }
<Link className="w-[18px] h-[18px]" />
</Button>
</div>
<MetaItem title="Checksum" value={file?.temp_checksum as string} />
{file?.temp_cas_id && (
<MetaItem title="Unique Content ID" value={file.temp_cas_id as string} />
)}
<Divider />
<MetaItem title="Uri" value={file?.materialized_path as string} />
<Divider />
<MetaItem
title="Date Created"
value={moment(file?.date_created).format('MMMM Do YYYY, h:mm:ss a')}
/>
<Divider />
<MetaItem
title="Date Indexed"
value={moment(file?.date_indexed).format('MMMM Do YYYY, h:mm:ss a')}
/>
<Divider />
{!file?.is_dir && (
<>
<div className="flex flex-row items-center px-3 py-2 meta-item">
{file?.extension && (
<span className="inline px-1 mr-1 text-xs font-bold uppercase bg-gray-500 rounded-md text-gray-150">
{file?.extension}
</span>
)}
<p className="text-xs text-gray-600 break-all truncate dark:text-gray-300">
{file?.extension
? //@ts-ignore
types[file.extension.toUpperCase()]?.descriptions.join(' / ')
: 'Unknown'}
</p>
</div>
<Divider />
</>
)}
<MetaItem
title="Comment"
value={<TextArea size="sm" className="mt-2 text-xs leading-snug !py-2" />}
/>
{/* <div className="flex flex-row m-3">
<Button size="sm">Mint</Button>
</div> */}
+29 -25
View File
@@ -14,7 +14,7 @@ import { platform } from '@tauri-apps/api/os';
interface SidebarProps extends DefaultProps {}
export const SidebarLink = (props: NavLinkProps) => (
export const SidebarLink = (props: NavLinkProps & { children: React.ReactNode }) => (
<NavLink {...props}>
{({ isActive }) => (
<span
@@ -34,7 +34,7 @@ const Icon = ({ component: Icon, ...props }: any) => (
<Icon weight="bold" {...props} className={clsx('w-4 h-4 mr-2', props.className)} />
);
const Heading: React.FC<{}> = ({ children }) => (
const Heading: React.FC<{ children: React.ReactNode }> = ({ children }) => (
<div className="mt-5 mb-1 ml-1 text-xs font-semibold text-gray-300">{children}</div>
);
@@ -53,7 +53,7 @@ export function MacOSTrafficLights() {
export const Sidebar: React.FC<SidebarProps> = (props) => {
const [isMacos, setIsMacos] = useState(false);
const { data: volumes } = useBridgeQuery('SysGetVolumes');
const { data: locations } = useBridgeQuery('SysGetLocations');
useEffect(() => {
platform().then((platform) => {
@@ -113,40 +113,47 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
</SidebarLink>
<SidebarLink to="spaces">
<Icon component={CirclesFour} />
Spaces
Content
</SidebarLink>
<SidebarLink to="media">
<Icon component={MonitorPlay} />
Media
Albums
</SidebarLink>
<SidebarLink to="explorer">
{/* <SidebarLink to="explorer">
<Icon component={MonitorPlay} />
Explorer
</SidebarLink>
</SidebarLink> */}
</div>
<div>
<Heading>Locations</Heading>
{volumes?.map((location, index) => {
{locations?.map((location, index) => {
return (
<div key={index} className="flex flex-row items-center">
<SidebarLink
className="relative w-full group"
to={{ pathname: `/app/explorer`, search: `?url=${location.mount_point}` }}
<NavLink
className="'relative w-full group'"
to={{
pathname: `explorer/${location.id}`
}}
>
<Icon component={ServerIcon} />
{location.name}
<div className="flex-grow" />
{location.is_removable && (
<Button
noBorder
size="sm"
className="w-7 h-7 top-0 right-0 absolute !bg-transparent group-hover:bg-gray-600 dark:hover:!bg-gray-550 !transition-none items-center !rounded-l-none"
{({ isActive }) => (
<span
className={clsx(
'max-w mb-[2px] text-gray-550 dark:text-gray-150 rounded px-2 py-1 flex flex-row flex-grow items-center hover:bg-gray-100 dark:hover:bg-gray-600 text-sm',
{
'!bg-primary !text-white hover:bg-primary dark:hover:bg-primary': isActive
}
)}
>
<Icon className="w-3 h-3 mr-0 " component={EjectSimple} />
</Button>
<img
className="w-4 h-4 mr-2 pointer-events-none z-90"
src={`/svg/${isActive ? 'folder-white' : 'folder'}.svg`}
/>
{location.name}
<div className="flex-grow" />
</span>
)}
</SidebarLink>
</NavLink>
</div>
);
})}
@@ -184,9 +191,6 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
)}
</NavLink>
</div>
{/* <div className="w-full px-2 py-2 mb-2 text-xs font-bold text-center text-gray-500 border border-dashed rounded border-gray-550">
Drop
</div> */}
</div>
);
};
@@ -0,0 +1,212 @@
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import {
CaretRightIcon,
CheckIcon,
CropIcon,
EyeClosedIcon,
EyeOpenIcon,
FileIcon,
FrameIcon,
GridIcon,
Link2Icon,
MixerHorizontalIcon,
PersonIcon,
TransparencyGridIcon
} from '@radix-ui/react-icons';
import cx from 'clsx';
import React, { ReactNode, useState } from 'react';
import { Button } from './Button';
interface RadixMenuItem {
label: string;
shortcut?: string;
icon?: ReactNode;
}
interface User {
name: string;
url?: string;
}
const generalMenuItems: RadixMenuItem[] = [
{
label: 'New File',
icon: <FileIcon className="mr-2 h-3.5 w-3.5" />,
shortcut: '⌘+N'
},
{
label: 'Settings',
icon: <MixerHorizontalIcon className="mr-2 h-3.5 w-3.5" />,
shortcut: '⌘+,'
}
];
const regionToolMenuItems: RadixMenuItem[] = [
{
label: 'Frame',
icon: <FrameIcon className="mr-2 h-3.5 w-3.5" />,
shortcut: '⌘+F'
},
{
label: 'Crop',
icon: <CropIcon className="mr-2 h-3.5 w-3.5" />,
shortcut: '⌘+S'
}
];
const users: User[] = [
{
name: 'Adam',
url: 'https://github.com/adamwathan.png'
},
{
name: 'Steve',
url: 'https://github.com/steveschoger.png'
},
{
name: 'Robin',
url: 'https://github.com/robinmalfait.png'
}
];
interface Props {}
const DropdownMenu = (props: Props) => {
const [showGrid, setShowGrid] = useState(false);
const [showUi, setShowUi] = useState(false);
return (
<div className="relative inline-block text-left">
<DropdownMenuPrimitive.Root>
<DropdownMenuPrimitive.Trigger asChild>
<Button>Click</Button>
</DropdownMenuPrimitive.Trigger>
<DropdownMenuPrimitive.Content
align="end"
sideOffset={5}
className={cx(
' radix-side-top:animate-slide-up radix-side-bottom:animate-slide-down',
'w-48 rounded-lg px-1.5 py-1 shadow-md md:w-56',
'bg-white dark:bg-gray-800'
)}
>
{generalMenuItems.map(({ label, icon, shortcut }, i) => (
<DropdownMenuPrimitive.Item
key={`${label}-${i}`}
className={cx(
'flex cursor-default select-none items-center rounded-md px-2 py-2 text-xs outline-none',
'text-gray-400 focus:bg-gray-50 dark:text-gray-500 dark:focus:bg-gray-900'
)}
>
{icon}
<span className="flex-grow text-gray-700 dark:text-gray-300">{label}</span>
{shortcut && <span className="text-xs">{shortcut}</span>}
</DropdownMenuPrimitive.Item>
))}
<DropdownMenuPrimitive.Separator className="h-px my-1 bg-gray-200 dark:bg-gray-700" />
<DropdownMenuPrimitive.CheckboxItem
checked={showGrid}
onCheckedChange={setShowGrid}
className={cx(
'flex w-full cursor-default select-none items-center rounded-md px-2 py-2 text-xs outline-none',
'text-gray-400 focus:bg-gray-50 dark:text-gray-500 dark:focus:bg-gray-900'
)}
>
{showGrid ? (
<GridIcon className="w-4 h-4 mr-2" />
) : (
<TransparencyGridIcon className="mr-2 h-3.5 w-3.5 text-gray-700 dark:text-gray-300" />
)}
<span className="flex-grow text-gray-700 dark:text-gray-300">Show Grid</span>
<DropdownMenuPrimitive.ItemIndicator>
<CheckIcon className="h-3.5 w-3.5" />
</DropdownMenuPrimitive.ItemIndicator>
</DropdownMenuPrimitive.CheckboxItem>
<DropdownMenuPrimitive.CheckboxItem
checked={showUi}
onCheckedChange={setShowUi}
className={cx(
'flex w-full cursor-default select-none items-center rounded-md px-2 py-2 text-xs outline-none',
'text-gray-400 focus:bg-gray-50 dark:text-gray-500 dark:focus:bg-gray-900'
)}
>
{showUi ? (
<EyeOpenIcon className="mr-2 h-3.5 w-3.5" />
) : (
<EyeClosedIcon className="mr-2 h-3.5 w-3.5" />
)}
<span className="flex-grow text-gray-700 dark:text-gray-300">Show UI</span>
<DropdownMenuPrimitive.ItemIndicator>
<CheckIcon className="h-3.5 w-3.5" />
</DropdownMenuPrimitive.ItemIndicator>
</DropdownMenuPrimitive.CheckboxItem>
<DropdownMenuPrimitive.Separator className="h-px my-1 bg-gray-200 dark:bg-gray-700" />
<DropdownMenuPrimitive.Label className="px-2 py-2 text-xs text-gray-700 select-none dark:text-gray-200">
Region Tools
</DropdownMenuPrimitive.Label>
{regionToolMenuItems.map(({ label, icon, shortcut }, i) => (
<DropdownMenuPrimitive.Item
key={`${label}-${i}`}
className={cx(
'flex cursor-default select-none items-center rounded-md px-2 py-2 text-xs outline-none',
'text-gray-400 focus:bg-gray-50 dark:text-gray-500 dark:focus:bg-gray-900'
)}
>
{icon}
<span className="flex-grow text-gray-700 dark:text-gray-300">{label}</span>
{shortcut && <span className="text-xs">{shortcut}</span>}
</DropdownMenuPrimitive.Item>
))}
<DropdownMenuPrimitive.Separator className="h-px my-1 bg-gray-200 dark:bg-gray-700" />
<DropdownMenuPrimitive.Root>
<DropdownMenuPrimitive.TriggerItem
className={cx(
'flex w-full cursor-default select-none items-center rounded-md px-2 py-2 text-xs outline-none',
'text-gray-400 focus:bg-gray-50 dark:text-gray-500 dark:focus:bg-gray-900'
)}
>
<Link2Icon className="mr-2 h-3.5 w-3.5" />
<span className="flex-grow text-gray-700 dark:text-gray-300">Share</span>
<CaretRightIcon className="h-3.5 w-3.5" />
</DropdownMenuPrimitive.TriggerItem>
<DropdownMenuPrimitive.Content
className={cx(
'origin-radix-dropdown-menu radix-side-right:animate-scale-in',
'w-full rounded-md px-1 py-1 text-xs shadow-md',
'bg-white dark:bg-gray-800'
)}
>
{users.map(({ name, url }, i) => (
<DropdownMenuPrimitive.Item
key={`${name}-${i}`}
className={cx(
'flex w-28 cursor-default select-none items-center rounded-md px-2 py-2 text-xs outline-none md:w-32',
'text-gray-400 focus:bg-gray-50 dark:text-gray-500 dark:focus:bg-gray-900'
)}
>
{url ? (
<img className="mr-2.5 h-6 w-6 rounded-full" src={url} />
) : (
<PersonIcon className="mr-2.5 h-6 w-6" />
)}
<span className="text-gray-700 dark:text-gray-300">{name}</span>
</DropdownMenuPrimitive.Item>
))}
</DropdownMenuPrimitive.Content>
</DropdownMenuPrimitive.Root>
</DropdownMenuPrimitive.Content>
</DropdownMenuPrimitive.Root>
</div>
);
};
export default DropdownMenu;
@@ -48,6 +48,25 @@ export const Input = ({ size, ...props }: InputProps) => {
);
};
interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaElement> {
variant?: keyof typeof variants;
size?: 'sm';
}
export const TextArea = ({ size, ...props }: TextAreaProps) => {
return (
<textarea
{...props}
className={clsx(
`px-3 py-1 rounded-md border leading-7 outline-none shadow-xs focus:ring-2 transition-all`,
variants[props.variant || 'default'],
size && '',
props.className
)}
/>
);
};
export const Label: React.FC<{ slug?: string }> = (props) => (
<label className="text-sm font-bold" htmlFor={props.slug}>
{props.children}
File diff suppressed because it is too large. Load diff
+19 -14
View File
@@ -7,32 +7,37 @@ import { useBridgeQuery } from '@sd/client';
import { Inspector } from '../components/file/Inspector';
export const ExplorerScreen: React.FC<{}> = () => {
// let { slug } = useParams();
let [searchParams] = useSearchParams();
let path = searchParams.get('path');
let path = searchParams.get('path') || '';
let hrefSplit = window.location.href.split('explorer/')[1];
let location_id = Number(hrefSplit.includes('?') ? hrefSplit.split('?')[0] : hrefSplit);
let [locationId, _setLocationId] = React.useState(1);
let [limit, setLimit] = React.useState(100);
useEffect(() => {
console.log({ location_id, path, limit });
}, [location_id, path]);
const { selectedRowIndex } = useExplorerState();
const { data: currentDir } = useBridgeQuery(
'LibGetExplorerDir',
{
location_id: locationId,
path: path || '/',
limit
},
{
enabled: !!path
}
{ location_id, path, limit },
{ enabled: !!location_id }
);
const { selectedRowIndex } = useExplorerState();
return (
<div className="flex flex-col w-full h-full">
<TopBar />
<div className="relative flex flex-row w-full ">
<FileList location_id={1} path={path ?? ''} limit={limit} />
<Inspector selectedFile={currentDir?.contents[selectedRowIndex]} locationId={locationId} />
<FileList location_id={location_id} path={path} limit={limit} />
{currentDir?.contents && (
<Inspector
selectedFile={currentDir.contents[selectedRowIndex]}
locationId={location_id}
/>
)}
</div>
</div>
);
+1 -1
View File
@@ -75,7 +75,7 @@ export const SettingsScreen: React.FC<{}> = () => {
</SidebarLink>
</div>
<div className="flex flex-grow-0 w-full h-full max-h-screen overflow-y-scroll">
<div className="px-12 py-5">
<div className="flex flex-grow px-12 py-5">
<Outlet />
<div className="block h-20" />
</div>
@@ -32,7 +32,7 @@ export default function GeneralSettings() {
const { data: jobsHistory } = useBridgeQuery('JobGetHistory');
return (
<div className="flex flex-col max-w-2xl space-y-4">
<div className="flex flex-col flex-grow max-w-4xl space-y-4">
<div className="mt-3 mb-6">
<h1 className="text-2xl font-bold">General Settings</h1>
<p className="mt-1 text-sm text-gray-400">Basic settings related to this client</p>
@@ -1,5 +1,7 @@
import React from 'react';
import { Button } from '../../components/primitive';
import { Dropdown } from '../../components/primitive/Dropdown';
import DropdownMenu from '../../components/primitive/DropdownMenu';
import { InputContainer } from '../../components/primitive/InputContainer';
const exampleLocations = [
@@ -12,7 +14,7 @@ export default function LocationSettings() {
// const locations = useBridgeQuery("SysGetLocation")
return (
<div className="max-w-md">
<div className="flex flex-col flex-grow max-w-4xl space-y-4">
{/*<Button size="sm">Add Location</Button>*/}
<InputContainer
title="Something about a vault"
@@ -31,6 +33,7 @@ export default function LocationSettings() {
<Button className="mb-3" variant="primary">
Add Location
</Button>
<DropdownMenu />
</div>
</InputContainer>
</div>
@@ -1,117 +0,0 @@
-- CreateTable
CREATE TABLE "libraries" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"remote_id" TEXT,
"is_primary" BOOLEAN NOT NULL DEFAULT true,
"encryption" INTEGER NOT NULL DEFAULT 0,
"total_file_count" INTEGER NOT NULL DEFAULT 0,
"total_bytes_used" TEXT NOT NULL DEFAULT '0',
"total_byte_capacity" TEXT NOT NULL DEFAULT '0',
"total_unique_bytes" TEXT NOT NULL DEFAULT '0',
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT
);
-- CreateTable
CREATE TABLE "clients" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"platform" INTEGER NOT NULL DEFAULT 0,
"version" TEXT,
"online" BOOLEAN DEFAULT true,
"last_seen" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "locations" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"path" TEXT,
"total_capacity" INTEGER,
"available_capacity" INTEGER,
"is_removable" BOOLEAN NOT NULL DEFAULT true,
"is_ejectable" BOOLEAN NOT NULL DEFAULT true,
"is_root_filesystem" BOOLEAN NOT NULL DEFAULT true,
"is_online" BOOLEAN NOT NULL DEFAULT true,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"materialized_path" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"path_integrity_hash" TEXT NOT NULL,
"quick_integrity_hash" TEXT,
"full_integrity_hash" TEXT,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ipfs_id" TEXT,
"parent_id" INTEGER,
CONSTRAINT "files_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "files_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "tags" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"encryption" INTEGER DEFAULT 0,
"total_files" INTEGER DEFAULT 0,
"redundancy_goal" INTEGER DEFAULT 1,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "tags_on_files" (
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"tag_id" INTEGER NOT NULL,
"file_id" INTEGER NOT NULL,
PRIMARY KEY ("tag_id", "file_id"),
CONSTRAINT "tags_on_files_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "tags_on_files_tag_id_fkey" FOREIGN KEY ("tag_id") REFERENCES "tags" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- CreateTable
CREATE TABLE "jobs" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"client_id" INTEGER NOT NULL,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"percentage_complete" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "jobs_client_id_fkey" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- CreateTable
CREATE TABLE "spaces" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"encryption" INTEGER DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"libraryId" INTEGER,
CONSTRAINT "spaces_libraryId_fkey" FOREIGN KEY ("libraryId") REFERENCES "libraries" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "clients_uuid_key" ON "clients"("uuid");
-- CreateIndex
CREATE UNIQUE INDEX "files_path_integrity_hash_key" ON "files"("path_integrity_hash");
@@ -1,37 +0,0 @@
/*
Warnings:
- You are about to drop the column `full_integrity_hash` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `path_integrity_hash` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `quick_integrity_hash` on the `files` table. All the data in the column will be lost.
- Added the required column `path_checksum` to the `files` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"materialized_path" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"path_checksum" TEXT NOT NULL,
"quick_checksum" TEXT,
"full_checksum" TEXT,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ipfs_id" TEXT,
"parent_id" INTEGER,
CONSTRAINT "files_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "files_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_files" ("date_created", "date_indexed", "date_modified", "encryption", "extension", "id", "ipfs_id", "is_dir", "location_id", "materialized_path", "name", "parent_id", "size_in_bytes") SELECT "date_created", "date_indexed", "date_modified", "encryption", "extension", "id", "ipfs_id", "is_dir", "location_id", "materialized_path", "name", "parent_id", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_path_checksum_key" ON "files"("path_checksum");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,39 +0,0 @@
/*
Warnings:
- You are about to drop the column `materialized_path` on the `files` table. All the data in the column will be lost.
- A unique constraint covering the columns `[uuid]` on the table `libraries` will be added. If there are existing duplicate values, this will fail.
- Added the required column `stem` to the `files` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"stem" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"path_checksum" TEXT NOT NULL,
"quick_checksum" TEXT,
"full_checksum" TEXT,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ipfs_id" TEXT,
"parent_id" INTEGER,
CONSTRAINT "files_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "files_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_files" ("date_created", "date_indexed", "date_modified", "encryption", "extension", "full_checksum", "id", "ipfs_id", "is_dir", "location_id", "name", "parent_id", "path_checksum", "quick_checksum", "size_in_bytes") SELECT "date_created", "date_indexed", "date_modified", "encryption", "extension", "full_checksum", "id", "ipfs_id", "is_dir", "location_id", "name", "parent_id", "path_checksum", "quick_checksum", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_path_checksum_key" ON "files"("path_checksum");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
-- CreateIndex
CREATE UNIQUE INDEX "libraries_uuid_key" ON "libraries"("uuid");
@@ -1,41 +0,0 @@
/*
Warnings:
- You are about to drop the column `total_byte_capacity` on the `libraries` table. All the data in the column will be lost.
- You are about to drop the column `total_bytes_used` on the `libraries` table. All the data in the column will be lost.
- You are about to drop the column `total_file_count` on the `libraries` table. All the data in the column will be lost.
- You are about to drop the column `total_unique_bytes` on the `libraries` table. All the data in the column will be lost.
*/
-- CreateTable
CREATE TABLE "library_statistics" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"date_captured" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"library_id" INTEGER NOT NULL,
"total_file_count" INTEGER NOT NULL DEFAULT 0,
"total_bytes_used" TEXT NOT NULL DEFAULT '0',
"total_byte_capacity" TEXT NOT NULL DEFAULT '0',
"total_unique_bytes" TEXT NOT NULL DEFAULT '0'
);
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_libraries" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"remote_id" TEXT,
"is_primary" BOOLEAN NOT NULL DEFAULT true,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT
);
INSERT INTO "new_libraries" ("date_created", "encryption", "id", "is_primary", "name", "remote_id", "timezone", "uuid") SELECT "date_created", "encryption", "id", "is_primary", "name", "remote_id", "timezone", "uuid" FROM "libraries";
DROP TABLE "libraries";
ALTER TABLE "new_libraries" RENAME TO "libraries";
CREATE UNIQUE INDEX "libraries_uuid_key" ON "libraries"("uuid");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
-- CreateIndex
CREATE UNIQUE INDEX "library_statistics_library_id_key" ON "library_statistics"("library_id");
@@ -1,40 +0,0 @@
/*
Warnings:
- You are about to drop the column `total_byte_capacity` on the `library_statistics` table. All the data in the column will be lost.
- You are about to drop the column `total_bytes_used` on the `library_statistics` table. All the data in the column will be lost.
- You are about to drop the column `total_file_count` on the `library_statistics` table. All the data in the column will be lost.
- You are about to drop the column `total_unique_bytes` on the `library_statistics` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_libraries" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"remote_id" TEXT,
"is_primary" BOOLEAN NOT NULL DEFAULT true,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT,
"total_file_count" INTEGER NOT NULL DEFAULT 0,
"total_bytes_used" TEXT NOT NULL DEFAULT '0',
"total_byte_capacity" TEXT NOT NULL DEFAULT '0',
"total_unique_bytes" TEXT NOT NULL DEFAULT '0'
);
INSERT INTO "new_libraries" ("date_created", "encryption", "id", "is_primary", "name", "remote_id", "timezone", "uuid") SELECT "date_created", "encryption", "id", "is_primary", "name", "remote_id", "timezone", "uuid" FROM "libraries";
DROP TABLE "libraries";
ALTER TABLE "new_libraries" RENAME TO "libraries";
CREATE UNIQUE INDEX "libraries_uuid_key" ON "libraries"("uuid");
CREATE TABLE "new_library_statistics" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"date_captured" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"library_id" INTEGER NOT NULL
);
INSERT INTO "new_library_statistics" ("date_captured", "id", "library_id") SELECT "date_captured", "id", "library_id" FROM "library_statistics";
DROP TABLE "library_statistics";
ALTER TABLE "new_library_statistics" RENAME TO "library_statistics";
CREATE UNIQUE INDEX "library_statistics_library_id_key" ON "library_statistics"("library_id");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,40 +0,0 @@
/*
Warnings:
- You are about to drop the column `total_byte_capacity` on the `libraries` table. All the data in the column will be lost.
- You are about to drop the column `total_bytes_used` on the `libraries` table. All the data in the column will be lost.
- You are about to drop the column `total_file_count` on the `libraries` table. All the data in the column will be lost.
- You are about to drop the column `total_unique_bytes` on the `libraries` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_library_statistics" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"date_captured" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"library_id" INTEGER NOT NULL,
"total_file_count" INTEGER NOT NULL DEFAULT 0,
"total_bytes_used" TEXT NOT NULL DEFAULT '0',
"total_byte_capacity" TEXT NOT NULL DEFAULT '0',
"total_unique_bytes" TEXT NOT NULL DEFAULT '0'
);
INSERT INTO "new_library_statistics" ("date_captured", "id", "library_id") SELECT "date_captured", "id", "library_id" FROM "library_statistics";
DROP TABLE "library_statistics";
ALTER TABLE "new_library_statistics" RENAME TO "library_statistics";
CREATE UNIQUE INDEX "library_statistics_library_id_key" ON "library_statistics"("library_id");
CREATE TABLE "new_libraries" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"remote_id" TEXT,
"is_primary" BOOLEAN NOT NULL DEFAULT true,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT
);
INSERT INTO "new_libraries" ("date_created", "encryption", "id", "is_primary", "name", "remote_id", "timezone", "uuid") SELECT "date_created", "encryption", "id", "is_primary", "name", "remote_id", "timezone", "uuid" FROM "libraries";
DROP TABLE "libraries";
ALTER TABLE "new_libraries" RENAME TO "libraries";
CREATE UNIQUE INDEX "libraries_uuid_key" ON "libraries"("uuid");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,33 +0,0 @@
/*
Warnings:
- You are about to drop the column `path_checksum` on the `files` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"stem" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"quick_checksum" TEXT,
"full_checksum" TEXT,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ipfs_id" TEXT,
"parent_id" INTEGER,
CONSTRAINT "files_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "files_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_files" ("date_created", "date_indexed", "date_modified", "encryption", "extension", "full_checksum", "id", "ipfs_id", "is_dir", "location_id", "name", "parent_id", "quick_checksum", "size_in_bytes", "stem") SELECT "date_created", "date_indexed", "date_modified", "encryption", "extension", "full_checksum", "id", "ipfs_id", "is_dir", "location_id", "name", "parent_id", "quick_checksum", "size_in_bytes", "stem" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_location_id_stem_name_extension_key" ON "files"("location_id", "stem", "name", "extension");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,24 +0,0 @@
/*
Warnings:
- You are about to drop the column `percentage_complete` on the `jobs` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_jobs" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"client_id" INTEGER NOT NULL,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "jobs_client_id_fkey" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
INSERT INTO "new_jobs" ("action", "client_id", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count") SELECT "action", "client_id", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count" FROM "jobs";
DROP TABLE "jobs";
ALTER TABLE "new_jobs" RENAME TO "jobs";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,91 +0,0 @@
/*
Warnings:
- You are about to drop the column `full_checksum` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `is_dir` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `location_id` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `parent_id` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `quick_checksum` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `stem` on the `files` table. All the data in the column will be lost.
- Added the required column `file_hash` to the `files` table without a default value. This is not possible if the table is not empty.
*/
-- CreateTable
CREATE TABLE "file_paths" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"materialized_path" TEXT NOT NULL,
"file_id" INTEGER,
"logical_file_parent_id" INTEGER,
"location_id" INTEGER NOT NULL,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"permissions" TEXT,
CONSTRAINT "file_paths_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "file_paths_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_logical_file_parent_id_fkey" FOREIGN KEY ("logical_file_parent_id") REFERENCES "file_paths" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "labels" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "label_on_files" (
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"label_id" INTEGER NOT NULL,
"file_id" INTEGER NOT NULL,
PRIMARY KEY ("label_id", "file_id"),
CONSTRAINT "label_on_files_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "label_on_files_label_id_fkey" FOREIGN KEY ("label_id") REFERENCES "labels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- CreateTable
CREATE TABLE "albums" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"is_hidden" BOOLEAN NOT NULL DEFAULT false,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "comments" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"content" TEXT NOT NULL,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"file_id" INTEGER,
CONSTRAINT "comments_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"file_hash" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"checksum" TEXT,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ipfs_id" TEXT
);
INSERT INTO "new_files" ("date_created", "date_indexed", "date_modified", "encryption", "extension", "id", "ipfs_id", "name", "size_in_bytes") SELECT "date_created", "date_indexed", "date_modified", "encryption", "extension", "id", "ipfs_id", "name", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_file_hash_key" ON "files"("file_hash");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
-- CreateIndex
CREATE UNIQUE INDEX "file_paths_location_id_materialized_path_file_id_key" ON "file_paths"("location_id", "materialized_path", "file_id");
@@ -1,29 +0,0 @@
/*
Warnings:
- You are about to drop the column `logical_file_parent_id` on the `file_paths` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_file_paths" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"materialized_path" TEXT NOT NULL,
"file_id" INTEGER,
"parent_id" INTEGER,
"location_id" INTEGER NOT NULL,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"permissions" TEXT,
CONSTRAINT "file_paths_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "file_paths_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "file_paths" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_file_paths" ("date_created", "date_indexed", "date_modified", "file_id", "id", "is_dir", "location_id", "materialized_path", "permissions") SELECT "date_created", "date_indexed", "date_modified", "file_id", "id", "is_dir", "location_id", "materialized_path", "permissions" FROM "file_paths";
DROP TABLE "file_paths";
ALTER TABLE "new_file_paths" RENAME TO "file_paths";
CREATE UNIQUE INDEX "file_paths_location_id_materialized_path_file_id_key" ON "file_paths"("location_id", "materialized_path", "file_id");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,51 +0,0 @@
/*
Warnings:
- You are about to drop the column `file_hash` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `date_created` on the `file_paths` table. All the data in the column will be lost.
- You are about to drop the column `date_modified` on the `file_paths` table. All the data in the column will be lost.
- Added the required column `id_hash` to the `files` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "locations" ADD COLUMN "disk_type" INTEGER;
ALTER TABLE "locations" ADD COLUMN "filesystem" TEXT;
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"id_hash" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"checksum" TEXT,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ipfs_id" TEXT
);
INSERT INTO "new_files" ("checksum", "date_created", "date_indexed", "date_modified", "encryption", "extension", "id", "ipfs_id", "name", "size_in_bytes") SELECT "checksum", "date_created", "date_indexed", "date_modified", "encryption", "extension", "id", "ipfs_id", "name", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_id_hash_key" ON "files"("id_hash");
CREATE TABLE "new_file_paths" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"materialized_path" TEXT NOT NULL,
"file_id" INTEGER,
"parent_id" INTEGER,
"location_id" INTEGER NOT NULL,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"permissions" TEXT,
CONSTRAINT "file_paths_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "file_paths_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "file_paths" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_file_paths" ("date_indexed", "file_id", "id", "is_dir", "location_id", "materialized_path", "parent_id", "permissions") SELECT "date_indexed", "file_id", "id", "is_dir", "location_id", "materialized_path", "parent_id", "permissions" FROM "file_paths";
DROP TABLE "file_paths";
ALTER TABLE "new_file_paths" RENAME TO "file_paths";
CREATE UNIQUE INDEX "file_paths_location_id_materialized_path_file_id_key" ON "file_paths"("location_id", "materialized_path", "file_id");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,27 +0,0 @@
/*
Warnings:
- You are about to drop the column `path` on the `locations` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_locations" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"local_path" TEXT,
"total_capacity" INTEGER,
"available_capacity" INTEGER,
"filesystem" TEXT,
"disk_type" INTEGER,
"is_removable" BOOLEAN NOT NULL DEFAULT true,
"is_ejectable" BOOLEAN NOT NULL DEFAULT true,
"is_root_filesystem" BOOLEAN NOT NULL DEFAULT true,
"is_online" BOOLEAN NOT NULL DEFAULT true,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_locations" ("available_capacity", "date_created", "disk_type", "filesystem", "id", "is_ejectable", "is_online", "is_removable", "is_root_filesystem", "name", "total_capacity") SELECT "available_capacity", "date_created", "disk_type", "filesystem", "id", "is_ejectable", "is_online", "is_removable", "is_root_filesystem", "name", "total_capacity" FROM "locations";
DROP TABLE "locations";
ALTER TABLE "new_locations" RENAME TO "locations";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,22 +0,0 @@
/*
Warnings:
- You are about to drop the column `client_id` on the `jobs` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_jobs" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_jobs" ("action", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count") SELECT "action", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count" FROM "jobs";
DROP TABLE "jobs";
ALTER TABLE "new_jobs" RENAME TO "jobs";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,22 +0,0 @@
/*
Warnings:
- The primary key for the `jobs` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_jobs" (
"id" TEXT NOT NULL PRIMARY KEY,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_jobs" ("action", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count") SELECT "action", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count" FROM "jobs";
DROP TABLE "jobs";
ALTER TABLE "new_jobs" RENAME TO "jobs";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,17 +0,0 @@
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_jobs" (
"id" TEXT NOT NULL PRIMARY KEY,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"seconds_elapsed" INTEGER NOT NULL DEFAULT 0
);
INSERT INTO "new_jobs" ("action", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count") SELECT "action", "completed_task_count", "date_created", "date_modified", "id", "status", "task_count" FROM "jobs";
DROP TABLE "jobs";
ALTER TABLE "new_jobs" RENAME TO "jobs";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,52 +0,0 @@
/*
Warnings:
- You are about to drop the column `extension` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `id_hash` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `name` on the `files` table. All the data in the column will be lost.
- Added the required column `partial_checksum` to the `files` table without a default value. This is not possible if the table is not empty.
- Added the required column `name` to the `file_paths` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"type" INTEGER NOT NULL DEFAULT 0,
"size_in_bytes" TEXT NOT NULL,
"partial_checksum" TEXT NOT NULL,
"checksum" TEXT,
"encryption" INTEGER NOT NULL DEFAULT 0,
"ipfs_id" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_files" ("checksum", "date_created", "date_indexed", "date_modified", "encryption", "id", "ipfs_id", "size_in_bytes") SELECT "checksum", "date_created", "date_indexed", "date_modified", "encryption", "id", "ipfs_id", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_checksum_key" ON "files"("checksum");
CREATE TABLE "new_file_paths" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"materialized_path" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"file_id" INTEGER,
"parent_id" INTEGER,
"encryption" INTEGER NOT NULL DEFAULT 0,
"permissions" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "file_paths_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "file_paths_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "file_paths" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_file_paths" ("date_indexed", "file_id", "id", "is_dir", "location_id", "materialized_path", "parent_id", "permissions") SELECT "date_indexed", "file_id", "id", "is_dir", "location_id", "materialized_path", "parent_id", "permissions" FROM "file_paths";
DROP TABLE "file_paths";
ALTER TABLE "new_file_paths" RENAME TO "file_paths";
CREATE UNIQUE INDEX "file_paths_location_id_materialized_path_name_extension_key" ON "file_paths"("location_id", "materialized_path", "name", "extension");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,29 +0,0 @@
/*
Warnings:
- You are about to drop the column `type` on the `files` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "file_paths" ADD COLUMN "temp_checksum" TEXT;
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"kind" INTEGER NOT NULL DEFAULT 0,
"size_in_bytes" TEXT NOT NULL,
"partial_checksum" TEXT NOT NULL,
"checksum" TEXT,
"encryption" INTEGER NOT NULL DEFAULT 0,
"ipfs_id" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_files" ("checksum", "date_created", "date_indexed", "date_modified", "encryption", "id", "ipfs_id", "partial_checksum", "size_in_bytes") SELECT "checksum", "date_created", "date_indexed", "date_modified", "encryption", "id", "ipfs_id", "partial_checksum", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_checksum_key" ON "files"("checksum");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -1,185 +0,0 @@
/*
Warnings:
- You are about to drop the column `checksum` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `partial_checksum` on the `files` table. All the data in the column will be lost.
- You are about to drop the column `temp_checksum` on the `file_paths` table. All the data in the column will be lost.
- Added the required column `cas_id` to the `files` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `labels` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `albums` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `locations` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `spaces` table without a default value. This is not possible if the table is not empty.
- Added the required column `client_id` to the `jobs` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `comments` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `tags` table without a default value. This is not possible if the table is not empty.
*/
-- CreateTable
CREATE TABLE "sync_events" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"client_id" INTEGER NOT NULL,
"timestamp" TEXT NOT NULL,
"data" TEXT NOT NULL,
CONSTRAINT "sync_events_client_id_fkey" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "media_data" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pixel_width" INTEGER,
"pixel_height" INTEGER,
"longitude" REAL,
"latitude" REAL,
"capture_device" TEXT,
"duration" INTEGER,
CONSTRAINT "media_data_id_fkey" FOREIGN KEY ("id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"cas_id" TEXT NOT NULL,
"integrity_checksum" TEXT,
"kind" INTEGER NOT NULL DEFAULT 0,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"hidden" BOOLEAN NOT NULL DEFAULT false,
"favorite" BOOLEAN NOT NULL DEFAULT false,
"important" BOOLEAN NOT NULL DEFAULT false,
"has_thumbnail" BOOLEAN NOT NULL DEFAULT false,
"has_thumbstrip" BOOLEAN NOT NULL DEFAULT false,
"has_video_preview" BOOLEAN NOT NULL DEFAULT false,
"ipfs_id" TEXT,
"comment" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_files" ("date_created", "date_indexed", "date_modified", "encryption", "id", "ipfs_id", "kind", "size_in_bytes") SELECT "date_created", "date_indexed", "date_modified", "encryption", "id", "ipfs_id", "kind", "size_in_bytes" FROM "files";
DROP TABLE "files";
ALTER TABLE "new_files" RENAME TO "files";
CREATE UNIQUE INDEX "files_integrity_checksum_key" ON "files"("integrity_checksum");
CREATE TABLE "new_labels" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_labels" ("date_created", "date_modified", "id", "name") SELECT "date_created", "date_modified", "id", "name" FROM "labels";
DROP TABLE "labels";
ALTER TABLE "new_labels" RENAME TO "labels";
CREATE UNIQUE INDEX "labels_uuid_key" ON "labels"("uuid");
CREATE TABLE "new_file_paths" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"materialized_path" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"file_id" INTEGER,
"parent_id" INTEGER,
"encryption" INTEGER NOT NULL DEFAULT 0,
"permissions" TEXT,
"temp_cas_id" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "file_paths_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "file_paths" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_file_paths" ("date_created", "date_indexed", "date_modified", "encryption", "extension", "file_id", "id", "is_dir", "location_id", "materialized_path", "name", "parent_id", "permissions") SELECT "date_created", "date_indexed", "date_modified", "encryption", "extension", "file_id", "id", "is_dir", "location_id", "materialized_path", "name", "parent_id", "permissions" FROM "file_paths";
DROP TABLE "file_paths";
ALTER TABLE "new_file_paths" RENAME TO "file_paths";
CREATE UNIQUE INDEX "file_paths_location_id_materialized_path_name_extension_key" ON "file_paths"("location_id", "materialized_path", "name", "extension");
CREATE TABLE "new_albums" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"is_hidden" BOOLEAN NOT NULL DEFAULT false,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_albums" ("date_created", "date_modified", "id", "is_hidden", "name") SELECT "date_created", "date_modified", "id", "is_hidden", "name" FROM "albums";
DROP TABLE "albums";
ALTER TABLE "new_albums" RENAME TO "albums";
CREATE UNIQUE INDEX "albums_uuid_key" ON "albums"("uuid");
CREATE TABLE "new_locations" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"client_id" INTEGER,
"name" TEXT,
"local_path" TEXT,
"total_capacity" INTEGER,
"available_capacity" INTEGER,
"filesystem" TEXT,
"disk_type" INTEGER,
"is_removable" BOOLEAN NOT NULL DEFAULT true,
"is_ejectable" BOOLEAN NOT NULL DEFAULT true,
"is_root_filesystem" BOOLEAN NOT NULL DEFAULT true,
"is_online" BOOLEAN NOT NULL DEFAULT true,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_locations" ("available_capacity", "date_created", "disk_type", "filesystem", "id", "is_ejectable", "is_online", "is_removable", "is_root_filesystem", "local_path", "name", "total_capacity") SELECT "available_capacity", "date_created", "disk_type", "filesystem", "id", "is_ejectable", "is_online", "is_removable", "is_root_filesystem", "local_path", "name", "total_capacity" FROM "locations";
DROP TABLE "locations";
ALTER TABLE "new_locations" RENAME TO "locations";
CREATE UNIQUE INDEX "locations_uuid_key" ON "locations"("uuid");
CREATE TABLE "new_spaces" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT NOT NULL,
"encryption" INTEGER DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"libraryId" INTEGER,
CONSTRAINT "spaces_libraryId_fkey" FOREIGN KEY ("libraryId") REFERENCES "libraries" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_spaces" ("date_created", "date_modified", "encryption", "id", "libraryId", "name") SELECT "date_created", "date_modified", "encryption", "id", "libraryId", "name" FROM "spaces";
DROP TABLE "spaces";
ALTER TABLE "new_spaces" RENAME TO "spaces";
CREATE UNIQUE INDEX "spaces_uuid_key" ON "spaces"("uuid");
CREATE TABLE "new_jobs" (
"id" TEXT NOT NULL PRIMARY KEY,
"client_id" INTEGER NOT NULL,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"seconds_elapsed" INTEGER NOT NULL DEFAULT 0
);
INSERT INTO "new_jobs" ("action", "completed_task_count", "date_created", "date_modified", "id", "seconds_elapsed", "status", "task_count") SELECT "action", "completed_task_count", "date_created", "date_modified", "id", "seconds_elapsed", "status", "task_count" FROM "jobs";
DROP TABLE "jobs";
ALTER TABLE "new_jobs" RENAME TO "jobs";
CREATE TABLE "new_comments" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"content" TEXT NOT NULL,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"file_id" INTEGER,
CONSTRAINT "comments_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_comments" ("content", "date_created", "date_modified", "file_id", "id") SELECT "content", "date_created", "date_modified", "file_id", "id" FROM "comments";
DROP TABLE "comments";
ALTER TABLE "new_comments" RENAME TO "comments";
CREATE UNIQUE INDEX "comments_uuid_key" ON "comments"("uuid");
CREATE TABLE "new_tags" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT,
"encryption" INTEGER DEFAULT 0,
"total_files" INTEGER DEFAULT 0,
"redundancy_goal" INTEGER DEFAULT 1,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_tags" ("date_created", "date_modified", "encryption", "id", "name", "redundancy_goal", "total_files") SELECT "date_created", "date_modified", "encryption", "id", "name", "redundancy_goal", "total_files" FROM "tags";
DROP TABLE "tags";
ALTER TABLE "new_tags" RENAME TO "tags";
CREATE UNIQUE INDEX "tags_uuid_key" ON "tags"("uuid");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
@@ -0,0 +1,250 @@
-- CreateTable
CREATE TABLE "sync_events" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"client_id" INTEGER NOT NULL,
"timestamp" TEXT NOT NULL,
"data" TEXT NOT NULL,
CONSTRAINT "sync_events_client_id_fkey" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "libraries" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"remote_id" TEXT,
"is_primary" BOOLEAN NOT NULL DEFAULT true,
"encryption" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT
);
-- CreateTable
CREATE TABLE "library_statistics" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"date_captured" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"library_id" INTEGER NOT NULL,
"total_file_count" INTEGER NOT NULL DEFAULT 0,
"total_bytes_used" TEXT NOT NULL DEFAULT '0',
"total_byte_capacity" TEXT NOT NULL DEFAULT '0',
"total_unique_bytes" TEXT NOT NULL DEFAULT '0'
);
-- CreateTable
CREATE TABLE "clients" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"platform" INTEGER NOT NULL DEFAULT 0,
"version" TEXT,
"online" BOOLEAN DEFAULT true,
"last_seen" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"timezone" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "locations" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"client_id" INTEGER,
"name" TEXT,
"local_path" TEXT,
"total_capacity" INTEGER,
"available_capacity" INTEGER,
"filesystem" TEXT,
"disk_type" INTEGER,
"is_removable" BOOLEAN NOT NULL DEFAULT true,
"is_ejectable" BOOLEAN NOT NULL DEFAULT true,
"is_root_filesystem" BOOLEAN NOT NULL DEFAULT true,
"is_online" BOOLEAN NOT NULL DEFAULT true,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "files" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"cas_id" TEXT NOT NULL,
"integrity_checksum" TEXT,
"kind" INTEGER NOT NULL DEFAULT 0,
"size_in_bytes" TEXT NOT NULL,
"encryption" INTEGER NOT NULL DEFAULT 0,
"hidden" BOOLEAN NOT NULL DEFAULT false,
"favorite" BOOLEAN NOT NULL DEFAULT false,
"important" BOOLEAN NOT NULL DEFAULT false,
"has_thumbnail" BOOLEAN NOT NULL DEFAULT false,
"has_thumbstrip" BOOLEAN NOT NULL DEFAULT false,
"has_video_preview" BOOLEAN NOT NULL DEFAULT false,
"ipfs_id" TEXT,
"comment" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "file_paths" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"is_dir" BOOLEAN NOT NULL DEFAULT false,
"location_id" INTEGER NOT NULL,
"materialized_path" TEXT NOT NULL,
"name" TEXT NOT NULL,
"extension" TEXT,
"file_id" INTEGER,
"parent_id" INTEGER,
"encryption" INTEGER NOT NULL DEFAULT 0,
"permissions" TEXT,
"temp_cas_id" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_indexed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "file_paths_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "file_paths_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "file_paths" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "media_data" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pixel_width" INTEGER,
"pixel_height" INTEGER,
"longitude" REAL,
"latitude" REAL,
"capture_device" TEXT,
"duration" INTEGER,
CONSTRAINT "media_data_id_fkey" FOREIGN KEY ("id") REFERENCES "files" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "tags" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"name" TEXT,
"encryption" INTEGER DEFAULT 0,
"total_files" INTEGER DEFAULT 0,
"redundancy_goal" INTEGER DEFAULT 1,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "tags_on_files" (
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"tag_id" INTEGER NOT NULL,
"file_id" INTEGER NOT NULL,
PRIMARY KEY ("tag_id", "file_id"),
CONSTRAINT "tags_on_files_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "tags_on_files_tag_id_fkey" FOREIGN KEY ("tag_id") REFERENCES "tags" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- CreateTable
CREATE TABLE "labels" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"name" TEXT,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "label_on_files" (
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"label_id" INTEGER NOT NULL,
"file_id" INTEGER NOT NULL,
PRIMARY KEY ("label_id", "file_id"),
CONSTRAINT "label_on_files_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "label_on_files_label_id_fkey" FOREIGN KEY ("label_id") REFERENCES "labels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- CreateTable
CREATE TABLE "jobs" (
"id" TEXT NOT NULL PRIMARY KEY,
"client_id" INTEGER NOT NULL,
"action" INTEGER NOT NULL,
"status" INTEGER NOT NULL DEFAULT 0,
"task_count" INTEGER NOT NULL DEFAULT 1,
"completed_task_count" INTEGER NOT NULL DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"seconds_elapsed" INTEGER NOT NULL DEFAULT 0,
CONSTRAINT "jobs_client_id_fkey" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "spaces" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"encryption" INTEGER DEFAULT 0,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"libraryId" INTEGER,
CONSTRAINT "spaces_libraryId_fkey" FOREIGN KEY ("libraryId") REFERENCES "libraries" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "albums" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"is_hidden" BOOLEAN NOT NULL DEFAULT false,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "files_in_albums" (
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"album_id" INTEGER NOT NULL,
"file_id" INTEGER NOT NULL,
PRIMARY KEY ("album_id", "file_id"),
CONSTRAINT "files_in_albums_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT "files_in_albums_album_id_fkey" FOREIGN KEY ("album_id") REFERENCES "albums" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- CreateTable
CREATE TABLE "comments" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"content" TEXT NOT NULL,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_modified" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"file_id" INTEGER,
CONSTRAINT "comments_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "libraries_pub_id_key" ON "libraries"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "library_statistics_library_id_key" ON "library_statistics"("library_id");
-- CreateIndex
CREATE UNIQUE INDEX "clients_pub_id_key" ON "clients"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "locations_pub_id_key" ON "locations"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "files_integrity_checksum_key" ON "files"("integrity_checksum");
-- CreateIndex
CREATE UNIQUE INDEX "file_paths_location_id_materialized_path_name_extension_key" ON "file_paths"("location_id", "materialized_path", "name", "extension");
-- CreateIndex
CREATE UNIQUE INDEX "tags_pub_id_key" ON "tags"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "labels_pub_id_key" ON "labels"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "spaces_pub_id_key" ON "spaces"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "albums_pub_id_key" ON "albums"("pub_id");
-- CreateIndex
CREATE UNIQUE INDEX "comments_pub_id_key" ON "comments"("pub_id");
@@ -0,0 +1,29 @@
/*
Warnings:
- You are about to drop the column `is_ejectable` on the `locations` table. All the data in the column will be lost.
- You are about to drop the column `is_root_filesystem` on the `locations` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_locations" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"pub_id" TEXT NOT NULL,
"client_id" INTEGER,
"name" TEXT,
"local_path" TEXT,
"total_capacity" INTEGER,
"available_capacity" INTEGER,
"filesystem" TEXT,
"disk_type" INTEGER,
"is_removable" BOOLEAN,
"is_online" BOOLEAN NOT NULL DEFAULT true,
"date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_locations" ("available_capacity", "client_id", "date_created", "disk_type", "filesystem", "id", "is_online", "is_removable", "local_path", "name", "pub_id", "total_capacity") SELECT "available_capacity", "client_id", "date_created", "disk_type", "filesystem", "id", "is_online", "is_removable", "local_path", "name", "pub_id", "total_capacity" FROM "locations";
DROP TABLE "locations";
ALTER TABLE "new_locations" RENAME TO "locations";
CREATE UNIQUE INDEX "locations_pub_id_key" ON "locations"("pub_id");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
+32 -18
View File
@@ -30,7 +30,7 @@ model SyncEvent {
model Library {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
name String
remote_id String?
is_primary Boolean @default(true)
@@ -56,7 +56,7 @@ model LibraryStatistics {
model Client {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
name String
platform Int @default(0)
version String?
@@ -64,16 +64,16 @@ model Client {
last_seen DateTime @default(now())
timezone String?
date_created DateTime @default(now())
// jobs Job[]
sync_events SyncEvent[]
jobs Job[]
@@map("clients")
}
model Location {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
client_id Int?
name String?
local_path String?
@@ -81,9 +81,7 @@ model Location {
available_capacity Int?
filesystem String?
disk_type Int?
is_removable Boolean @default(true)
is_ejectable Boolean @default(true)
is_root_filesystem Boolean @default(true)
is_removable Boolean?
is_online Boolean @default(true)
date_created DateTime @default(now())
@@ -122,11 +120,12 @@ model File {
// when this file was first indexed
date_indexed DateTime @default(now())
file_tags TagOnFile[]
file_labels LabelOnFile[]
file_paths FilePath[]
comments Comment[]
media_data MediaData?
tags TagOnFile[]
labels LabelOnFile[]
albums FileInAlbum[]
paths FilePath[]
comments Comment[]
media_data MediaData?
@@map("files")
}
@@ -179,7 +178,7 @@ model MediaData {
model Tag {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
name String?
encryption Int? @default(0)
total_files Int? @default(0)
@@ -206,7 +205,7 @@ model TagOnFile {
model Label {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
name String?
date_created DateTime @default(now())
date_modified DateTime @default(now())
@@ -238,15 +237,15 @@ model Job {
completed_task_count Int @default(0)
date_created DateTime @default(now())
date_modified DateTime @default(now())
// clients Client @relation(fields: [client_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
seconds_elapsed Int @default(0)
clients Client @relation(fields: [client_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
@@map("jobs")
}
model Space {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
name String
encryption Int? @default(0) // remove
date_created DateTime @default(now())
@@ -259,19 +258,34 @@ model Space {
model Album {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
name String
is_hidden Boolean @default(false)
date_created DateTime @default(now())
date_modified DateTime @default(now())
files FileInAlbum[]
@@map("albums")
}
model FileInAlbum {
date_created DateTime @default(now())
album_id Int
album Album @relation(fields: [album_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
file_id Int
file File @relation(fields: [file_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
@@id([album_id, file_id])
@@map("files_in_albums")
}
model Comment {
id Int @id @default(autoincrement())
uuid String @unique
pub_id String @unique
content String
date_created DateTime @default(now())
date_modified DateTime @default(now())
+2 -2
View File
@@ -51,7 +51,7 @@ pub async fn create(core: &Core) -> Result<(), ClientError> {
let client = match db
.client()
.find_unique(prisma::Client::uuid().equals(config.client_uuid.clone()))
.find_unique(prisma::Client::pub_id().equals(config.client_uuid.clone()))
.exec()
.await?
{
@@ -59,7 +59,7 @@ pub async fn create(core: &Core) -> Result<(), ClientError> {
None => {
db.client()
.create_one(
prisma::Client::uuid().set(config.client_uuid.clone()),
prisma::Client::pub_id().set(config.client_uuid.clone()),
prisma::Client::name().set(hostname.clone()),
vec![
prisma::Client::platform().set(platform as i32),
+2 -6
View File
@@ -14,7 +14,7 @@ pub async fn open_dir(
let config = client::get();
// get location
let location = get_location(ctx, location_id.clone()).await.unwrap();
let location = get_location(ctx, location_id.clone()).await?;
let directory = db
.file_path()
@@ -25,7 +25,7 @@ pub async fn open_dir(
])
.exec()
.await?
.ok_or(FileError::FileNotFound(path.to_string()))?;
.ok_or(FileError::DirectoryNotFound(path.to_string()))?;
let files = db
.file_path()
@@ -46,10 +46,6 @@ pub async fn open_dir(
.with_extension("webp");
let exists = path.exists();
if exists {
println!("thumb found!! {:?}", path);
}
file.has_local_thumbnail = exists;
}
contents.push(file);
+9
View File
@@ -6,6 +6,7 @@ use ts_rs::TS;
use crate::{
crypto::encryption::EncryptionAlgorithm,
prisma::{self, FileData, FilePathData},
sys::SysError,
};
pub mod checksum;
pub mod explorer;
@@ -61,6 +62,10 @@ pub struct FilePath {
pub temp_cas_id: Option<String>,
pub has_local_thumbnail: bool,
#[ts(type = "string")]
pub date_created: chrono::DateTime<chrono::Utc>,
#[ts(type = "string")]
pub date_modified: chrono::DateTime<chrono::Utc>,
#[ts(type = "string")]
pub date_indexed: chrono::DateTime<chrono::Utc>,
pub permissions: Option<String>,
}
@@ -120,6 +125,8 @@ impl Into<FilePath> for FilePathData {
name: self.name,
extension: self.extension,
temp_cas_id: self.temp_cas_id,
date_created: self.date_created,
date_modified: self.date_modified,
}
}
}
@@ -139,4 +146,6 @@ pub enum FileError {
FileNotFound(String),
#[error("Database error")]
DatabaseError(#[from] prisma::QueryError),
#[error("System error")]
SysError(#[from] SysError),
}
+23 -18
View File
@@ -14,9 +14,11 @@ use std::fs;
use std::path::{Path, PathBuf};
use webp::*;
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct ThumbnailJob {
pub location_id: i32,
pub path: String,
pub background: bool,
}
static THUMBNAIL_SIZE_FACTOR: f32 = 0.2;
@@ -39,7 +41,7 @@ impl Job for ThumbnailJob {
let root_path = location.path.unwrap();
let image_files = get_images(&core_ctx, self.location_id).await?;
let image_files = get_images(&core_ctx, self.location_id, &self.path).await?;
let location_id = location.id.clone();
@@ -106,22 +108,25 @@ pub fn generate_thumbnail(file_path: &str, output_path: &PathBuf) -> Result<()>
Ok(())
}
pub async fn get_images(ctx: &CoreContext, location_id: i32) -> Result<Vec<FilePathData>> {
let image_files = ctx
.database
.file_path()
.find_many(vec![
FilePath::location_id().equals(location_id),
or!(
FilePath::extension().equals("png".to_string()),
FilePath::extension().equals("jpeg".to_string()),
FilePath::extension().equals("jpg".to_string()),
FilePath::extension().equals("gif".to_string()),
FilePath::extension().equals("webp".to_string()),
),
])
.exec()
.await?;
pub async fn get_images(
ctx: &CoreContext,
location_id: i32,
path: &str,
) -> Result<Vec<FilePathData>> {
let mut params = vec![
FilePath::location_id().equals(location_id),
or!(
FilePath::extension().equals("png".to_string()),
FilePath::extension().equals("jpeg".to_string()),
FilePath::extension().equals("jpg".to_string()),
FilePath::extension().equals("gif".to_string()),
FilePath::extension().equals("webp".to_string()),
),
];
if !path.is_empty() {
params.push(FilePath::materialized_path().starts_with(path.to_string()))
}
let image_files = ctx.database.file_path().find_many(params).exec().await?;
Ok(image_files)
}
+13 -2
View File
@@ -5,6 +5,7 @@ use super::{
use crate::{
prisma::{self, JobData},
state::client,
sync::{crdt::Replicate, engine::SyncContext},
CoreContext,
};
use anyhow::Result;
@@ -145,8 +146,8 @@ impl JobReport {
.job()
.create_one(
prisma::Job::id().set(self.id.clone()),
prisma::Job::client_id().set(config.client_id),
prisma::Job::action().set(1),
prisma::Job::clients().link(prisma::Client::id().equals(config.client_id)),
vec![],
)
.exec()
@@ -154,7 +155,6 @@ impl JobReport {
Ok(())
}
pub async fn update(&self, ctx: &CoreContext) -> Result<(), JobError> {
// let config = client::get();
ctx
.database
.job()
@@ -172,6 +172,17 @@ impl JobReport {
}
}
#[derive(Clone)]
pub struct JobReportCreate {}
#[async_trait::async_trait]
impl Replicate for JobReport {
type Create = JobReportCreate;
async fn create(_data: Self::Create, ctx: SyncContext) {}
async fn delete(ctx: SyncContext) {}
}
#[repr(i32)]
#[derive(Debug, Clone, Copy, Serialize, Deserialize, TS, Eq, PartialEq, IntEnum)]
#[ts(export)]
+17 -17
View File
@@ -53,7 +53,7 @@ impl CoreController {
})
.unwrap_or(());
// wait for response and return
recv.await.unwrap()
recv.await.unwrap_or(Err(CoreError::QueryError))
}
pub async fn command(&self, command: ClientCommand) -> Result<CoreResponse, CoreError> {
@@ -158,7 +158,9 @@ impl Core {
internal_channel,
};
// p2p::listener::listen(None).await.unwrap_or(());
tokio::spawn(async move {
p2p::listener::listen(None).await.unwrap_or(());
});
(core, event_recv)
}
@@ -253,8 +255,12 @@ impl Core {
ClientCommand::SysVolumeUnmount { id: _ } => todo!(),
ClientCommand::LibDelete { id: _ } => todo!(),
ClientCommand::TagUpdate { name: _, color: _ } => todo!(),
ClientCommand::GenerateThumbsForLocation { id } => {
ctx.spawn_job(Box::new(ThumbnailJob { location_id: id }));
ClientCommand::GenerateThumbsForLocation { id, path } => {
ctx.spawn_job(Box::new(ThumbnailJob {
location_id: id,
path,
background: false, // fix
}));
CoreResponse::Success(())
}
ClientCommand::PurgeDatabase => {
@@ -267,13 +273,16 @@ impl Core {
// query sources of data
async fn exec_query(&self, query: ClientQuery) -> Result<CoreResponse, CoreError> {
info!("Core query: {:?}", query);
println!("Core query: {:?}", query);
let ctx = self.get_context();
Ok(match query {
// return the client state from memory
ClientQuery::ClientGetState => CoreResponse::ClientGetState(self.state.clone()),
// get system volumes without saving to library
ClientQuery::SysGetVolumes => CoreResponse::SysGetVolumes(sys::volumes::get_volumes()?),
ClientQuery::SysGetLocations => {
CoreResponse::SysGetLocations(sys::locations::get_locations(&ctx).await?)
}
// get location from library
ClientQuery::SysGetLocation { id } => {
CoreResponse::SysGetLocation(sys::locations::get_location(&ctx, id).await?)
@@ -292,17 +301,6 @@ impl Core {
ClientQuery::JobGetHistory => CoreResponse::JobGetHistory(Jobs::get_history(&ctx).await?),
})
}
// pub fn queue(&mut self, job: JobResource) -> &mut JobResource {
// self.job_runner.queued_jobs.push(job);
// self.job_runner.queued_jobs.last_mut().unwrap()
// }
// send an event to the client
// async fn emit_event(&mut self, event: ClientEvent) {}
// pub async fn send(&self, event: CoreEvent) {
// // self.event_channel.1.send(event).await;
// }
}
// represents an event this library can emit
@@ -327,7 +325,7 @@ pub enum ClientCommand {
LocDelete { id: i32 },
// System
SysVolumeUnmount { id: i32 },
GenerateThumbsForLocation { id: i32 },
GenerateThumbsForLocation { id: i32, path: String },
PurgeDatabase,
}
@@ -341,6 +339,7 @@ pub enum ClientQuery {
LibGetTags,
JobGetRunning,
JobGetHistory,
SysGetLocations,
SysGetLocation {
id: i32,
},
@@ -371,6 +370,7 @@ pub enum CoreResponse {
Success(()),
SysGetVolumes(Vec<sys::volumes::Volume>),
SysGetLocation(sys::locations::LocationResource),
SysGetLocations(Vec<sys::locations::LocationResource>),
LibGetExplorerDir(file::DirectoryWithContents),
ClientGetState(ClientState),
LocCreate(sys::locations::LocationResource),
+2 -2
View File
@@ -30,7 +30,7 @@ pub async fn get(core: &Core) -> Result<LibraryData, LibraryError> {
// get library from db
let library = match db
.library()
.find_unique(Library::uuid().equals(library_state.library_uuid.clone()))
.find_unique(Library::pub_id().equals(library_state.library_uuid.clone()))
.exec()
.await?
{
@@ -87,7 +87,7 @@ pub async fn create(core: &Core, name: Option<String>) -> Result<()> {
let _library = db
.library()
.create_one(
Library::uuid().set(config.current_library_uuid),
Library::pub_id().set(config.current_library_uuid),
Library::name().set(name.unwrap_or(DEFAULT_NAME.into())),
vec![],
)
+25 -38
View File
@@ -8,7 +8,7 @@ use crate::{
use anyhow::Result;
use log::info;
use serde::{Deserialize, Serialize};
use std::{fs, io, io::Write};
use std::{fs, io, io::Write, path::Path};
use thiserror::Error;
use ts_rs::TS;
@@ -24,9 +24,7 @@ pub struct LocationResource {
pub path: Option<String>,
pub total_capacity: Option<i32>,
pub available_capacity: Option<i32>,
pub is_removable: bool,
pub is_ejectable: bool,
pub is_root_filesystem: bool,
pub is_removable: Option<bool>,
pub is_online: bool,
#[ts(type = "string")]
pub date_created: chrono::DateTime<chrono::Utc>,
@@ -41,8 +39,6 @@ impl Into<LocationResource> for LocationData {
total_capacity: self.total_capacity,
available_capacity: self.available_capacity,
is_removable: self.is_removable,
is_ejectable: self.is_ejectable,
is_root_filesystem: self.is_root_filesystem,
is_online: self.is_online,
date_created: self.date_created,
}
@@ -78,9 +74,7 @@ pub async fn get_location(
// get location by location_id from db and include location_paths
let location = match db
.location()
.find_first(vec![
Location::file_paths().some(vec![FilePath::id().equals(location_id.into())])
])
.find_unique(Location::id().equals(location_id))
.exec()
.await?
{
@@ -106,6 +100,21 @@ pub async fn new_location_and_scan(
Ok(location)
}
pub async fn get_locations(ctx: &CoreContext) -> Result<Vec<LocationResource>, SysError> {
let db = &ctx.database;
let config = client::get();
let locations = db.location().find_many(vec![]).exec().await?;
// turn locations into LocationResource
let locations: Vec<LocationResource> = locations
.into_iter()
.map(|location| location.into())
.collect();
Ok(locations)
}
pub async fn create_location(ctx: &CoreContext, path: &str) -> Result<LocationResource, SysError> {
let db = &ctx.database;
let config = client::get();
@@ -129,40 +138,18 @@ pub async fn create_location(ctx: &CoreContext, path: &str) -> Result<LocationRe
&path
);
let uuid = uuid::Uuid::new_v4();
// create new location
let create_location_params = {
let volumes = match volumes::get_volumes() {
Ok(volumes) => volumes,
Err(e) => Err(LocationError::VolumeReadError(e.to_string()))?,
};
info!("Loaded mounted volumes: {:?}", volumes);
// find mount with matching path
let volume = volumes
.into_iter()
.find(|mount| path.starts_with(&mount.mount_point));
let volume_data = match volume {
Some(mount) => mount,
None => Volume::default(),
};
vec![
Location::name().set(volume_data.name.to_string()),
Location::total_capacity().set(volume_data.total_capacity as i32),
Location::available_capacity().set(volume_data.available_capacity as i32),
Location::is_ejectable().set(false), // remove this
Location::is_removable().set(volume_data.is_removable),
Location::is_root_filesystem().set(false), // remove this
Location::is_online().set(true),
Location::local_path().set(path.to_string()),
]
};
let p = Path::new(&path);
let location = db
.location()
.create_one(
Location::uuid().set(uuid.to_string()),
create_location_params,
Location::pub_id().set(uuid.to_string()),
vec![
Location::name().set(p.file_name().unwrap().to_string_lossy().to_string()),
Location::is_online().set(true),
Location::local_path().set(path.to_string()),
],
)
.exec()
.await?;
+24 -24
View File
@@ -8,37 +8,37 @@ use crate::state;
// an SQL commit to be sent to connected clients
#[derive(Serialize, Deserialize)]
pub struct Commit {
pub id: String,
pub timestamp: DateTime<Utc>,
pub client_uuid: String,
pub library_uuid: String,
pub query: String,
pub id: String,
pub timestamp: DateTime<Utc>,
pub client_uuid: String,
pub library_uuid: String,
pub query: String,
}
impl Commit {
pub fn new(query: String) -> Self {
let client = state::client::get();
let id = Uuid::new_v4().to_string();
let timestamp = Utc::now();
Self {
id,
sql,
client_uuid: client.client_id,
library_uuid: client.current_library_id,
timestamp,
}
pub fn new(query: String) -> Self {
let client = state::client::get();
let id = Uuid::new_v4().to_string();
let timestamp = Utc::now();
Self {
id,
sql,
client_uuid: client.client_id,
library_uuid: client.current_library_id,
timestamp,
}
}
pub fn from_query<T: SerializeQuery>(query: T) -> Self {
Self::new(query.serialize_query())
}
pub fn from_query<T: SerializeQuery>(query: T) -> Self {
Self::new(query.serialize_query())
}
}
// example
fn do_something() {
Commit::new(db.client().create_one(
Client::uuid().set(config.client_id.clone()),
Client::name().set(hostname.clone()),
vec![],
))
Commit::new(db.client().create_one(
Client::pub_id().set(config.client_id.clone()),
Client::name().set(hostname.clone()),
vec![],
))
}
+129
View File
@@ -16,6 +16,8 @@ importers:
'@headlessui/react': ^1.5.0
'@heroicons/react': ^1.0.6
'@radix-ui/react-dialog': ^0.1.7
'@radix-ui/react-dropdown-menu': ^0.1.6
'@radix-ui/react-icons': ^1.1.0
'@radix-ui/react-slider': ^0.1.4
'@sd/client': workspace:*
'@sd/core': workspace:*
@@ -70,6 +72,8 @@ importers:
'@headlessui/react': 1.5.0_react-dom@18.0.0+react@18.0.0
'@heroicons/react': 1.0.6_react@18.0.0
'@radix-ui/react-dialog': 0.1.7_761282c47ea27a9f40e1344337910648
'@radix-ui/react-dropdown-menu': 0.1.6_761282c47ea27a9f40e1344337910648
'@radix-ui/react-icons': 1.1.0_react@18.0.0
'@radix-ui/react-slider': 0.1.4_react@18.0.0
'@sd/client': link:../../packages/client
'@sd/core': link:../../core
@@ -586,12 +590,29 @@ packages:
'@babel/runtime': 7.17.9
dev: false
/@radix-ui/popper/0.1.0:
resolution: {integrity: sha512-uzYeElL3w7SeNMuQpXiFlBhTT+JyaNMCwDfjKkrzugEcYrf5n52PHqncNdQPUtR42hJh8V9FsqyEDbDxkeNjJQ==}
dependencies:
'@babel/runtime': 7.17.9
csstype: 3.0.11
dev: false
/@radix-ui/primitive/0.1.0:
resolution: {integrity: sha512-tqxZKybwN5Fa3VzZry4G6mXAAb9aAqKmPtnVbZpL0vsBwvOHTBwsjHVPXylocYLwEtBY9SCe665bYnNB515uoA==}
dependencies:
'@babel/runtime': 7.17.9
dev: false
/@radix-ui/react-arrow/0.1.4_react@18.0.0:
resolution: {integrity: sha512-BB6XzAb7Ml7+wwpFdYVtZpK1BlMgqyafSQNGzhIpSZ4uXvXOHPlR5GP8M449JkeQzgQjv9Mp1AsJxFC0KuOtuA==}
peerDependencies:
react: ^16.8 || ^17.0
dependencies:
'@babel/runtime': 7.17.9
'@radix-ui/react-primitive': 0.1.4_react@18.0.0
react: 18.0.0
dev: false
/@radix-ui/react-collection/0.1.4_react@18.0.0:
resolution: {integrity: sha512-3muGI15IdgaDFjOcO7xX8a35HQRBRF6LH9pS6UCeZeRmbslkVeHyJRQr2rzICBUoX7zgIA0kXyMDbpQnJGyJTA==}
peerDependencies:
@@ -665,6 +686,26 @@ packages:
react: 18.0.0
dev: false
/@radix-ui/react-dropdown-menu/0.1.6_761282c47ea27a9f40e1344337910648:
resolution: {integrity: sha512-RZhtzjWwJ4ZBN7D8ek4Zn+ilHzYuYta9yIxFnbC0pfqMnSi67IQNONo1tuuNqtFh9SRHacPKc65zo+kBBlxtdg==}
peerDependencies:
react: ^16.8 || ^17.0
react-dom: ^16.8 || ^17.0
dependencies:
'@babel/runtime': 7.17.9
'@radix-ui/primitive': 0.1.0
'@radix-ui/react-compose-refs': 0.1.0_react@18.0.0
'@radix-ui/react-context': 0.1.1_react@18.0.0
'@radix-ui/react-id': 0.1.5_react@18.0.0
'@radix-ui/react-menu': 0.1.6_761282c47ea27a9f40e1344337910648
'@radix-ui/react-primitive': 0.1.4_react@18.0.0
'@radix-ui/react-use-controllable-state': 0.1.0_react@18.0.0
react: 18.0.0
react-dom: 18.0.0_react@18.0.0
transitivePeerDependencies:
- '@types/react'
dev: false
/@radix-ui/react-focus-guards/0.1.0_react@18.0.0:
resolution: {integrity: sha512-kRx/swAjEfBpQ3ns7J3H4uxpXuWCqN7MpALiSDOXiyo2vkWv0L9sxvbpZeTulINuE3CGMzicVMuNc/VWXjFKOg==}
peerDependencies:
@@ -686,6 +727,14 @@ packages:
react: 18.0.0
dev: false
/@radix-ui/react-icons/1.1.0_react@18.0.0:
resolution: {integrity: sha512-nhctV9YKN8G4HfkS3p03ml+osTBDMGKImaAJTm666hymtaWEgIPiqL7F53ivDqIO4A+20ERwUiiKJ8h3XK7uAg==}
peerDependencies:
react: ^16.x || ^17.x
dependencies:
react: 18.0.0
dev: false
/@radix-ui/react-id/0.1.5_react@18.0.0:
resolution: {integrity: sha512-IPc4H/63bes0IZ1GJJozSEkSWcDyhNGtKFWUpJ+XtaLyQ1X3x7Mf6fWwWhDcpqlYEP+5WtAvfqcyEsyjP+ZhBQ==}
peerDependencies:
@@ -696,6 +745,53 @@ packages:
react: 18.0.0
dev: false
/@radix-ui/react-menu/0.1.6_761282c47ea27a9f40e1344337910648:
resolution: {integrity: sha512-ho3+bhpr3oAFkOBJ8VkUb1BcGoiZBB3OmcWPqa6i5RTUKrzNX/d6rauochu2xDlWjiRtpVuiAcsTVOeIC4FbYQ==}
peerDependencies:
react: ^16.8 || ^17.0
react-dom: ^16.8 || ^17.0
dependencies:
'@babel/runtime': 7.17.9
'@radix-ui/primitive': 0.1.0
'@radix-ui/react-collection': 0.1.4_react@18.0.0
'@radix-ui/react-compose-refs': 0.1.0_react@18.0.0
'@radix-ui/react-context': 0.1.1_react@18.0.0
'@radix-ui/react-dismissable-layer': 0.1.5_react@18.0.0
'@radix-ui/react-focus-guards': 0.1.0_react@18.0.0
'@radix-ui/react-focus-scope': 0.1.4_react@18.0.0
'@radix-ui/react-id': 0.1.5_react@18.0.0
'@radix-ui/react-popper': 0.1.4_react@18.0.0
'@radix-ui/react-portal': 0.1.4_react-dom@18.0.0+react@18.0.0
'@radix-ui/react-presence': 0.1.2_react@18.0.0
'@radix-ui/react-primitive': 0.1.4_react@18.0.0
'@radix-ui/react-roving-focus': 0.1.5_react@18.0.0
'@radix-ui/react-use-callback-ref': 0.1.0_react@18.0.0
'@radix-ui/react-use-direction': 0.1.0_react@18.0.0
aria-hidden: 1.1.3
react: 18.0.0
react-dom: 18.0.0_react@18.0.0
react-remove-scroll: 2.4.4_@types+react@18.0.0+react@18.0.0
transitivePeerDependencies:
- '@types/react'
dev: false
/@radix-ui/react-popper/0.1.4_react@18.0.0:
resolution: {integrity: sha512-18gDYof97t8UQa7zwklG1Dr8jIdj3u+rVOQLzPi9f5i1YQak/pVGkaqw8aY+iDUknKKuZniTk/7jbAJUYlKyOw==}
peerDependencies:
react: ^16.8 || ^17.0
dependencies:
'@babel/runtime': 7.17.9
'@radix-ui/popper': 0.1.0
'@radix-ui/react-arrow': 0.1.4_react@18.0.0
'@radix-ui/react-compose-refs': 0.1.0_react@18.0.0
'@radix-ui/react-context': 0.1.1_react@18.0.0
'@radix-ui/react-primitive': 0.1.4_react@18.0.0
'@radix-ui/react-use-rect': 0.1.1_react@18.0.0
'@radix-ui/react-use-size': 0.1.1_react@18.0.0
'@radix-ui/rect': 0.1.1
react: 18.0.0
dev: false
/@radix-ui/react-portal/0.1.4_react-dom@18.0.0+react@18.0.0:
resolution: {integrity: sha512-MO0wRy2eYRTZ/CyOri9NANCAtAtq89DEtg90gicaTlkCfdqCLEBsLb+/q66BZQTr3xX/Vq01nnVfc/TkCqoqvw==}
peerDependencies:
@@ -730,6 +826,23 @@ packages:
react: 18.0.0
dev: false
/@radix-ui/react-roving-focus/0.1.5_react@18.0.0:
resolution: {integrity: sha512-ClwKPS5JZE+PaHCoW7eu1onvE61pDv4kO8W4t5Ra3qMFQiTJLZMdpBQUhksN//DaVygoLirz4Samdr5Y1x1FSA==}
peerDependencies:
react: ^16.8 || ^17.0
dependencies:
'@babel/runtime': 7.17.9
'@radix-ui/primitive': 0.1.0
'@radix-ui/react-collection': 0.1.4_react@18.0.0
'@radix-ui/react-compose-refs': 0.1.0_react@18.0.0
'@radix-ui/react-context': 0.1.1_react@18.0.0
'@radix-ui/react-id': 0.1.5_react@18.0.0
'@radix-ui/react-primitive': 0.1.4_react@18.0.0
'@radix-ui/react-use-callback-ref': 0.1.0_react@18.0.0
'@radix-ui/react-use-controllable-state': 0.1.0_react@18.0.0
react: 18.0.0
dev: false
/@radix-ui/react-slider/0.1.4_react@18.0.0:
resolution: {integrity: sha512-0z3bCcdrAi+FIcoLXS6r0ESVWuuyMnUJoCsFm7tC7Rtv95x34YtaI8YfSyQmzuMVS4rTsNtCCTZ/s727uRaVkQ==}
peerDependencies:
@@ -826,6 +939,16 @@ packages:
react: 18.0.0
dev: false
/@radix-ui/react-use-rect/0.1.1_react@18.0.0:
resolution: {integrity: sha512-kHNNXAsP3/PeszEmM/nxBBS9Jbo93sO+xuMTcRfwzXsmxT5gDXQzAiKbZQ0EecCPtJIzqvr7dlaQi/aP1PKYqQ==}
peerDependencies:
react: ^16.8 || ^17.0
dependencies:
'@babel/runtime': 7.17.9
'@radix-ui/rect': 0.1.1
react: 18.0.0
dev: false
/@radix-ui/react-use-size/0.1.1_react@18.0.0:
resolution: {integrity: sha512-pTgWM5qKBu6C7kfKxrKPoBI2zZYZmp2cSXzpUiGM3qEBQlMLtYhaY2JXdXUCxz+XmD1YEjc8oRwvyfsD4AG4WA==}
peerDependencies:
@@ -835,6 +958,12 @@ packages:
react: 18.0.0
dev: false
/@radix-ui/rect/0.1.1:
resolution: {integrity: sha512-g3hnE/UcOg7REdewduRPAK88EPuLZtaq7sA9ouu8S+YEtnyFRI16jgv6GZYe3VMoQLL1T171ebmEPtDjyxWLzw==}
dependencies:
'@babel/runtime': 7.17.9
dev: false
/@rollup/pluginutils/4.2.0:
resolution: {integrity: sha512-2WUyJNRkyH5p487pGnn4tWAsxhEFKN/pT8CMgHshd5H+IXkOnKvKZwsz5ZWz+YCXkleZRAU5kwbfgF8CPfDRqA==}
engines: {node: '>= 8.0.0'}