resource_mon_page.h 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "mon_page.h"
  3. #include <library/cpp/resource/resource.h>
  4. namespace NMonitoring {
  5. struct TResourceMonPage: public IMonPage {
  6. public:
  7. enum EResourceType {
  8. BINARY,
  9. TEXT,
  10. JSON,
  11. CSS,
  12. JAVASCRIPT,
  13. FONT_EOT,
  14. FONT_TTF,
  15. FONT_WOFF,
  16. FONT_WOFF2,
  17. PNG,
  18. SVG
  19. };
  20. TResourceMonPage(const TString& path, const TString& resourceName,
  21. const EResourceType& resourceType = BINARY, const bool isCached = false)
  22. : IMonPage(path, "")
  23. , ResourceName(resourceName)
  24. , ResourceType(resourceType)
  25. , IsCached(isCached)
  26. {
  27. }
  28. void Output(NMonitoring::IMonHttpRequest& request) override;
  29. void NotFound(NMonitoring::IMonHttpRequest& request) const;
  30. private:
  31. TString ResourceName;
  32. EResourceType ResourceType;
  33. bool IsCached;
  34. };
  35. }