Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

ecloud_sso
anke1460 5 years ago
commit 267538657e

@ -16,7 +16,7 @@ class Admins::LaboratorySettingsController < Admins::BaseController
def form_params def form_params
params.permit(:identifier, :name, params.permit(:identifier, :name,
:nav_logo, :login_logo, :tab_logo, :oj_banner, :nav_logo, :login_logo, :tab_logo, :oj_banner, :shixun_banner,
:subject_banner, :course_banner, :competition_banner, :moop_cases_banner, :subject_banner, :course_banner, :competition_banner, :moop_cases_banner,
:footer, navbar: %i[name link hidden]) :footer, navbar: %i[name link hidden])
end end

@ -230,7 +230,7 @@ class ChallengesController < ApplicationController
logger.info("############shixun_publiced:#{@shixun.public == 0}") logger.info("############shixun_publiced:#{@shixun.public == 0}")
if @shixun.public == 0 if @shixun.public == 0
script = modify_shixun_script @shixun, @shixun.evaluate_script script = modify_shixun_script @shixun, @shixun.evaluate_script
@shixun.shixun_info.update_column(:evaluate_script, script) @shixun.shixun_info.update_column(:evaluate_script, script) if script.present?
end end
# TODO: # TODO:
# if path != params[:challenge][:path] # if path != params[:challenge][:path]

@ -1433,7 +1433,7 @@ class HomeworkCommonsController < ApplicationController
def require_id_params def require_id_params
tip_exception("请至少选择一个作业") if params[:homework_ids].blank? tip_exception("请至少选择一个作业") if params[:homework_ids].blank?
tip_exception("批量设置不能超过15个") if params[:homework_ids].length > 15 tip_exception("批量设置不能超过15个") if params[:homework_ids].length > 15 && params[:type].blank?
end end
def validate_min_max_num def validate_min_max_num

@ -1,8 +1,8 @@
#encoding=utf-8 #encoding=utf-8
class Ecloud < ActiveRecord::Base class Ecloud < ActiveRecord::Base
attr_accessible :applyno, :begintime, :bossorderid, :custcode, :custid, :custname, :custtype, :ecordercode, :endtime, # attr_accessible :applyno, :begintime, :bossorderid, :custcode, :custid, :custname, :custtype, :ecordercode, :endtime,
:mobile, :opttype, :productcode, :registersource, :string, :trial, :useralias, :userid, :username, :email, # :mobile, :opttype, :productcode, :registersource, :string, :trial, :useralias, :userid, :username, :email,
:effecttime, :operatime # :effecttime, :operatime
has_many :ecloud_services, :dependent => :destroy # 业务列表 has_many :ecloud_services, :dependent => :destroy # 业务列表
has_many :ecloud_productparas, :dependent => :destroy # 开通参数列表 has_many :ecloud_productparas, :dependent => :destroy # 开通参数列表

@ -1,4 +1,4 @@
class EcloudProductpara < ActiveRecord::Base class EcloudProductpara < ActiveRecord::Base
attr_accessible :key, :value, :ecloud_id # attr_accessible :key, :value, :ecloud_id
belongs_to :ecloud belongs_to :ecloud
end end

@ -1,6 +1,6 @@
# 操作代码 0新增业务1注销业务2修改业务 # 操作代码 0新增业务1注销业务2修改业务
class EcloudService < ActiveRecord::Base class EcloudService < ActiveRecord::Base
attr_accessible :begintime, :code, :endtime, :opttype, :ecloud_id, :packagecode, :bossorderid # attr_accessible :begintime, :code, :endtime, :opttype, :ecloud_id, :packagecode, :bossorderid
belongs_to :ecloud belongs_to :ecloud
has_many :ecloud_serviece_serviceparas has_many :ecloud_serviece_serviceparas
end end

@ -1,5 +1,5 @@
# ket值license表示人数对应企业版duration表示月数对应个人版 # ket值license表示人数对应企业版duration表示月数对应个人版
class EcloudServieceServicepara < ActiveRecord::Base class EcloudServieceServicepara < ActiveRecord::Base
attr_accessible :key, :value, :ecloud_service_id # attr_accessible :key, :value, :ecloud_service_id
belongs_to :ecloud_service belongs_to :ecloud_service
end end

@ -1,4 +1,4 @@
class EcloudUser < ActiveRecord::Base class EcloudUser < ActiveRecord::Base
# opttype: # user['opttype']: 操作类型0开通1变更3: 取消授权4暂停5恢复 # opttype: # user['opttype']: 操作类型0开通1变更3: 取消授权4暂停5恢复
attr_accessible :begintime, :email, :endtime, :mobile, :opttype, :paras, :useralias, :userid, :username, :custid # attr_accessible :begintime, :email, :endtime, :mobile, :opttype, :paras, :useralias, :userid, :username, :custid
end end

@ -30,6 +30,10 @@ class LaboratorySetting < ApplicationRecord
image_url('_subject_banner') image_url('_subject_banner')
end end
def shixun_banner_url
image_url('_shixun_banner')
end
def course_banner_url def course_banner_url
image_url('_course_banner') image_url('_course_banner')
end end
@ -62,7 +66,7 @@ class LaboratorySetting < ApplicationRecord
name: nil, name: nil,
navbar: [ navbar: [
{ 'name' => '实践课程', 'link' => '/paths', 'hidden' => false }, { 'name' => '实践课程', 'link' => '/paths', 'hidden' => false },
{ 'name' => '翻转课堂', 'link' => '/courses', 'hidden' => false }, { 'name' => '教学课堂', 'link' => '/courses', 'hidden' => false },
{ 'name' => '实训项目', 'link' => '/shixuns', 'hidden' => false }, { 'name' => '实训项目', 'link' => '/shixuns', 'hidden' => false },
{ 'name' => '在线竞赛', 'link' => '/competitions', 'hidden' => false }, { 'name' => '在线竞赛', 'link' => '/competitions', 'hidden' => false },
{ 'name' => '教学案例', 'link' => '/moop_cases', 'hidden' => false }, { 'name' => '教学案例', 'link' => '/moop_cases', 'hidden' => false },

@ -2,10 +2,12 @@ class ShixunInfo < ApplicationRecord
belongs_to :shixun belongs_to :shixun
validates_uniqueness_of :shixun_id validates_uniqueness_of :shixun_id
validates_length_of :fork_reason, maximum: 60, message: "不能超过60个字符" validates_length_of :fork_reason, maximum: 60, message: "不能超过60个字符"
validates_presence_of :evaluate_script, message: "实训脚本不能为空"
after_commit :create_diff_record after_commit :create_diff_record
validates :description, length: { maximum: 5000, too_long: "不能超过5000个字符" } validates :description, length: { maximum: 5000, too_long: "不能超过5000个字符" }
private private
def create_diff_record def create_diff_record

@ -40,6 +40,7 @@ class Admins::SaveLaboratorySettingService < ApplicationService
save_image_file(params[:login_logo], 'login') save_image_file(params[:login_logo], 'login')
save_image_file(params[:tab_logo], 'tab') save_image_file(params[:tab_logo], 'tab')
save_image_file(params[:subject_banner], '_subject_banner') save_image_file(params[:subject_banner], '_subject_banner')
save_image_file(params[:shixun_banner], '_shixun_banner')
save_image_file(params[:course_banner], '_course_banner') save_image_file(params[:course_banner], '_course_banner')
save_image_file(params[:competition_banner], '_competition_banner') save_image_file(params[:competition_banner], '_competition_banner')
save_image_file(params[:moop_cases_banner], '_moop_cases_banner') save_image_file(params[:moop_cases_banner], '_moop_cases_banner')

@ -100,9 +100,19 @@
</div> </div>
</div> </div>
<div class="col-12 col-md-4 banner-item">
<%- shixun_banner = setting.shixun_banner_url -%>
<div class="banner-item-top">实训项目</div>
<div class="banner-item-bottom <%= shixun_banner ? 'has-img' : '' %>">
<img class="banner-item-img shixun-banner-img" src="<%= shixun_banner %>" style="<%= shixun_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:shixun_banner, accept: 'image/*', style: 'display: none', value: params[:shixun_banner]) %>
<label for="shixun_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item"> <div class="col-12 col-md-4 banner-item">
<%- course_banner = setting.course_banner_url -%> <%- course_banner = setting.course_banner_url -%>
<div class="banner-item-top">翻转课堂</div> <div class="banner-item-top">教学课堂</div>
<div class="banner-item-bottom <%= course_banner ? 'has-img' : '' %>"> <div class="banner-item-bottom <%= course_banner ? 'has-img' : '' %>">
<img class="banner-item-img course-banner-img" src="<%= course_banner %>" style="<%= course_banner.present? ? '' : 'display: none' %>"/> <img class="banner-item-img course-banner-img" src="<%= course_banner %>" style="<%= course_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: params[:course_banner]) %> <%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: params[:course_banner]) %>

@ -23,13 +23,13 @@
<td class="text-left"> <td class="text-left">
<% if myshixun.shixun.is_jupyter? %> <% if myshixun.shixun.is_jupyter? %>
<%= link_to "/tasks/#{myshixun.identifier}/jupyter", target: '_blank' do %> <%= link_to "/tasks/#{myshixun.identifier}/jupyter", target: '_blank' do %>
<%= overflow_hidden_span myshixun.shixun.name, width: 280 %> <%= overflow_hidden_span myshixun.shixun.name, width: 200 %>
<% end %> <% end %>
<% else %> <% else %>
<% current_task = myshixun.last_executable_task || myshixun.last_task %> <% current_task = myshixun.last_executable_task || myshixun.last_task %>
<% if current_task %> <% if current_task %>
<%= link_to "/tasks/#{current_task.identifier}", target: '_blank' do %> <%= link_to "/tasks/#{current_task.identifier}", target: '_blank' do %>
<%= overflow_hidden_span myshixun.shixun.name, width: 280 %> <%= overflow_hidden_span myshixun.shixun.name, width: 200 %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

@ -10,7 +10,7 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="/paths">实践课程</a></li> <li class="nav-item"><a class="nav-link" href="/paths">实践课程</a></li>
<li class="nav-item"><a class="nav-link" href="/courses">翻转课堂</a></li> <li class="nav-item"><a class="nav-link" href="/courses">教学课堂</a></li>
<li class="nav-item"><a class="nav-link" href="/shixuns">实训项目</a></li> <li class="nav-item"><a class="nav-link" href="/shixuns">实训项目</a></li>
<li class="nav-item"><a class="nav-link" href="/competitions">在线竞赛</a></li> <li class="nav-item"><a class="nav-link" href="/competitions">在线竞赛</a></li>
<li class="nav-item"><a class="nav-link" href="/moop_cases">教学案例</a></li> <li class="nav-item"><a class="nav-link" href="/moop_cases">教学案例</a></li>

@ -101,7 +101,7 @@
<div class="col-12 col-md-4 banner-item"> <div class="col-12 col-md-4 banner-item">
<%- course_banner = setting.course_banner_url -%> <%- course_banner = setting.course_banner_url -%>
<div class="banner-item-top">翻转课堂</div> <div class="banner-item-top">教学课堂</div>
<div class="banner-item-bottom <%= course_banner ? 'has-img' : '' %>"> <div class="banner-item-bottom <%= course_banner ? 'has-img' : '' %>">
<img class="banner-item-img course-banner-img" src="<%= course_banner %>" style="<%= course_banner.present? ? '' : 'display: none' %>"/> <img class="banner-item-img course-banner-img" src="<%= course_banner %>" style="<%= course_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: params[:course_banner]) %> <%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: params[:course_banner]) %>

@ -42,7 +42,7 @@ if (isDev) {
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
} }
// 超管 // 超管
// debugType="admin"; debugType="admin";
// 老师 // 老师
//debugType="teacher"; //debugType="teacher";
// 学生 // 学生
@ -136,7 +136,7 @@ export function initAxiosInterceptors(props) {
// proxy="https://test-jupyterweb.educoder.net" // proxy="https://test-jupyterweb.educoder.net"
// proxy="https://test-newweb.educoder.net" // proxy="https://test-newweb.educoder.net"
// proxy="https://test-jupyterweb.educoder.net" // proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001" //proxy="https://test-jupyterweb.educoder.net/"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -432,6 +432,8 @@ class Newshixuns extends Component {
}, },
} }
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<style> <style>
@ -621,9 +623,10 @@ class Newshixuns extends Component {
{this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" : {this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
<div className={"font-12"} style={{'max-width': '600px'}}> <div className={"font-12"} style={{'max-width': '600px'}}>
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`} {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`}
{`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`} {`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.subvalues}`}
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : ""}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" :
this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
</div>} </div>}
</div> </div>

Loading…
Cancel
Save