You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
|
|
class JupytersController < ApplicationController
|
|
include JupyterService
|
|
|
|
before_action :shixun, only: [:open, :open1, :test, :save]
|
|
|
|
def save_with_tpi
|
|
myshixun = Myshixun.find_by(identifier: params[:identifier])
|
|
jupyter_save_with_game(myshixun, params[:jupyter_port])
|
|
render json: {status: 0}
|
|
end
|
|
|
|
def save_with_tpm
|
|
shixun = Shixun.find_by(identifier: params[:identifier])
|
|
jupyter_save_with_shixun(shixun, params[:jupyter_port])
|
|
render json: {status: 0}
|
|
end
|
|
|
|
def get_info_with_tpi
|
|
myshixun = Myshixun.find_by(identifier: params[:identifier])
|
|
url = jupyter_url_with_game(myshixun)
|
|
port = jupyter_port_with_game(myshixun)
|
|
render json: {status: 0, url: url, port: port}
|
|
end
|
|
|
|
def get_info_with_tpm
|
|
shixun = Shixun.find_by(identifier: params[:identifier])
|
|
url = jupyter_url_with_shixun(shixun)
|
|
port = jupyter_port_with_shixun(shixun)
|
|
render json: {status: 0, url: url, port: port}
|
|
end
|
|
|
|
|
|
end |