mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-27 05:11:28 +02:00
fix(gui): random ts errors (#2316)
This commit is contained in:
parent
a34efd6c6b
commit
0b01d93083
@ -1,6 +1,6 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Input, Tooltip, Button } from "@nextui-org/react";
|
import { Input, Tooltip, Button } from "@nextui-org/react";
|
||||||
import { FolderInputIcon, HelpCircleIcon } from "lucide-react";
|
import { FolderInputIcon } from "lucide-react";
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { createReactBlockSpec } from "@blocknote/react";
|
import { createReactBlockSpec } from "@blocknote/react";
|
||||||
@ -9,7 +9,7 @@ import { open } from "@tauri-apps/plugin-dialog";
|
|||||||
|
|
||||||
interface DirectoryProps {
|
interface DirectoryProps {
|
||||||
path: string;
|
path: string;
|
||||||
onInputChange: (string) => void;
|
onInputChange: (val: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Directory = ({ path, onInputChange }: DirectoryProps) => {
|
const Directory = ({ path, onInputChange }: DirectoryProps) => {
|
||||||
@ -21,8 +21,8 @@ const Directory = ({ path, onInputChange }: DirectoryProps) => {
|
|||||||
directory: true,
|
directory: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
setValue(path);
|
setValue(path || "");
|
||||||
onInputChange(path);
|
onInputChange(path || "");
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -87,9 +87,15 @@ const RunBlock = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isRunning) {
|
if (!isRunning) {
|
||||||
const cwd = findFirstParentOfType(editor, id, "directory");
|
let cwd = findFirstParentOfType(editor, id, "directory");
|
||||||
console.log(cwd.props.path);
|
|
||||||
let pty = await invoke<string>("pty_open", { cwd: cwd.props.path });
|
if (cwd) {
|
||||||
|
cwd = cwd.props.path;
|
||||||
|
} else {
|
||||||
|
cwd = "~";
|
||||||
|
}
|
||||||
|
|
||||||
|
let pty = await invoke<string>("pty_open", { cwd });
|
||||||
if (onRun) onRun(pty);
|
if (onRun) onRun(pty);
|
||||||
|
|
||||||
if (currentRunbook) incRunbookPty(currentRunbook);
|
if (currentRunbook) incRunbookPty(currentRunbook);
|
||||||
|
@ -3,51 +3,9 @@ import { useVirtualizer } from "@tanstack/react-virtual";
|
|||||||
|
|
||||||
import HistoryList from "@/components/HistoryList.tsx";
|
import HistoryList from "@/components/HistoryList.tsx";
|
||||||
import HistorySearch from "@/components/HistorySearch.tsx";
|
import HistorySearch from "@/components/HistorySearch.tsx";
|
||||||
import Stats from "@/components/history/Stats.tsx";
|
|
||||||
import Drawer from "@/components/Drawer.tsx";
|
|
||||||
|
|
||||||
import { AtuinState, useStore } from "@/state/store";
|
import { AtuinState, useStore } from "@/state/store";
|
||||||
|
|
||||||
function Header() {
|
|
||||||
return (
|
|
||||||
<div className="md:flex md:items-center md:justify-between">
|
|
||||||
<div className="min-w-0 flex-1">
|
|
||||||
<h2 className="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">
|
|
||||||
Shell History
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div className="flex">
|
|
||||||
<Drawer
|
|
||||||
width="70%"
|
|
||||||
trigger={
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="inline-flex border-2 items-center hover:shadow-xl rounded-md text-sm font-semibold shadow-sm"
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
fill="none"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
strokeWidth={1.5}
|
|
||||||
stroke="currentColor"
|
|
||||||
className="w-6 h-6"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Stats />
|
|
||||||
</Drawer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Search() {
|
export default function Search() {
|
||||||
const history = useStore((state: AtuinState) => state.shellHistory);
|
const history = useStore((state: AtuinState) => state.shellHistory);
|
||||||
const refreshHistory = useStore(
|
const refreshHistory = useStore(
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import Editor from "@/components/runbooks/editor/Editor";
|
import Editor from "@/components/runbooks/editor/Editor";
|
||||||
import List from "@/components/runbooks/List";
|
import List from "@/components/runbooks/List";
|
||||||
|
|
||||||
import { Checkbox } from "@nextui-org/react";
|
|
||||||
|
|
||||||
import { useStore } from "@/state/store";
|
import { useStore } from "@/state/store";
|
||||||
|
|
||||||
export default function Runbooks() {
|
export default function Runbooks() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user