TooB ML support for large model. .zip file uploads.
This commit is contained in:
@@ -428,6 +428,18 @@ export default withStyles(styles, { withTheme: true })(
|
||||
hasSelectedFileOrFolder(): boolean {
|
||||
return this.state.hasSelection && this.state.selectedFile !== "";
|
||||
}
|
||||
getFileExtensionList(uiFileProperty: UiFileProperty): string {
|
||||
let result = "";
|
||||
for (var fileType of uiFileProperty.fileTypes)
|
||||
{
|
||||
if (fileType.fileExtension !== "" && fileType.fileExtension !== ".zip")
|
||||
{
|
||||
if (result !== "") result = result + ",";
|
||||
result += fileType.fileExtension;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
render() {
|
||||
let classes = this.props.classes;
|
||||
let columnWidth = this.state.columnWidth;
|
||||
@@ -573,9 +585,13 @@ export default withStyles(styles, { withTheme: true })(
|
||||
this.setState({ openUploadFileDialog: false });
|
||||
}
|
||||
}
|
||||
uploadPage={"uploadUserFile?directory=" + encodeURIComponent(
|
||||
pathConcat(this.props.fileProperty.directory,this.state.navDirectory)
|
||||
)}
|
||||
uploadPage={
|
||||
"uploadUserFile?directory=" + encodeURIComponent(
|
||||
pathConcat(this.props.fileProperty.directory,this.state.navDirectory)
|
||||
)
|
||||
+ "&ext="
|
||||
+ encodeURIComponent(this.getFileExtensionList(this.props.fileProperty))
|
||||
}
|
||||
onUploaded={() => { this.requestFiles(this.state.navDirectory); }}
|
||||
fileProperty={this.props.fileProperty}
|
||||
|
||||
|
||||
@@ -787,7 +787,7 @@ export class PiPedalModel //implements PiPedalModel
|
||||
this.androidHost = new FakeAndroidHost();
|
||||
}
|
||||
this.debug = !!data.debug;
|
||||
let { socket_server_port, socket_server_address } = data;
|
||||
let { socket_server_port, socket_server_address,max_upload_size } = data;
|
||||
if ((!socket_server_address) || socket_server_address === "*") {
|
||||
socket_server_address = window.location.hostname;
|
||||
}
|
||||
@@ -798,6 +798,7 @@ export class PiPedalModel //implements PiPedalModel
|
||||
|
||||
this.socketServerUrl = socket_server;
|
||||
this.varServerUrl = var_server_url;
|
||||
this.maxFileUploadSize = parseInt(max_upload_size);
|
||||
|
||||
this.webSocket = new PiPedalSocket(
|
||||
this.socketServerUrl,
|
||||
|
||||
@@ -208,7 +208,11 @@ export default class UploadFileDialog extends ResizeResponsiveComponent<UploadFi
|
||||
{
|
||||
throw new Error("Invalid file extension.");
|
||||
}
|
||||
let filename = await this.model.uploadFile(this.props.uploadPage, this.uploadList[i].file, "application/octet-stream", upload.abortController);
|
||||
let filename = await this.model.uploadFile(
|
||||
this.props.uploadPage,
|
||||
this.uploadList[i].file,
|
||||
"application/octet-stream",
|
||||
upload.abortController);
|
||||
this.props.onUploaded(filename);
|
||||
upload.status = FileUploadStatus.Uploaded;
|
||||
upload.statusMessage = "Uploaded.";
|
||||
|
||||
Reference in New Issue
Block a user