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
|
@ -50,6 +50,8 @@ module.exports = class Task{
|
|||
this.webhook = webhook;
|
||||
|
||||
|
||||
|
||||
|
||||
async.series([
|
||||
// Read images info
|
||||
cb => {
|
||||
|
@ -477,7 +479,8 @@ module.exports = class Task{
|
|||
name: this.name,
|
||||
dateCreated: this.dateCreated,
|
||||
status: this.status,
|
||||
options: this.options
|
||||
options: this.options,
|
||||
webhook: this.webhook
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -51,8 +51,9 @@
|
|||
</div>
|
||||
<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">
|
||||
<div id="errorBlock" class="help-block"></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" />
|
||||
<input type="button" class="btn btn-info hidden" value="Switch to File Upload" id="btnShowUpload" />
|
||||
|
|
|
@ -289,8 +289,22 @@ $(function() {
|
|||
$("#btnUpload").attr('disabled', true)
|
||||
.val("Uploading...");
|
||||
|
||||
// validate webhook if exists
|
||||
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(){
|
||||
|
|
Ładowanie…
Reference in New Issue