module Sinatra::UC3HomeRoutes
client specific routes
Public Class Methods
Source
# File app/lib/routes/home.rb, line 55 def self.registered(app) app.get '/test/routes' do content_type :json UC3::TestClient.client.test_paths.to_json end app.get '/test/routes/links' do table = AdminUI::FilterTable.new( columns: [ AdminUI::Column.new(:link, header: 'Link') ] ) UC3::TestClient.client.test_paths.each do |route| table.add_row(AdminUI::Row.make_row(table.columns, { link: { value: route, href: route } })) end adminui_show_table( AdminUI::Context.new(request.path, request.params), table ) end app.get '/test/consistency' do content_type :json UC3::TestClient.client.consistency_checks.to_json end app.get '/test/consistency/links' do table = AdminUI::FilterTable.new( columns: [ AdminUI::Column.new(:link, header: 'Link') ] ) UC3::TestClient.client.consistency_checks.each do |route| table.add_row(AdminUI::Row.make_row(table.columns, { link: { value: route, href: route } })) end adminui_show_table( AdminUI::Context.new(request.path, request.params), table ) end app.get '/robots.txt' do content_type :text "User-agent: *\nDisallow: /" end app.get '/ops/cloudwatch' do redirect UC3::UC3Client.cloudwatch_home end app.get '/ops/cloudwatch/logs/*' do |service| redirect UC3::UC3Client.cloudwatch_subservice(service) end app.get '/ops/opensearch' do redirect ENV.fetch('OPENSEARCH_URL', '/') end app.get '/markdown/*' do |md| adminui_show_markdown( AdminUI::Context.new(request.path, request.params, show_formats: false), "app/markdown/mrt/#{md}" ) end app.get '/private/markdown/*' do |md| page = '' begin page = UC3S3::ConfigObjectsClient.client.get_doc_page(md) rescue StandardError => e logger.error "Error retrieving private doc page #{md}: #{e.message}" end adminui_show_markdown_text( AdminUI::Context.new(request.path, request.params, show_formats: false), page ) end app.get '/index.html' do redirect '/' end app.get '/version' do content_type :json `git log -1 --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",\ %n "committer": {%n "name": "%cn",%n "email": "%ce",%n "date": "%cd"%n },\ %n "message": "%s",%n "body": "%b",%n "tags": "%d"%n}' --date=iso --decorate=full` end end
Source
# File app/lib/routes/home.rb, line 34 def self.skipitem(skipitem) route = skipitem.fetch(:route, '') AdminUI::TopMenu.instance.skip_paths << route unless route.empty? skipitem.fetch(:items, []).each do |citem| route = citem.fetch(:route, '') AdminUI::TopMenu.instance.skip_paths << route unless route.empty? skipitem(citem) end end