constants.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. import React from 'react'
  2. import Translate, {translate} from '@docusaurus/Translate'
  3. export const features = [{
  4. title: translate({
  5. message: '开箱即用'
  6. }),
  7. description: (
  8. <>
  9. <Translate values={{
  10. TANCLOUD: <strong>TANCLOUD</strong>,
  11. SAAS: <strong>SAAS</strong>,
  12. console: <a href={'https://www.console.tancloud.cn'}><strong>注册登陆</strong></a>,
  13. doc: <strong>文档</strong>,
  14. br: <br/>
  15. }}>
  16. {'中小团队和个人无需再为了监控自己的网站资源,而去部署一套繁琐的监控系统。往往有时候,那套监控系统比自身网站消耗的资源还大。' +
  17. '{TANCLOUD} 提供{SAAS}云版本,{console}即可开始您的服务监控。{br}' +
  18. '安全是最重要的,我们对账户密钥和监控密钥全链路加密。'
  19. }
  20. </Translate>
  21. </>
  22. ),
  23. }, {
  24. title: translate({
  25. message: '多支持与自定义'
  26. }),
  27. description: (
  28. <>
  29. <Translate values={{
  30. WebSockets: <strong>WebSockets</strong>,
  31. Servlet: <strong>Servlet</strong>,
  32. JaxRs: <strong>JAX-RS</strong>,
  33. custom: <a href={'/docs/advanced/extend-point'}><strong>自定义监控</strong></a>,
  34. br: <br/>
  35. }}>
  36. {'TANCLOUD目前支持对网站,API,PING连通性,端口可用性,MYSQL数据库等的监控,不久我们将兼容 prometheus 协议,提供更多的监控类型和性能指标。{br}' +
  37. '我们提供了更自由化的阈值告警配置,支持邮箱,短信,webhook等告警通知,更多三方应用通知正在集成中。{br}' +
  38. '不同团队的监控需求千变万化,我们提供{custom},仅需配置YML就能快速接入监控系统。'
  39. }
  40. </Translate>
  41. </>
  42. ),
  43. },
  44. {
  45. title: translate({
  46. message: '拥抱开源'
  47. }),
  48. description: (
  49. <>
  50. <Translate values={{
  51. github: <a href={'https://github.com/dromara/hertzbeat'}><strong>HertzBeat Github 代码仓库</strong></a>,
  52. gitee: <a href={'https://gitee.com/dromara/hertzbeat'}><strong>HertzBeat Gitee 代码仓库</strong></a>,
  53. br: <br/>
  54. }}>
  55. {'TANCLOUD监控系统代码开源,非常欢迎任何对此有兴趣的同学参与中来,我们一起进步,丰富的资源文档正在完善中。{br}' +
  56. '中二的我们相信开源改变世界!{br}' +
  57. '{github} {br}' +
  58. '{gitee}'
  59. }
  60. </Translate>
  61. </>
  62. ),
  63. }]
  64. export const friendLinks = [
  65. {
  66. img: 'ShenYu_logo.png',
  67. alt: 'ShenYu',
  68. url: 'https://dromara.org/projects/soul/overview/'
  69. }, {
  70. img: 'maxkey_logo.png',
  71. alt: 'MaxKey',
  72. url: 'https://maxkey.top/'
  73. }, {
  74. img: 'tlog_logo.png',
  75. alt: 'TLog',
  76. url: 'https://yomahub.com/tlog/'
  77. }, {
  78. img: 'hutool_logo.jpg',
  79. alt: 'Hutool',
  80. url: 'https://hutool.cn/'
  81. }, {
  82. img: 'satoken_logo.png',
  83. alt: 'Sa-Token',
  84. url: 'http://sa-token.dev33.cn/'
  85. }, {
  86. img: 'justauth_logo.png',
  87. alt: 'Justauth',
  88. url: 'https://justauth.wiki/'
  89. }, {
  90. img: 'pha_logo.jfif',
  91. alt: 'pha_api',
  92. url: 'https://www.phalapi.net/'
  93. }, {
  94. img: 'liteflow_logo.png',
  95. alt: 'LiteFlow',
  96. url: 'https://yomahub.com/liteflow/'
  97. }
  98. ]
  99. export const mediaPartners = [
  100. {
  101. img: 'dromara_qr.png',
  102. alt: 'Dromara',
  103. url: 'https://mp.weixin.qq.com/s/Q3b7ZE802IMF6MwIPJIGQA'
  104. },
  105. {
  106. img: 'JavaHouDuan_logo.png',
  107. alt: 'JavaHouDuan',
  108. url: 'https://mp.weixin.qq.com/s/Ylq51a7Av8ZRuH811xZnDA'
  109. }
  110. ]
  111. export const SetupExample = `
  112. <dependency>
  113. <groupId>com.usthe.sureness</groupId>
  114. <artifactId>sureness-core</artifactId>
  115. <version>1.0.6</version>
  116. </dependency>
  117. compile group: 'com.usthe.sureness', name: 'sureness-core', version: '1.0.6'
  118. `
  119. export const SurenessIntegration = `
  120. @Override
  121. public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
  122. throws IOException, ServletException {
  123. try {
  124. SubjectSum subject = SurenessSecurityManager.getInstance().checkIn(servletRequest);
  125. } catch (IncorrectCredentialsException | UnknownAccountException | ExpiredCredentialsException e1) {
  126. logger.debug("this request account info is illegal");
  127. responseWrite(ResponseEntity
  128. .status(HttpStatus.UNAUTHORIZED).body(e1.getMessage()), servletResponse);
  129. return;
  130. } catch (UnauthorizedException e4) {
  131. logger.debug("this account can not access this resource");
  132. responseWrite(ResponseEntity
  133. .status(HttpStatus.FORBIDDEN).body(e4.getMessage()), servletResponse);
  134. return;
  135. } catch (RuntimeException e) {
  136. logger.error("other exception happen: ", e);
  137. responseWrite(ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build(),
  138. servletResponse);
  139. return;
  140. }
  141. filterChain.doFilter(servletRequest, servletResponse);
  142. }
  143. `