kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Fix: Task Serialization
Fix: Error output to show correctly Feature: Added regex webhook validationpull/8/head
rodzic
fbca4187be
commit
0d49f36bc8
|
@ -48,6 +48,8 @@ module.exports = class Task{
|
||||||
this.output = [];
|
this.output = [];
|
||||||
this.runningProcesses = [];
|
this.runningProcesses = [];
|
||||||
this.webhook = webhook;
|
this.webhook = webhook;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
|
@ -477,7 +479,8 @@ module.exports = class Task{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
dateCreated: this.dateCreated,
|
dateCreated: this.dateCreated,
|
||||||
status: this.status,
|
status: this.status,
|
||||||
options: this.options
|
options: this.options,
|
||||||
|
webhook: this.webhook
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,8 +51,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="zipFileInput" class="form-group hidden">
|
<div id="zipFileInput" class="form-group hidden">
|
||||||
<label for="zipurl">URL to zip file with Aerial Images and GCP List (optional):</label> <input id="zipurl" name="zipurl" class="form-control" type="text">
|
<label for="zipurl">URL to zip file with Aerial Images and GCP List (optional):</label> <input id="zipurl" name="zipurl" class="form-control" type="text">
|
||||||
<div id="errorBlock" class="help-block"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id="errorBlock" class="help-block"></div>
|
||||||
|
|
||||||
<div class="text-right"><input type="button" class="btn btn-info" value="Switch to URL" id="btnShowImport" />
|
<div class="text-right"><input type="button" class="btn btn-info" value="Switch to URL" id="btnShowImport" />
|
||||||
<input type="button" class="btn btn-info hidden" value="Switch to File Upload" id="btnShowUpload" />
|
<input type="button" class="btn btn-info hidden" value="Switch to File Upload" id="btnShowUpload" />
|
||||||
|
|
|
@ -289,8 +289,22 @@ $(function() {
|
||||||
$("#btnUpload").attr('disabled', true)
|
$("#btnUpload").attr('disabled', true)
|
||||||
.val("Uploading...");
|
.val("Uploading...");
|
||||||
|
|
||||||
// Start upload
|
// validate webhook if exists
|
||||||
$("#images").fileinput('upload');
|
var webhook = $("#webhook").val();
|
||||||
|
var regex = new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?");
|
||||||
|
|
||||||
|
if(webhook.length > 0 && !regex.test(webhook)){
|
||||||
|
$('#errorBlock').text("Webhook url is not valid..");
|
||||||
|
$("#btnUpload").attr('disabled', false).val("Start Task");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Start upload
|
||||||
|
$("#images").fileinput('upload');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#resetWebhook').on('click', function(){
|
$('#resetWebhook').on('click', function(){
|
||||||
|
|
Ładowanie…
Reference in New Issue