mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
https://github.com/Termix-SSH/Support/issues/1218
This commit is contained in:
1 parent
0ab6a3e674
commit
db2c90838f
4 files changed
+46
-1
No files matched your search
@@ -641,6 +641,9 @@ export function AppShell({
|
|||||||
const v = localStorage.getItem("commandPaletteShortcutEnabled");
|
const v = localStorage.getItem("commandPaletteShortcutEnabled");
|
||||||
return v !== null ? v === "true" : true;
|
return v !== null ? v === "true" : true;
|
||||||
});
|
});
|
||||||
|
const [showTabNumbers, setShowTabNumbers] = useState<boolean>(
|
||||||
|
() => localStorage.getItem("showTabNumbers") === "true",
|
||||||
|
);
|
||||||
const terminalRefs = useRef<Map<string, ReturnType<typeof createRef>>>(
|
const terminalRefs = useRef<Map<string, ReturnType<typeof createRef>>>(
|
||||||
new Map(),
|
new Map(),
|
||||||
);
|
);
|
||||||
@@ -931,6 +934,14 @@ export function AppShell({
|
|||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = () => {
|
||||||
|
setShowTabNumbers(localStorage.getItem("showTabNumbers") === "true");
|
||||||
|
};
|
||||||
|
window.addEventListener("showTabNumbersChanged", handler);
|
||||||
|
return () => window.removeEventListener("showTabNumbersChanged", handler);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handle = (event: Event) => {
|
const handle = (event: Event) => {
|
||||||
const manual =
|
const manual =
|
||||||
@@ -3081,6 +3092,7 @@ export function AppShell({
|
|||||||
onToggleAppFullscreen={toggleAppFullscreen}
|
onToggleAppFullscreen={toggleAppFullscreen}
|
||||||
rightDockOpen={rightRailView !== null}
|
rightDockOpen={rightRailView !== null}
|
||||||
onToggleRightDock={isMobile ? undefined : toggleRightDock}
|
onToggleRightDock={isMobile ? undefined : toggleRightDock}
|
||||||
|
showTabNumbers={showTabNumbers}
|
||||||
/>
|
/>
|
||||||
<div className="relative flex flex-col flex-1 min-h-0 overflow-hidden">
|
<div className="relative flex flex-col flex-1 min-h-0 overflow-hidden">
|
||||||
{/* Split view — always mounted when not mobile, hidden via CSS when inactive */}
|
{/* Split view — always mounted when not mobile, hidden via CSS when inactive */}
|
||||||
|
|||||||
@@ -4567,6 +4567,8 @@
|
|||||||
"reopenTabsOnLoginDesc": "Restore your open tabs when you log in or refresh the page, even from another device",
|
"reopenTabsOnLoginDesc": "Restore your open tabs when you log in or refresh the page, even from another device",
|
||||||
"confirmTabClose": "Confirm Tab Close",
|
"confirmTabClose": "Confirm Tab Close",
|
||||||
"confirmTabCloseDesc": "Ask before closing terminal tabs",
|
"confirmTabCloseDesc": "Ask before closing terminal tabs",
|
||||||
|
"showTabNumbers": "Show Tab Numbers",
|
||||||
|
"showTabNumbersDesc": "Display a number on each tab to help tell them apart",
|
||||||
"transferConcurrency": "Simultaneous File Transfers",
|
"transferConcurrency": "Simultaneous File Transfers",
|
||||||
"transferConcurrencyDesc": "How many files the side by side local/remote manager uploads or downloads at the same time. Lower this if your server limits SFTP channels.",
|
"transferConcurrencyDesc": "How many files the side by side local/remote manager uploads or downloads at the same time. Lower this if your server limits SFTP channels.",
|
||||||
"settingsAppRail": "App Rail",
|
"settingsAppRail": "App Rail",
|
||||||
|
|||||||
+16
-1
@@ -62,6 +62,7 @@ export function TabBar({
|
|||||||
onToggleAppFullscreen,
|
onToggleAppFullscreen,
|
||||||
rightDockOpen,
|
rightDockOpen,
|
||||||
onToggleRightDock,
|
onToggleRightDock,
|
||||||
|
showTabNumbers,
|
||||||
}: {
|
}: {
|
||||||
tabs: Tab[];
|
tabs: Tab[];
|
||||||
activeTabId: string;
|
activeTabId: string;
|
||||||
@@ -82,6 +83,7 @@ export function TabBar({
|
|||||||
onToggleAppFullscreen: () => void;
|
onToggleAppFullscreen: () => void;
|
||||||
rightDockOpen?: boolean;
|
rightDockOpen?: boolean;
|
||||||
onToggleRightDock?: () => void;
|
onToggleRightDock?: () => void;
|
||||||
|
showTabNumbers?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const reduceMotion = useReducedMotion();
|
const reduceMotion = useReducedMotion();
|
||||||
@@ -422,6 +424,12 @@ export function TabBar({
|
|||||||
{showInPaneIndicator && (
|
{showInPaneIndicator && (
|
||||||
<span className="absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1 rounded-full bg-muted-foreground/40 z-10" />
|
<span className="absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1 rounded-full bg-muted-foreground/40 z-10" />
|
||||||
)}
|
)}
|
||||||
|
{showTabNumbers && tab.type !== "dashboard" && (
|
||||||
|
<span className="shrink-0 text-[10px] tabular-nums text-muted-foreground/70">
|
||||||
|
{tabs.slice(0, index).filter((t) => t.type !== "dashboard")
|
||||||
|
.length + 1}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
{tabIcon(tab.type)}
|
{tabIcon(tab.type)}
|
||||||
{tab.type !== "dashboard" && renamingTabId === tab.id ? (
|
{tab.type !== "dashboard" && renamingTabId === tab.id ? (
|
||||||
<input
|
<input
|
||||||
@@ -543,13 +551,20 @@ export function TabBar({
|
|||||||
sideOffset={1}
|
sideOffset={1}
|
||||||
className="w-56 border-t-0 [clip-path:inset(0px_-4px_-4px_-4px)] p-0"
|
className="w-56 border-t-0 [clip-path:inset(0px_-4px_-4px_-4px)] p-0"
|
||||||
>
|
>
|
||||||
{tabs.map((tab) => (
|
{tabs.map((tab, index) => (
|
||||||
<div
|
<div
|
||||||
key={tab.id}
|
key={tab.id}
|
||||||
onClick={() => onSetActiveTab(tab.id)}
|
onClick={() => onSetActiveTab(tab.id)}
|
||||||
className={`flex items-center justify-between px-2 py-2 text-xs cursor-default hover:bg-accent hover:text-accent-foreground ${tab.id === activeTabId ? "text-foreground" : "text-muted-foreground"}`}
|
className={`flex items-center justify-between px-2 py-2 text-xs cursor-default hover:bg-accent hover:text-accent-foreground ${tab.id === activeTabId ? "text-foreground" : "text-muted-foreground"}`}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2 flex-1 min-w-0">
|
<div className="flex items-center gap-2 flex-1 min-w-0">
|
||||||
|
{showTabNumbers && tab.type !== "dashboard" && (
|
||||||
|
<span className="shrink-0 text-[10px] tabular-nums text-muted-foreground/70">
|
||||||
|
{tabs
|
||||||
|
.slice(0, index)
|
||||||
|
.filter((t) => t.type !== "dashboard").length + 1}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
{tabIcon(tab.type)}
|
{tabIcon(tab.type)}
|
||||||
<span className="truncate">
|
<span className="truncate">
|
||||||
{tab.type === "dashboard"
|
{tab.type === "dashboard"
|
||||||
|
|||||||
@@ -768,6 +768,9 @@ export function UserProfilePanel({
|
|||||||
const [confirmTabClose, setConfirmTabClose] = useState(
|
const [confirmTabClose, setConfirmTabClose] = useState(
|
||||||
() => localStorage.getItem("confirmTabClose") === "true",
|
() => localStorage.getItem("confirmTabClose") === "true",
|
||||||
);
|
);
|
||||||
|
const [showTabNumbers, setShowTabNumbers] = useState(
|
||||||
|
() => localStorage.getItem("showTabNumbers") === "true",
|
||||||
|
);
|
||||||
const [hiddenRailTabs, setHiddenRailTabs] = useState<Set<string>>(() => {
|
const [hiddenRailTabs, setHiddenRailTabs] = useState<Set<string>>(() => {
|
||||||
try {
|
try {
|
||||||
const stored = localStorage.getItem("hiddenRailTabs");
|
const stored = localStorage.getItem("hiddenRailTabs");
|
||||||
@@ -2122,6 +2125,19 @@ export function UserProfilePanel({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
|
<SettingRow
|
||||||
|
label={t("newUi.sidebar.userProfile.showTabNumbers")}
|
||||||
|
description={t("newUi.sidebar.userProfile.showTabNumbersDesc")}
|
||||||
|
>
|
||||||
|
<FakeSwitch
|
||||||
|
checked={showTabNumbers}
|
||||||
|
onChange={(v) => {
|
||||||
|
setShowTabNumbers(v);
|
||||||
|
localStorage.setItem("showTabNumbers", v.toString());
|
||||||
|
window.dispatchEvent(new Event("showTabNumbersChanged"));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SettingRow>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col gap-1 border-t border-border pt-3">
|
<div className="flex flex-col gap-1 border-t border-border pt-3">
|
||||||
|
|||||||
Reference in new issue
Block a user