Skip to content

Commit

Permalink
Merge pull request #34 from samperson1997/split_development
Browse files Browse the repository at this point in the history
[IOTDB-183] Split Development pages and add "latest" version
  • Loading branch information
Jialin Qiao committed Aug 30, 2019
2 parents e83c72d + 7c81ac4 commit e6cc236
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 12 deletions.
6 changes: 6 additions & 0 deletions src/components/Global.vue
Expand Up @@ -18,6 +18,12 @@
"doc-prefix": DOC_URL_PREFIX,
'text': "V0.8.0",
'content': '0-Content.md'
},
"latest": {
"branch": "master",
"doc-prefix": DOC_URL_PREFIX,
'text': "Latest",
'content': '0-Content.md'
}
};
Expand Down
17 changes: 15 additions & 2 deletions src/components/NavBar.vue
Expand Up @@ -57,8 +57,15 @@
</li>
</ul>
</li>
<li class="nav-item">
<router-link to="/Development" class="nav-link"><span>Development</span></router-link>
<li class="dropdown">
<router-link to="/Development/Contributing" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false"><span>Development<b class="caret"></b></span>
</router-link>
<ul class="dropdown-menu">
<li v-for="item in Development">
<router-link :to=item.url class="nav-link"><span>{{item.content}}</span></router-link>
</li>
</ul>
</li>
<li class="nav-item">
<router-link to="/Example" class="nav-link"><span>Example</span></router-link>
Expand Down Expand Up @@ -120,6 +127,12 @@
{"url": "/Tools/Hadoop", "content": "Hadoop Connector"},
{"url": "/Tools/Spark", "content": "Spark Connector"}
],
"Development": [
{"url": "/Development/Contributing", "content": "Questions and Contributing"},
{"url": "/Development/IDE", "content": "Developing in IDE"},
{"url": "/Development/Tsfile", "content": "Changelist of Tsfile"},
{"url": "/Development/RPC", "content": "Changelist of RPC"}
]
}
},
}
Expand Down
6 changes: 3 additions & 3 deletions src/router/index.js
Expand Up @@ -34,7 +34,7 @@ export default new Router({
},
{
path: '/Documents/:version/:chapter?/:section?',
name: 'Documents',
name: 'UserGuideDocuments',
component: Documents
},
{
Expand All @@ -44,7 +44,7 @@ export default new Router({
},
{
path: '/Materials/:doc',
name: 'Materials',
name: 'SingleMaterial',
component: SingleMaterials
},
{
Expand All @@ -63,7 +63,7 @@ export default new Router({
component: Community
},
{
path: '/Development',
path: '/Development/:content',
name: 'Development',
component: Development
},
Expand Down
26 changes: 20 additions & 6 deletions src/views/Development.vue
Expand Up @@ -22,7 +22,7 @@
import SideBar from '../components/SideBar'
import markdown from 'vue-markdown'
import axios from 'axios'
import Golbal from '../components/Global'
import Global from '../components/Global'
import LoadingBar from '../components/Loading'
export default {
Expand Down Expand Up @@ -53,18 +53,32 @@
return this.$route.params.content
},
fetchData() {
let url = Golbal.SUPPORT_VERSION[Golbal.DEFAULT_VERSION]['doc-prefix'] +
Golbal.SUPPORT_VERSION[Golbal.DEFAULT_VERSION]['branch'] +
"/docs/Development.md";
let pointer = this;
const dict = {
"Contributing": Global.SUPPORT_VERSION[Global.LATEST_STR]['doc-prefix'] +
Global.SUPPORT_VERSION[Global.LATEST_STR]['branch'] + "/docs/Development-Contributing.md",
"IDE": Global.SUPPORT_VERSION[Global.LATEST_STR]['doc-prefix'] +
Global.SUPPORT_VERSION[Global.LATEST_STR]['branch'] + "/docs/Development-IDE.md",
"Tsfile": Global.SUPPORT_VERSION[Global.LATEST_STR]['doc-prefix'] +
Global.SUPPORT_VERSION[Global.LATEST_STR]['branch'] + "/tsfile/format-changelist.md",
"RPC": Global.SUPPORT_VERSION[Global.LATEST_STR]['doc-prefix'] +
Global.SUPPORT_VERSION[Global.LATEST_STR]['branch'] + "/service-rpc/rpc-changelist.md",
};
const content = this.content();
let url = null;
if (content in dict) {
url = dict[content];
} else {
this.$router.push('/404');
}
const pointer = this;
this.seen = true;
axios.get(url).then(function (response) {
pointer.md = response.data;
pointer.seen = false;
})
},
parse(html){
return Golbal.isReadyForPrerender(html)
return Global.isReadyForPrerender(html)
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/views/Documents.vue
Expand Up @@ -132,7 +132,10 @@
return this.$route.params.section;
},
updateDocument(){
this.text = this.getVersionString();
if (this.text !== this.getVersionString()) {
this.text = this.getVersionString();
location.reload();
}
},
switchLanguage() {
this.eng = this.eng !== true;
Expand Down

0 comments on commit e6cc236

Please sign in to comment.