1 line
7.6 KiB
Plaintext
1 line
7.6 KiB
Plaintext
{"version":3,"sources":["webpack:///./src/views/update.vue","webpack:///src/views/update.vue","webpack:///./src/views/update.vue?500f","webpack:///./src/views/update.vue?4e38"],"names":["render","_vm","this","_c","_self","staticClass","attrs","_v","_s","next_version","update_launched","_e","update_finished","class","on","$event","launch_update","staticRenderFns","name","data","translation","check_interval","current_version","jwt","methods","check_version","axios","timeout","headers","then","window","clearInterval","setTimeout","catch","console","get_versions","created","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,YAAY,kBAAkBC,MAAM,CAAC,GAAK,YAAY,CAACH,EAAG,MAAM,CAACE,YAAY,0BAA0B,CAACF,EAAG,MAAMA,EAAG,IAAI,CAACA,EAAG,SAAS,CAACF,EAAIM,GAAG,wCAAwCN,EAAIO,GAAGP,EAAIQ,cAAc,QAAQN,EAAG,MAAQF,EAAIS,gBAAkGT,EAAIU,KAArFR,EAAG,OAAO,CAACF,EAAIM,GAAG,+DAAyEN,EAAIS,kBAAkBT,EAAIW,gBAAiBT,EAAG,OAAO,CAACF,EAAIM,GAAG,wEAAwEN,EAAIU,KAAMV,EAAIS,iBAAiBT,EAAIW,gBAAiBT,EAAG,OAAO,CAACE,YAAY,eAAe,CAACJ,EAAIM,GAAG,wBAAwBN,EAAIU,OAASV,EAAIW,gBAAmMX,EAAIU,KAAtLR,EAAG,SAAS,CAACE,YAAY,kBAAkBQ,MAAM,CAAEZ,EAAIS,gBAAkB,UAAY,IAAKI,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOd,EAAIe,mBAAmB,CAACf,EAAIM,GAAG,0BAEx1BU,EAAkB,G,qBCetB,GACAC,cACAC,OACA,OACAC,eACAV,qBACAW,oBACAZ,kBACAa,qBACAV,mBACAW,SAGAC,SACAC,yBACAC,mCAAAC,YAAAC,SAAA,sBACAC,SACA,eACA,4CACAC,8CACA,wBACAC,mCACAC,uBAAAF,2BAAA,QAIAG,UAAAC,kBAEAlB,yBACAU,+BAAAC,YAAAC,SAAA,sBACAC,SACA,eACA,iDACA,wBACA,oFAIAI,UAAAC,kBAEA,sBACA,0BAAAP,cACAE,SACA,eACA,yBAGAI,0BAEAE,wBACAT,6BAAAC,YAAAC,SAAA,sBACAC,SACA,gBACA,4CACA,sCACA,uEAGAI,UAAAC,mBAGAE,mBACA,yBACA,wBChFgV,I,YCO5UC,EAAY,eACd,EACArC,EACAiB,GACA,EACA,KACA,KACA,MAIa,aAAAoB,E","file":"js/chunk-2d0a3726.bebe5116.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"backend-content\",attrs:{\"id\":\"content\"}},[_c('div',{staticClass:\"column col-8 col-xs-12\"},[_c('br'),_c('p',[_c('strong',[_vm._v(\"A new SpyGuard version is available (\"+_vm._s(_vm.next_version)+\").\")]),_c('br'),(!_vm.update_launched)?_c('span',[_vm._v(\"Please click on the button below to update your instance.\")]):_vm._e(),(_vm.update_launched&&!_vm.update_finished)?_c('span',[_vm._v(\"Updating SpyGuard, please wait. You'll be redirected once updated.\")]):_vm._e(),(_vm.update_launched&&_vm.update_finished)?_c('span',{staticClass:\"color-green\"},[_vm._v(\"✓ Update finished!\")]):_vm._e()]),(!_vm.update_finished)?_c('button',{staticClass:\"btn btn-primary\",class:[ _vm.update_launched ? 'loading' : '' ],on:{\"click\":function($event){return _vm.launch_update()}}},[_vm._v(\"Update Spyguard\")]):_vm._e()])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <div class=\"backend-content\" id=\"content\">\n <div class=\"column col-8 col-xs-12\">\n <br />\n <p><strong>A new SpyGuard version is available ({{next_version}}).</strong><br />\n <span v-if=\"!update_launched\">Please click on the button below to update your instance.</span>\n <span v-if=\"update_launched&&!update_finished\">Updating SpyGuard, please wait. You'll be redirected once updated.</span> \n <span v-if=\"update_launched&&update_finished\" class=\"color-green\">✓ Update finished!</span>\n </p>\n <button class=\"btn btn-primary\" :class=\"[ update_launched ? 'loading' : '' ]\" v-on:click=\"launch_update()\" v-if=\"!update_finished\">Update Spyguard</button>\n </div>\n </div>\n</template>\n\n<script>\n import axios from 'axios'\n\n export default {\n name: 'update',\n data() {\n return {\n translation: {},\n update_launched: null,\n check_interval: null,\n next_version: null,\n current_version: null,\n update_finished: false,\n jwt: \"\",\n }\n },\n methods: {\n check_version: function() {\n axios.get('/api/update/get-version', { timeout: 60000, headers: { 'X-Token': this.jwt } })\n .then(response => { \n if(response.data.status) {\n if(response.data.current_version == this.next_version){\n window.current_version = response.data.current_version\n this.update_finished = true\n clearInterval(this.check_interval);\n setTimeout(function () { window.location.href = \"/\"; }, 3000) \n }\n }\n })\n .catch(error => { console.log(error) });\n },\n launch_update: function() {\n axios.get(`/api/update/process`, { timeout: 60000, headers: { 'X-Token': this.jwt } })\n .then(response => {\n if(response.data.status) {\n if(response.data.message == \"Update successfully launched\"){\n this.update_launched = true\n this.check_interval = setInterval(function(){ this.check_version(); }.bind(this), 3000);\n }\n }\n })\n .catch(error => { console.log(error) });\n },\n async get_jwt() {\n await axios.get(`/api/get-token`, { timeout: 10000 })\n .then(response => {\n if (response.data.token) {\n this.jwt = response.data.token\n }\n })\n .catch(err => (console.log(err)))\n },\n get_versions: function() {\n axios.get('/api/update/check', { timeout: 60000, headers: { 'X-Token': this.jwt } })\n .then(response => { \n if(response.data.status){\n this.current_version = response.data.current_version\n this.next_version = response.data.next_version\n if(this.current_version == this.next_version) window.location.href = \"/\";\n }\n })\n .catch(error => { console.log(error) });\n },\n },\n created: function() {\n this.get_jwt().then(() => {\n this.get_versions();\n });\n }\n }\n</script>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./update.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./update.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./update.vue?vue&type=template&id=576c78b2&\"\nimport script from \"./update.vue?vue&type=script&lang=js&\"\nexport * from \"./update.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} |