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

dev_cs
杨树林 6 years ago
commit e63a32e2d3

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

@ -54,8 +54,8 @@ GEM
tzinfo (~> 1.1)
acts-as-taggable-on (6.0.0)
activerecord (~> 5.0)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (9.0.0)
@ -180,7 +180,7 @@ GEM
rack (>= 1.2, < 3)
pdfkit (0.8.4.1)
popper_js (1.14.5)
public_suffix (3.0.2)
public_suffix (4.0.1)
puma (3.12.0)
rack (2.0.5)
rack-cors (1.0.2)

@ -44,6 +44,14 @@ $.notifyDefaults({
delay: 2000
});
function show_success_flash(){
$.notify({
message: '操作成功'
},{
type: 'success'
});
}
$(document).on('turbolinks:load', function(){
$('[data-toggle="tooltip"]').tooltip({ trigger : 'hover' });
$('[data-toggle="popover"]').popover();

@ -0,0 +1,70 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-ec-templates-index-page').length > 0) {
var add_modal = $(".ec-templates-new-add");
var template_file_name = add_modal.find(".template-file-upload");
var attachment_id_input = add_modal.find(".template_attachment_id");
var template_container = $(".ec-templates-list-container");
//编辑附件
template_container.on("click", ".edit-template-content", function () {
var t_id = $(this).attr("data-id");
var t_name = $(this).attr("data-name");
var template_name = $(this).attr("data-template-name");
var t_msg = $(this).attr("data-msg");
var template_id = $(this).attr("data-template-id");
add_modal.modal("show");
add_modal.find(".template_add_title").html(t_msg);
attachment_id_input.val(template_id);
add_modal.find(".template_show_id").val(t_id);
add_modal.find("input[name='name']").val(t_name);
add_modal.find("i.delete-template-icon").attr("data-id", template_id);
if(template_id !== "-1"){
template_file_name.find("span.template-file-input").hide();
template_file_name.find("span.template_file_show").show();
template_file_name.find("span.template_file_show_title").html(template_name);
}
});
//删除附件
add_modal.on("click",".delete-template-icon",function () {
var attachment_id = $(this).attr("data-id");
$.ajax({
url: "/api/attachments/" + attachment_id,
type: "delete",
contentType:"application/json",
dataType:"json",
success: function (data) {
template_file_name.find("span.template-file-input").show();
template_file_name.find("span.template_file_show").hide();
attachment_id_input.attr("value","-1")
}
})
});
//上传附件
add_modal.on("change", "#upload_template_file",function () {
var template = document.getElementById('upload_template_file').files[0];
var file_content = new FormData();
file_content.append("file", template);
$.ajax({
type: "POST",
url: "/api/attachments",
data:file_content,
contentType: false,
processData: false,
success: function (data) {
template_file_name.find("span.template-file-input").hide();
template_file_name.find("span.template_file_show").show();
template_file_name.find("span.template_file_show_title").html(template.name);
template_file_name.find("i.delete-template-icon").attr("data-id",data.id);
attachment_id_input.val(data.id)
}
})
})
}
});

@ -0,0 +1,13 @@
$(document).on('turbolinks:load', function() {
if($(".admins-graduation-standards-index-page").length > 0){
$(".admin-body-container").on("click", ".standard-create-modal", function () {
var content = $(this).attr("data-content");
var g_id = $(this).attr("data-id");
var g_msg = $(this).attr("data-msg");
$("#graduation-modal-type").html(g_msg);
$("#graduation_standard_id").val(g_id);
$("textarea[name='content']").val(content);
})
}
});

@ -50,6 +50,4 @@ input.form-control {
right:20px;
position: absolute;
}
.position-r{position:relative;}
.color-grey-c{color:#ccc}
.inline-block{display:inline-block;}

@ -0,0 +1,22 @@
.admins-ec-templates-index-page{
.template-file-upload{
padding: 10px;
background: #fafafa;
border: 1px dashed #ccc;
text-align: center;
color: #999;
position: relative;
width: 100%;
}
input[name='file']{
opacity: 0;
position: absolute;
display: inline-block;
left: 0;
height: 43px;
top: 0;
width:100%;
cursor: pointer;
}
}

@ -38,3 +38,12 @@ input.form-control {
.width100 { width: 100%;}
.mb10 { margin-bottom: 10px ;}
.mt10 { margin-top: 10px ;}
.mr10{ margin-right: 10px; }
.textarea-width-100{width:100%; resize: none; border: 1px solid #ccc;}
.padding10{padding: 10px;}
.padding5-10{padding: 5px 10px;}
.position-r{position:relative;}
.color-grey-c{color:#ccc}
.inline-block{display:inline-block;}
.hide{display: none;}
.show{display: block;}

@ -10,6 +10,7 @@ class Admins::AuthSchoolsController < Admins::BaseController
ActiveRecord::Base.transaction do
school = School.where(id: params[:id]).first
school.destroy
render_success_js
end
end

@ -0,0 +1,41 @@
class Admins::EcTemplatesController < Admins::BaseController
def index
@params_page = params[:page] || 1
templates = EcTemplate.where(nil).includes(:attachments).order("updated_at desc")
@templates = paginate templates
end
def create_template
ActiveRecord::Base.transaction do
if params[:template_id] == "-1"
ec_template = EcTemplate.new(name: params[:name])
ec_template.save
else
ec_template = EcTemplate.find_by(id: params[:template_id])
end
if params[:attachment_id] != "-1"
attachment_id = params[:attachment_id]
attachment_tem = Attachment.find_by(id: attachment_id)
unless attachment_tem.container_id.present? && attachment_tem.container_id == ec_template&.id
attachment_tem.update_attributes(container_id: ec_template&.id, container_type: "EcTemplate")
end
end
@params_page = params[:page] || 1
templates = EcTemplate.where(nil).includes(:attachments).order("updated_at desc")
@templates = paginate templates
end
end
def destroy
ActiveRecord::Base.transaction do
template = EcTemplate.find_by(id: params[:id])
template.destroy
render_success_js
end
end
end

@ -0,0 +1,33 @@
class Admins::GraduationStandardsController < Admins::BaseController
def index
standards = EcGraduationStandard.all.order("updated_at desc")
@params_page = params[:page] || 1
@standards = paginate standards
end
def create_standard
ActiveRecord::Base.transaction do
if params[:graduation_id] == "-1"
content = params[:content]
EcGraduationStandard.create(:content => content)
else
graduation = EcGraduationStandard.find_by(id: params[:graduation_id])
graduation.update_attribute(:content, params[:content])
end
standards = EcGraduationStandard.all.order("updated_at desc")
@params_page = params[:page] || 1
@standards = paginate standards
end
end
def destroy
ActiveRecord::Base.transaction do
@graduation = EcGraduationStandard.find_by(id: params[:id])
@graduation.destroy
render_success_js
end
end
end

@ -247,7 +247,7 @@ class ApplicationController < ActionController::Base
uid_logger("user_setup: " + (User.current.logged? ? "#{User.current.try(:login)} (id=#{User.current.try(:id)})" : "anonymous"))
if !User.current.logged? && Rails.env.development?
User.current = User.find 8686
User.current = User.find 1
end

@ -56,11 +56,6 @@ module ApplicationHelper
end
# 相关推荐
def relation_path(shixun)
shixun.subjects.where(hidden: 0).limit(2)
end
# shixun开启挑战对应的行为名及url
def task_operation_url current_myshixun, shixun
if current_myshixun.blank?

@ -0,0 +1,6 @@
class EcTemplate < ActiveRecord::Base
# attr_accessible :title, :body
# acts_as_attachable
has_many :attachments, as: :container
end

@ -280,6 +280,11 @@ class Shixun < ApplicationRecord
self.mirror_name.include?('JavaWeb') || self.mirror_name.include?('PHP') && self.mirror_name.include?('Mysql') || self.mirror_name.include?('Web')
end
# 所属实践课程
def relation_path
subjects.where(hidden: 0).uniq
end
private
def send_tiding

@ -557,11 +557,6 @@ a.user_greybg_btn{background-color:#747A7F;color: #fff;}
.cdefault{cursor: default}
/*md编辑器恢复被覆盖样式*/
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
/*搜索框*/
#pollingPanel{position: relative;width: 248px;height: 32px;}
#pollingPanel > input{width: 100%;height: 100%;border:1px solid #eaeaea;border-radius: 4px;padding: 0px 30px 0px 5px;box-sizing: border-box;background-color: #F4F4F4;}

@ -4,3 +4,5 @@ if($(".auth-schools-user-add").length > 0){
<% if @school_users.size > 0 %>
$("#table-school-<%= @school_id %>").find(".school_user_list").html("<%= j render partial: "admins/auth_schools/shared/school_user_list", locals: {users: @school_users, school_id: @school_id} %> ")
<% end %>
show_success_flash()

@ -1,2 +1,4 @@
$(".auth-schools-list-container").html("<%= j render partial: "admins/auth_schools/shared/list", locals: {schools: @schools} %>")
$(".auth-schools-new-add").modal("hide")
show_success_flash()

@ -1 +0,0 @@
$("#table-school-<%= params[:id] %>").remove()

@ -1,2 +1,3 @@
$("#table-school-<%= params[:school_id] %>").find("#manager-<%= params[:user_id] %>").remove()
$("#table-school-<%= params[:school_id] %>").find("#manager-<%= params[:user_id] %>").remove()
show_success_flash()

@ -0,0 +1,3 @@
$(".ec-templates-new-add").modal("hide")
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")
show_success_flash()

@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('导入模板管理') %>
<% end %>
<div class="box search-form-container ec-templates-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.ec-templates-new-add' } %>
</div>
<div class="box ec-templates-list-container">
<%= render(partial: 'admins/ec_templates/shared/list', locals: { templates: @templates }) %>
</div>
<%= render partial: "admins/ec_templates/shared/templates_add_modal" %>
<%#= render partial: "admins/auth_schools/shared/user_add_modal" %>

@ -0,0 +1 @@
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")

@ -0,0 +1,35 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="8%">序号</th>
<th width="40%">模板名称</th>
<th width="40%">上传模板</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if templates.size > 0 %>
<% templates.each_with_index do |t, index| %>
<% attachment = t.attachments.first %>
<tr id="template-item-<%= t.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= t.name %></td>
<td>
<% if attachment.present? %>
<%= link_to "#{attachment.try(:filename)}",attachment_path(attachment), target: "_blank" %>
<% end %>
</td>
<td>
<%= link_to "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe,
"javascript:void(0)", data: {"id": "#{t.id}", "template-id": "#{attachment.present? ? attachment.id : "-1"}",
msg: "编辑", name: "#{t.name}", "template_name": "#{attachment.try(:filename)}"}, class: "edit-template-content" %>
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_ec_template_path(t.id), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: templates } %>

@ -0,0 +1,44 @@
<div class="modal fade ec-templates-new-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span class="template_add_title">新建</span>导入模版</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(create_template_admins_ec_templates_path, method: :post, remote: true ) do %>
<%= hidden_field_tag(:attachment_id,"-1",class:"template_attachment_id") %>
<%= hidden_field_tag(:template_id,"-1",class:"template_show_id") %>
<div class="modal-body">
<div class="form-group d-flex">
<label for="template_name" class="col-form-label mr10">模板名称:</label>
<div class="d-flex flex-column-reverse w-75">
<%= text_field_tag("name","",class: "form-control", placeholder: "请输入模版名称", id: 'template_name') %>
</div>
</div>
<div class="form-group d-flex">
<label for="template_name" class="col-form-label mr10">上传文件:</label>
<div class="d-flex flex-column-reverse w-75">
<div class="template-file-upload">
<span class="template_file_show hide">
<span class="template_file_show_title">
</span>
<i class="fa fa-trash-o color-grey padding5-10 ml-5 delete-template-icon" title="删除"></i>
</span>
<span class="template-file-input">
<%= file_field_tag(:file, id: "upload_template_file") %>
<i class="fa fa-plus-circle font-20"></i> 上传文件
</span>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
</div>
<% end %>
</div>
</div>
</div>

@ -0,0 +1,3 @@
$(".graduation-standards-add").removeClass("show").modal("hide")
$(".graduation-standards-list-container").html("<%= j render partial: "admins/graduation_standards/shared/list", locals: { standards: @standards } %>")
show_success_flash()

@ -0,0 +1,14 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('毕业要求通用标准') %>
<% end %>
<div class="box search-form-container graduation-standards-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary standard-create-modal', data: { toggle: 'modal', target: '.graduation-standards-add',
id: "-1", content: "", msg: "添加" } %>
</div>
<div class="box graduation-standards-list-container">
<%= render(partial: 'admins/graduation_standards/shared/list', locals: { standards: @standards }) %>
</div>
<%= render partial: "admins/graduation_standards/shared/add_standard_modal" %>

@ -0,0 +1 @@
$(".graduation-standards-list-container").html("<%= j render partial: "admins/graduation_standards/shared/list", locals: { standards: @standards } %>")

@ -0,0 +1,22 @@
<div class="modal fade graduation-standards-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span id="graduation-modal-type">添加</span>通用标准</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(create_standard_admins_graduation_standards_path, method: :post ,remote: true) do %>
<%= hidden_field_tag(:graduation_id, "", id: "graduation_standard_id") %>
<div class="modal-body">
<%= text_area_tag(:content,"",placeholder: "请输入通用标准内容", rows: "3", class: "textarea-width-100") %>
</div>
<div class="modal-footer">
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
</div>
<% end %>
</div>
</div>
</div>

@ -0,0 +1,27 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="8%">序号</th>
<th width="82%">通用标准</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if standards.size > 0 %>
<% standards.each_with_index do |standard, index| %>
<tr id="standard-item-<%= standard.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= standard.content %></td>
<td>
<%= javascript_void_link "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, class: 'standard-create-modal',
data: { toggle: 'modal', target: '.graduation-standards-add', id: "#{standard.id}", content: "#{standard.content}", msg: "编辑" }, title: "编辑" %>
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_graduation_standard_path(standard), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: standards } %>

@ -70,6 +70,8 @@
<%= sidebar_item_group('#major-identification-submenu', '工程认证', icon: 'anchor') do %>
<li><%= sidebar_item(admins_major_informations_path, '本科专业目录', icon: 'outdent', controller: 'admins-major_informations') %></li>
<li><%= sidebar_item(admins_auth_schools_path, '认证单位列表', icon: 'th', controller: 'admins-auth_schools') %></li>
<li><%= sidebar_item(admins_graduation_standards_path, '毕业要求通用标准', icon: 'file-word-o', controller: 'admins-graduation_standards') %></li>
<li><%= sidebar_item(admins_ec_templates_path, '导入模板管理', icon: 'file-excel-o', controller: 'admins-ec_templates') %></li>
<% end %>
</li>

@ -7,6 +7,8 @@ json.attachments @attachments do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
end
json.cross_comment @task.cross_comment
json.comment_status @task.comment_status
if @user_course_identity == Course::STUDENT
json.work_id @task.user_work(@current_user.id).try(:id)

@ -3,14 +3,14 @@ json.creator do
json.partial! 'users/user', locals: { user: shixun.owner }
end
# 推荐实训
json.recommands do
json.partial! 'shap_shixun', locals: { shixuns: recommend_shixun(shixun) }
end
# 相关路径
json.paths do
json.partial! 'subjects/subject', locals: {subjects: relation_path(shixun)}
json.partial! 'subjects/subject', locals: {subjects: shixun.relation_path}
end
# 推荐实训
json.recommands do
json.partial! 'shap_shixun', locals: { shixuns: shixun.relation_path.size > 0 ? recommend_shixun(shixun) : [] }
end
# 技能标签

@ -811,6 +811,16 @@ Rails.application.routes.draw do
namespace :admins do
get '/', to: 'dashboards#index'
resources :major_informations, only: [:index]
resources :ec_templates, only: [:index, :destroy] do
collection do
post :create_template
end
end
resources :graduation_standards, only: [:index, :destroy] do
collection do
post :create_standard
end
end
resources :auth_schools, only: [:index, :destroy] do
collection do
get :search_school

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -10,7 +10,6 @@ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legen
table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5; color:#333;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;color:#898989; }
a:hover {color:#4CACFF;}
a:hover.fa{color:#4CACFF;}
@ -1416,9 +1415,6 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no-
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:10px;}
.postSort {width:75px; float:right}
.shixunPostSort {width:60px; float:right}
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
.remove_li li{ list-style-type: none!important;}
a.shixun-task-btn { display: inline-block;font-weight: bold;border: none;padding: 0 12px;color: #666;letter-spacing: 1px;text-align: center;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px; }

@ -10,7 +10,6 @@ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legen
table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5; color:#333;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;color:#898989; }
a:hover {color:#FF7500;}
a:hover.fa{color:#FF7500;}

@ -296,9 +296,6 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no-
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:10px;}
.postSort {width:75px; float:right}
.shixunPostSort {width:60px; float:right}
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
.remove_li li{ list-style-type: none!important;}
a.shixun-task-btn { display: inline-block;font-weight: bold;border: none;padding: 0 12px;color: #666;letter-spacing: 1px;text-align: center;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px; }

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext'
import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS} from 'educoder'
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC } from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -877,6 +877,7 @@ pop_box_new(htmlvalue, 480, 182);
return (
<TPIContext.Provider
value={{
...this.props,
...this.state,
resetTestSetsExpandedArray: this.resetTestSetsExpandedArray,
onRunCodeTestFinish: this.onRunCodeTestFinish,
@ -961,7 +962,7 @@ pop_box_new(htmlvalue, 480, 182);
}
}
export default withStyles(styles) (TPIContextProvider);
export default CNotificationHOC() (withStyles(styles) (TPIContextProvider));

@ -109,7 +109,7 @@ export function CNotificationHOC(options = {}) {
const { title, content,subContent, onOk, onCancel, okText } = object;
this.onCancel = onCancel
this.onOk = onOk
this.okText = okText || ''
this.okText = okText || '确定'
this.setState({ title, content , subContent , dialogOpen: true })
}
onDialogOkBtnClick = () => {
@ -146,7 +146,15 @@ export function CNotificationHOC(options = {}) {
return (
<React.Fragment>
<style>
{`
.confirmModal .task-popup-content {
padding: 0px;
}
`}
</style>
<Modals
className="confirmModal"
modalsType={dialogOpen}
modalsTopval={
content

@ -14,9 +14,6 @@ i.iconfont {
}
/* BASICS */
.editormd-preview ol li {
list-style-type: decimal ;
}
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
@ -1656,8 +1653,9 @@ input.ant-input-number-input:focus {
}
/* md代码类样式渲染 */
.markdown-body li{ list-style-type: disc!important;margin-bottom: 0!important; }
.markdown-body ol li{ list-style-type: decimal!important; }
.new_li .markdown-body ul > li{ list-style-type: disc!important;margin-bottom: 0!important; }
.new_li .markdown-body ol > li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
/* 有不少问题,没有出现'数据已于 09:24:53 保存'时靠太近,和红字提示重叠 */
.upload_under_markdown_editor {

@ -213,7 +213,7 @@ class AddStudentModal extends Component{
{/* <Divider /> */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<p className="clearfix mb2" style={{ margin: '0px 20px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'姓名'}</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'学号'}</span>
@ -224,7 +224,7 @@ class AddStudentModal extends Component{
<Spin size="large" spinning={isSpin}>
{ loading || users.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<div className="edu-back-skyblue padding10-15" style={{height:"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
@ -239,22 +239,17 @@ class AddStudentModal extends Component{
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl task-hide with25 ml5" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<span className="fl task-hide with25 ml5">
{ candidate.name ?
<a href={`/users/${candidate.login}`} target="_blank">
<a href={`/users/${candidate.login}`} title={candidate.name} target="_blank">
{ candidate.name }
</a> : <span> </span> }
</ConditionToolTip>
</a> : <span> </span> }
</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.student_id} condition={candidate.student_id && candidate.student_id.length > 12 }>
{candidate.student_id || ' '}
</ConditionToolTip>
<span className="fl task-hide with25" title={candidate.student_id} style={{ width: '145px' , height : "20px" }}>
{candidate.student_id || ' '}
</span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{candidate.school_name}</span>
<span className="fl task-hide with35" title={candidate.school_name} style={{ width: '204px' , height : "20px" }}>{candidate.school_name}</span>
<span className="fl task-hide with10" style={{"maxWidth":"48px", color: theme.foreground_select }}>{candidate.added ? '已加入' : ''}</span>
</p>
)
}) }

@ -262,7 +262,7 @@ class AddTeacherModal extends Component{
{/* graduation_groups && !!graduation_groups.length */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<p className="clearfix mb2" style={{ margin: '0px 20px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'姓名'}</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'昵称'}</span>
@ -287,20 +287,15 @@ class AddTeacherModal extends Component{
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl task-hide with25 ml5" style={{"maxWidth":"208px;"}}>
{/* "color":"#4c4c4c" */}
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<a href={`/users/${candidate.login}`} target="_blank"
style={{}}
>{candidate.name}</a>
</ConditionToolTip>
<span className="fl task-hide with25 ml5" style={{ width: '145px' , height : "20px" }}>
<a href={`/users/${candidate.login}`} target="_blank" title={candidate.name}>{candidate.name}</a>
</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
{candidate.nickname || ' '}
</ConditionToolTip>
<span className="fl task-hide with25" title={candidate.nickname} style={{ width: '145px' , height : "20px" }}>
{candidate.nickname}
</span>
<span className="fl task-hide with35" title={candidate.school_name} style={{ width: '145px' , height : "20px" }}>
{candidate.school_name}
</span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{candidate.school_name}</span>
<span className="fl task-hide with10 color-blue" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</span>
</p>
)

@ -13,6 +13,7 @@ render() {
const antIcons = <Icon type="loading" style={{ fontSize: 24 }} spin />
return(
<Modal
className={this.props.className}
keyboard={false}
title="提示"
visible={this.props.modalsType===undefined?false:this.props.modalsType}

@ -210,6 +210,8 @@ class Index extends Component {
{/* 区分下repo和evaluate模块的以及子模块的 */}
<MainContentContainer
confirm={context.confirm}
onDrawerButtonClick={this.onDrawerButtonClick}
grade={context.grade}
allowed_unlock={context.allowed_unlock}

@ -21,7 +21,8 @@ class VNCContainer extends Component {
this.state = {
fileTreeSelectedKeys: [],
repositoryCode: ''
repositoryCode: '',
displayKey: 1
}
}
componentDidMount() {
@ -114,6 +115,43 @@ class VNCContainer extends Component {
showCodeEvaluate = () => {
this.setState({ bottomDrawer: true })
}
onResetVNC = () => {
// 桌面系统将恢复到初始状态,您在系统中创建的数据可能会丢失
// 请确保您的数据已保存(如:版本库代码已推送到服务器)
// 是否确认重置?
this.props.confirm({
content: <div style={{textAlign: 'center'}}>
<div>桌面系统将恢复到初始状态您在系统中创建的数据可能会丢失</div>
<div>请确保您的数据已保存版本库代码已推送到服务器</div>
<div>是否确认重置</div>
</div>,
onOk: () => {
const url = `/tasks/${this.props.game.identifier}/reset_vnc_link.json`
axios.get(url, {
}).then((response) => {
if (response.data.data && response.data.data.vnc_url) {
// reset
this.setState({
displayKey: this.state.displayKey + 1,
vnc_url: response.data.data.vnc_url
})
} else {
}
// this.setState({ isEditablePath, currentPath: path });
}).catch(error =>{
console.log(error)
this.setState({ readingCodeLoading: false });
this.props.showSnackbar(`服务端异常,请联系管理员!`);
})
console.log('doooo')
},
onCancel() {
console.log('Cancel');
},
})
}
/*
selectedKeys={fileTreeSelectedKeys}
@ -191,6 +229,30 @@ class VNCContainer extends Component {
.codeInDrawer .ant-spin-nested-loading > div > .ant-spin .ant-spin-text {
text-shadow: none;
}
.resetVNC {
top: 30px;
writing-mode: initial;
left: calc(100% - 120px);
background-image: none;
width: auto;
background: #081516;
height: 30px;
padding: 0 6px;
border-radius: 4px;
}
.resetVNC .text {
top: 0px;
writing-mode: initial;
left: unset;
}
.resetVNC .text span {
vertical-align: middle;
margin-left: 2px;
}
.float_button:hover .text {
color: #4CACFF;
}
`}</style>
<div style={{ 'padding': '16px', 'border-bottom': '1px solid #3A383A' }}>
<div style={{ color: '#888888' }}>网址克隆</div>
@ -207,9 +269,14 @@ class VNCContainer extends Component {
></RepoTree>
</SecondDrawer>
{/* <FloatButton></FloatButton> */}
<FloatButton className="resetVNC" onClick={this.onResetVNC}>
<i className="iconfont icon-zhongzhi2 font-16 "></i>
<span>重置桌面系统</span>
</FloatButton>
<VNCDisplay
{...this.props}
key={this.state.displayKey}
vnc_url={this.state.vnc_url || this.props.vnc_url}
>
<Drawer

@ -6,6 +6,7 @@ const $ = window.$;
// const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
class VNCDisplay extends Component {
componentDidMount() {
console.log('vnc init')
console.log(RFB)
let rfb;

@ -9,7 +9,6 @@ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legen
table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5; color:#333;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;color:#898989; }
a:hover {color:#FF7500;}
a:hover.fa{color:#FF7500;}

@ -582,8 +582,8 @@ a.user_greybg_btn{background-color:#747A7F;color: #fff;}
/*md编辑器恢复被覆盖样式*/
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li .markdown-body ul > li{ list-style-type: disc!important;margin-bottom: 0!important; }
.new_li .markdown-body ol > li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
/*搜索框*/

Loading…
Cancel
Save