mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 04:43:36 +00:00
chore: fix lint warnings and run formating
This commit is contained in:
@@ -1331,22 +1331,6 @@ function promisifySftpFstat(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function promisifySftpWrite(
|
|
||||||
sftp: SFTPWrapper,
|
|
||||||
handle: Buffer,
|
|
||||||
buffer: Buffer,
|
|
||||||
offset: number,
|
|
||||||
length: number,
|
|
||||||
position: number,
|
|
||||||
): Promise<void> {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
sftp.write(handle, buffer, offset, length, position, (err) => {
|
|
||||||
if (err) reject(err);
|
|
||||||
else resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PipelinedXferOptions {
|
interface PipelinedXferOptions {
|
||||||
fileSize?: number;
|
fileSize?: number;
|
||||||
initialOffset?: number;
|
initialOffset?: number;
|
||||||
@@ -2895,7 +2879,6 @@ async function runTransfer(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const sourceSftp = await deps.getSessionSftp(sourceSession);
|
const sourceSftp = await deps.getSessionSftp(sourceSession);
|
||||||
const destSftp = await deps.getSessionSftp(destSession);
|
|
||||||
|
|
||||||
for (const path of sourcePaths) {
|
for (const path of sourcePaths) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -134,21 +134,6 @@ function splitPathForCompletion(
|
|||||||
return { dirPath, partial, replaceStart: lastSlash + 1 };
|
return { dirPath, partial, replaceStart: lastSlash + 1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectionStatusDot(state: HostConnectionState): string {
|
|
||||||
switch (state) {
|
|
||||||
case "ready":
|
|
||||||
return "bg-green-500";
|
|
||||||
case "connecting":
|
|
||||||
return "bg-yellow-500 animate-pulse";
|
|
||||||
case "auth_required":
|
|
||||||
return "bg-yellow-500";
|
|
||||||
case "error":
|
|
||||||
return "bg-red-500";
|
|
||||||
default:
|
|
||||||
return "bg-muted-foreground/40";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function connectionLabel(
|
function connectionLabel(
|
||||||
state: HostConnectionState,
|
state: HostConnectionState,
|
||||||
t: (key: string) => string,
|
t: (key: string) => string,
|
||||||
|
|||||||
@@ -1144,7 +1144,10 @@ export function formatDurationMs(ms?: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface TransferProgressTracker {
|
interface TransferProgressTracker {
|
||||||
update(status: TransferProgressResponse): { rate: number | undefined; stalled: boolean };
|
update(status: TransferProgressResponse): {
|
||||||
|
rate: number | undefined;
|
||||||
|
stalled: boolean;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createTransferProgressTracker(): TransferProgressTracker {
|
export function createTransferProgressTracker(): TransferProgressTracker {
|
||||||
@@ -1159,7 +1162,11 @@ export function createTransferProgressTracker(): TransferProgressTracker {
|
|||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const bytes = status.bytesTransferred;
|
const bytes = status.bytesTransferred;
|
||||||
|
|
||||||
if (bytes !== undefined && lastBytes !== undefined && lastTime !== undefined) {
|
if (
|
||||||
|
bytes !== undefined &&
|
||||||
|
lastBytes !== undefined &&
|
||||||
|
lastTime !== undefined
|
||||||
|
) {
|
||||||
const deltaBytes = bytes - lastBytes;
|
const deltaBytes = bytes - lastBytes;
|
||||||
const deltaMs = now - lastTime;
|
const deltaMs = now - lastTime;
|
||||||
if (deltaMs > 0 && deltaBytes >= 0) {
|
if (deltaMs > 0 && deltaBytes >= 0) {
|
||||||
|
|||||||
@@ -26,7 +26,11 @@ import {
|
|||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/components/dropdown-menu";
|
} from "@/components/dropdown-menu";
|
||||||
import { getSSHHosts, bulkImportSSHHosts, exportAllSSHHosts } from "@/main-axios";
|
import {
|
||||||
|
getSSHHosts,
|
||||||
|
bulkImportSSHHosts,
|
||||||
|
exportAllSSHHosts,
|
||||||
|
} from "@/main-axios";
|
||||||
import type { SSHHostWithStatus } from "@/main-axios";
|
import type { SSHHostWithStatus } from "@/main-axios";
|
||||||
import type { Host, HostFolder, TabType } from "@/types/ui-types";
|
import type { Host, HostFolder, TabType } from "@/types/ui-types";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user