update nextui > heroui, tailwind, vite, onboard, comments, fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Chip, Textarea, Tooltip } from '@nextui-org/react'
|
||||
import { Chip, Textarea, Tooltip } from '@heroui/react'
|
||||
import { LockKeyholeIcon, LockOpenIcon, XIcon } from 'lucide-react'
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { replaceSmartQuotes } from '../../lib/format'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Autocomplete } from '@nextui-org/autocomplete'
|
||||
import { AutocompleteItem, Button } from '@nextui-org/react'
|
||||
import { Autocomplete, Tooltip } from '@heroui/react'
|
||||
import { AutocompleteItem, Button } from '@heroui/react'
|
||||
import { cn } from '@heroui/react'
|
||||
import { open } from '@tauri-apps/plugin-dialog'
|
||||
import { readDir } from '@tauri-apps/plugin-fs'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Drawer, DrawerBody, DrawerFooter, DrawerHeader } from '@nextui-org/drawer'
|
||||
import { Drawer, DrawerBody, DrawerFooter, DrawerHeader } from '@heroui/react'
|
||||
import {
|
||||
Autocomplete,
|
||||
AutocompleteItem,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
Input,
|
||||
Select,
|
||||
SelectItem,
|
||||
} from '@nextui-org/react'
|
||||
} from '@heroui/react'
|
||||
import { message } from '@tauri-apps/plugin-dialog'
|
||||
import { ChevronDown, ChevronUp, RefreshCcwIcon } from 'lucide-react'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
@@ -73,20 +73,6 @@ export default function RemoteCreateDrawer({
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
// <input
|
||||
// type="checkbox"
|
||||
// id={fieldId}
|
||||
// name={option.Name}
|
||||
// className="form-checkbox"
|
||||
// defaultChecked={fieldValue === 'true'}
|
||||
// onChange={(e) =>
|
||||
// setConfig({ ...config, [option.Name]: e.target.checked })
|
||||
// }
|
||||
// autoComplete="off"
|
||||
// autoCapitalize="off"
|
||||
// autoCorrect="off"
|
||||
// spellCheck={false}
|
||||
// />
|
||||
)
|
||||
case 'string': {
|
||||
if (option.Examples && option.Examples.length > 0) {
|
||||
@@ -127,7 +113,7 @@ export default function RemoteCreateDrawer({
|
||||
autoComplete="off"
|
||||
autoCapitalize="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
description={option.Help.split('\n').slice(1).join('\n')}
|
||||
isRequired={option.Required}
|
||||
onValueChange={(value) => {
|
||||
@@ -136,37 +122,6 @@ export default function RemoteCreateDrawer({
|
||||
}}
|
||||
/>
|
||||
)
|
||||
// if (option.Examples && option.Examples.length > 0) {
|
||||
// return (
|
||||
// <select
|
||||
// id={fieldId}
|
||||
// name={option.Name}
|
||||
// className="w-full p-2 border rounded dark:bg-gray-800"
|
||||
// value={fieldValue}
|
||||
// onChange={(e) =>
|
||||
// setConfig({ ...config, [option.Name]: e.target.value })
|
||||
// }
|
||||
// >
|
||||
// <option value="">Select {option.Name}</option>
|
||||
// {option.Examples.map((example) => (
|
||||
// <option key={example.Value} value={example.Value}>
|
||||
// {example.Help || example.Value}
|
||||
// </option>
|
||||
// ))}
|
||||
// </select>
|
||||
// )
|
||||
// }
|
||||
// return (
|
||||
// <input
|
||||
// id={fieldId}
|
||||
// name={option.Name}
|
||||
// type={option.IsPassword ? 'password' : 'text'}
|
||||
// value={fieldValue || ''}
|
||||
// onChange={(e) =>
|
||||
// setConfig({ ...config, [option.Name]: e.target.value })
|
||||
// }
|
||||
// />
|
||||
// )
|
||||
}
|
||||
default:
|
||||
return null
|
||||
@@ -275,7 +230,7 @@ export default function RemoteCreateDrawer({
|
||||
autoComplete="off"
|
||||
autoCapitalize="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
/>
|
||||
|
||||
<Select
|
||||
@@ -290,7 +245,7 @@ export default function RemoteCreateDrawer({
|
||||
isRequired={true}
|
||||
>
|
||||
{backends.map((backend) => (
|
||||
<SelectItem key={backend.Name} value={backend.Name}>
|
||||
<SelectItem key={backend.Name}>
|
||||
{backend.Description.includes('Compliant')
|
||||
? `${backend.Description.split('Compliant')[0]} Compliant`
|
||||
: backend.Description || backend.Name}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Checkbox } from '@nextui-org/checkbox'
|
||||
import { Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader } from '@nextui-org/drawer'
|
||||
import { Accordion, AccordionItem, Avatar, Button, Input } from '@nextui-org/react'
|
||||
import { Checkbox } from '@heroui/react'
|
||||
import { Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader } from '@heroui/react'
|
||||
import { Accordion, AccordionItem, Avatar, Button, Input } from '@heroui/react'
|
||||
import { homeDir } from '@tauri-apps/api/path'
|
||||
import { message, open } from '@tauri-apps/plugin-dialog'
|
||||
import {
|
||||
@@ -82,7 +82,6 @@ export default function RemoteDefaultsDrawer({
|
||||
const handleSubmit = useCallback(async () => {
|
||||
if (!config) {
|
||||
console.log('No config')
|
||||
// console.log(JSON.stringify(config, null, 2))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -309,7 +308,7 @@ export default function RemoteDefaultsDrawer({
|
||||
autoComplete="off"
|
||||
autoCapitalize="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
onValueChange={(value) => {
|
||||
setConfig((prev) => ({
|
||||
...prev,
|
||||
@@ -330,7 +329,7 @@ export default function RemoteDefaultsDrawer({
|
||||
autoComplete="off"
|
||||
autoCapitalize="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
startContent={
|
||||
<Button
|
||||
onPress={async () => {
|
||||
@@ -340,6 +339,7 @@ export default function RemoteDefaultsDrawer({
|
||||
directory: true,
|
||||
multiple: false,
|
||||
defaultPath: await homeDir(),
|
||||
title: 'Select a mount point',
|
||||
})
|
||||
await unlockWindows()
|
||||
if (selected) {
|
||||
@@ -511,14 +511,6 @@ export default function RemoteDefaultsDrawer({
|
||||
rows={20}
|
||||
/>
|
||||
</AccordionItem>
|
||||
{/* <SyncSection
|
||||
remoteName={remoteName}
|
||||
syncOptionsJson={syncOptionsJson}
|
||||
setSyncOptionsJson={setSyncOptionsJson}
|
||||
globalOptions={
|
||||
globalOptions['main' as keyof typeof globalOptions]
|
||||
}
|
||||
/> */}
|
||||
</Accordion>
|
||||
</DrawerBody>
|
||||
<DrawerFooter>
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
import { Checkbox } from '@nextui-org/checkbox'
|
||||
import { Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader } from '@nextui-org/drawer'
|
||||
import {
|
||||
Autocomplete,
|
||||
AutocompleteItem,
|
||||
Button,
|
||||
Input,
|
||||
Select,
|
||||
SelectItem,
|
||||
} from '@nextui-org/react'
|
||||
import { Checkbox } from '@heroui/react'
|
||||
import { Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader } from '@heroui/react'
|
||||
import { Autocomplete, AutocompleteItem, Button, Input, Select, SelectItem } from '@heroui/react'
|
||||
import { message } from '@tauri-apps/plugin-dialog'
|
||||
import { ChevronDown, ChevronUp } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
@@ -115,7 +108,7 @@ export default function RemoteEditDrawer({
|
||||
autoComplete="off"
|
||||
autoCapitalize="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
description={option.Help.split('\n').slice(1).join('\n')}
|
||||
/>
|
||||
)
|
||||
@@ -204,14 +197,10 @@ export default function RemoteEditDrawer({
|
||||
selectionMode="single"
|
||||
placeholder="Select Type"
|
||||
selectedKeys={[config.type]}
|
||||
// onChange={(e) => {
|
||||
// console.log(e.target.value)
|
||||
// setConfig({ ...config, type: e.target.value })
|
||||
// }}
|
||||
isDisabled={true}
|
||||
>
|
||||
{backends.map((backend) => (
|
||||
<SelectItem key={backend.Name} value={backend.Name}>
|
||||
<SelectItem key={backend.Name}>
|
||||
{backend.Description.includes('Compliant')
|
||||
? `${backend.Description.split('Compliant')[0]} Compliant`
|
||||
: backend.Description || backend.Name}
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client'
|
||||
import { RouterProvider, createBrowserRouter } from 'react-router-dom'
|
||||
import Home from './pages/Home'
|
||||
import './global.css'
|
||||
import { NextUIProvider } from '@nextui-org/react'
|
||||
import { HeroUIProvider } from '@heroui/react'
|
||||
import { debug, error, info, trace, warn } from '@tauri-apps/plugin-log'
|
||||
import Copy from './pages/Copy'
|
||||
import Jobs from './pages/Jobs'
|
||||
@@ -64,9 +64,9 @@ const router = createBrowserRouter([
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<NextUIProvider>
|
||||
<HeroUIProvider>
|
||||
{/* <TauriWatcher /> */}
|
||||
<RouterProvider router={router} />
|
||||
</NextUIProvider>
|
||||
</HeroUIProvider>
|
||||
</React.StrictMode>
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { Accordion, AccordionItem, Avatar, Button } from '@nextui-org/react'
|
||||
import { Accordion, AccordionItem, Avatar, Button } from '@heroui/react'
|
||||
import { message } from '@tauri-apps/plugin-dialog'
|
||||
import { exists } from '@tauri-apps/plugin-fs'
|
||||
import { AlertOctagonIcon, CopyIcon, FilterIcon, FoldersIcon, PlayIcon } from 'lucide-react'
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { Card, CardBody, CardFooter, CardHeader } from '@nextui-org/card'
|
||||
import { Button, Chip, Divider, Progress, Spinner } from '@nextui-org/react'
|
||||
import { Card, CardBody, CardFooter, CardHeader } from '@heroui/react'
|
||||
import { Button, Chip, Divider, Progress, Spinner } from '@heroui/react'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import { ask } from '@tauri-apps/plugin-dialog'
|
||||
import { Trash2Icon } from 'lucide-react'
|
||||
@@ -50,7 +50,7 @@ export default function Jobs() {
|
||||
await fetchJobs()
|
||||
}, 2000)
|
||||
|
||||
//! prevents jobs being refreshed after "X" was pressed on the window
|
||||
// prevents jobs being refreshed after closing the window
|
||||
const unlisten = listen('tauri://close-requested', () => {
|
||||
clearInterval(interval)
|
||||
})
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { Accordion, AccordionItem, Avatar, Button } from '@nextui-org/react'
|
||||
import { Accordion, AccordionItem, Avatar, Button } from '@heroui/react'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import { message } from '@tauri-apps/plugin-dialog'
|
||||
import { exists, mkdir, remove } from '@tauri-apps/plugin-fs'
|
||||
@@ -201,7 +201,7 @@ export default function Mount() {
|
||||
return (
|
||||
<div className="flex flex-col h-screen gap-10 pt-10">
|
||||
{/* Main Content */}
|
||||
<div className="flex flex-col flex-1 w-full max-w-xl gap-6 mx-auto">
|
||||
<div className="flex flex-col flex-1 w-full max-w-3xl gap-6 mx-auto">
|
||||
{/* Paths Display */}
|
||||
<PathFinder
|
||||
sourcePath={source}
|
||||
@@ -240,7 +240,7 @@ export default function Mount() {
|
||||
setOptionsJson={setMountOptionsJson}
|
||||
globalOptions={globalOptions['mount' as keyof typeof globalOptions]}
|
||||
optionsFetcher={getMountFlags}
|
||||
rows={5}
|
||||
rows={7}
|
||||
isLocked={mountOptionsLocked}
|
||||
setIsLocked={setMountOptionsLocked}
|
||||
/>
|
||||
|
||||
+8
-28
@@ -1,4 +1,4 @@
|
||||
import { Button, Card, CardBody, Checkbox, Chip, Input, Tab, Tabs } from '@nextui-org/react'
|
||||
import { Button, Card, CardBody, Checkbox, Chip, Input, Tab, Tabs } from '@heroui/react'
|
||||
import { ask, message } from '@tauri-apps/plugin-dialog'
|
||||
import { openUrl } from '@tauri-apps/plugin-opener'
|
||||
import { relaunch } from '@tauri-apps/plugin-process'
|
||||
@@ -38,7 +38,7 @@ function Settings() {
|
||||
autoCapitalize="none"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
type={passwordVisible ? 'text' : 'password'}
|
||||
fullWidth={false}
|
||||
size="lg"
|
||||
@@ -75,20 +75,22 @@ function Settings() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col w-screen h-screen gap-0 overflow-hidden animate-fade-in">
|
||||
<div className="relative flex flex-col w-screen h-screen gap-0 overflow-hidden">
|
||||
<Tabs
|
||||
aria-label="Options"
|
||||
isVertical={true}
|
||||
variant="light"
|
||||
destroyInactiveTabPanel={false}
|
||||
disableAnimation={true}
|
||||
className="flex-shrink-0 w-3/12 h-screen px-2 py-4 border-r border-neutral-700"
|
||||
className="flex-shrink-0 w-40 h-screen px-2 py-4 border-r border-neutral-700"
|
||||
classNames={{
|
||||
tabList: 'w-full gap-3',
|
||||
tab: 'h-14',
|
||||
}}
|
||||
size="lg"
|
||||
defaultSelectedKey="general"
|
||||
color="secondary"
|
||||
radius="sm"
|
||||
>
|
||||
<Tab
|
||||
key="general"
|
||||
@@ -276,7 +278,7 @@ function GeneralSection() {
|
||||
autoCapitalize="none"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
type={passwordVisible ? 'text' : 'password'}
|
||||
endContent={
|
||||
passwordInput && (
|
||||
@@ -454,7 +456,7 @@ function LicenseSection() {
|
||||
autoCapitalize="none"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
spellCheck="false"
|
||||
endContent={
|
||||
licenseValid && <CheckIcon className="w-5 h-5 text-green-500" />
|
||||
}
|
||||
@@ -806,25 +808,3 @@ function BaseHeader({ title, endContent }: { title: string; endContent?: React.R
|
||||
}
|
||||
|
||||
export default Settings
|
||||
|
||||
// {/* <Button
|
||||
// onPress={async () => {
|
||||
// const enabled = await isEnabled()
|
||||
// if (enabled) {
|
||||
// await disable()
|
||||
// } else {
|
||||
// await enable()
|
||||
// }
|
||||
// }}
|
||||
// >
|
||||
// Start on boot
|
||||
// </Button>
|
||||
|
||||
// <Button
|
||||
// onPress={async () => {
|
||||
// const enabled = await isEnabled()
|
||||
// alert(enabled ? 'Enabled' : 'Disabled')
|
||||
// }}
|
||||
// >
|
||||
// Get status
|
||||
// </Button> */}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { Accordion, AccordionItem, Avatar, Button } from '@nextui-org/react'
|
||||
import { Accordion, AccordionItem, Avatar, Button } from '@heroui/react'
|
||||
import { message } from '@tauri-apps/plugin-dialog'
|
||||
import { exists } from '@tauri-apps/plugin-fs'
|
||||
import { AlertOctagonIcon, FilterIcon, FolderSyncIcon, FoldersIcon, PlayIcon } from 'lucide-react'
|
||||
@@ -188,7 +188,7 @@ export default function Sync() {
|
||||
return (
|
||||
<div className="flex flex-col h-screen gap-10 pt-10">
|
||||
{/* Main Content */}
|
||||
<div className="flex flex-col flex-1 w-full max-w-xl gap-6 mx-auto">
|
||||
<div className="flex flex-col flex-1 w-full max-w-3xl gap-6 mx-auto">
|
||||
{/* Paths Display */}
|
||||
<PathFinder
|
||||
sourcePath={source}
|
||||
|
||||
Reference in New Issue
Block a user