mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-04 00:00:51 -04:00
Plugin download page WIP
This commit is contained in:
@@ -259,5 +259,24 @@ class APIRouter < Router
|
||||
}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
post "/api/admin/plugin/search" do |env|
|
||||
begin
|
||||
query = env.params.json["query"].as String
|
||||
plugin = Plugin.new env.params.json["plugin"].as String
|
||||
|
||||
chapters = plugin.search query
|
||||
|
||||
send_json env, {
|
||||
"success" => true,
|
||||
"chapters" => chapters,
|
||||
}.to_json
|
||||
rescue e
|
||||
send_json env, {
|
||||
"success" => false,
|
||||
"error" => e.message,
|
||||
}.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -78,6 +78,12 @@ class MainRouter < Router
|
||||
layout "download"
|
||||
end
|
||||
|
||||
get "/download/plugins" do |env|
|
||||
plugins = Plugin.list
|
||||
plugin = Plugin.new plugins[0]
|
||||
layout "plugin-download"
|
||||
end
|
||||
|
||||
get "/" do |env|
|
||||
begin
|
||||
username = get_username env
|
||||
|
||||
Reference in New Issue
Block a user