From 76cdf90b44fb884478ec76915dbf53d056cfd4d1 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 26 Apr 2021 03:07:06 +0000 Subject: [PATCH] Commit web interface build and serve statically --- .gitignore | 1 - main.py | 11 ++++- web_interface/.gitignore | 3 -- web_interface/build/asset-manifest.json | 17 ++++++++ web_interface/build/index.html | 1 + .../build/static/js/2.2b306052.chunk.js | 3 ++ .../static/js/2.2b306052.chunk.js.LICENSE.txt | 41 +++++++++++++++++++ .../build/static/js/2.2b306052.chunk.js.map | 1 + .../build/static/js/main.27336089.chunk.js | 2 + .../static/js/main.27336089.chunk.js.map | 1 + .../build/static/js/runtime-main.97b64705.js | 2 + .../static/js/runtime-main.97b64705.js.map | 1 + web_interface/src/App.js | 2 +- 13 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 web_interface/build/asset-manifest.json create mode 100644 web_interface/build/index.html create mode 100644 web_interface/build/static/js/2.2b306052.chunk.js create mode 100644 web_interface/build/static/js/2.2b306052.chunk.js.LICENSE.txt create mode 100644 web_interface/build/static/js/2.2b306052.chunk.js.map create mode 100644 web_interface/build/static/js/main.27336089.chunk.js create mode 100644 web_interface/build/static/js/main.27336089.chunk.js.map create mode 100644 web_interface/build/static/js/runtime-main.97b64705.js create mode 100644 web_interface/build/static/js/runtime-main.97b64705.js.map diff --git a/.gitignore b/.gitignore index c1bc3c2..9308289 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ __pycache__/ # Distribution / packaging .Python -build/ develop-eggs/ dist/ downloads/ diff --git a/main.py b/main.py index e1eb148..18368cf 100644 --- a/main.py +++ b/main.py @@ -4,9 +4,14 @@ import time import traceback import json +import logging +log = logging.getLogger('werkzeug') +log.setLevel(logging.ERROR) + from flask import Flask from flask_cors import CORS -app = Flask(__name__) +build_folder = 'web_interface/build' +app = Flask(__name__, template_folder=build_folder, static_folder=build_folder, static_url_path='') CORS(app) from munch import Munch @@ -48,6 +53,10 @@ def api_global(): ) return response +@app.route('/') +def root(): + return app.send_static_file('index.html') + reload_timeout = time.time() def main(): diff --git a/web_interface/.gitignore b/web_interface/.gitignore index 4d29575..8996736 100644 --- a/web_interface/.gitignore +++ b/web_interface/.gitignore @@ -8,9 +8,6 @@ # testing /coverage -# production -/build - # misc .DS_Store .env.local diff --git a/web_interface/build/asset-manifest.json b/web_interface/build/asset-manifest.json new file mode 100644 index 0000000..5533ef8 --- /dev/null +++ b/web_interface/build/asset-manifest.json @@ -0,0 +1,17 @@ +{ + "files": { + "main.js": "/static/js/main.27336089.chunk.js", + "main.js.map": "/static/js/main.27336089.chunk.js.map", + "runtime-main.js": "/static/js/runtime-main.97b64705.js", + "runtime-main.js.map": "/static/js/runtime-main.97b64705.js.map", + "static/js/2.2b306052.chunk.js": "/static/js/2.2b306052.chunk.js", + "static/js/2.2b306052.chunk.js.map": "/static/js/2.2b306052.chunk.js.map", + "index.html": "/index.html", + "static/js/2.2b306052.chunk.js.LICENSE.txt": "/static/js/2.2b306052.chunk.js.LICENSE.txt" + }, + "entrypoints": [ + "static/js/runtime-main.97b64705.js", + "static/js/2.2b306052.chunk.js", + "static/js/main.27336089.chunk.js" + ] +} \ No newline at end of file diff --git a/web_interface/build/index.html b/web_interface/build/index.html new file mode 100644 index 0000000..2155cd8 --- /dev/null +++ b/web_interface/build/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/web_interface/build/static/js/2.2b306052.chunk.js b/web_interface/build/static/js/2.2b306052.chunk.js new file mode 100644 index 0000000..0c44ebc --- /dev/null +++ b/web_interface/build/static/js/2.2b306052.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.2b306052.chunk.js.LICENSE.txt */ +(this.webpackJsonpweb_interface=this.webpackJsonpweb_interface||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(40)},function(e,t,n){"use strict";var r=n(6),a=Object.prototype.toString;function o(e){return"[object Array]"===a.call(e)}function l(e){return"undefined"===typeof e}function i(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"[object Function]"===a.call(e)}function c(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){i.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){i.headers[e]=r.merge(o)})),e.exports=i}).call(this,n(27))},function(e,t,n){"use strict";var r=n(1),a=n(29),o=n(31),l=n(7),i=n(32),u=n(35),s=n(36),c=n(11);e.exports=function(e){return new Promise((function(t,n){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+m)}var v=i(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),l(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};a(t,n,o),p=null}},p.onabort=function(){p&&(n(c("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(c("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||s(v))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(g){if("json"!==e.responseType)throw g}"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),f||(f=null),p.send(f)}))}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e,t,n,a,o){var l=new Error(e);return r(l,t,n,a,o)}},function(e,t,n){"use strict";var r=n(1);e.exports=function(e,t){t=t||{};var n={},a=["url","method","data"],o=["headers","auth","proxy","params"],l=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],i=["validateStatus"];function u(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function s(a){r.isUndefined(t[a])?r.isUndefined(e[a])||(n[a]=u(void 0,e[a])):n[a]=u(e[a],t[a])}r.forEach(a,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(o,s),r.forEach(l,(function(a){r.isUndefined(t[a])?r.isUndefined(e[a])||(n[a]=u(void 0,e[a])):n[a]=u(void 0,t[a])})),r.forEach(i,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var c=a.concat(o).concat(l).concat(i),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return r.forEach(f,s),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(18)},function(e,t,n){"use strict";function r(e,t,n,r,a,o,l){try{var i=e[o](l),u=i.value}catch(s){return void n(s)}i.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var l=e.apply(t,n);function i(e){r(l,a,o,i,u,"next",e)}function u(e){r(l,a,o,i,u,"throw",e)}i(void 0)}))}}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n