mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 05:02:50 +08:00
Merge pull request #3415 from okriuchykhin/ok_SCI_5844
Add biomolecular toolkit license endpoint [SCI-5844]
This commit is contained in:
commit
0459602327
3 changed files with 15 additions and 3 deletions
|
@ -4,10 +4,10 @@ class BioEddieAssetsController < ApplicationController
|
|||
include BioEddieActions
|
||||
include ActiveStorage::SetCurrent
|
||||
|
||||
before_action :load_vars, except: %i(create bmt_request)
|
||||
before_action :load_vars, except: %i(create bmt_request license)
|
||||
before_action :load_create_vars, only: :create
|
||||
|
||||
before_action :check_read_permission, except: %i(update create start_editing bmt_request)
|
||||
before_action :check_read_permission, except: %i(update create start_editing bmt_request license)
|
||||
before_action :check_edit_permission, only: %i(update create start_editing)
|
||||
|
||||
def create
|
||||
|
@ -43,8 +43,17 @@ class BioEddieAssetsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def license
|
||||
license_file_path = Rails.root.join('data/bioeddie/license.cxl')
|
||||
if File.file?(license_file_path)
|
||||
send_file(license_file_path)
|
||||
else
|
||||
render_404
|
||||
end
|
||||
end
|
||||
|
||||
def bmt_request
|
||||
return_404 unless ENV['BIOMOLECULE_TOOLKIT_BASE_URL']
|
||||
return render_404 unless ENV['BIOMOLECULE_TOOLKIT_BASE_URL']
|
||||
|
||||
uri = URI.parse(ENV['BIOMOLECULE_TOOLKIT_BASE_URL'])
|
||||
uri.path = request.original_fullpath.remove('/biomolecule_toolkit')
|
||||
|
|
|
@ -774,6 +774,9 @@ Rails.application.routes.draw do
|
|||
end
|
||||
|
||||
resources :bio_eddie_assets, only: %i(create update) do
|
||||
collection do
|
||||
get :license
|
||||
end
|
||||
member do
|
||||
post :start_editing
|
||||
end
|
||||
|
|
0
data/bioeddie/.keep
Normal file
0
data/bioeddie/.keep
Normal file
Loading…
Reference in a new issue