Added config editor to tab system, (W.I.P)

This commit is contained in:
LukeGus
2025-08-17 02:33:50 -05:00
parent 981705e81d
commit 22162e5b9b
11 changed files with 236 additions and 401 deletions

View File

@@ -1,6 +1,7 @@
import React, { useEffect, useRef, useState } from "react";
import {TerminalComponent} from "../SSH/Terminal/TerminalComponent.tsx";
import {Server as ServerView} from "@/ui/SSH/Server/Server.tsx";
import {ConfigEditor} from "@/ui/SSH/Config Editor/ConfigEditor.tsx";
import {useTabs} from "@/contexts/TabContext.tsx";
import {ResizablePanelGroup, ResizablePanel, ResizableHandle} from '@/components/ui/resizable.tsx';
import * as ResizablePrimitive from "react-resizable-panels";
@@ -16,7 +17,7 @@ export function AppView({ isTopbarOpen = true }: TerminalViewProps): React.React
const {tabs, currentTab, allSplitScreenTab} = useTabs() as any;
const { state: sidebarState } = useSidebar();
const terminalTabs = tabs.filter((tab: any) => tab.type === 'terminal' || tab.type === 'server');
const terminalTabs = tabs.filter((tab: any) => tab.type === 'terminal' || tab.type === 'server' || tab.type === 'config');
const containerRef = useRef<HTMLDivElement | null>(null);
const panelRefs = useRef<Record<string, HTMLDivElement | null>>({});
@@ -158,7 +159,7 @@ export function AppView({ isTopbarOpen = true }: TerminalViewProps): React.React
showTitle={false}
splitScreen={allSplitScreenTab.length>0}
/>
) : (
) : t.type === 'server' ? (
<ServerView
hostConfig={t.hostConfig}
title={t.title}
@@ -166,6 +167,11 @@ export function AppView({ isTopbarOpen = true }: TerminalViewProps): React.React
isTopbarOpen={isTopbarOpen}
embedded
/>
) : (
<ConfigEditor
embedded
initialHost={t.hostConfig}
/>
)}
</div>
</div>