|
|
@ -69,7 +69,10 @@ class GamesController < ApplicationController
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
|
|
|
|
# 无域名版本
|
|
|
|
|
|
|
|
#@vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
|
|
|
|
|
|
|
|
# 有域名版本
|
|
|
|
|
|
|
|
@vnc_url = "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -593,7 +596,7 @@ class GamesController < ApplicationController
|
|
|
|
:times => params[:first].to_i, :podType => @shixun.webssh, :content_modified => content_modified,
|
|
|
|
:times => params[:first].to_i, :podType => @shixun.webssh, :content_modified => content_modified,
|
|
|
|
:containers => "#{Base64.urlsafe_encode64(shixun_container_limit(@shixun))}",
|
|
|
|
:containers => "#{Base64.urlsafe_encode64(shixun_container_limit(@shixun))}",
|
|
|
|
:persistenceName => @shixun.identifier, :tpmScript => "#{tpmScript}", :sec_key => sec_key,
|
|
|
|
:persistenceName => @shixun.identifier, :tpmScript => "#{tpmScript}", :sec_key => sec_key,
|
|
|
|
:timeLimit => "#{game_challenge.exec_time}", :isPublished => (@shixun.status < 2 ? 0 : 1) }
|
|
|
|
:timeLimit => game_challenge.exec_time, :isPublished => (@shixun.status < 2 ? 0 : 1) }
|
|
|
|
|
|
|
|
|
|
|
|
# 评测有文件输出的需要特殊传字段 path:表示文件存储的位置
|
|
|
|
# 评测有文件输出的需要特殊传字段 path:表示文件存储的位置
|
|
|
|
br_params['file'] = Base64.urlsafe_encode64({path: "#{game_challenge.picture_path}"}.to_json) if game_challenge.picture_path.present?
|
|
|
|
br_params['file'] = Base64.urlsafe_encode64({path: "#{game_challenge.picture_path}"}.to_json) if game_challenge.picture_path.present?
|
|
|
|