index_mon_page.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "mon_page.h"
  3. #include <list>
  4. namespace NMonitoring {
  5. struct TIndexMonPage: public IMonPage {
  6. TMutex Mtx;
  7. using TPages = std::list<TMonPagePtr>;
  8. TPages Pages; // a list of pages to maintain specific order
  9. using TPagesByPath = THashMap<TString, TPages::iterator>;
  10. TPagesByPath PagesByPath;
  11. TIndexMonPage(const TString& path, const TString& title)
  12. : IMonPage(path, title)
  13. {
  14. }
  15. ~TIndexMonPage() override {
  16. }
  17. bool IsIndex() const override {
  18. return true;
  19. }
  20. void Output(IMonHttpRequest& request) override;
  21. void OutputIndexPage(IMonHttpRequest& request);
  22. virtual void OutputIndex(IOutputStream& out, bool pathEndsWithSlash);
  23. virtual void OutputCommonJsCss(IOutputStream& out);
  24. void OutputHead(IOutputStream& out);
  25. void OutputBody(IMonHttpRequest& out);
  26. void Register(TMonPagePtr page);
  27. TIndexMonPage* RegisterIndexPage(const TString& path, const TString& title);
  28. IMonPage* FindPage(const TString& relativePath);
  29. TIndexMonPage* FindIndexPage(const TString& relativePath);
  30. IMonPage* FindPageByAbsolutePath(const TString& absolutePath);
  31. void SortPages();
  32. void ClearPages();
  33. };
  34. }