You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/01/08 04:11:35 UTC

[incubator-dolphinscheduler-website] branch master updated: Modify the official website menu (#253)

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 349d3f6  Modify the official website menu (#253)
349d3f6 is described below

commit 349d3f66f295772ed40424c0336f03eeb6aa3f5e
Author: break60 <79...@qq.com>
AuthorDate: Fri Jan 8 12:11:29 2021 +0800

    Modify the official website menu (#253)
    
    * Modified version number
    
    * Document quick start link replaced with 1.3.4
    
    * Modify the official website menu
    
    * fix
---
 src/components/header/index.jsx  | 180 ++++++++++++++++++++++++++++++++++-----
 src/components/header/index.scss |  81 +++++++++++++-----
 2 files changed, 221 insertions(+), 40 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index df1b81f..8479dbf 100755
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -56,6 +56,7 @@ class Header extends React.Component {
       inputVisible: false,
     };
   }
+
   componentDidMount() {
     if(localStorage.getItem("currents") == null) {
       this.setState({
@@ -146,6 +147,7 @@ class Header extends React.Component {
   render() {
     const { type, logo, onLanguageChange, currentKey } = this.props;
     const { menuBodyVisible, language, search, searchVisible } = this.state;
+    
     return (
       <header
         className={
@@ -211,25 +213,165 @@ class Header extends React.Component {
               src={type === 'primary' ? getLink('/img/system/menu_white.png') : getLink('/img/system/menu_gray.png')}
             />
             <div>
-            <Menu className={type === 'primary'? 'whiteClass': 'blackClass'} onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
-            {siteConfig[language].pageMenu.map(item => (
-              item.children ? <SubMenu
-              title={
-                <span className="submenu-title-wrapper">
-                  <a href={getLink(item.link)} target={item.target || '_self'}>{item.text}</a>
-                </span>
-              }
-            >
-            <Menu.ItemGroup>
-            {item.children.map(items => (
-              <Menu.Item key={items.key} ><a href={getLink(items.link)} target={items.target || '_self'}>{items.text}</a></Menu.Item>
-            ))}
-            </Menu.ItemGroup>
-          </SubMenu> : <Menu.Item key={item.key}>
-              <a href={getLink(item.link)} target={item.target || '_self'}>{item.text}</a>
-            </Menu.Item>
-            ))}
-          </Menu>
+              {/* {language==='zh-cn'? <Menu className={type === 'primary'? 'whiteClass': 'blackClass'} onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
+                <Menu.Item key='home'>
+                  <a href={getLink('/zh-cn/index.html')}>首页</a>
+                </Menu.Item>
+                <SubMenu
+                  title={
+                    <span className="submenu-title-wrapper">
+                      <a href={getLink('/zh-cn/docs/1.3.4/user_doc/quick-start.html')}>文档</a>
+                    </span>
+                  }
+                >
+                  <Menu.ItemGroup>
+                    <Menu.Item key='docs1' ><a href={getLink('http://'+window.location.host+'/zh-cn/docs/1.3.4/user_doc/quick-start.html')}>1.3.4(推荐)</a></Menu.Item>
+                    <Menu.Item key='docs2' ><a href={getLink('http://'+window.location.host+'/zh-cn/docs/1.3.3/user_doc/quick-start.html')}>1.3.3</a></Menu.Item>
+                    <Menu.Item key='docs3' ><a href={getLink('http://'+window.location.host+'zh-cn/docs/1.3.2/user_doc/quick-start.html')}>1.3.2</a></Menu.Item>
+                    <Menu.Item key='docs4' ><a href={getLink('http://'+window.location.host+'zh-cn/docs/1.3.1/user_doc/quick-start.html')}>1.3.1</a></Menu.Item>
+                    <Menu.Item key='docs5' ><a href={getLink('http://'+window.location.host+'zh-cn/docs/1.2.1/user_doc/quick-start.html')}>1.2.1</a></Menu.Item>
+                    <Menu.Item key='docs6' ><a href={getLink('http://'+window.location.host+'zh-cn/docs/1.2.0/user_doc/quick-start.html')}>1.2.0</a></Menu.Item>
+                    <Menu.Item key='docs7' ><a href={getLink('https://analysys.github.io/easyscheduler_docs_cn/')}>1.1.0(Not Apache Release)</a></Menu.Item>
+                  </Menu.ItemGroup>
+                </SubMenu>
+                <Menu.Item key='download'>
+                  <a href={getLink('/zh-cn/docs/release/download.html')}>下载</a>
+                </Menu.Item>
+                <Menu.Item key='blog'>
+                  <a href={getLink('/zh-cn/blog/index.html')}>博客</a>
+                </Menu.Item>
+                <Menu.Item key='development'>
+                  <a href={getLink('/zh-cn/docs/development/subscribe.html')}>开发者</a>
+                </Menu.Item>
+                <Menu.Item key='community'>
+                  <a href={getLink('/zh-cn/community/index.html')}>社区</a>
+                </Menu.Item>
+                <SubMenu
+                  title={
+                    <span className="submenu-title-wrapper">
+                      <a href={getLink('https://www.apache.org/')} target='_blank'>ASF</a>
+                    </span>
+                  }
+                >
+                  <Menu.ItemGroup>
+                    <Menu.Item key='Foundation' ><a href='https://www.apache.org/' target='_blank'>Foundation</a></Menu.Item>
+                    <Menu.Item key='License' ><a href='https://www.apache.org/licenses/' target='_blank'>License</a></Menu.Item>
+                    <Menu.Item key='Events' ><a href='https://www.apache.org/events/current-event' target='_blank'>Events</a></Menu.Item>
+                    <Menu.Item key='Security' ><a href='https://www.apache.org/security/' target='_blank'>Security</a></Menu.Item>
+                    <Menu.Item key='Sponsorship' ><a href='https://www.apache.org/foundation/sponsorship.html' target='_blank'>Sponsorship</a></Menu.Item>
+                    <Menu.Item key='Thanks' ><a href='https://www.apache.org/foundation/thanks.html' target='_blank'>Thanks</a></Menu.Item>
+                  </Menu.ItemGroup>
+                </SubMenu>
+              </Menu> : <Menu className={type === 'primary'? 'whiteClass': 'blackClass'} onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
+                <Menu.Item key='home'>
+                  <a href={getLink('/en-us/index.html')}>HOME</a>
+                </Menu.Item>
+                <SubMenu
+                  title={
+                    <span className="submenu-title-wrapper">
+                      <a href={getLink('/en-us/docs/1.3.4/user_doc/quick-start.html')}>DOCS</a>
+                    </span>
+                  }
+                >
+                  <Menu.ItemGroup>
+                    <Menu.Item key='docs1' ><a href={getLink('http://'+window.location.host+'/en-us/docs/1.3.4/user_doc/quick-start.html')}>1.3.4(Recommend)</a></Menu.Item>
+                    <Menu.Item key='docs2' ><a href={getLink('http://'+window.location.host+'/en-us/docs/1.3.3/user_doc/quick-start.html')}>1.3.3</a></Menu.Item>
+                    <Menu.Item key='docs3' ><a href={getLink('http://'+window.location.host+'en-us/docs/1.3.2/user_doc/quick-start.html')}>1.3.2</a></Menu.Item>
+                    <Menu.Item key='docs4' ><a href={getLink('http://'+window.location.host+'en-us/docs/1.3.1/user_doc/quick-start.html')}>1.3.1</a></Menu.Item>
+                    <Menu.Item key='docs5' ><a href={getLink('http://'+window.location.host+'en-us/docs/1.2.1/user_doc/quick-start.html')}>1.2.1</a></Menu.Item>
+                    <Menu.Item key='docs6' ><a href={getLink('http://'+window.location.host+'en-us/docs/1.2.0/user_doc/quick-start.html')}>1.2.0</a></Menu.Item>
+                    <Menu.Item key='docs7' ><a href={getLink('http://'+window.location.host+'https://analysys.github.io/easyscheduler_docs_cn/')}>1.1.0(Not Apache Release)</a></Menu.Item>
+                  </Menu.ItemGroup>
+                </SubMenu>
+                <Menu.Item key='download'>
+                  <a href={getLink('/en-us/docs/release/download.html')}>DOWNLOAD</a>
+                </Menu.Item>
+                <Menu.Item key='blog'>
+                  <a href={getLink('/en-us/blog/index.html')}>BLOG</a>
+                </Menu.Item>
+                <Menu.Item key='development'>
+                  <a href={getLink('/en-us/docs/development/subscribe.html')}>DEVELOPMENT</a>
+                </Menu.Item>
+                <Menu.Item key='community'>
+                  <a href={getLink('/en-us/community/index.html')}>COMMUNITY</a>
+                </Menu.Item>
+                <SubMenu
+                  title={
+                    <span className="submenu-title-wrapper">
+                      <a href={getLink('https://www.apache.org/')} target='_blank'>ASF</a>
+                    </span>
+                  }
+                >
+                  <Menu.ItemGroup>
+                    <Menu.Item key='Foundation' ><a href='https://www.apache.org/' target='_blank'>Foundation</a></Menu.Item>
+                    <Menu.Item key='License' ><a href='https://www.apache.org/licenses/' target='_blank'>License</a></Menu.Item>
+                    <Menu.Item key='Events' ><a href='https://www.apache.org/events/current-event' target='_blank'>Events</a></Menu.Item>
+                    <Menu.Item key='Security' ><a href='https://www.apache.org/security/' target='_blank'>Security</a></Menu.Item>
+                    <Menu.Item key='Sponsorship' ><a href='https://www.apache.org/foundation/sponsorship.html' target='_blank'>Sponsorship</a></Menu.Item>
+                    <Menu.Item key='Thanks' ><a href='https://www.apache.org/foundation/thanks.html' target='_blank'>Thanks</a></Menu.Item>
+                  </Menu.ItemGroup>
+                </SubMenu>
+              </Menu>} */}
+              {language==='zh-cn'?
+              <ul className="nav">
+                <li><a href={getLink('/zh-cn/index.html')}>首页</a></li>
+                <li>
+                  <a href={getLink('/zh-cn/docs/1.3.4/user_doc/quick-start.html')}>文档</a>
+                  <ul>
+                    <li><a href={getLink('/zh-cn/docs/1.3.4/user_doc/quick-start.html')}>1.3.4(推荐)</a></li>
+                    <li><a href={getLink('/zh-cn/docs/1.3.3/user_doc/quick-start.html')}>1.3.3</a></li>
+                    <li><a href={getLink('/zh-cn/docs/1.3.2/user_doc/quick-start.html')}>1.3.2</a></li>
+                    <li><a href={getLink('/zh-cn/docs/1.3.1/user_doc/quick-start.html')}>1.3.1</a></li>
+                    <li><a href={getLink('/zh-cn/docs/1.2.1/user_doc/quick-start.html')}>1.2.1</a></li>
+                    <li><a href={getLink('/zh-cn/docs/1.2.0/user_doc/quick-start.html')}>1.2.0</a></li>
+                    <li><a href="https://analysys.github.io/easyscheduler_docs_cn/">1.1.0(Not Apache Release)</a></li>
+                  </ul>
+                </li>
+                <li><a href={getLink('/zh-cn/docs/release/download.html')}>下载</a></li>
+                <li><a href={getLink('/zh-cn/blog/index.html')}>博客</a></li>
+                <li><a href={getLink('/zh-cn/docs/development/subscribe.html')}>开发者</a></li>
+                <li><a href={getLink('/zh-cn/community/index.html')}>社区</a></li>
+                <li>
+                  <a href="https://www.apache.org/" target='_blank'>ASF</a>
+                  <ul>
+                    <li><a href="https://www.apache.org/" target='_blank'>Foundation</a></li>
+                    <li><a href="https://www.apache.org/licenses/" target='_blank'>License</a></li>
+                    <li><a href="https://www.apache.org/events/current-event" target='_blank'>Events</a></li>
+                    <li><a href="https://www.apache.org/security/" target='_blank'>Security</a></li>
+                    <li><a href="https://www.apache.org/foundation/sponsorship.html" target='_blank'>Sponsorship</a></li>
+                    <li><a href="https://www.apache.org/foundation/thanks.html" target='_blank'>Thanks</a></li>
+                  </ul>
+                </li>
+              </ul>: <ul className="nav">
+                <li><a href={getLink('/en-us/index.html')}>HOME</a></li>
+                <li>
+                  <a href={getLink('/en-us/docs/1.3.4/user_doc/quick-start.html')}>DOCS</a>
+                  <ul>
+                    <li><a href={getLink('/en-us/docs/1.3.4/user_doc/quick-start.html')}>1.3.4(Recommend)</a></li>
+                    <li><a href={getLink('/en-us/docs/1.3.3/user_doc/quick-start.html')}>1.3.3</a></li>
+                    <li><a href={getLink('/en-us/docs/1.3.2/user_doc/quick-start.html')}>1.3.2</a></li>
+                    <li><a href={getLink('/en-us/docs/1.3.1/user_doc/quick-start.html')}>1.3.1</a></li>
+                    <li><a href={getLink('/en-us/docs/1.2.1/user_doc/quick-start.html')}>1.2.1</a></li>
+                    <li><a href={getLink('/en-us/docs/1.2.0/user_doc/quick-start.html')}>1.2.0</a></li>
+                    <li><a href="https://analysys.github.io/easyscheduler_docs_cn/">1.1.0(Not Apache Release)</a></li>
+                  </ul>
+                </li>
+                <li><a href={getLink('/en-us/docs/release/download.html')}>DOWNLOAD</a></li>
+                <li><a href={getLink('/en-us/blog/index.html')}>BLOG</a></li>
+                <li><a href={getLink('/en-us/docs/development/subscribe.html')}>DEVELOPMENT</a></li>
+                <li><a href={getLink('/en-us/community/index.html')}>COMMUNITY</a></li>
+                <li>
+                  <a href="https://www.apache.org/" target='_blank'>ASF</a>
+                  <ul>
+                    <li><a href="https://www.apache.org/" target='_blank'>Foundation</a></li>
+                    <li><a href="https://www.apache.org/licenses/" target='_blank'>License</a></li>
+                    <li><a href="https://www.apache.org/events/current-event" target='_blank'>Events</a></li>
+                    <li><a href="https://www.apache.org/security/" target='_blank'>Security</a></li>
+                    <li><a href="https://www.apache.org/foundation/sponsorship.html" target='_blank'>Sponsorship</a></li>
+                    <li><a href="https://www.apache.org/foundation/thanks.html" target='_blank'>Thanks</a></li>
+                  </ul>
+                </li>
+              </ul>}
           </div>
           </div>
         </div>
diff --git a/src/components/header/index.scss b/src/components/header/index.scss
index bf84c2d..0127591 100755
--- a/src/components/header/index.scss
+++ b/src/components/header/index.scss
@@ -45,14 +45,6 @@
         cursor: pointer;
       }
     }
-    ul {
-      padding: 0;
-      margin: 0;
-    }
-    li {
-      display: inline-block;
-      margin-right: 20px;
-    }
     .menu-item {
       font-family: Avenir-Heavy;
       font-size: 14px;
@@ -241,6 +233,66 @@
   }
 }
 
+.nav {
+  margin-top: -12px;
+  height: 60px;
+  line-height: 60px;
+  padding:0;
+  list-style-type:none;
+  float:left;
+  a:hover {
+    color:#1890ff!important;
+  }
+  ul {
+    margin:0;
+    padding:0;
+    list-style-type:none;
+    float:left;
+    a:hover {
+      color:#1890ff!important;
+    }
+  }
+  li {
+    float:left;
+    width:120px;
+    text-align: center;
+    ul {
+      width:150px;
+      position:absolute;
+      left:-99999px;
+      background-color:#fff;
+    }
+    li {
+      float:none;
+      width: 150px;
+      height: 45px;
+      line-height: 45px;
+      a {
+        border-left:0;
+        border-right:0;
+      }
+    }
+  }
+  a {
+    display:block;
+    color:#333;
+    text-decoration:none;
+    padding:5px 10px;
+  }
+  li:last-child {
+    a {
+      border-right:0;
+      border-bottom:0;
+    }
+  }
+  li:hover {
+    ul {
+      left:auto;
+    }
+  }
+}
+  
+
 @media screen and (max-width: $mobileWidth) {
   .header-container {
     .header-body {
@@ -273,20 +325,7 @@
           display: list-item;
           padding-left: 30px;
           list-style: none;
-          line-height: 40px;
           margin-right: 20px;
-          a {
-            color: #333;
-            display: inline-block;
-            width: 100%;
-          }
-          &:hover {
-            background: $endColor;
-            a {
-              color: #fff;
-              opacity: 1;
-            }
-          }
         }
         .menu-item-primary-active, .menu-item-normal-active {
           background: $endColor;