Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,8 @@ def start_webui(
"ClientDir": str(container_webui_dir / "client"),
"LogViewerDir": str(container_webui_dir / "yscope-log-viewer"),
"StreamTargetUncompressedSize": container_clp_config.stream_output.target_uncompressed_size,
"ClpStorageEngine": clp_config.package.storage_engine,
"LsRoot": str(container_clp_config.logs_input.directory)
}

container_cmd_extra_opts = []
Expand Down Expand Up @@ -941,6 +943,7 @@ def start_webui(
]
necessary_mounts = [
mounts.clp_home,
mounts.input_logs_dir
]
if StorageType.S3 == stream_storage.type:
auth = stream_storage.s3_config.aws_authentication
Expand Down
31 changes: 31 additions & 0 deletions components/webui/client/src/api/compress/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import axios, {AxiosResponse} from "axios";


type CompressionJobCreationSchema = {
paths: string[];
dataset?: string;
timestampKey?: string;
};

type CompressionJobSchema = {
jobId: number;
};

/**
* Submits a compression job.
*
* @param payload
* @return
*/
const submitCompressionJob = async (payload: CompressionJobCreationSchema): Promise<number> => {
console.log("Submitting compression job:", JSON.stringify(payload));

const response = await axios.post<CompressionJobSchema>("/api/compress", payload);
return response.data.jobId;
};

export type {
CompressionJobCreationSchema,
CompressionJobSchema,
};
export {submitCompressionJob};
31 changes: 31 additions & 0 deletions components/webui/client/src/api/os/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
Static,
Type,
} from "@sinclair/typebox";
import axios, {AxiosResponse} from "axios";


// eslint-disable-next-line @typescript-eslint/no-unused-vars
const FileListResponseSchema = Type.Array(
Type.Object({
isExpandable: Type.Boolean(),
name: Type.String(),
parentPath: Type.String(),
})
);


type FileListResponseSchemaType = Static<typeof FileListResponseSchema>;


/**
* Lists files and directories at the specified path.
*
* @param path The path to list files for
* @return
*/
const listFiles = async (path: string): Promise<AxiosResponse<FileListResponseSchemaType>> => {
return axios.get<FileListResponseSchemaType>(`/api/os/ls?path=${encodeURIComponent(path)}`);
};

export {listFiles};
Loading
Loading