platypush/platypush/backend/http/webapp/dist/static/js/chunk-5d632024.5840de9b.js.map

1 line
7.0 KiB
Plaintext

{"version":3,"sources":["webpack:///./src/components/panels/Switches/Switch.vue","webpack:///./src/components/panels/Switches/Switch.vue?75fc","webpack:///./src/components/panels/Switches/Mixin.vue","webpack:///./src/components/panels/Switches/Mixin.vue?618b","webpack:///./src/components/panels/Switches/Switch.vue?2bb9"],"names":["class","onToggle","loading","hasInfo","onInfo","disabled","value","state","name","components","Loading","ToggleSwitch","emits","props","type","String","required","Boolean","default","id","methods","event","stopPropagation","this","$emit","render","__scopeId","mixins","Utils","pluginName","bus","Object","config","selected","data","initialized","selectedDevice","devices","onRefreshEvent","refresh","toggle","device","request","response","on","reduce","obj","length","mounted","$watch","newValue","unmounted","off"],"mappings":"yNAGSA,MAAM,iC,EAEP,eAAwB,KAArBA,MAAM,cAAY,S,GAIpBA,MAAM,mC,yIARb,eAWM,OAXDA,MAAM,SAAU,QAAK,8CAAO,EAAAC,SAAA,qBAAQ,Y,CACxB,EAAAC,S,iBAAf,eAA0B,Y,sBAC1B,eAKM,MALN,EAKM,CAJU,EAAAC,S,iBAAd,eAES,U,MAFe,QAAK,8CAAU,EAAAC,OAAA,qBAAM,e,CAC3C,K,sBAEF,eAA2C,QAArCJ,MAAM,e,YAAe,eAAa,EAAD,O,0BAEzC,eAEM,MAFN,EAEM,CADJ,eAAqE,GAAtDK,SAAU,EAAAH,QAAUI,MAAO,EAAAC,MAAQ,QAAO,EAAAN,U,sEAShD,GACbO,KAAM,SACNC,WAAY,CAACC,UAAA,KAASC,eAAA,MACtBC,MAAO,CAAC,SAAU,QAElBC,MAAO,CACLL,KAAM,CACJM,KAAMC,OACNC,UAAU,GAGZT,MAAO,CACLO,KAAMG,QACNC,SAAS,GAGXhB,QAAS,CACPY,KAAMG,QACNC,SAAS,GAGXf,QAAS,CACPW,KAAMG,QACNC,SAAS,GAGXC,GAAI,CACFL,KAAMC,SAIVK,QAAS,CACPhB,OADO,SACAiB,GA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e,iBAG9Ba,UA5Ea,WA6EX5B,KAAKO,IAAIsB,IAAI,UAAW7B,KAAKe,kBC7ElB,U,kCCHf","file":"static/js/chunk-5d632024.5840de9b.js","sourcesContent":["<template>\n <div class=\"switch\" @click.stop=\"onToggle\">\n <Loading v-if=\"loading\" />\n <div class=\"name col-l-10 col-m-9 col-s-8\">\n <button v-if=\"hasInfo\" @click.prevent=\"onInfo\">\n <i class=\"fa fa-info\" />\n </button>\n <span class=\"name-content\" v-text=\"name\" />\n </div>\n <div class=\"toggler col-l-2 col-m-3 col-s-4\">\n <ToggleSwitch :disabled=\"loading\" :value=\"state\" @input=\"onToggle\" />\n </div>\n </div>\n</template>\n\n<script>\nimport ToggleSwitch from \"@/components/elements/ToggleSwitch\";\nimport Loading from \"@/components/Loading\";\n\nexport default {\n name: \"Switch\",\n components: {Loading, ToggleSwitch},\n emits: ['toggle', 'info'],\n\n props: {\n name: {\n type: String,\n required: true,\n },\n\n state: {\n type: Boolean,\n default: false,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n hasInfo: {\n type: Boolean,\n default: false,\n },\n\n id: {\n type: String,\n },\n },\n\n methods: {\n onInfo(event) {\n event.stopPropagation()\n this.$emit('info')\n return false\n },\n\n onToggle(event) {\n event.stopPropagation()\n this.$emit('toggle')\n return false\n },\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.switch {\n width: 100%;\n display: flex;\n position: relative;\n align-items: center;\n padding: .75em .5em;\n border-bottom: $default-border-2;\n cursor: pointer;\n\n &:hover {\n background: $hover-bg;\n }\n\n .toggler {\n text-align: right;\n }\n\n button {\n background: none;\n border: none;\n\n &:hover {\n color: $default-hover-fg-2;\n }\n }\n}\n</style>\n","import { render } from \"./Switch.vue?vue&type=template&id=38eb9831&scoped=true\"\nimport script from \"./Switch.vue?vue&type=script&lang=js\"\nexport * from \"./Switch.vue?vue&type=script&lang=js\"\n\nimport \"./Switch.vue?vue&type=style&index=0&id=38eb9831&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-38eb9831\"\n\nexport default script","<script>\nimport Utils from \"@/Utils\";\n\nexport default {\n name: \"SwitchesMixin\",\n mixins: [Utils],\n\n props: {\n pluginName: {\n type: String,\n required: true,\n },\n\n bus: {\n type: Object,\n required: true,\n },\n\n config: {\n type: Object,\n default: () => { return {} },\n },\n\n selected: {\n type: Boolean,\n default: false,\n }\n },\n\n data() {\n return {\n loading: false,\n initialized: false,\n selectedDevice: null,\n devices: {},\n }\n },\n\n methods: {\n onRefreshEvent(pluginName) {\n if (pluginName !== this.pluginName)\n return\n\n this.refresh()\n },\n\n async toggle(device, id) {\n if (id == null)\n id = device\n\n const response = await this.request(`${this.pluginName}.toggle`, {device: id})\n this.devices[device].on = response.on\n },\n\n async refresh() {\n this.loading = true\n try {\n this.devices = (await this.request(`${this.pluginName}.switch_status`)).reduce((obj, device) => {\n const name = device.name?.length ? device.name : device.id\n obj[name] = device\n return obj\n }, {})\n } finally {\n this.loading = false\n }\n }\n },\n\n mounted() {\n this.$watch(() => this.selected, (newValue) => {\n if (newValue && !this.initialized) {\n this.refresh()\n this.initialized = true\n }\n })\n\n this.bus.on('refresh', this.onRefreshEvent)\n },\n\n unmounted() {\n this.bus.off('refresh', this.onRefreshEvent)\n },\n}\n</script>\n","import script from \"./Mixin.vue?vue&type=script&lang=js\"\nexport * from \"./Mixin.vue?vue&type=script&lang=js\"\n\nexport default script","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Switch.vue?vue&type=style&index=0&id=38eb9831&lang=scss&scoped=true\""],"sourceRoot":""}