From f09a791a0acf9d668d6322d887c1519afaac964f Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 17 Nov 2017 18:56:28 +0200 Subject: Fix some shit --- Geshem.vue | 12 +++++++++--- README.md | 13 ++++++++----- package.json | 2 +- static/error.html | 20 ++++++++++++++++++++ 4 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 static/error.html diff --git a/Geshem.vue b/Geshem.vue index e7cac1e..62fe47d 100644 --- a/Geshem.vue +++ b/Geshem.vue @@ -56,7 +56,7 @@ computed: { datetime: function () { if (!this.imgs) { return '' }; - var d = this.imgs[this.res][this.slider].substr(0, 13); + var d = this.imgs[this.res][this.slider].substr(5, 13); var md = moment.utc(d, 'YYYYMMDD/HHmm').tz('Asia/Jerusalem'); return md }, @@ -71,12 +71,18 @@ }, mounted: function () { var vm = this; - axios.get('//imgs.geshem.space/imgs.json').then((res) => { + axios({ + url: '//imgs.geshem.space/imgs.json', + method: 'get', + withCredentials: true + }).then((res) => { vm.imgs = res.data; if (vm.mapLoaded) { vm.loadSources(); } - }) + }).catch(function(error) { + console.log(error) + }) }, created: function () { this.initMap(); diff --git a/README.md b/README.md index 3332d64..13ac7e5 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ An interactive rain radar clone running on Mapbox GL, see it live at: [https://geshem.space](https://geshem.space) The entire service is served off of static assets located in S3 buckets: - - A static main index page, JS bundle and other static assets that are uploaded upon deploy - - Radar images that collected and indexed every minute by a recurring task running on AWS Lambda + + - A static main index page, JS bundle and other static assets that are uploaded upon deploy, Vue.js-based + - Radar images that are collected and indexed every minute by a recurring task running on AWS Lambda, written in Python ## Prerequisites @@ -31,7 +32,7 @@ $ yarn run build Deploy new static assets to S3: ```bash -$ yarn run deploy_static +$ yarn run deploystatic ``` ### Cron Task @@ -39,11 +40,13 @@ $ yarn run deploy_static #### Deploy ```bash -$ yarn run deploy_cron +$ yarn run deploycron ``` #### Invoke +For testing the cron task: + ```bash -$ yarn run invoke_cron +$ yarn run invokecron ``` diff --git a/package.json b/package.json index 715b4f4..7f2b39e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "build": "NODE_ENV=production webpack --config ./webpack.config.js --progress --colors", - "deploystatic": "whoami", + "deploystatic": "aws s3 sync --acl public-read static s3://geshem.space", "deploycron": "serverless deploy -f update", "invokecron": "serverless invoke -l -f update" }, diff --git a/static/error.html b/static/error.html new file mode 100644 index 0000000..8b515fa --- /dev/null +++ b/static/error.html @@ -0,0 +1,20 @@ + + +
+ + +