From 0f31a41af2d653a64d44146c561bae1ddd79cf1d Mon Sep 17 00:00:00 2001
From: 151250128 <151250128@smail.nju.edu.cn>
Date: Wed, 28 Aug 2019 16:04:38 +0800
Subject: [PATCH 1/2] [IOTDB-183] Split Development pages and add "latest"
version
---
src/components/Global.vue | 6 ++++++
src/components/NavBar.vue | 17 +++++++++++++++--
src/router/index.js | 6 +++---
src/views/Development.vue | 26 ++++++++++++++++++++------
src/views/Documents.vue | 5 ++++-
5 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/src/components/Global.vue b/src/components/Global.vue
index 24bfecf49e1..83facd2e877 100644
--- a/src/components/Global.vue
+++ b/src/components/Global.vue
@@ -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'
}
};
diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index 352b339ef87..b3954b1b694 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -57,8 +57,15 @@
-
- Development
+
+ Development
+
+
Example
@@ -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"}
+ ]
}
},
}
diff --git a/src/router/index.js b/src/router/index.js
index 1a73ba5f697..f4497f25c3e 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -34,7 +34,7 @@ export default new Router({
},
{
path: '/Documents/:version/:chapter?/:section?',
- name: 'Documents',
+ name: 'UserGuideDocuments',
component: Documents
},
{
@@ -44,7 +44,7 @@ export default new Router({
},
{
path: '/Materials/:doc',
- name: 'Materials',
+ name: 'SingleMaterial',
component: SingleMaterials
},
{
@@ -63,7 +63,7 @@ export default new Router({
component: Community
},
{
- path: '/Development',
+ path: '/Development/:content',
name: 'Development',
component: Development
},
diff --git a/src/views/Development.vue b/src/views/Development.vue
index b5f1943692e..d81ee461762 100644
--- a/src/views/Development.vue
+++ b/src/views/Development.vue
@@ -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 {
@@ -53,10 +53,24 @@
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.md",
+ "IDE": Global.SUPPORT_VERSION[Global.LATEST_STR]['doc-prefix'] +
+ Global.SUPPORT_VERSION[Global.LATEST_STR]['branch'] + "/docs/Development.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;
@@ -64,7 +78,7 @@
})
},
parse(html){
- return Golbal.isReadyForPrerender(html)
+ return Global.isReadyForPrerender(html)
}
}
}
diff --git a/src/views/Documents.vue b/src/views/Documents.vue
index 19861b37fd7..6d74c5fb145 100644
--- a/src/views/Documents.vue
+++ b/src/views/Documents.vue
@@ -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;
From 7c81ac42f25e0edc38fdccfb04725600f0325bf5 Mon Sep 17 00:00:00 2001
From: 151250128 <151250128@smail.nju.edu.cn>
Date: Wed, 28 Aug 2019 16:10:40 +0800
Subject: [PATCH 2/2] Change file name
---
src/views/Development.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/Development.vue b/src/views/Development.vue
index d81ee461762..34dfbcc3f7f 100644
--- a/src/views/Development.vue
+++ b/src/views/Development.vue
@@ -55,9 +55,9 @@
fetchData() {
const dict = {
"Contributing": Global.SUPPORT_VERSION[Global.LATEST_STR]['doc-prefix'] +
- Global.SUPPORT_VERSION[Global.LATEST_STR]['branch'] + "/docs/Development.md",
+ 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.md",
+ 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'] +