mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: local volume explore file system
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
unmountVolume,
|
||||
healthCheckVolume,
|
||||
listFiles,
|
||||
browseFilesystem,
|
||||
listRepositories,
|
||||
createRepository,
|
||||
deleteRepository,
|
||||
@@ -67,6 +68,7 @@ import type {
|
||||
HealthCheckVolumeData,
|
||||
HealthCheckVolumeResponse,
|
||||
ListFilesData,
|
||||
BrowseFilesystemData,
|
||||
ListRepositoriesData,
|
||||
CreateRepositoryData,
|
||||
CreateRepositoryResponse,
|
||||
@@ -647,6 +649,27 @@ export const listFilesOptions = (options: Options<ListFilesData>) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const browseFilesystemQueryKey = (options?: Options<BrowseFilesystemData>) =>
|
||||
createQueryKey("browseFilesystem", options);
|
||||
|
||||
/**
|
||||
* Browse directories on the host filesystem
|
||||
*/
|
||||
export const browseFilesystemOptions = (options?: Options<BrowseFilesystemData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await browseFilesystem({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: browseFilesystemQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const listRepositoriesQueryKey = (options?: Options<ListRepositoriesData>) =>
|
||||
createQueryKey("listRepositories", options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user