|
|
@ -68,13 +68,11 @@ class GamesController < ApplicationController
|
|
|
|
service_host = edu_setting('vnc_url')
|
|
|
|
service_host = edu_setting('vnc_url')
|
|
|
|
uri = "#{shixun_tomcat}/bridge/vnc/getvnc"
|
|
|
|
uri = "#{shixun_tomcat}/bridge/vnc/getvnc"
|
|
|
|
params = {tpiID: @myshixun.id, :containers => "#{Base64.urlsafe_encode64(container_limit(@shixun.mirror_repositories))}"}
|
|
|
|
params = {tpiID: @myshixun.id, :containers => "#{Base64.urlsafe_encode64(container_limit(@shixun.mirror_repositories))}"}
|
|
|
|
logger.info("#######_------uri:#{uri}, params: #{params}")
|
|
|
|
|
|
|
|
res = uri_post uri, params
|
|
|
|
res = uri_post uri, params
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@url = "http://#{service_host}:#{res['port']}}/vnc_lite.html?password=headless"
|
|
|
|
@url = "http://#{service_host}:#{res['port']}}/vnc_lite.html?password=headless"
|
|
|
|
Rails.logger.info("66666666sssssss#{url}")
|
|
|
|
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
end
|
|
|
|
end
|
|
|
|