mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 04:43:36 +00:00
feat: add Open File Manager to tab right-click menu (#1046)
This commit is contained in:
@@ -1713,6 +1713,10 @@ export function AppShell({
|
|||||||
onAddToSplit={addTabToSplit}
|
onAddToSplit={addTabToSplit}
|
||||||
onRemoveFromSplit={removeTabFromSplit}
|
onRemoveFromSplit={removeTabFromSplit}
|
||||||
onRenameTab={renameTab}
|
onRenameTab={renameTab}
|
||||||
|
onOpenFileManager={(tabId) => {
|
||||||
|
const targetTab = tabs.find((t) => t.id === tabId);
|
||||||
|
if (targetTab?.host) openTab(targetTab.host, "files");
|
||||||
|
}}
|
||||||
isAppFullscreen={isAppFullscreen}
|
isAppFullscreen={isAppFullscreen}
|
||||||
onToggleAppFullscreen={toggleAppFullscreen}
|
onToggleAppFullscreen={toggleAppFullscreen}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
Pencil,
|
Pencil,
|
||||||
Maximize2,
|
Maximize2,
|
||||||
Minimize2,
|
Minimize2,
|
||||||
|
FolderOpen,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { tabIcon } from "@/shell/tabUtils";
|
import { tabIcon } from "@/shell/tabUtils";
|
||||||
import { isElectron } from "@/lib/electron";
|
import { isElectron } from "@/lib/electron";
|
||||||
@@ -40,6 +41,7 @@ export function TabBar({
|
|||||||
onAddToSplit,
|
onAddToSplit,
|
||||||
onRemoveFromSplit,
|
onRemoveFromSplit,
|
||||||
onRenameTab,
|
onRenameTab,
|
||||||
|
onOpenFileManager,
|
||||||
isAppFullscreen,
|
isAppFullscreen,
|
||||||
onToggleAppFullscreen,
|
onToggleAppFullscreen,
|
||||||
}: {
|
}: {
|
||||||
@@ -56,6 +58,7 @@ export function TabBar({
|
|||||||
onAddToSplit: (tabId: string) => void;
|
onAddToSplit: (tabId: string) => void;
|
||||||
onRemoveFromSplit: (tabId: string) => void;
|
onRemoveFromSplit: (tabId: string) => void;
|
||||||
onRenameTab?: (tabId: string, newLabel: string) => void;
|
onRenameTab?: (tabId: string, newLabel: string) => void;
|
||||||
|
onOpenFileManager?: (tabId: string) => void;
|
||||||
isAppFullscreen: boolean;
|
isAppFullscreen: boolean;
|
||||||
onToggleAppFullscreen: () => void;
|
onToggleAppFullscreen: () => void;
|
||||||
}) {
|
}) {
|
||||||
@@ -527,6 +530,20 @@ export function TabBar({
|
|||||||
{t("nav.refreshTab")}
|
{t("nav.refreshTab")}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
{ctxTab.type === "terminal" &&
|
||||||
|
ctxTab.host &&
|
||||||
|
onOpenFileManager && (
|
||||||
|
<button
|
||||||
|
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
|
||||||
|
onClick={() => {
|
||||||
|
onOpenFileManager(contextTabId);
|
||||||
|
setContextTabId(null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FolderOpen className="size-3" />
|
||||||
|
{t("nav.openFileManager")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
|
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user