实训配置页服务器设置调整

dev_bj
杨树明 6 years ago
parent 7b46227ec4
commit 39d46e8222

@ -298,8 +298,8 @@
<div class="edu-back-white padding40-20 mb20">
<p class="color-grey-6 font-16 mb30">服务配置</p>
<% @shixun.shixun_service_configs.each do |config| %>
<p class="color-grey-6 font-16 mt30"><%= config.mirror_repository.try(:type_name) %></p>
<input type="hidden" name="mirror_id[]" value="<%= config.mirror_repository.try(:id) %>'">
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name"><%= config.mirror_repository.try(:type_name) %></p>
<input type="hidden" name="mirror_id[]" id="shixun_scenario_type_name_id" value="<%= config.mirror_repository.try(:id) %>'">
<div class="clearfix mb5">
<label class="panel-form-label fl">CPU(核)</label>
<div class="pr fl with80 status_con">
@ -345,14 +345,67 @@
<!-- </div>-->
<% end %>
</div>
<div id='result'></div>
<% end %>
<div class="clearfix mt30">
<a href="javascript:void(0)" class="defalutSubmitbtn fl mr20" onclick="submit_edit_shixun(<%= @shixun.id %>);">保存</a>
<%= link_to "取消", settings_shixun_path(@shixun), :class => "defalutCancelbtn fl" %>
</div>
<% end %>
</div>
<script id="t:edit-setting-list" type="text/html">
<!if(list.length>1) { !>
<!for(var i=0;i<list.length;i++){!>
<div class="edu-back-white padding40-20 mb20">
<p class="color-grey-6 font-16 mb30">服务配置</p>
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name">
<!=listname[i]!>
</p>
<input type="hidden" name="mirror_id[]" value=<!=list[i]!> >
<div class="clearfix mb5">
<label class="panel-form-label fl">CPU(核)</label>
<div class="pr fl with80 status_con">
<input type="text" name="cpu_limit[]" value="<%= config.cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
</div>
<div class="clearfix mb5">
<label class="panel-form-label fl">最低CPU(核)</label>
<div class="pr fl with80 status_con">
<input type="text" name="lower_cpu_limit[]" value="<%= config.lower_cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
</div>
<div class="clearfix mb5">
<label class="panel-form-label fl">内存限制(M)</label>
<div class="pr fl with80 status_con">
<input type="text" name="memory_limit[]" value="<%= config.memory_limit %>"class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
</div>
<div class="clearfix mb5">
<label class="panel-form-label fl">内存要求(M)</label>
<div class="pr fl with20 status_con">
<input type="text" name="request_limit[]" value="<%= config.request_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<label class="panel-form-label fl" style="width: 48%">温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
<div class="cl"></div>
</div>
</div>
<!}!>
<!}else{!><!}!>
</script>
<script>
//配置-信息提交
function submit_edit_shixun(id) {
@ -407,6 +460,7 @@
$select = $(this).parents(".down-select");
hideValue = $(this).attr("data-shixun-value");
textValue = $(this).html().trim();
$("#shixun_scenario_type_name").html(textValue)
$parent = $(this).parent();
var parentId = $(this).parent().attr("id");
if (parentId != "shixun_scenario_option") {
@ -416,6 +470,7 @@
}
if (parentId == "shixun_language_option") {
var mirror_id = $("#shixun_main_language").val();
$("#shixun_scenario_type_name_id").val(mirror_id)
$.ajax({
url: "<%= get_mirror_script_shixuns_path %>",
data: {mirror_id: mirror_id},
@ -455,16 +510,28 @@
}, function () {
$(this).find(".down-select").hide();
});
$("[select-more] .down-select p input").bind("click", function () {
$("[select-more] .down-select p input").bind("click", function (){
var bt=baidu.template;
bt.LEFT_DELIMITER='<!';
bt.RIGHT_DELIMITER='!>';
var all = $(this).parents(".down-select");
var arr = "";
var arrs=[];
var idarr = [];
for (var i = 0; i < all.find("input").length; i++) {
if (all.find("input").eq(i).is(':checked')) {
arr += ";" + (all.find("input").eq(i).attr("value"));
arrs.push(all.find("input").eq(i).attr("value"))
idarr.push(all.find("input").eq(i).parents("p").attr("data-shixun-value"));
}
}
var data={
"listname":arrs,
"list":idarr
};
var htmlidarr=bt('t:edit-setting-list',data);
document.getElementById('result').innerHTML=htmlidarr;
$("input[name='small_type']").val(idarr);
$(this).parents().prev("input").val(arr.substring(1));
//$(this).parents(".down-select").hide();

Loading…
Cancel
Save