diff --git a/chi_annotator/webui/static/js/core.js b/chi_annotator/webui/static/js/core.js
index 363b915..a2a0a5d 100644
--- a/chi_annotator/webui/static/js/core.js
+++ b/chi_annotator/webui/static/js/core.js
@@ -46,8 +46,8 @@ axios.defaults.baseURL = 'http://localhost:5000';
var load_local_data = new Vue({
el: '#load_local_data',
data: {
- message: "load local test data",
- file_path: 'D:\\Github\\Chinese-Annotator\\chi_annotator\\data\\files\\spam_classify_chi_shuf.txt',
+ message: "fill the local data file path",
+ file_path: '',
},
// define methods under the `methods` object
methods: {
@@ -76,4 +76,27 @@ var load_local_data = new Vue({
});
}
}
+})
+
+var upload_remote_file = new Vue({
+ el: '#upload_remote_file',
+ data: {
+ message: "select file to do upload",
+ },
+ // define methods under the `methods` object
+ methods: {
+ upload_remote_file: function (event) {
+ // Make a request for a user with a given ID
+ axios.post('/upload_remote_file',{
+ filepath: this.file_path,
+ })
+ .then(function (response) {
+ this.message = response.data.message
+ console.log(response);
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ },
+ }
})
\ No newline at end of file
diff --git a/chi_annotator/webui/static/web_util.html b/chi_annotator/webui/static/web_util.html
index d371598..be872fb 100644
--- a/chi_annotator/webui/static/web_util.html
+++ b/chi_annotator/webui/static/web_util.html
@@ -2,7 +2,7 @@
-
+
anatine - a free css template
@@ -30,11 +30,11 @@ Welcome to canno chinese annotator!!
Examples
- Text Classification
-
+ Text Classification
+
- web api util
-
+ web api util
+
@@ -45,26 +45,45 @@ Welcome to canno chinese annotator!!
API Testing
-
- this web is for API testing, it list all API that provided by the web service backend. user can use this web site
- to access the web api send GET or POST request
+ this web is for API testing, it list all API that provided by the web service backend. user can use this
+ web site to access the web api send GET or POST request
-
-
+
+
Load Local Data
-
-
-
-
-
load local data by POST
-
load local data by GET
-
{{ message }}
-
-
-
+
+
+
+
+
+ Upload remote file
+
+
+
-
© 2017 sitename.
diff --git a/docs/apis.md b/docs/apis.md
index f7cddd6..fc34f4f 100644
--- a/docs/apis.md
+++ b/docs/apis.md
@@ -23,4 +23,10 @@
支持post和get请求
参数:filepath 本地文件的绝对路径
-功能: 将本地的文件load到Mongo数据库
\ No newline at end of file
+功能: 将本地的data文件中的内容存入MongoDB
+
+//upload_remote_file
+仅支持post请求
+参数:上传的file文件
+
+功能:解析上次的data文件,并将其内容存入mongoDB