mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-10-21 08:34:37 -04:00
some tweaks
This commit is contained in:
1 parent
9bbc37254e
commit
f5f48767dc
4 files changed
+32
-24
No files matched your search
@@ -131,6 +131,9 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<div className="w-full px-2 py-1.5 mt-1 text-xs font-bold text-center text-gray-500 border border-dashed rounded border-transparent cursor-normal border-gray-550">
|
||||
Add Location
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Heading>Tags</Heading>
|
||||
@@ -162,9 +165,9 @@ 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">
|
||||
{/* <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> */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,15 +1,8 @@
|
||||
import React from 'react';
|
||||
import * as SliderPrimitive from '@radix-ui/react-slider';
|
||||
|
||||
interface SliderProps {
|
||||
value: number[];
|
||||
}
|
||||
|
||||
const Slider = (props: SliderProps) => (
|
||||
<SliderPrimitive.Root
|
||||
value={props.value}
|
||||
className="relative flex items-center w-full h-6 select-none"
|
||||
>
|
||||
const Slider = (props: SliderPrimitive.SliderProps) => (
|
||||
<SliderPrimitive.Root {...props} className="relative flex items-center w-full h-6 select-none">
|
||||
<SliderPrimitive.Track className="relative flex-grow h-2 bg-gray-500 rounded-full outline-none">
|
||||
<SliderPrimitive.Range className="absolute h-full rounded-full outline-none bg-primary-500" />
|
||||
</SliderPrimitive.Track>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { InputContainer } from '../../components/primitive/InputContainer';
|
||||
import { Button, Input } from '../../components/primitive';
|
||||
import { invoke } from '@tauri-apps/api';
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useExplorerStore } from '../../store/explorer';
|
||||
import { useAppState } from '../../store/global';
|
||||
import Listbox from '../../components/primitive/Listbox';
|
||||
@@ -12,6 +12,8 @@ import Slider from '../../components/primitive/Slider';
|
||||
export default function GeneralSettings() {
|
||||
const locations = useLocations();
|
||||
|
||||
const [fakeSliderVal, setFakeSliderVal] = useState([30, 0]);
|
||||
|
||||
// const fileUploader = useRef<HTMLInputElement | null>(null);
|
||||
const app = useAppState();
|
||||
|
||||
@@ -73,10 +75,15 @@ export default function GeneralSettings() {
|
||||
</div>
|
||||
</InputContainer>
|
||||
<InputContainer
|
||||
title="Locations"
|
||||
description="Local cache storage for media previews and thumbnails."
|
||||
title="Volumes"
|
||||
description="A list of mounted volumes on this machine, for no reason."
|
||||
>
|
||||
<Slider value={[20, 0]} />
|
||||
<Slider
|
||||
step={5}
|
||||
value={fakeSliderVal}
|
||||
onValueChange={setFakeSliderVal}
|
||||
defaultValue={[25, 75]}
|
||||
/>
|
||||
</InputContainer>
|
||||
<InputContainer
|
||||
title="Media cache directory"
|
||||
@@ -86,14 +93,11 @@ export default function GeneralSettings() {
|
||||
<Input
|
||||
className="flex-grow"
|
||||
value={app.config.data_dir}
|
||||
placeholder="/users/jamie/Desktop"
|
||||
placeholder="/users/jamie/Library/Application Support/spacedrive/cache"
|
||||
/>
|
||||
</div>
|
||||
</InputContainer>
|
||||
<InputContainer
|
||||
title="Something about a vault"
|
||||
description="Local cache storage for media previews and thumbnails."
|
||||
>
|
||||
<InputContainer title="Vault" description="Enable vault storage with VeraCrypt.">
|
||||
<div className="flex flex-row">
|
||||
<Button variant="primary">Enable Vault</Button>
|
||||
{/*<Input className="flex-grow" value="jeff" placeholder="/users/jamie/Desktop" />*/}
|
||||
|
||||
@@ -22,7 +22,7 @@ Flow for changing an active "Job" resource for example:
|
||||
```
|
||||
2. Resolver is defined in Rust
|
||||
```rust
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct GetLatestJobs {
|
||||
amount: u8
|
||||
}
|
||||
@@ -35,7 +35,15 @@ Flow for changing an active "Job" resource for example:
|
||||
}
|
||||
}
|
||||
```
|
||||
3. Rust backend dispatches change to a resource
|
||||
3. Register resolver
|
||||
- this enum is serialized into TS for use
|
||||
```rust
|
||||
#[derive(Serialize, Deserialize, TS)]
|
||||
pub enum Requests {
|
||||
GetLatestJobs(GetLatestJobs)
|
||||
}
|
||||
```
|
||||
4. Rust backend dispatches change to a resource
|
||||
```rust
|
||||
Commit::new(
|
||||
Resource::Job,
|
||||
@@ -45,9 +53,9 @@ Flow for changing an active "Job" resource for example:
|
||||
Job::percentage_complete().set(&percentage_complete),
|
||||
Job::completed_task_count().set(&completed_task_count),
|
||||
])
|
||||
.raw(),
|
||||
._raw_gql(),
|
||||
)
|
||||
.exec()
|
||||
.await?;
|
||||
```
|
||||
4. From within the
|
||||
5. Commit
|
||||
Reference in new issue
Block a user