Added config editor operations and re-added ssh tools with recording feature

This commit is contained in:
LukeGus
2025-08-17 22:57:25 -05:00
parent 7d904c4a2c
commit 2df2c4e73d
15 changed files with 2791 additions and 294 deletions

View File

@@ -558,6 +558,75 @@ export async function writeSSHFile(sessionId: string, path: string, content: str
}
}
export async function uploadSSHFile(sessionId: string, path: string, fileName: string, content: string): Promise<any> {
try {
const response = await fileManagerApi.post('/ssh/file_manager/ssh/uploadFile', {
sessionId,
path,
fileName,
content
});
return response.data;
} catch (error) {
throw error;
}
}
export async function createSSHFile(sessionId: string, path: string, fileName: string, content: string = ''): Promise<any> {
try {
const response = await fileManagerApi.post('/ssh/file_manager/ssh/createFile', {
sessionId,
path,
fileName,
content
});
return response.data;
} catch (error) {
throw error;
}
}
export async function createSSHFolder(sessionId: string, path: string, folderName: string): Promise<any> {
try {
const response = await fileManagerApi.post('/ssh/file_manager/ssh/createFolder', {
sessionId,
path,
folderName
});
return response.data;
} catch (error) {
throw error;
}
}
export async function deleteSSHItem(sessionId: string, path: string, isDirectory: boolean): Promise<any> {
try {
const response = await fileManagerApi.delete('/ssh/file_manager/ssh/deleteItem', {
data: {
sessionId,
path,
isDirectory
}
});
return response.data;
} catch (error) {
throw error;
}
}
export async function renameSSHItem(sessionId: string, oldPath: string, newName: string): Promise<any> {
try {
const response = await fileManagerApi.put('/ssh/file_manager/ssh/renameItem', {
sessionId,
oldPath,
newName
});
return response.data;
} catch (error) {
throw error;
}
}
export {sshHostApi, tunnelApi, fileManagerApi};
export async function getAllServerStatuses(): Promise<Record<number, ServerStatus>> {