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

    - -
    - - - - -

    {{ message }}

    -
    - - +
    +
    +

    web service interface + http://localhost:5000/load_local_dataset/ + it's function is to upload the data from local data file to Mongo DB. It support both GET and POST method

    +
    + + + load local data by POST + load local data by GET +

    {{ message }}

    +
    +
    +
    +
    +
    +

    Upload remote file

    +
    +
    +

    web service interface + http://localhost:5000/upload_remote_file/ + it's function is to upload the data from data file provied by http request to Mongo DB. It only support both POST method

    +
    +

    + + +

    +

    {{ message }}

    +
    +
    +
    -