update batch job info page

This commit is contained in:
Firmlyzhu 2019-03-31 20:10:08 +08:00
parent b1aaa558bc
commit f914b07d8f
3 changed files with 113 additions and 4 deletions

View File

@ -360,7 +360,7 @@ class JobMgr():
if job.username != user: if job.username != user:
return [False, "Wrong User!"] return [False, "Wrong User!"]
jobdata = json.loads(str(job)) jobdata = json.loads(str(job))
tasks = job.tasks.all() tasks = job.tasks.order_by(Batchtask.idx).all()
tasksdata = [json.loads(str(t)) for t in tasks] tasksdata = [json.loads(str(t)) for t in tasks]
jobdata['tasks'] = tasksdata jobdata['tasks'] = tasksdata
return [True, jobdata] return [True, jobdata]

View File

@ -235,14 +235,14 @@
+'<div class="col-sm-3"><input type="number" class="form-control" name="diskSetting_' + task_number + '" id="diskSetting_' + task_number + '" value= 1024 min="128" max="10000" required/>' +'<div class="col-sm-3"><input type="number" class="form-control" name="diskSetting_' + task_number + '" id="diskSetting_' + task_number + '" value= 1024 min="128" max="10000" required/>'
+'</div>MB</div>' +'</div>MB</div>'
+'<div class="form-group">' +'<div class="form-group">'
+'<label class="col-sm-2 control-label">VNode Count</label>' +'<label class="col-sm-2 control-label">VNode Number</label>'
+'<div class="col-sm-3"><input type="number" class="form-control" name="vnodeCount_' + task_number + '" id="vnodeCount_' + task_number + '" value= 1 min="1" max="14" required/>' +'<div class="col-sm-3"><input type="number" class="form-control" name="vnodeCount_' + task_number + '" id="vnodeCount_' + task_number + '" value= 1 min="1" max="14" required/>'
+'</div>' +'</div>'
+'<label class="col-sm-2 control-label">Max Retry Count</label>' +'<label class="col-sm-2 control-label">Max Retry Times</label>'
+'<div class="col-sm-3"><input type="number" class="form-control" name="retryCount_' + task_number + '" id="retryCount_' + task_number + '" value= 1 min="0" max="5" required/>' +'<div class="col-sm-3"><input type="number" class="form-control" name="retryCount_' + task_number + '" id="retryCount_' + task_number + '" value= 1 min="0" max="5" required/>'
+'</div></div>' +'</div></div>'
+'<div class="form-group">' +'<div class="form-group">'
+'<label class="col-sm-2 control-label">Source Code Address</label>' +'<label class="col-sm-2 control-label">Running Path</label>'
+'<div class="col-sm-3"><input type="text" class="form-control" name="srcAddr_' + task_number + '" id="srcAddr_' + task_number + '" value="/root" required/>' +'<div class="col-sm-3"><input type="text" class="form-control" name="srcAddr_' + task_number + '" id="srcAddr_' + task_number + '" value="/root" required/>'
+'</div>' +'</div>'
+'<label class="col-sm-2 control-label">Expire Time</label>' +'<label class="col-sm-2 control-label">Expire Time</label>'

View File

@ -115,6 +115,115 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Tasks Configs</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
{% for task in jobinfo['tasks'] %}
<div class="panel panel-default" id="task_pannel_{{ task['idx'] }}">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-panel="#accordion" href="#collapse{{ task['idx'] }}">
Task #{{ task['idx'] }}
</a>
</h4>
</div>
<div id="collapse{{ task['idx'] }}" class="panel-collapse collapse in">
<div class="panel-body">
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>CPU Cores</th>
<th>Memory</th>
<th>GPU</th>
<th>Disk</th>
<th>VNode Number</th>
<th>Max Retry Times</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ task['config']['cpuSetting'] }}</td>
<td>{{ task['config']['memorySetting'] }} MB</td>
<td>{{ task['config']['gpuSetting'] }}</td>
<td>{{ task['config']['diskSetting'] }} MB</td>
<td>{{ task['config']['vnodeCount'] }}</td>
<td>{{ task['config']['retryCount'] }}</td>
</tr>
</tbody>
<thead>
<tr>
<th>Running Path</th>
<th>Expire Time</th>
<th>Stdout Redirect Path</th>
<th>Stderr Redirect Path</th>
<th>Dependency</th>
<th>Command</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ task['config']['srcAddr'] }}</td>
<td>{{ task['config']['expTime'] }} seconds</td>
<td>{{ task['config']['stdOutRedPth'] }}</td>
<td>{{ task['config']['stdErrRedPth'] }}</td>
<td>{{ task['config']['dependency'] }}</td>
<td>{{ task['config']['command'] }}</td>
</tr>
</tbody>
<thead>
<tr>
<th>Run on</th>
<th>Start at the Same Time</th>
<th>Image Name</th>
<th>Image Owner</th>
<th>Image Type</th>
</tr>
</thead>
<tbody>
<tr>
{% if task['config']['runon'] == 'all' %}
<td>all vnodes</td>
{% else %}
<td>master vnode</td>
{% endif %}
{% if 'atSameTime' in task['config'].keys() %}
<td>True</td>
{% else %}
<td>False</td>
{% endif %}
{% if task['config']['image'] == 'base_base_base' %}
<td>base</td>
<td>docklet</td>
<td>public</td>
{% else %}
<td>{{ task['config']['image'].split('_')[0] }}</td>
<td>{{ task['config']['image'].split('_')[1] }}</td>
<td>{{ task['config']['image'].split('_')[2] }}</td>
{% endif %}
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block script_src %} {% block script_src %}