summaryrefslogtreecommitdiff
path: root/website/static
diff options
context:
space:
mode:
Diffstat (limited to 'website/static')
-rw-r--r--website/static/website/js/cloud.js37
-rw-r--r--website/static/website/templates/index.html3
2 files changed, 22 insertions, 18 deletions
diff --git a/website/static/website/js/cloud.js b/website/static/website/js/cloud.js
index ab4efa1..01153cd 100644
--- a/website/static/website/js/cloud.js
+++ b/website/static/website/js/cloud.js
@@ -674,27 +674,29 @@ $(document.body).ready(function() {
$("#execute-inner").html(
"Execute");
ajax_loader('clear');
- result.setValue(data.output);
if (data.error.length != 0)
{
alert(data.error);
}
- if(data.plot_exist =='True'){
- $plot = $("<img>");
- $plot.attr({
- src: data.plot_path,
- width: '100%'
- });
- $plotbox.html($plot);
- $plotbox_wrapper.modal('show');
- var dt = new Date().getTime();
- $("#plot_download").show();
- $("#plot_download").attr(
- "download", dt +
- '.png');
- $("#plot_download").attr(
- "href", data.plot_path
- );
+ else{
+ result.setValue(data.output);
+ if(data.plot_exist =='True'){
+ $plot = $("<img>");
+ $plot.attr({
+ src: data.plot_path,
+ width: '100%'
+ });
+ $plotbox.html($plot);
+ $plotbox_wrapper.modal('show');
+ var dt = new Date().getTime();
+ $("#plot_download").show();
+ $("#plot_download").attr(
+ "download", dt +
+ '.png');
+ $("#plot_download").attr(
+ "href", data.plot_path
+ );
+ }
}
});
}else{
@@ -1048,6 +1050,7 @@ function doSubmit(){
var user_id = document.getElementById("user_id");
formData.set("user_id", user_id.value)
// Http Request
+
var request = new XMLHttpRequest();
request.open('POST', api_url_upload);
request.send(formData);
diff --git a/website/static/website/templates/index.html b/website/static/website/templates/index.html
index a095bc3..fb0681f 100644
--- a/website/static/website/templates/index.html
+++ b/website/static/website/templates/index.html
@@ -219,7 +219,7 @@
<input type="hidden" id="user_id" name="user_id" value="{{ user_id }}">
<a id="execute" class="btn btn-dark text-white"><span id="execute-inner">Execute</span></a>
<!-- Trigger the modal with a button -->
- <!-- <button id="uploaddataset" type="button" class="btn btn-dark text-white" data-toggle="modal" data-target="#uploaddatasetModal">Upload Dataset</button> -->
+ <button id="uploaddataset" type="button" class="btn btn-dark text-white" data-toggle="modal" data-target="#uploaddatasetModal">Upload Dataset</button>
<button id="reset" type="button" class="btn btn-dark text-white" data-dismiss="modal">Reset</button>
<!-- Modal -->
@@ -230,6 +230,7 @@
<div class="modal-header">
</div>
<div class="modal-body">
+ <p>Upload your CSV dataset file</p>
<form>
<input type="file" id="fileSelect" accept="text/csv" />
<button id="fileuploadsubmit" type="button" >Upload</button>