Sha256: 28dd7bcdde8e395d6b60463f6d71f9de89cdf417e4daf6b40b625bd901198655

Contents?: true

Size: 818 Bytes

Versions: 11

Compression:

Stored size: 818 Bytes

Contents

module PhantomProxy
  class StatusApi < AppRouterBase
    get "/phantom_proxy_control_panel(.:format)", :status_page

    get "*any", :next_api
    put "*any", :next_api
    delete "*any", :next_api
    head "*any", :next_api
    post "*any", :next_api

    json_var :uptime

    private
      def status_page
        case format
        when :json
          render_json
        when :xml
          render_xml
        else
          render "status_page"
        end
      end

      def name
        "Data"
      end
      def value
        @value||="none"
      end
      def uptime
        logger.info "Call Uptime"
        @uptime||=StatusInfo.uptime
      end
      def format
        if env[nil] && env[nil][:format]
          env[nil][:format].to_sym
        else
          :html
        end
      end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
phantom_proxy-1.4.0 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.12 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.11 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.10 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.9 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.8 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.7 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.6 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.5 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.3 lib/phantom_proxy/status/status_api.rb
phantom_proxy-1.3.0 lib/phantom_proxy/status/status_api.rb