25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

index.js 4.5 KiB

4 yıl önce
4 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /**
  2. * Copyright (c) 2017-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. const React = require('react');
  8. const CompLibrary = require('../../core/CompLibrary.js');
  9. const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
  10. const Container = CompLibrary.Container;
  11. const GridBlock = CompLibrary.GridBlock;
  12. class HomeSplash extends React.Component {
  13. render() {
  14. const {siteConfig, language = ''} = this.props;
  15. const {baseUrl, docsUrl} = siteConfig;
  16. const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
  17. const langPart = `${language ? `${language}/` : ''}`;
  18. const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`;
  19. const SplashContainer = props => (
  20. <div className="homeContainer">
  21. <div className="homeSplashFade">
  22. <div className="wrapper homeWrapper">{props.children}</div>
  23. </div>
  24. </div>
  25. );
  26. const Logo = props => (
  27. <div className="projectLogo">
  28. <img src={props.img_src} alt="Project Logo" />
  29. </div>
  30. );
  31. const ProjectTitle = props => (
  32. <h2 className="projectTitle">
  33. {props.title}
  34. <small>{props.tagline}</small>
  35. </h2>
  36. );
  37. const PromoSection = props => (
  38. <div className="section promoSection">
  39. <div className="promoRow">
  40. <div className="pluginRowBlock">{props.children}</div>
  41. </div>
  42. </div>
  43. );
  44. const Button = props => (
  45. <div className="pluginWrapper buttonWrapper">
  46. <a className="button" href={props.href} target={props.target}>
  47. {props.children}
  48. </a>
  49. </div>
  50. );
  51. return (
  52. <SplashContainer>
  53. <Logo img_src={`${baseUrl}img/diagrams.png`} />
  54. <div className="inner">
  55. <ProjectTitle tagline={siteConfig.tagline} title={siteConfig.title} />
  56. <PromoSection>
  57. <Button href={docUrl('getting-started/installation')}>Try It Out</Button>
  58. <Button href={docUrl('getting-started/examples')}>Show Examples</Button>
  59. </PromoSection>
  60. </div>
  61. </SplashContainer>
  62. );
  63. }
  64. }
  65. class Index extends React.Component {
  66. render() {
  67. const {config: siteConfig, language = ''} = this.props;
  68. const {baseUrl} = siteConfig;
  69. const Block = props => (
  70. <Container
  71. padding={['bottom', 'top']}
  72. id={props.id}
  73. background={props.background}>
  74. <GridBlock
  75. align="center"
  76. contents={props.children}
  77. layout={props.layout}
  78. />
  79. </Container>
  80. );
  81. const About = () => (
  82. <div
  83. className="productShowcaseSection paddingBottom"
  84. style={{textAlign: 'center'}}>
  85. <h2>About Diagrams</h2>
  86. <MarkdownBlock>
  87. Diagrams lets you draw the cloud system architecture **in Python code**.
  88. </MarkdownBlock>
  89. <MarkdownBlock>
  90. It was born for **prototyping** a new system architecture without any design tools. You can also describe or visualize the existing system architecture as well.
  91. </MarkdownBlock>
  92. <MarkdownBlock>
  93. `Diagram as Code` allows you to **track** the architecture diagram changes in any **version control** system.
  94. </MarkdownBlock>
  95. <MarkdownBlock>
  96. Diagrams currently supports six major providers: `AWS`, `Azure`, `GCP`, `Kubernetes`, `Alibaba Cloud` and `Oracle Cloud`. It now also supports `On-Premise` nodes as well as `Programming Languages` and `Frameworks`.
  97. </MarkdownBlock>
  98. </div>
  99. );
  100. const Example = () => (
  101. <Block>
  102. {[
  103. {
  104. image: `${baseUrl}img/message_collecting_code.png`,
  105. imageAlign: 'left',
  106. },
  107. {
  108. image: `${baseUrl}img/message_collecting_diagram.png`,
  109. imageAlign: 'right',
  110. },
  111. ]}
  112. </Block>
  113. );
  114. const Example2 = () => (
  115. <Block>
  116. {[
  117. {
  118. image: `${baseUrl}img/event_processing_code.png`,
  119. imageAlign: 'left',
  120. },
  121. {
  122. image: `${baseUrl}img/event_processing_diagram.png`,
  123. imageAlign: 'right',
  124. },
  125. ]}
  126. </Block>
  127. );
  128. return (
  129. <div>
  130. <HomeSplash siteConfig={siteConfig} language={language} />
  131. <div className="mainContainer">
  132. <About />
  133. <Example />
  134. <Example2 />
  135. </div>
  136. </div>
  137. );
  138. }
  139. }
  140. module.exports = Index;