The web based syslog https://lggr.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
3.5KB

  1. <?php
  2. class LggrState {
  3. const SESSIONNAME = 'LggrState';
  4. const PAGELEN = 100;
  5. private $bLocalCall = false;
  6. private $bSearch = false;
  7. private $sSearch = null;
  8. private $sSearchProg = null;
  9. private $iPage = 0;
  10. private $sHostName = null;
  11. private $iHost = 0;
  12. private $sLevel = null;
  13. private $iRange = 24;
  14. // default 24h = today, sort of
  15. private $bFromTo = false;
  16. private $tsFrom = null;
  17. private $tsTo = null;
  18. private $iResultSize = 0;
  19. // result size of last query
  20. private $bPanelOpen = false;
  21. function __construct() {
  22. $this->bLocalCall = false;
  23. $this->iPage = 0;
  24. $this->bSearch = false;
  25. $this->sSearch = null;
  26. $this->bSearchProg = false;
  27. $this->sSearchProg = null;
  28. $this->sHostName = null;
  29. $this->iHost = 0;
  30. $this->sLevel = null;
  31. $this->iRange = 24;
  32. $this->bFromTo = false;
  33. $this->tsFrom = null;
  34. $this->tsTo = null;
  35. $this->iResultSize = 0;
  36. $this->bPanelOpen = false;
  37. }
  38. // constructor
  39. public function setSearch($s) {
  40. if (null != $s) {
  41. $this->bSearch = true;
  42. $this->sSearch = $s;
  43. }
  44. }
  45. public function isSearch() {
  46. return $this->bSearch;
  47. }
  48. public function getSearch() {
  49. return $this->sSearch;
  50. }
  51. public function setSearchProg($s) {
  52. if (null != $s) {
  53. $this->bSearch = true;
  54. $this->sSearchProg = $s;
  55. } // if
  56. }
  57. public function getSearchProg() {
  58. return $this->sSearchProg;
  59. }
  60. public function setPage($i) {
  61. $this->iPage = $i;
  62. }
  63. public function getPage() {
  64. return $this->iPage;
  65. }
  66. public function setHostName($s) {
  67. $this->sHostName = $s;
  68. }
  69. public function getHostName() {
  70. return $this->sHostName;
  71. }
  72. public function setHostId($id) {
  73. $this->iHost = $id;
  74. }
  75. public function getHostId() {
  76. return $this->iHost;
  77. }
  78. public function isHost() {
  79. return 0 != $this->iHost;
  80. }
  81. public function setLevel($s) {
  82. $this->sLevel = $s;
  83. }
  84. public function getLevel() {
  85. return $this->sLevel;
  86. }
  87. public function isLevel() {
  88. return null != $this->sLevel;
  89. }
  90. public function setRange($i) {
  91. $this->iRange = $i;
  92. }
  93. public function getRange() {
  94. return $this->iRange;
  95. }
  96. public function setFromTo($tsFrom, $tsTo) {
  97. if (null == $tsFrom && null == $tsTo) {
  98. $this->bFromTo = false;
  99. } else {
  100. $this->bFromTo = true;
  101. } // if
  102. $this->tsFrom = $tsFrom;
  103. $this->tsTo = $tsTo;
  104. }
  105. public function isFromTo() {
  106. return $this->bFromTo;
  107. }
  108. public function getFrom() {
  109. return $this->tsFrom;
  110. }
  111. public function getTo() {
  112. return $this->tsTo;
  113. }
  114. public function setResultSize($i) {
  115. $this->iResultSize = $i;
  116. }
  117. public function getResultSize() {
  118. return $this->iResultSize;
  119. }
  120. public function setLocalCall($b) {
  121. $this->bLocalCall = $b;
  122. }
  123. public function isLocalCall() {
  124. return $this->bLocalCall;
  125. }
  126. public function setPanelOpen($b) {
  127. $this->bPanelOpen = $b;
  128. }
  129. public function isPanelOpen() {
  130. return $this->bPanelOpen;
  131. }
  132. } // class
Social stuff:
Mastodon