Browse Source

FIX 更改云上实验室主站配置

tags/v1
Jasder 6 years ago
parent
commit
260e6f8932
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      app/models/laboratory.rb
  2. +1
    -1
      app/views/admins/laboratories/shared/_laboratory_item.html.erb

+ 2
- 2
app/models/laboratory.rb View File

@@ -24,7 +24,7 @@ class Laboratory < ApplicationRecord

def site
rails_env = EduSetting.get('rails_env')
suffix = rails_env && rails_env != 'production' ? ".#{rails_env}.educoder.net" : '.educoder.net'
suffix = rails_env && rails_env != 'production' ? ".#{rails_env}.trustie.net" : '.trustie.net'

identifier ? "#{identifier}#{suffix}" : ''
end
@@ -126,4 +126,4 @@ class Laboratory < ApplicationRecord
def main_site?
id == 1
end
end
end

+ 1
- 1
app/views/admins/laboratories/shared/_laboratory_item.html.erb View File

@@ -1,6 +1,6 @@
<% school = laboratory&.school %>
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left"><%= school&.name || 'EduCoder主站' %></td>
<td class="text-left"><%= school&.name || 'Trustie主站' %></td>
<td class="text-left">
<% if laboratory.identifier %>
<%= link_to laboratory.site, "https://#{laboratory.site}", target: '_blank' %>


Loading…
Cancel
Save