|
|
@ -71,7 +71,7 @@
|
|
|
|
<div class="down-select" id="shixun_small_language_option" style="padding: 2px 0px">
|
|
|
|
<div class="down-select" id="shixun_small_language_option" style="padding: 2px 0px">
|
|
|
|
<% @small_type.try(:each) do |type| %>
|
|
|
|
<% @small_type.try(:each) do |type| %>
|
|
|
|
<p data-shixun-value="<%= type.id %>">
|
|
|
|
<p data-shixun-value="<%= type.id %>">
|
|
|
|
<input type="checkbox" class="magic-checkbox" id="mirror_<%= type.id %>" value="<%= type.type_name %>"/>
|
|
|
|
<input type="checkbox" class="magic-checkbox" id="mirror_<%= type.id %>" value="<%= type.type_name %>" <%= @shixun.child_mirror_ids.include?(type.id) ? "checked" : ""%>/>
|
|
|
|
<label style="top:0px" for="mirror_<%= type.id %>"><%= type.type_name %></label>
|
|
|
|
<label style="top:0px" for="mirror_<%= type.id %>"><%= type.type_name %></label>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
@ -294,16 +294,19 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% if User.current.admin? || User.current.business? %>
|
|
|
|
|
|
|
|
<div class="edu-back-white padding40-20 mb20">
|
|
|
|
<div class="edu-back-white padding40-20 mb20">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="color-grey-6 font-16 mb30">服务配置</p>
|
|
|
|
<p class="color-grey-6 font-16 mb30">服务配置</p>
|
|
|
|
<% @shixun.shixun_service_configs.each do |config| %>
|
|
|
|
<% @shixun.shixun_service_configs.each do |config| %>
|
|
|
|
|
|
|
|
<div id="<%= 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>
|
|
|
|
<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) %>'">
|
|
|
|
<input type="hidden" name="mirror_id[]" id="shixun_scenario_type_name_id" value="<%= config.mirror_repository.try(:id) %>">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">CPU(核):</label>
|
|
|
|
<label class="panel-form-label fl">CPU(核):</label>
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<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"
|
|
|
|
<input type="text" <%= User.current.admin? ? "" : "readonly" %> name="cpu_limit[]" value="<%= config.cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -311,7 +314,7 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">最低CPU(核):</label>
|
|
|
|
<label class="panel-form-label fl">最低CPU(核):</label>
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<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"
|
|
|
|
<input type="text" name="lower_cpu_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="<%= config.lower_cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -319,7 +322,7 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">内存限制(M):</label>
|
|
|
|
<label class="panel-form-label fl">内存限制(M):</label>
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<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"
|
|
|
|
<input type="text" name="memory_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="<%= config.memory_limit %>" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -327,13 +330,13 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">内存要求(M):</label>
|
|
|
|
<label class="panel-form-label fl">内存要求(M):</label>
|
|
|
|
<div class="pr fl with20 status_con">
|
|
|
|
<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"
|
|
|
|
<input type="text" name="request_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="<%= config.request_limit %>" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<label class="panel-form-label fl" style="width: 48%">温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
<label class="panel-form-label fl" style="width: 48%">温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div class="clearfix mb5">-->
|
|
|
|
<!-- <div class="clearfix mb5">-->
|
|
|
|
<!-- <label class="panel-form-label fl">磁盘限制(K):</label>-->
|
|
|
|
<!-- <label class="panel-form-label fl">磁盘限制(K):</label>-->
|
|
|
@ -347,7 +350,6 @@
|
|
|
|
<div id='result'></div>
|
|
|
|
<div id='result'></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="clearfix mt30">
|
|
|
|
<div class="clearfix mt30">
|
|
|
|
<a href="javascript:void(0)" class="defalutSubmitbtn fl mr20" onclick="submit_edit_shixun(<%= @shixun.id %>);">保存</a>
|
|
|
|
<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" %>
|
|
|
|
<%= link_to "取消", settings_shixun_path(@shixun), :class => "defalutCancelbtn fl" %>
|
|
|
@ -360,8 +362,10 @@
|
|
|
|
<script id="t:edit-setting-list" type="text/html">
|
|
|
|
<script id="t:edit-setting-list" type="text/html">
|
|
|
|
|
|
|
|
|
|
|
|
<!if(list.length>0) { !>
|
|
|
|
<!if(list.length>0) { !>
|
|
|
|
<!for(var i=0;i<list.length;i++){!>
|
|
|
|
<!for(var i=0;i
|
|
|
|
|
|
|
|
<list.length
|
|
|
|
|
|
|
|
;i++){!>
|
|
|
|
|
|
|
|
<div id=<!=list[i]!>>
|
|
|
|
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name">
|
|
|
|
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name">
|
|
|
|
<!=listname[i]!>
|
|
|
|
<!=listname[i]!>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
@ -369,7 +373,7 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">CPU(核):</label>
|
|
|
|
<label class="panel-form-label fl">CPU(核):</label>
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<input type="text" name="cpu_limit[]" value="1" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
<input type="text" name="cpu_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="1" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -377,7 +381,7 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">最低CPU(核):</label>
|
|
|
|
<label class="panel-form-label fl">最低CPU(核):</label>
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<input type="text" name="lower_cpu_limit[]" value="0.1" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
<input type="text" name="lower_cpu_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="0.1" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -385,7 +389,7 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">内存限制(M):</label>
|
|
|
|
<label class="panel-form-label fl">内存限制(M):</label>
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<div class="pr fl with80 status_con">
|
|
|
|
<input type="text" name="memory_limit[]" value="1024" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
<input type="text" name="memory_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="1024" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
@ -393,13 +397,13 @@
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<div class="clearfix mb5">
|
|
|
|
<label class="panel-form-label fl">内存要求(M):</label>
|
|
|
|
<label class="panel-form-label fl">内存要求(M):</label>
|
|
|
|
<div class="pr fl with20 status_con">
|
|
|
|
<div class="pr fl with20 status_con">
|
|
|
|
<input type="text" name="request_limit[]" value="10" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
<input type="text" name="request_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="10" class="panel-box-sizing task-form-100 task-height-40"
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
placeholder="请输入类别名称"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<label class="panel-form-label fl" style="width: 48%">温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
<label class="panel-form-label fl" style="width: 48%">温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!}!>
|
|
|
|
<!}!>
|
|
|
|
<!}else{!><!}!>
|
|
|
|
<!}else{!><!}!>
|
|
|
|
|
|
|
|
|
|
|
@ -520,18 +524,26 @@
|
|
|
|
var arr = "";
|
|
|
|
var arr = "";
|
|
|
|
var arrs = [];
|
|
|
|
var arrs = [];
|
|
|
|
var idarr = [];
|
|
|
|
var idarr = [];
|
|
|
|
|
|
|
|
var noidarr=[];
|
|
|
|
for (var i = 0; i < all.find("input").length; i++) {
|
|
|
|
for (var i = 0; i < all.find("input").length; i++) {
|
|
|
|
if (all.find("input").eq(i).is(':checked')) {
|
|
|
|
if (all.find("input").eq(i).is(':checked')) {
|
|
|
|
arr += ";" + (all.find("input").eq(i).attr("value"));
|
|
|
|
arr += ";" + (all.find("input").eq(i).attr("value"));
|
|
|
|
arrs.push(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"));
|
|
|
|
idarr.push(all.find("input").eq(i).parents("p").attr("data-shixun-value"));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
noidarr.push(all.find("input").eq(i).parents("p").attr("data-shixun-value"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<noidarr.length; i++){
|
|
|
|
|
|
|
|
$("#"+noidarr[i]).remove();
|
|
|
|
|
|
|
|
}
|
|
|
|
var data = {
|
|
|
|
var data = {
|
|
|
|
"listname": arrs,
|
|
|
|
"listname": arrs,
|
|
|
|
"list":idarr
|
|
|
|
"list": idarr,
|
|
|
|
|
|
|
|
"admin":<%= User.current.admin? %>
|
|
|
|
};
|
|
|
|
};
|
|
|
|
debugger
|
|
|
|
|
|
|
|
var htmlidarr = bt('t:edit-setting-list', data);
|
|
|
|
var htmlidarr = bt('t:edit-setting-list', data);
|
|
|
|
document.getElementById('result').innerHTML = htmlidarr;
|
|
|
|
document.getElementById('result').innerHTML = htmlidarr;
|
|
|
|
$("input[name='small_type']").val(idarr);
|
|
|
|
$("input[name='small_type']").val(idarr);
|
|
|
|