From ee8cbb85534d687a362cc78467674e5059e83f15 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 7 Aug 2020 14:34:26 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E8=B0=83=E6=95=B4=E4=BA=91=E4=B8=8A?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/settings_controller.rb | 2 -- app/models/laboratory.rb | 3 ++- app/views/admins/laboratories/index.html.erb | 4 ++-- .../shared/_laboratory_item.html.erb | 20 +++---------------- .../admins/laboratory_settings/show.html.erb | 2 +- app/views/settings/show.json.jbuilder | 4 +--- 6 files changed, 9 insertions(+), 26 deletions(-) diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index bb031c7b..896e2a52 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -1,6 +1,4 @@ class SettingsController < ApplicationController def show - @old_projects_url = nil - @old_projects_url = "https://www.trustie.net/users/#{current_user.try(:login)}/projects" if User.current.logged? end end diff --git a/app/models/laboratory.rb b/app/models/laboratory.rb index f53a2afe..7aea4254 100644 --- a/app/models/laboratory.rb +++ b/app/models/laboratory.rb @@ -22,9 +22,10 @@ class Laboratory < ApplicationRecord delegate :name, :navbar, :footer, :login_logo_url, :nav_logo_url, :tab_logo_url, :default_navbar, to: :laboratory_setting + # TODO 域名申请后更改 def site rails_env = EduSetting.get('rails_env') - suffix = rails_env && rails_env != 'production' ? ".#{rails_env}.trustie.net" : '.trustie.net' + suffix = rails_env && rails_env != 'production' ? "39.105.176.215" : '39.105.176.215' identifier ? "#{identifier}#{suffix}" : '' end diff --git a/app/views/admins/laboratories/index.html.erb b/app/views/admins/laboratories/index.html.erb index 397f50cb..771bc331 100644 --- a/app/views/admins/laboratories/index.html.erb +++ b/app/views/admins/laboratories/index.html.erb @@ -4,7 +4,7 @@
<%= form_tag(admins_laboratories_path(unsafe_params), method: :get, class: 'form-inline search-form flex-1', remote: true) do %> - <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-6 col-md-4 ml-3', placeholder: '学校名称/二级域名前缀检索') %> + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-6 col-md-4 ml-3', placeholder: '二级域名前缀检索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> <% end %> @@ -16,4 +16,4 @@
<%= render 'admins/laboratories/shared/create_laboratory_modal' %> -<%= render 'admins/laboratories/shared/add_laboratory_user_modal' %> \ No newline at end of file +<%= render 'admins/laboratories/shared/add_laboratory_user_modal' %> diff --git a/app/views/admins/laboratories/shared/_laboratory_item.html.erb b/app/views/admins/laboratories/shared/_laboratory_item.html.erb index 8fdf9c72..da080a51 100644 --- a/app/views/admins/laboratories/shared/_laboratory_item.html.erb +++ b/app/views/admins/laboratories/shared/_laboratory_item.html.erb @@ -1,9 +1,9 @@ <% school = laboratory&.school %> <%= list_index_no((params[:page] || 1).to_i, index) %> -<%= school&.name || 'Trustie主站' %> +<%= school&.name || '可控开源社区' %> <% if laboratory.identifier %> - <%= link_to laboratory.site, "https://#{laboratory.site}", target: '_blank' %> + <%= link_to laboratory.site, "http://#{laboratory.site}", target: '_blank' %> <% else %> -- <% end %> @@ -51,19 +51,5 @@ <% if school.present? && laboratory.id != 1 %> <%= javascript_void_link '添加管理员', class: 'action', data: { laboratory_id: laboratory.id, toggle: 'modal', target: '.admin-add-laboratory-user-modal' } %> <%= link_to '同步用户', synchronize_user_admins_laboratory_path(laboratory), remote: true, data: { confirm: '确认同步该单位下的所有用户到云上实验室吗?' }, class: 'action' %> -<% end %> - -
- <%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %> - -
+ <% end %> diff --git a/app/views/admins/laboratory_settings/show.html.erb b/app/views/admins/laboratory_settings/show.html.erb index ee9880fb..0ee1d1c0 100644 --- a/app/views/admins/laboratory_settings/show.html.erb +++ b/app/views/admins/laboratory_settings/show.html.erb @@ -184,4 +184,4 @@ <%= link_to '取消', admins_laboratories_path, class: 'btn btn-secondary px-4' %> <% end %> - \ No newline at end of file + diff --git a/app/views/settings/show.json.jbuilder b/app/views/settings/show.json.jbuilder index 939153c6..3d9d8561 100644 --- a/app/views/settings/show.json.jbuilder +++ b/app/views/settings/show.json.jbuilder @@ -45,7 +45,5 @@ json.setting do json.main_site current_laboratory.main_site? json.new_course default_course_links - json.old_projects_url @old_projects_url - -end \ No newline at end of file +end