vnc在gamesow中自动调用

pre_develop
jingquan huang 6 years ago
parent 03843caf39
commit 1f34e30a28

@ -10,6 +10,10 @@ class MyshixunsController < ApplicationController
include ApplicationHelper include ApplicationHelper
def archive
end
def forbidden def forbidden
render_403 render_403
return return

@ -77,6 +77,23 @@ class GamesService
:image_url => image_url, :user_url => user_url, :praise_count => praise_count, :user_praise => user_praise, :time_limit => time_limit, :image_url => image_url, :user_url => user_url, :praise_count => praise_count, :user_praise => user_praise, :time_limit => time_limit,
:tomcat_url => Redmine::Configuration['tomcat_php'], :is_teacher => is_teacher, :power => power, :myshixun_manager => myshixun_manager, :tomcat_url => Redmine::Configuration['tomcat_php'], :is_teacher => is_teacher, :power => power, :myshixun_manager => myshixun_manager,
:vnc => shixun.vnc} :vnc => shixun.vnc}
if shixun.vnc
begin
shixun_tomcat = Redmine::Configuration['shixun_tomcat']
service_host = Redmine::Configuration['tomcat_php']
uri = "#{shixun_tomcat}/bridge/vnc/getvnc"
params = {tpiID: myshixun.id, :containers => "#{Base64.urlsafe_encode64(container_limit(shixun.mirror_repositories))}"}
res = uri_exec uri, params
if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级99")
end
url = service_host +":#{res['port']}/vnc.html"
rescue Exception => e
logger.error(e.message)
end
container = container.merge(:vnc_url => url)
end
# 区分选择题和编程题st0编程题 # 区分选择题和编程题st0编程题
if st == 0 if st == 0

Loading…
Cancel
Save