Commit c5f79b65 authored by Daniele Venzano's avatar Daniele Venzano

Delete templates that are no longer in use

parent 2a383f4c
{% extends "base.html" %}
{% block title %}Application delete{% endblock %}
{% block content %}
<h1>Delete application</h1>
<p>Warning the application binary and all historic data and logs will be deleted for application {{ app.name }}.</p>
<form enctype="multipart/form-data" id="app_del">
<input type="submit" value="Yes, delete the application" id="submit">
</form>
<script type="application/javascript">
function completeHandler(e) {
if (e.status == "ok") {
location.href = "{{ url_for('web.home') }}";
} else {
alert("Error: " + e.msg);
}
return false;
}
function errorHandler(e) {
alert(e.msg)
}
$('#app_del').on('submit', function(event) {
event.preventDefault();
$("#progress").show();
$.ajax({
url: '{{ url_for("api.application_delete", app_id=app.id) }}', // Server script to process data
type: 'POST',
success: completeHandler,
error: errorHandler,
// Form data
data: new FormData(this),
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
return false;
});
</script>
{% endblock %}
\ No newline at end of file
{% extends "base.html" %}
{% block title %}New application{% endblock %}
{% block content %}
<h1>New application</h1>
<form enctype="multipart/form-data" id="app_new" class="wizard clearfix">
<div class="step" data-state="app_type">
<h3 class="step-header">Application type</h3>
<section>
<label for="app_name">Name:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-]+" name="app_name" id="app_name" placeholder="myapp"><br/>
<label for="app_type">Type:</label><br/>
<input id="radio_inb" type="radio" name="app_type" value="ipython-notebook" checked>&nbsp;Spark iPython Notebook<br/>
<input id="radio_nb" type="radio" name="app_type" value="spark-notebook">&nbsp;Spark Notebook<br/>
<input id="radio_sub" type="radio" name="app_type" value="spark-submit">&nbsp;Spark Application<br/>
<input id="radio_sub" type="radio" name="app_type" value="hadoop-hdfs">&nbsp;Hadoop HDFS data layer<br/>
<input id="radio_zk" type="radio" name="app_type" value="zookeeper" disabled>&nbsp;Zookeeper (coming soon)<br/>
</section>
</div>
<div class="branch" id="spark">
<div class="step">
<h3 class="step-header">Spark: minimum required resources</h3>
<section>
<label for="master_mem_limit">Amount of RAM per worker node (gigabytes)</label>
<input type="number" min="1" step="1" value="2" required name="master_mem_limit"><br/>
<label for="worker_count">Number of worker nodes</label>
<input type="number" min="1" step="1" value="2" required name="worker_count"><br/>
<label for="worker_cores">Number of cores per worker node</label>
<input type="number" min="2" step="1" value="2" required name="worker_cores"><br/>
<label for="worker_mem_limit">Amount of RAM per worker node (gigabytes)</label>
<input type="number" min="1" step="1" value="2" name="worker_mem_limit" required>
</section>
</div>
<div class="step" data-state="spark-settings">
<h3 class="step-header">Spark: settings</h3>
<section>
<h4>Other settings</h4>
<label for="spark_options">Spark options:</label>
<input type="text" autofocus autocomplete="on" pattern="[a-z0-9_\-=]+" name="spark_options" id="spark_options" size="60">
</section>
<section>
<h4>Images</h4>
<label for="master_image">Spark Master Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="master_image" id="master_image" size="40" value="/zoerepo/spark-master"><br/>
<label for="worker_image">Spark Worker Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="worker_image" id="worker_image" size="40" value="/zoerepo/spark-worker"><br/>
</section>
</div>
<div class="branch" id="spark-notebook">
<div class="submit step">
<h3 class="step-header">Spark: Scala notebook settings</h3>
<section>
<label for="notebook_image">Spark Scala Notebook Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="notebook_image" id="notebook_image" size="40" value="/zoerepo/spark-scala-notebook">
</section>
</div>
</div>
<div class="branch" id="ipython-notebook">
<div class="submit step">
<h3 class="step-header">Spark: iPython notebook settings</h3>
<section>
<label for="ipython_image">Spark iPython Notebook Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="ipython_image" id="ipython_image" size="40" value="/zoerepo/spark-ipython-notebook">
</section>
</div>
</div>
<div class="branch" id="spark-submit">
<div class="submit step">
<h3 class="step-header">Spark: application settings</h3>
<section>
<h4>Other settings</h4>
<label for="commandline">Spark options:</label>
<input type="text" autocomplete="on" required name="commandline" id="commandline" size="100" placeholder="wordcount.py hdfs://192.168.45.157/datasets/gutenberg_big_2x.txt hdfs://192.168.45.157/tmp/cntwdc1"><br/>
<label for="upload" class="spark-submit">Zip file containing the Spark application:</label>
<input class="spark-submit" type="file" name="file" id="upload" accept="application/zip"><br/>
</section>
<section>
<h4>Image</h4>
<label for="submit_image">Spark Submit Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="submit_image" id="submit_image" size="40" value="/zoerepo/spark-submit">
</section>
</div>
</div>
</div>
<div class="branch" id="hdfs">
<div class="submit step">
<h3 class="step-header">HDFS: settings</h3>
<section>
<label for="dn_count">DataNode count:</label>
<input type="number" min="1" step="1" value="3" required name="dn_count"><br/>
</section>
<section>
<h4>Images</h4>
<label for="namenode_image">Hadoop NameNode Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="namenode_image" id="namenode_image" size="40" value="/zoerepo/hadoop-namenode"><br/>
<label for="datanode_image">Hadoop DataNode Docker image:</label>
<input type="text" autofocus autocomplete="on" required pattern="[a-z0-9_\-=]+" name="datanode_image" id="datanode_image" size="40" value="/zoerepo/hadoop-datanode"><br/>
</section>
</div>
</div>
<div class="navigation">
<ul class="clearfix">
<li><button type="button" name="backward" class="backward">Backward</button></li>
<li><button type="button" name="forward" class="forward">Forward</button></li>
<li><button type="submit" name="process" class="submit">Submit</button></li>
</ul>
</div>
</form>
<script type="application/javascript">
var form = $("#app_new");
form.wizard({
stepsWrapper: "#app_new",
submit: ".submit",
branches: ".branch",
header: ".step-header",
beforeForward: function (event, state) {
form.validate().settings.ignore = ":disabled,:hidden";
return $(this).wizard("form").valid();
},
transitions: {
'app_type': function( state, action ) {
var app_type = $("[name=app_type]:checked").val();
if (app_type == "spark-notebook" || app_type == "spark-submit" || app_type == "ipython-notebook") {
return "spark";
} else if (app_type == "hadoop-hdfs") {
return "hdfs";
}
},
'spark-settings': function(state, action) {
return $("[name=app_type]:checked").val();
}
}
}).wizard("form").submit(function( event ) {
event.preventDefault();
form_submit(this);
}).validate({
errorPlacement: function( error, element ) {
if ( element.is( ":radio" ) || element.is( ":checkbox" ) ) {
error.insertBefore( element.next() );
} else {
error.insertAfter( element );
}
}
});
function progressHandlingFunction(e){
if(e.lengthComputable){
$('progress').attr({value:e.loaded,max:e.total});
}
}
function completeHandler(e) {
if (e.status == "ok") {
location.href = "{{ url_for('web.home') }}";
} else {
alert("Error: " + e.msg);
}
return false;
}
function errorHandler(e) {
$("#progress").hide();
}
function form_submit(form) {
$("#app_new").hide();
$("#progress").show();
$.ajax({
url: '{{ url_for("api.application_new") }}', // Server script to process data
type: 'POST',
xhr: function() { // Custom XMLHttpRequest
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload){ // Check if upload property exists
myXhr.upload.addEventListener('progress', progressHandlingFunction, false); // For handling the progress of the upload
}
return myXhr;
},
//Ajax events
//beforeSend: beforeSendHandler,
success: completeHandler,
error: errorHandler,
// Form data
data: new FormData(form),
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
return false;
}
</script>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment