1 line
16 KiB
Plaintext
Executable File
1 line
16 KiB
Plaintext
Executable File
{"version":3,"sources":["webpack:///./src/views/generate-ap.vue","webpack:///src/views/generate-ap.vue","webpack:///./src/views/generate-ap.vue?1b7e","webpack:///./src/views/generate-ap.vue?929c"],"names":["render","_vm","this","_c","_self","staticClass","error","ssid_name","on","$event","generate_ap","attrs","ssid_qr","_v","_s","$t","ssid_password","staticStyle","domProps","staticRenderFns","name","components","data","capture_token","capture_start","interval","reboot_option","window","config","attempts","methods","console","log","clearInterval","axios","get","timeout","then","response","show_ap","status","access_point","ssid","password","qrcode","start_capture","setTimeout","bind","get_capture_token","reboot","Date","now","get_device","setInterval","check_device","device_name","router","replace","params","created","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,MAAM,CAACE,YAAY,UAAU,CAAgB,GAAbJ,EAAIK,MAAiBH,EAAG,MAAM,CAAEF,EAAIM,UAAWJ,EAAG,MAAM,CAACA,EAAG,MAAM,CAACE,YAAY,cAAcG,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOR,EAAIS,iBAAiB,CAACP,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,SAAS,CAACA,EAAG,MAAM,CAACQ,MAAM,CAAC,IAAMV,EAAIW,QAAQ,GAAK,eAAe,GAAGT,EAAG,MAAM,CAACE,YAAY,wBAAwBM,MAAM,CAAC,eAAe,QAAQR,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,MAAMA,EAAG,OAAO,CAACE,YAAY,cAAc,CAACJ,EAAIY,GAAGZ,EAAIa,GAAGb,EAAIc,GAAG,6BAA6B,OAAOZ,EAAG,MAAMA,EAAG,KAAK,CAACF,EAAIY,GAAGZ,EAAIa,GAAGb,EAAIM,cAAcJ,EAAG,OAAO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BAAAV,EAAAhB,QAEA2B,OAAA,WACAlB,QAAAC,IAAA,0CACAE,IAAAC,IAAA,oBAAAC,QAAA,MACAC,KAAAC,IAAAP,QAAAC,IAAAM,MAEAU,kBAAA,SAAA1B,GACAA,EAAAkB,SACAT,QAAAC,IAAA,0EACA,KAAAT,cAAAD,EAAAC,cACA,KAAAC,cAAA0B,KAAAC,MACA,KAAAC,eAGAA,WAAA,WACA,KAAA3B,SAAA4B,YAAA,KACAnB,IAAAC,IAAA,wBAAAZ,cAAA,CAAAa,QAAA,MACAC,KAAAC,GAAA,KAAAgB,aAAAhB,EAAAhB,QACA,MAEAgC,aAAA,SAAAhC,GACA,GAAAA,EAAAkB,OAAA,CACAT,QAAAC,IAAA,8DACAC,cAAA,KAAAR,UACA,IAAAF,EAAA,KAAAA,cACAC,EAAA,KAAAA,cACA+B,EAAAjC,EAAAF,KACAoC,OAAAC,QAAA,CACArC,KAAA,UACAsC,OAAA,CACAnC,gBACAC,gBACA+B,oBAMAI,QAAA,WACA5B,QAAAC,IAAA,6CACA,KAAAtB,gBC3IqV,I,YCOjVkD,EAAY,eACd,EACA5D,EACAmB,GACA,EACA,KACA,KACA,MAIa,aAAAyC,E","file":"js/chunk-2d0baeaa.f849dd44.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"wrapper\"},[_c('div',{staticClass:\"center\"},[((_vm.error == false))?_c('div',[(_vm.ssid_name)?_c('div',[_c('div',{staticClass:\"card apcard\",on:{\"click\":function($event){return _vm.generate_ap()}}},[_c('div',{staticClass:\"columns\"},[_c('div',{staticClass:\"column col-5\"},[_c('center',[_c('img',{attrs:{\"src\":_vm.ssid_qr,\"id\":\"qrcode\"}})])],1),_c('div',{staticClass:\"divider-vert white-bg\",attrs:{\"data-content\":\"OR\"}}),_c('div',{staticClass:\"column col-5\"},[_c('br'),_c('span',{staticClass:\"light-grey\"},[_vm._v(_vm._s(_vm.$t(\"generate-ap.network_name\"))+\" \")]),_c('br'),_c('h4',[_vm._v(_vm._s(_vm.ssid_name))]),_c('span',{staticClass:\"light-grey\"},[_vm._v(_vm._s(_vm.$t(\"generate-ap.network_password\"))+\" \")]),_c('br'),_c('h4',[_vm._v(_vm._s(_vm.ssid_password))])])])]),_c('br'),_c('br'),_c('br'),_c('br'),_vm._v(\" \"),_c('br'),_c('br'),_c('br'),_c('br'),_c('br'),_c('br'),_c('span',{staticClass:\"legend\"},[_vm._v(_vm._s(_vm.$t(\"generate-ap.tap_msg\")))])]):_c('div',[_c('svg',{staticStyle:{\"margin\":\"auto\",\"background\":\"none\",\"display\":\"block\",\"shape-rendering\":\"auto\"},attrs:{\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"width\":\"194px\",\"height\":\"194px\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('circle',{attrs:{\"cx\":\"50\",\"cy\":\"50\",\"r\":\"0\",\"fill\":\"none\",\"stroke\":\"#dfdfdf\",\"stroke-width\":\"1\"}},[_c('animate',{attrs:{\"attributeName\":\"r\",\"repeatCount\":\"indefinite\",\"dur\":\"2.941176470588235s\",\"values\":\"0;43\",\"keyTimes\":\"0;1\",\"keySplines\":\"0 0.2 0.8 1\",\"calcMode\":\"spline\",\"begin\":\"0s\"}}),_c('animate',{attrs:{\"attributeName\":\"opacity\",\"repeatCount\":\"indefinite\",\"dur\":\"2.941176470588235s\",\"values\":\"1;0\",\"keyTimes\":\"0;1\",\"keySplines\":\"0.2 0 0.8 1\",\"calcMode\":\"spline\",\"begin\":\"0s\"}})]),_c('circle',{attrs:{\"cx\":\"50\",\"cy\":\"50\",\"r\":\"0\",\"fill\":\"none\",\"stroke\":\"#dadada\",\"stroke-width\":\"1\"}},[_c('animate',{attrs:{\"attributeName\":\"r\",\"repeatCount\":\"indefinite\",\"dur\":\"2.941176470588235s\",\"values\":\"0;43\",\"keyTimes\":\"0;1\",\"keySplines\":\"0 0.2 0.8 1\",\"calcMode\":\"spline\",\"begin\":\"-1.4705882352941175s\"}}),_c('animate',{attrs:{\"attributeName\":\"opacity\",\"repeatCount\":\"indefinite\",\"dur\":\"2.941176470588235s\",\"values\":\"1;0\",\"keyTimes\":\"0;1\",\"keySplines\":\"0.2 0 0.8 1\",\"calcMode\":\"spline\",\"begin\":\"-1.4705882352941175s\"}})])]),_c('p',{staticClass:\"legend\"},[_vm._v(_vm._s(_vm.$t(\"generate-ap.generate_ap_msg\")))])])]):_c('div',[_c('p',[_c('strong',{domProps:{\"innerHTML\":_vm._s(_vm.$t('generate-ap.error_msg1'))}}),_c('br'),_c('br'),_c('span',{domProps:{\"innerHTML\":_vm._s(_vm.$t('generate-ap.error_msg2'))}}),_c('br'),_c('br')])])])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"wrapper\">\r\n <div class=\"center\">\r\n <div v-if=\"(error == false)\">\r\n <div v-if=\"ssid_name\">\r\n <div class=\"card apcard\" v-on:click=\"generate_ap()\">\r\n <div class=\"columns\">\r\n <div class=\"column col-5\">\r\n <center><img :src=\"ssid_qr\" id=\"qrcode\"></center>\r\n </div>\r\n <div class=\"divider-vert white-bg\" data-content=\"OR\"></div>\r\n <div class=\"column col-5\"><br />\r\n <span class=\"light-grey\">{{ $t(\"generate-ap.network_name\") }} </span><br />\r\n <h4>{{ ssid_name }}</h4>\r\n <span class=\"light-grey\">{{ $t(\"generate-ap.network_password\") }} </span><br />\r\n <h4>{{ ssid_password }}</h4>\r\n </div>\r\n </div>\r\n </div>\r\n <br /><br /><br /><br /> <br /><br /><br /><br /><br /><br />\r\n <!-- Requite a CSS MEME for that shit :) -->\r\n <span class=\"legend\">{{ $t(\"generate-ap.tap_msg\") }}</span>\r\n </div>\r\n <div v-else>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"margin: auto; background: none; display: block; shape-rendering: auto;\" width=\"194px\" height=\"194px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\r\n <circle cx=\"50\" cy=\"50\" r=\"0\" fill=\"none\" stroke=\"#dfdfdf\" stroke-width=\"1\">\r\n <animate attributeName=\"r\" repeatCount=\"indefinite\" dur=\"2.941176470588235s\" values=\"0;43\" keyTimes=\"0;1\" keySplines=\"0 0.2 0.8 1\" calcMode=\"spline\" begin=\"0s\"></animate>\r\n <animate attributeName=\"opacity\" repeatCount=\"indefinite\" dur=\"2.941176470588235s\" values=\"1;0\" keyTimes=\"0;1\" keySplines=\"0.2 0 0.8 1\" calcMode=\"spline\" begin=\"0s\"></animate>\r\n </circle><circle cx=\"50\" cy=\"50\" r=\"0\" fill=\"none\" stroke=\"#dadada\" stroke-width=\"1\">\r\n <animate attributeName=\"r\" repeatCount=\"indefinite\" dur=\"2.941176470588235s\" values=\"0;43\" keyTimes=\"0;1\" keySplines=\"0 0.2 0.8 1\" calcMode=\"spline\" begin=\"-1.4705882352941175s\"></animate>\r\n <animate attributeName=\"opacity\" repeatCount=\"indefinite\" dur=\"2.941176470588235s\" values=\"1;0\" keyTimes=\"0;1\" keySplines=\"0.2 0 0.8 1\" calcMode=\"spline\" begin=\"-1.4705882352941175s\"></animate>\r\n </circle>\r\n </svg>\r\n <p class=\"legend\">{{ $t(\"generate-ap.generate_ap_msg\") }}</p>\r\n </div>\r\n </div>\r\n <div v-else>\r\n <p>\r\n <strong v-html=\"$t('generate-ap.error_msg1')\"></strong>\r\n <br /><br />\r\n <span v-html=\"$t('generate-ap.error_msg2')\"></span>\r\n <br /><br /> \r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport axios from 'axios'\r\nimport router from '../router'\r\n\r\nexport default {\r\n name: 'generate-ap',\r\n components: {},\r\n data() {\r\n return {\r\n ssid_name: false,\r\n ssid_qr: false,\r\n ssid_password: false,\r\n capture_token: false,\r\n capture_start: false,\r\n interval: false,\r\n error: false,\r\n reboot_option: window.config.reboot_option,\r\n attempts: 3\r\n }\r\n },\r\n methods: {\r\n generate_ap: function() {\r\n console.log(\"[generate-ap.vue] Trying to start a new access point\");\r\n clearInterval(this.interval);\r\n this.ssid_name = false\r\n axios.get('/api/network/ap/start', { timeout: 30000 })\r\n .then(response => (this.show_ap(response.data)))\r\n },\r\n show_ap: function(data) {\r\n if (data.status) {\r\n console.log(\"[generate-ap.vue] Access point created, showing SSID\");\r\n window.access_point = data.ssid\r\n this.ssid_name = data.ssid\r\n this.ssid_password = data.password\r\n this.ssid_qr = data.qrcode\r\n this.start_capture()\r\n } else {\r\n console.log(\"[generate-ap.vue] Issue when creating AP, let's retry\");\r\n if(this.attempts != 0){\r\n setTimeout(function () { this.generate_ap() }.bind(this), 10000)\r\n this.attempts -= 1;\r\n } else {\r\n console.log(\"[generate-ap.vue] Fatal error when creating AP, showing the error message\");\r\n this.error = true\r\n }\r\n }\r\n },\r\n start_capture: function() {\r\n console.log(\"[generate-ap.vue] Starting the capture in background\");\r\n axios.get('/api/capture/start', { timeout: 30000 })\r\n .then(response => (this.get_capture_token(response.data)))\r\n },\r\n reboot: function() {\r\n console.log(\"[generate-ap.vue] Rebooting the device\");\r\n axios.get('/api/misc/reboot', { timeout: 30000 })\r\n .then(response => { console.log(response)})\r\n },\r\n get_capture_token: function(data) {\r\n if (data.status) {\r\n console.log(\"[generate-ap.vue] Capture token retrieved, waiting a device to connect\");\r\n this.capture_token = data.capture_token\r\n this.capture_start = Date.now()\r\n this.get_device()\r\n }\r\n },\r\n get_device: function() {\r\n this.interval = setInterval(() => {\r\n axios.get(`/api/device/get/${this.capture_token}`, { timeout: 30000 })\r\n .then(response => (this.check_device(response.data)))\r\n }, 500);\r\n },\r\n check_device: function(data) {\r\n if (data.status) {\r\n console.log(\"[generate-ap.vue] Device connected, going to capture view.\");\r\n clearInterval(this.interval);\r\n var capture_token = this.capture_token\r\n var capture_start = this.capture_start\r\n var device_name = data.name\r\n router.replace({\r\n name: 'capture',\r\n params: {\r\n capture_token: capture_token,\r\n capture_start: capture_start,\r\n device_name: device_name\r\n }\r\n });\r\n }\r\n }\r\n },\r\n created: function() {\r\n console.log(\"[generate-ap.vue] Showing generate-ap.vue\")\r\n this.generate_ap();\r\n }\r\n}\r\n</script>\r\n\r\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!./generate-ap.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!./generate-ap.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./generate-ap.vue?vue&type=template&id=357a8836&\"\nimport script from \"./generate-ap.vue?vue&type=script&lang=js&\"\nexport * from \"./generate-ap.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":""} |