|
|
|
@ -33,19 +33,19 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb10 edu-back-white padding40-20">
|
|
|
|
|
<p class="color-grey-6 font-16 mb30">简介</p>
|
|
|
|
|
<div class="df mb20">
|
|
|
|
|
<div class="flex1 mr20">
|
|
|
|
|
<div id="setting_introduction" class="fl">
|
|
|
|
|
<textarea name="shixun[description]"><%= @shixun.description %></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
<p id="e_tip_in" class="edu-txt-right color-grey-cd font-12"></p>
|
|
|
|
|
<p id="e_tips_in" class="edu-txt-right color-grey-cd font-12"></p>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 57px;"> </div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="mb10 edu-back-white padding40-20">-->
|
|
|
|
|
<!-- <p class="color-grey-6 font-16 mb30">简介</p>-->
|
|
|
|
|
<!-- <div class="df mb20">-->
|
|
|
|
|
<!-- <div class="flex1 mr20">-->
|
|
|
|
|
<!-- <div id="setting_introduction" class="fl">-->
|
|
|
|
|
<!-- <textarea name="shixun[description]"><%#= @shixun.description %></textarea>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <p id="e_tip_in" class="edu-txt-right color-grey-cd font-12"></p>-->
|
|
|
|
|
<!-- <p id="e_tips_in" class="edu-txt-right color-grey-cd font-12"></p>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div style="width: 57px;"> </div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
<div class="mb10 edu-back-white padding40-20">
|
|
|
|
|
<div class="clearfix mb20">
|
|
|
|
@ -294,8 +294,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if User.current.admin? || User.current.business? %>
|
|
|
|
|
<div class=<%User.current.admin? || User.current.business? ? "edu-back-white padding40-20 mb20":"none" %> >
|
|
|
|
|
<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" id="shixun_scenario_type_name"><%= config.mirror_repository.try(:type_name) %></p>
|
|
|
|
@ -303,8 +302,7 @@
|
|
|
|
|
<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"
|
|
|
|
|
>
|
|
|
|
|
<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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -312,8 +310,7 @@
|
|
|
|
|
<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"
|
|
|
|
|
>
|
|
|
|
|
<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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -321,8 +318,7 @@
|
|
|
|
|
<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"
|
|
|
|
|
>
|
|
|
|
|
<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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -330,8 +326,7 @@
|
|
|
|
|
<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"
|
|
|
|
|
>
|
|
|
|
|
<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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<label class="panel-form-label fl" style="width: 48%">温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
@ -340,31 +335,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div class="clearfix mb5">-->
|
|
|
|
|
<!-- <label class="panel-form-label fl">磁盘限制(K):</label>-->
|
|
|
|
|
<!-- <div class="pr fl with80 status_con">-->
|
|
|
|
|
<!-- <input type="text" name="resource_limit[]" value="<%#= config.resource_limit %>" class="panel-box-sizing task-form-100 task-height-40"-->
|
|
|
|
|
<!-- placeholder="请输入类别名称"/>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div class="cl"></div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <label class="panel-form-label fl">磁盘限制(K):</label>-->
|
|
|
|
|
<!-- <div class="pr fl with80 status_con">-->
|
|
|
|
|
<!-- <input type="text" name="resource_limit[]" value="<%#= config.resource_limit %>" class="panel-box-sizing task-form-100 task-height-40"-->
|
|
|
|
|
<!-- placeholder="请输入类别名称"/>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div class="cl"></div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<% end %>
|
|
|
|
|
<div id='result'></div>
|
|
|
|
|
</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>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script id="t:edit-setting-list" type="text/html">
|
|
|
|
|
|
|
|
|
|
<!if(list.length>0) { !>
|
|
|
|
|
<!for(var i=0;i<list.length;i++){!>
|
|
|
|
|
<!for(var i=0;i
|
|
|
|
|
<list.length
|
|
|
|
|
;i++){!>
|
|
|
|
|
|
|
|
|
|
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name">
|
|
|
|
|
<!=listname[i]!>
|
|
|
|
@ -373,8 +369,7 @@
|
|
|
|
|
<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="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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -382,8 +377,7 @@
|
|
|
|
|
<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="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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -391,8 +385,7 @@
|
|
|
|
|
<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="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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -400,8 +393,7 @@
|
|
|
|
|
<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="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="请输入类别名称"/>
|
|
|
|
|
</div>
|
|
|
|
|
<label class="panel-form-label fl" style="width: 48%">温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
@ -414,7 +406,7 @@
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
<script>
|
|
|
|
|
//配置-信息提交
|
|
|
|
|
function submit_edit_shixun(id) {
|
|
|
|
|
if (regex_shixun_name() && regex_public_unit() && regex_tech_platform()) {
|
|
|
|
@ -518,15 +510,15 @@
|
|
|
|
|
}, 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 bt = baidu.template;
|
|
|
|
|
bt.LEFT_DELIMITER = '<!';
|
|
|
|
|
bt.RIGHT_DELIMITER = '!>';
|
|
|
|
|
|
|
|
|
|
var all = $(this).parents(".down-select");
|
|
|
|
|
var arr = "";
|
|
|
|
|
var arrs=[];
|
|
|
|
|
var arrs = [];
|
|
|
|
|
var idarr = [];
|
|
|
|
|
for (var i = 0; i < all.find("input").length; i++) {
|
|
|
|
|
if (all.find("input").eq(i).is(':checked')) {
|
|
|
|
@ -535,14 +527,14 @@
|
|
|
|
|
idarr.push(all.find("input").eq(i).parents("p").attr("data-shixun-value"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var data={
|
|
|
|
|
"listname":arrs,
|
|
|
|
|
"list":idarr,
|
|
|
|
|
var data = {
|
|
|
|
|
"listname": arrs,
|
|
|
|
|
"list": idarr,
|
|
|
|
|
"admin":<%= User.current.admin? %>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var htmlidarr=bt('t:edit-setting-list',data);
|
|
|
|
|
document.getElementById('result').innerHTML=htmlidarr;
|
|
|
|
|
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();
|
|
|
|
@ -703,4 +695,4 @@
|
|
|
|
|
});
|
|
|
|
|
script_Codemirror.setSize("auto", "600px");
|
|
|
|
|
// 非管理员只能查看
|
|
|
|
|
</script>
|
|
|
|
|
</script>
|