diff --git a/libs/Task.js b/libs/Task.js
index 89bf007..986541f 100644
--- a/libs/Task.js
+++ b/libs/Task.js
@@ -48,6 +48,8 @@ module.exports = class Task{
this.output = [];
this.runningProcesses = [];
this.webhook = webhook;
+
+
async.series([
@@ -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
};
}
};
diff --git a/public/index.html b/public/index.html
index 85c1f13..a7f3486 100644
--- a/public/index.html
+++ b/public/index.html
@@ -51,8 +51,9 @@
+
diff --git a/public/js/main.js b/public/js/main.js
index a861113..49ebad1 100644
--- a/public/js/main.js
+++ b/public/js/main.js
@@ -289,8 +289,22 @@ $(function() {
$("#btnUpload").attr('disabled', true)
.val("Uploading...");
- // Start upload
- $("#images").fileinput('upload');
+ // 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(){