From ad9837fd9671c25bc7ddbc4f06f1e1a43d223f08 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Thu, 13 Jul 2017 21:57:28 +0300 Subject: [PATCH] frontend: replace angular with vue --- CMakeLists.txt | 18 +- src/resources.cpp | 7 +- src/resources/index.html | 216 ++++++++-- src/resources/js/app.js | 765 +++++++++++++++++++--------------- src/resources/progress.gif | Bin 0 -> 2545 bytes src/resources/tpl/browse.html | 21 - src/resources/tpl/home.html | 58 --- src/resources/tpl/job.html | 51 --- src/resources/tpl/run.html | 43 -- 9 files changed, 626 insertions(+), 553 deletions(-) create mode 100644 src/resources/progress.gif delete mode 100644 src/resources/tpl/browse.html delete mode 100644 src/resources/tpl/home.html delete mode 100644 src/resources/tpl/job.html delete mode 100644 src/resources/tpl/run.html diff --git a/CMakeLists.txt b/CMakeLists.txt index 15f943d..ddf4189 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,14 +58,13 @@ add_custom_command(OUTPUT laminar.capnp.c++ laminar.capnp.h # Zip and compile statically served resources generate_compressed_bins(${CMAKE_SOURCE_DIR}/src/resources index.html js/app.js tpl/home.html tpl/job.html tpl/run.html tpl/browse.html - favicon.ico favicon-152.png icon.png progress.png) + favicon.ico favicon-152.png icon.png progress.gif) + # Download 3rd-party frontend JS libs... -file(DOWNLOAD https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js - js/angular.min.js EXPECTED_MD5 b1137641dbb512a60e83d673f7e2d98f) -file(DOWNLOAD https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-route.min.js - js/angular-route.min.js EXPECTED_MD5 28ef7d7b4349ae0dce602748185ef32a) -file(DOWNLOAD https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-sanitize.min.js - js/angular-sanitize.min.js EXPECTED_MD5 0854eae86bcdf5f92b1ab2b458d8d054) +file(DOWNLOAD https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue.min.js + js/vue.min.js EXPECTED_MD5 ae2fca1cfa0e31377819b1b0ffef704c) +file(DOWNLOAD https://cdnjs.cloudflare.com/ajax/libs/vue-router/2.7.0/vue-router.min.js + js/vue-router.min.js EXPECTED_MD5 5d3e35710dbe02de78c39e3e439b8d4e) file(DOWNLOAD https://raw.githubusercontent.com/drudru/ansi_up/v1.3.0/ansi_up.js js/ansi_up.js EXPECTED_MD5 158566dc1ff8f2804de972f7e841e2f6) file(DOWNLOAD https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js @@ -75,9 +74,8 @@ file(DOWNLOAD https://raw.githubusercontent.com/tomsouthall/Chart.HorizontalBar. file(DOWNLOAD https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css css/bootstrap.min.css EXPECTED_MD5 5d5357cb3704e1f43a1f5bfed2aebf42) # ...and compile them -generate_compressed_bins(${CMAKE_BINARY_DIR} js/angular.min.js js/angular-route.min.js - js/angular-sanitize.min.js js/ansi_up.js js/Chart.min.js js/Chart.HorizontalBar.js - css/bootstrap.min.css) +generate_compressed_bins(${CMAKE_BINARY_DIR} js/vue-router.min.js js/vue.min.js + js/ansi_up.js js/Chart.min.js js/Chart.HorizontalBar.js css/bootstrap.min.css) # (see resources.cpp where these are fetched) ## Server diff --git a/src/resources.cpp b/src/resources.cpp index d3b1e0c..96f31c1 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -30,7 +30,7 @@ Resources::Resources() INIT_RESOURCE("/", index_html); INIT_RESOURCE("/favicon.ico", favicon_ico); INIT_RESOURCE("/favicon-152.png", favicon_152_png); - INIT_RESOURCE("/progress.png", progress_png); + INIT_RESOURCE("/progress.gif", progress_gif); INIT_RESOURCE("/icon.png", icon_png); INIT_RESOURCE("/js/app.js", js_app_js); INIT_RESOURCE("/js/Chart.HorizontalBar.js", js_Chart_HorizontalBar_js); @@ -39,9 +39,8 @@ Resources::Resources() INIT_RESOURCE("/tpl/job.html", tpl_job_html); INIT_RESOURCE("/tpl/run.html", tpl_run_html); INIT_RESOURCE("/tpl/browse.html", tpl_browse_html); - INIT_RESOURCE("/js/angular.min.js", js_angular_min_js); - INIT_RESOURCE("/js/angular-route.min.js", js_angular_route_min_js); - INIT_RESOURCE("/js/angular-sanitize.min.js", js_angular_sanitize_min_js); + INIT_RESOURCE("/js/vue.min.js", js_vue_min_js); + INIT_RESOURCE("/js/vue-router.min.js", js_vue_router_min_js); INIT_RESOURCE("/js/ansi_up.js", js_ansi_up_js); INIT_RESOURCE("/js/Chart.min.js", js_Chart_min_js); INIT_RESOURCE("/js/Chart.HorizontalBar.js", js_Chart_HorizontalBar_js); diff --git a/src/resources/index.html b/src/resources/index.html index 5f7530e..a78fb24 100644 --- a/src/resources/index.html +++ b/src/resources/index.html @@ -1,5 +1,5 @@ - + @@ -8,14 +8,13 @@ Laminar - - - - + + + - + -