diff --git a/app/views/managements/_departments_list.html.erb b/app/views/managements/_departments_list.html.erb
index 26bad842..f9ba8659 100644
--- a/app/views/managements/_departments_list.html.erb
+++ b/app/views/managements/_departments_list.html.erb
@@ -17,7 +17,7 @@
<% @department.each_with_index do |department,index| %>
<%= (@page -1) * @limit + index + 1 %>
- <%= department.name %>
+ <%= department.name %>
<%= School.where(:id => department.school_id).first %>
<%= UserExtensions.where(:department_id => department.id, :school_id => department.school_id ).count %>
<%= User.where(:id => UserExtensions.where(:department_id => department.id, :school_id => department.school_id).map(&:user_id),:professional_certification => 1).count %>
@@ -38,8 +38,9 @@
<%= format_time department.created_at %>
- 删除
+ 删除
<%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.id), :remote => true, :class => "application-default-link" %>
+ 修改
<% end %>
@@ -78,4 +79,11 @@
$("#update_host_count_depart_id").val(id);
$("input[name='host_count']").val($("#depart_host_count_"+id).html().trim());
}
+
+ function editDepartName(id){
+ var htmlvalue = "<%= escape_javascript(render :partial => 'managements/edit_depart_name') %>";
+ pop_box_new(htmlvalue,400,204);
+ $("#update_depart_name_depart_id").val(id);
+ $("input[name='depart_name']").val($("#department_name_"+id).html().trim());
+ }
diff --git a/app/views/managements/_edit_depart_name.html.erb b/app/views/managements/_edit_depart_name.html.erb
new file mode 100644
index 00000000..fadcf5a2
--- /dev/null
+++ b/app/views/managements/_edit_depart_name.html.erb
@@ -0,0 +1,15 @@
+
\ No newline at end of file
diff --git a/app/views/managements/update_depart_name.js.erb b/app/views/managements/update_depart_name.js.erb
new file mode 100644
index 00000000..24a2e19b
--- /dev/null
+++ b/app/views/managements/update_depart_name.js.erb
@@ -0,0 +1 @@
+$("#department_name_<%= @depart.id %>").html("<%= params[:depart_name] %>");
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index c9d01c3b..f5fafc29 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -629,6 +629,8 @@ RedmineApp::Application.routes.draw do ## oauth相关
match 'new_major', :via => [:get, :post]
post 'insert_major'
match 'update_department',:via => [:get, :post]
+ post 'update_depart_name'
+ get 'check_depart_name'
post 'edit_departments_school'
get 'create_departments'
post 'add_department'
diff --git a/public/500.html b/public/500.html
index b0dc43d7..674febcf 100644
--- a/public/500.html
+++ b/public/500.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/html4/loose.dtd">
-
Trustie 500 error
+
EduCoder 500 error
diff --git a/public/javascripts/edu/management.js b/public/javascripts/edu/management.js
index f8571035..e755c5fd 100644
--- a/public/javascripts/edu/management.js
+++ b/public/javascripts/edu/management.js
@@ -26,6 +26,27 @@ function submit_depart_host_count(){
}
}
+function submit_depart_name_form(){
+ if($("input[name='depart_name']").val().trim() == ""){
+ $("#update_depart_name_notice").html("名称不能为空").show();
+ } else {
+ $.ajax({
+ type: "GET",
+ url: '/managements/check_depart_name',
+ data: {depart_id: $("#update_depart_name_depart_id").val(), depart_name: $("input[name='depart_name']").val().trim()},
+ success: function (data) {
+ if(data.status == 0){
+ $("#update_depart_name_notice").hide();
+ $('#update_depart_name_form').submit();
+ hideModal();
+ } else{
+ $("#update_depart_name_notice").html("该名称已存在").show();
+ }
+ }
+ });
+ }
+}
+
/*--------------------------- 用户授权全选 -------------------------------*/
$("#all_member_select").live('click', function(){
if($("#all_member_select").is(':checked')){
diff --git a/public/react/public/js/js_min_all.js b/public/react/public/js/js_min_all.js
index 19daead5..0c139046 100644
--- a/public/react/public/js/js_min_all.js
+++ b/public/react/public/js/js_min_all.js
@@ -206,6 +206,7 @@ $(function(){
// window resize
$(window).on('resize', function() {
+ // _resizeVNC_if_needed()
$('.CodeMirror.cm-s-railscasts').css("height", $("#games_repository_contents").height() - repositoryTabHeight);
})
@@ -1182,6 +1183,7 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
dragging = true;
dragDom = lab;
$('#htmlIframe').css('pointer-events', 'none')
+ $('#can-drag').show()
return false;
}
);
@@ -1202,7 +1204,10 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
doc.live("mouseup", function(e) {
// 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326
+ $('#can-drag').hide()
+
if (dragging === true) {
+ // _resizeVNC_if_needed()
window.editor_CodeMirror && window.editor_CodeMirror.refresh()
// 使得iframe可以继续捕获事件
$('#htmlIframe').css('pointer-events', 'inherit')
@@ -1210,6 +1215,27 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
dragging = false;
});
})
+function _resizeVNC_if_needed() {
+ return;
+ if (window.__isVNC) {
+ // $('#screen>div').width('1024px').height('768px')
+ var trueHeight = $('#game_right_contents').height();
+ var width = $('#game_right_contents').width()
+
+ // __rfb && __rfb.get_display().autoscale(width, trueHeight)
+
+ return;
+ if (trueHeight < 768) {
+ var width = $('#game_right_contents').width()
+ var _left = width - $('#screen').width() / 2
+ var scale = (trueHeight / 768).toFixed(5)
+ // _left
+ $('#screen').css('transform', 'scale(' + scale + ', ' + scale +')').css('transform-origin', 0 + 'px 0px')
+ } else {
+ $('#screen').css('transform', 'scale(' + 1 + ', ' + 1 +')')
+ }
+ }
+}
// ---------------------------------------------------------------------------------------------
/**
diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js
index a0ac70f1..6902b7f2 100644
--- a/public/react/src/modules/page/MainContent.js
+++ b/public/react/src/modules/page/MainContent.js
@@ -46,7 +46,8 @@ class MainContent extends Component {
} else {
games_repository_contents_style = {overflow: 'hidden', height: '445px'}
}
- const showIframeContent = shixun && shixun.vnc == true
+ const showIframeContent = shixun && shixun.vnc == true
+ // window.__isVNC = showIframeContent && !!vnc_url
return (
@@ -55,6 +56,18 @@ class MainContent extends Component {
{/* 左侧任务说明等功能的区域 */}
+
+ {showIframeContent && vnc_url &&
}
diff --git a/public/react/src/modules/page/VNCDisplay.js b/public/react/src/modules/page/VNCDisplay.js
index 1e443ed1..57d26731 100644
--- a/public/react/src/modules/page/VNCDisplay.js
+++ b/public/react/src/modules/page/VNCDisplay.js
@@ -13,6 +13,7 @@ class VNCDisplay extends Component {
// When this function is called we have
// successfully connected to a server
function connectedToServer(e) {
+ $('#top_bar').hide()
status("Connected to " + desktopName);
}
// This function is called when we are disconnected
@@ -109,6 +110,8 @@ class VNCDisplay extends Component {
// Set parameters that can be changed on an active connection
rfb.viewOnly = readQueryVariable('view_only', false);
rfb.scaleViewport = readQueryVariable('scale', false);
+ rfb.resizeSession = true
+ window.__rfb = rfb;
}
render() {
@@ -116,7 +119,7 @@ class VNCDisplay extends Component {
return (
-