|
@@ -166,6 +166,10 @@
|
|
|
$('#reset_password_instance_uuid').val(
|
|
$('#reset_password_instance_uuid').val(
|
|
|
$(me.relatedTarget).parent().parent().parent().parent().parent().children()[0].textContent);
|
|
$(me.relatedTarget).parent().parent().parent().parent().parent().children()[0].textContent);
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ $('#add_boot_job_modal').on('show.bs.modal', function (me) {
|
|
|
|
|
+ refresh_boot_job_selectpicker($('#boot_job_selector'));
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function refresh() {
|
|
function refresh() {
|
|
@@ -179,6 +183,26 @@
|
|
|
window.location.href=cur_url;
|
|
window.location.href=cur_url;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function refresh_boot_job_selectpicker(selectpicker) {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url : '/api/boot_jobs?filter=use_for:eq:2',
|
|
|
|
|
+ type : 'GET',
|
|
|
|
|
+ contentType: "application/json; charset=utf-8",
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ error : function() {
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(data, textStatus, xhr) {
|
|
|
|
|
+ selectpicker.empty();
|
|
|
|
|
+ $.each(data.data, function(k, v) {
|
|
|
|
|
+ selectpicker.append(
|
|
|
|
|
+ $('<option>', {value: v['id'], text: v['name'], 'data-subtext': v['remark']})
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+ selectpicker.selectpicker('refresh');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function row_onmouseover(me) {
|
|
function row_onmouseover(me) {
|
|
|
$(me).find(".edit_remark_trigger").css('display','inline-flex');
|
|
$(me).find(".edit_remark_trigger").css('display','inline-flex');
|
|
|
}
|
|
}
|
|
@@ -389,6 +413,21 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function add_boot_job(uuids, boot_job_id) {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url : '/api/guests/_boot_jobs/' + uuids.join(',') + '/' + boot_job_id,
|
|
|
|
|
+ type : 'PUT',
|
|
|
|
|
+ contentType: "application/json; charset=utf-8",
|
|
|
|
|
+ error : function() {
|
|
|
|
|
+ alter_danger('启动作业添加指令发送失败!');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function() {
|
|
|
|
|
+ alter_success('启动作业添加指令发送成功!');
|
|
|
|
|
+ refresh();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function boot_at(me) {
|
|
function boot_at(me) {
|
|
|
var uuid = $(me).parent().parent().parent().parent().parent().children()[0].textContent;
|
|
var uuid = $(me).parent().parent().parent().parent().parent().children()[0].textContent;
|
|
|
boot([uuid]);
|
|
boot([uuid]);
|
|
@@ -533,6 +572,15 @@
|
|
|
remove(uuids);
|
|
remove(uuids);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function batch_add_boot_job() {
|
|
|
|
|
+ var uuids = get_checked_uuids();
|
|
|
|
|
+ var boot_job_id = $('#boot_job_selector').val();
|
|
|
|
|
+ if (uuids) {
|
|
|
|
|
+ add_boot_job(uuids, boot_job_id);
|
|
|
|
|
+ }
|
|
|
|
|
+ $('#add_boot_job_modal').modal('hide');
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
<div class="panel">
|
|
<div class="panel">
|
|
|
<div class="panel-body">
|
|
<div class="panel-body">
|
|
@@ -687,6 +735,12 @@
|
|
|
</a>
|
|
</a>
|
|
|
</li>
|
|
</li>
|
|
|
<li class="divider"></li>
|
|
<li class="divider"></li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a href="javascript:;" data-toggle="modal" data-target="#add_boot_job_modal">
|
|
|
|
|
+ 启动作业
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="divider"></li>
|
|
|
<li>
|
|
<li>
|
|
|
<a href="javascript:;" onclick="batch_force_shutdown();">强制停止</a>
|
|
<a href="javascript:;" onclick="batch_force_shutdown();">强制停止</a>
|
|
|
</li>
|
|
</li>
|
|
@@ -789,4 +843,35 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+<div class="modal" id="add_boot_job_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
|
|
|
|
|
+ <div class="modal-dialog modal-lg">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <h4 class="modal-title">添加启动作业:</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body" style="padding-top: 0; padding-bottom: 0;">
|
|
|
|
|
+ <div class="example-box-wrapper">
|
|
|
|
|
+ <form class="form-horizontal bordered-row">
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <div class="col-sm-2"></div>
|
|
|
|
|
+ <label class="col-sm-2 control-label"><span class="glyph-icon icon-list-alt"></span> 启动作业</label>
|
|
|
|
|
+ <div class="col-sm-6">
|
|
|
|
|
+ <select id="boot_job_selector" name="boot_job_selector" title="启动作业" class="selectpicker">
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <div class="col-sm-4"></div>
|
|
|
|
|
+ <div class="col-sm-6 pull-right">
|
|
|
|
|
+ <button class="btn btn-blue-alt" style="width: 180px; height: 40px; font-size: 16px;" onclick="batch_add_boot_job();">添加</button>
|
|
|
|
|
+ <button class="btn btn-default" style="width: 64px; height: 40px; font-size: 16px;" data-dismiss="modal">取消</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
{% endblock content %}
|
|
{% endblock content %}
|