mirror of
https://github.com/yuzu-emu/liftinstall.git
synced 2025-11-05 04:04:57 +00:00
2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
(function(t){function a(a){for(var n,o,l=a[0],r=a[1],c=a[2],u=0,p=[];u<l.length;u++)o=l[u],s[o]&&p.push(s[o][0]),s[o]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);d&&d(a);while(p.length)p.shift()();return i.push.apply(i,c||[]),e()}function e(){for(var t,a=0;a<i.length;a++){for(var e=i[a],n=!0,l=1;l<e.length;l++){var r=e[l];0!==s[r]&&(n=!1)}n&&(i.splice(a--,1),t=o(o.s=e[0]))}return t}var n={},s={app:0},i=[];function o(a){if(n[a])return n[a].exports;var e=n[a]={i:a,l:!1,exports:{}};return t[a].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=t,o.c=n,o.d=function(t,a,e){o.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:e})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,a){if(1&a&&(t=o(t)),8&a)return t;if(4&a&&"object"===typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var n in t)o.d(e,n,function(a){return t[a]}.bind(null,n));return e},o.n=function(t){var a=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(a,"a",a),a},o.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},o.p="/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],r=l.push.bind(l);l.push=a,l=l.slice();for(var c=0;c<l.length;c++)a(l[c]);var d=r;i.push([0,"chunk-vendors"]),e()})({0:function(t,a,e){t.exports=e("56d7")},"034f":function(t,a,e){"use strict";var n=e("64a9"),s=e.n(n);s.a},"56d7":function(t,a,e){"use strict";e.r(a);var n=e("f499"),s=e.n(n),i=(e("cadf"),e("551c"),e("f751"),e("097d"),e("2b0e")),o=function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("div",{staticClass:"is-max-height",attrs:{id:"app"}},[n("section",{staticClass:"section is-max-height"},[n("div",{staticClass:"container is-max-height"},[n("div",{staticClass:"columns is-max-height"},[t.$root.$data.metadata.is_launcher?t._e():n("div",{staticClass:"column is-one-third has-padding"},[n("img",{attrs:{src:e("cf05"),width:"60%"}}),n("br"),n("br"),t.$root.$data.metadata.preexisting_install?t._e():n("h2",{staticClass:"subtitle"},[t._v("\n Welcome to the "+t._s(t.$root.$data.attrs.name)+" installer!\n ")]),t.$root.$data.metadata.preexisting_install?t._e():n("h2",{staticClass:"subtitle"},[t._v("\n We will have you up and running in just a few moments.\n ")]),t.$root.$data.metadata.preexisting_install?n("h2",{staticClass:"subtitle"},[t._v("\n Welcome to the "+t._s(t.$root.$data.attrs.name)+" Maintenance Tool.\n ")]):t._e()]),n("router-view")],1)])])])},l=[],r=(e("034f"),e("2877")),c={},d=Object(r["a"])(c,o,l,!1,null,null,null),u=d.exports,p=e("8c4f"),f=function(){var t=this,a=t.$createElement;t._self._c;return t._m(0)},m=[function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"column has-padding"},[e("h4",{staticClass:"subtitle"},[t._v("Downloading config...")]),e("br"),e("progress",{staticClass:"progress is-info is-medium",attrs:{value:"0",max:"100"}},[t._v("\n 0%\n ")])])}],h=(e("a481"),{name:"DownloadConfig",created:function(){this.download_install_status()},methods:{download_install_status:function(){var t=this;this.$root.ajax("/api/installation-status",function(a){t.$root.metadata=a,t.download_config()})},download_config:function(){var t=this;this.$root.ajax("/api/config",function(a){t.$root.config=a,t.choose_next_state()},function(a){console.error("Got error while downloading config: "+a),t.$root.metadata.is_launcher?t.$root.exit():t.$router.replace({name:"showerr",params:{msg:"Got error while downloading config: "+a}})})},choose_next_state:function(){var t=this.$root;if(t.config.new_tool)this.$router.push("/install/updater");else if(t.metadata.preexisting_install){t.install_location=t.metadata.install_path;for(var a=0;a<t.config.packages.length;a++)t.config.packages[a].default=!1,t.config.packages[a].installed=!1;for(var e=0;e<t.metadata.database.packages.length;e++)for(a=0;a<t.config.packages.length;a++)t.config.packages[a].name===t.metadata.database.packages[e].name&&(t.config.packages[a].default=!0,t.config.packages[a].installed=!0);t.metadata.is_launcher?this.$router.replace("/install/regular"):this.$router.replace("/modify")}else{for(a=0;a<t.config.packages.length;a++)t.config.packages[a].installed=!1;this.$root.ajax("/api/default-path",function(a){null!=a.path&&(t.install_location=a.path)}),this.$router.replace("/packages")}}}}),_=h,g=Object(r["a"])(_,f,m,!1,null,null,null),v=g.exports,b=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"column has-padding"},[e("h4",{staticClass:"subtitle"},[t._v("Select which packages you want to install:")]),e("div",{staticClass:"tile is-ancestor"},t._l(t.$root.$data.config.packages,function(a){return e("div",{key:a.name,staticClass:"tile is-parent",attrs:{index:a.name}},[e("div",{staticClass:"tile is-child"},[e("div",{staticClass:"box clickable-box",on:{"!click":function(t){t.stopPropagation(),a.default=!a.default}}},[e("label",{staticClass:"checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:a.default,expression:"Lpackage.default"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(a.default)?t._i(a.default,null)>-1:a.default},on:{change:function(e){var n=a.default,s=e.target,i=!!s.checked;if(Array.isArray(n)){var o=null,l=t._i(n,o);s.checked?l<0&&t.$set(a,"default",n.concat([o])):l>-1&&t.$set(a,"default",n.slice(0,l).concat(n.slice(l+1)))}else t.$set(a,"default",i)}}}),t._v("\n "+t._s(a.name)+"\n "),a.installed?e("span",[e("i",[t._v("(installed)")])]):t._e()]),e("p",[t._v("\n "+t._s(a.description)+"\n ")])])])])}),0),!t.$root.$data.metadata.preexisting_install&&t.advanced?e("div",{staticClass:"subtitle is-6"},[t._v("Install Location")]):t._e(),!t.$root.$data.metadata.preexisting_install&&t.advanced?e("div",{staticClass:"field has-addons"},[e("div",{staticClass:"control is-expanded"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.$root.$data.install_location,expression:"$root.$data.install_location"}],staticClass:"input",attrs:{type:"text",placeholder:"Enter a install path here"},domProps:{value:t.$root.$data.install_location},on:{input:function(a){a.target.composing||t.$set(t.$root.$data,"install_location",a.target.value)}}})]),e("div",{staticClass:"control"},[e("a",{staticClass:"button is-dark",on:{click:t.select_file}},[t._v("\n Select\n ")])])]):t._e(),e("div",{staticClass:"is-right-floating is-bottom-floating"},[e("div",{staticClass:"field is-grouped"},[e("p",{staticClass:"control"},[t.$root.$data.config.hide_advanced||t.$root.$data.metadata.preexisting_install||t.advanced?t._e():e("a",{staticClass:"button is-medium",on:{click:function(a){t.advanced=!0}}},[t._v("Advanced...")])]),e("p",{staticClass:"control"},[t.$root.$data.metadata.preexisting_install?t._e():e("a",{staticClass:"button is-dark is-medium",on:{click:t.install}},[t._v("Install")])]),e("p",{staticClass:"control"},[t.$root.$data.metadata.preexisting_install?e("a",{staticClass:"button is-dark is-medium",on:{click:t.install}},[t._v("Modify")]):t._e()])])]),e("div",{staticClass:"field is-grouped is-left-floating is-bottom-floating"},[e("p",{staticClass:"control"},[t.$root.$data.metadata.preexisting_install?e("a",{staticClass:"button is-medium",on:{click:t.go_back}},[t._v("Back")]):t._e()])])])},$=[],k={name:"SelectPackages",data:function(){return{advanced:!1}},methods:{select_file:function(){window.external.invoke(s()({SelectInstallDir:{callback_name:"selectFileCallback"}}))},install:function(){this.$router.push("/install/regular")},go_back:function(){this.$router.go(-1)}}},w=k,C=Object(r["a"])(w,b,$,!1,null,null,null),x=C.exports,y=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"column has-padding"},[e("h4",{staticClass:"subtitle"},[t._v("An error occurred:")]),e("pre",[t._v(t._s(t.msg))]),e("div",{staticClass:"field is-grouped is-right-floating is-bottom-floating"},[e("p",{staticClass:"control"},[t.remaining?e("a",{staticClass:"button is-primary is-medium",on:{click:t.go_back}},[t._v("Back")]):t._e()])])])},O=[],P={name:"ErrorView",data:function(){return{msg:this.$route.params.msg,remaining:window.history.length>1}},methods:{go_back:function(){this.$router.go(-1)}}},T=P,j=Object(r["a"])(T,y,O,!1,null,null,null),E=j.exports,S=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"column has-padding"},[t.$root.$data.metadata.is_launcher||t.is_update?e("h4",{staticClass:"subtitle"},[t._v("Checking for updates...")]):t.is_uninstall?e("h4",{staticClass:"subtitle"},[t._v("Uninstalling...")]):t.is_updater_update?e("h4",{staticClass:"subtitle"},[t._v("Downloading self-update...")]):e("h4",{staticClass:"subtitle"},[t._v("Installing...")]),e("div",{domProps:{innerHTML:t._s(t.$root.$data.config.installing_message)}}),e("br"),e("div",{domProps:{innerHTML:t._s(t.progress_message)}}),e("progress",{staticClass:"progress is-info is-medium",attrs:{max:"100"},domProps:{value:t.progress}},[t._v("\n "+t._s(t.progress)+"%\n ")])])},L=[],I={name:"InstallPackages",data:function(){return{progress:0,progress_message:"Please wait...",is_uninstall:!1,is_updater_update:!1,is_update:!1,failed_with_error:!1,packages_installed:0}},created:function(){this.is_uninstall="uninstall"===this.$route.params.kind,this.is_updater_update="updater"===this.$route.params.kind,this.is_update="update"===this.$route.params.kind,console.log("Installer kind: "+this.$route.params.kind),this.install()},methods:{install:function(){for(var t=this,a=this.$root,e={},n=0;n<a.config.packages.length;n++){var s=a.config.packages[n];null!=s.default&&(e[s.name]=s.default)}e["path"]=a.install_location;var i="/api/start-install";this.is_uninstall&&(i="/api/uninstall"),this.is_updater_update&&(i="/api/update-updater"),this.$root.stream_ajax(i,function(e){e.hasOwnProperty("Status")&&(t.progress_message=e.Status[0],t.progress=100*e.Status[1]),e.hasOwnProperty("PackageInstalled")&&(t.packages_installed+=1),e.hasOwnProperty("Error")&&(a.metadata.is_launcher?a.exit():(t.failed_with_error=!0,t.$router.replace({name:"showerr",params:{msg:e.Error}})))},function(e){t.is_updater_update?a.metadata.is_launcher?t.$router.replace("/install/regular"):a.metadata.preexisting_install?t.$router.replace("/modify"):t.$router.replace("/packages"):a.metadata.is_launcher?a.exit():t.failed_with_error||(t.is_uninstall?t.$router.replace({name:"complete",params:{uninstall:!0,update:t.is_update,installed:t.packages_installed}}):t.$router.replace({name:"complete",params:{uninstall:!1,update:t.is_update,installed:t.packages_installed}}))},void 0,e)}}},M=I,A=Object(r["a"])(M,S,L,!1,null,null,null),H=A.exports,R=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"column has-padding"},[t.was_update?e("div",[t.has_installed?e("div",[e("h4",{staticClass:"subtitle"},[t._v(t._s(t.$root.$data.attrs.name)+" has been updated.")]),e("p",[t._v("You can find your installed applications in your start menu.")])]):e("div",[e("h4",{staticClass:"subtitle"},[t._v(t._s(t.$root.$data.attrs.name)+" is already up to date!")]),e("p",[t._v("You can find your installed applications in your start menu.")])])]):t.was_install?e("div",[e("h4",{staticClass:"subtitle"},[t._v("Thanks for installing "+t._s(t.$root.$data.attrs.name)+"!")]),e("p",[t._v("You can find your installed applications in your start menu.")])]):e("div",[e("h4",{staticClass:"subtitle"},[t._v(t._s(t.$root.$data.attrs.name)+" has been uninstalled.")])]),e("div",{staticClass:"field is-grouped is-right-floating is-bottom-floating"},[e("p",{staticClass:"control"},[e("a",{staticClass:"button is-dark is-medium",on:{click:t.exit}},[t._v("Exit")])])])])},q=[],U={name:"CompleteView",data:function(){return{was_install:!this.$route.params.uninstall,was_update:this.$route.params.update,has_installed:this.$route.params.packages_installed>0}},methods:{exit:function(){this.$root.exit()}}},D=U,J=Object(r["a"])(D,R,q,!1,null,null,null),N=J.exports,G=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"column has-padding"},[e("h4",{staticClass:"subtitle"},[t._v("Choose an option:")]),e("a",{staticClass:"button is-dark is-medium",on:{click:t.update}},[t._v("\n Update\n ")]),e("br"),e("br"),e("a",{staticClass:"button is-dark is-medium",on:{click:t.modify_packages}},[t._v("\n Modify\n ")]),e("br"),e("br"),e("a",{staticClass:"button is-dark is-medium",on:{click:t.prepare_uninstall}},[t._v("\n Uninstall\n ")]),t.show_uninstall?e("div",{staticClass:"modal is-active"},[e("div",{staticClass:"modal-background"}),e("div",{staticClass:"modal-card"},[e("header",{staticClass:"modal-card-head"},[e("p",{staticClass:"modal-card-title"},[t._v("Are you sure you want to uninstall "+t._s(t.$root.$data.attrs.name)+"?")])]),e("footer",{staticClass:"modal-card-foot"},[e("button",{staticClass:"button is-danger",on:{click:t.uninstall}},[t._v("Yes")]),e("button",{staticClass:"button",on:{click:t.cancel_uninstall}},[t._v("No")])])])]):t._e()])},Y=[],B={name:"ModifyView",data:function(){return{show_uninstall:!1}},methods:{update:function(){this.router.push("/install/update")},modify_packages:function(){this.router.push("/packages")},prepare_uninstall:function(){this.show_uninstall=!0},cancel_uninstall:function(){this.show_uninstall=!1},uninstall:function(){this.router.push("/install/uninstall")}}},V=B,W=Object(r["a"])(V,G,Y,!1,null,null,null),X=W.exports;i["a"].use(p["a"]);var F=new p["a"]({routes:[{path:"/config",name:"config",component:v},{path:"/packages",name:"packages",component:x},{path:"/install/:kind",name:"install",component:H},{path:"/showerr",name:"showerr",component:E},{path:"/complete/:uninstall/:update/:packages_installed",name:"complete",component:N},{path:"/modify",name:"modify",component:X},{path:"/",redirect:"/config"}]}),z=0;function K(t,a,e,n){void 0===e&&(e=Z),console.log("Making HTTP request to "+t);var s=new XMLHttpRequest;if(s.addEventListener("load",function(){200===this.status&&-1!==this.getResponseHeader("Content-Type").indexOf("application/json")?a(JSON.parse(this.responseText)):e(this.responseText)}),s.addEventListener("error",e),s.open(null==n?"GET":"POST",t+"?nocache="+z++,!0),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),null!=n){var i="";for(var o in n)n.hasOwnProperty(o)&&(""!==i&&(i+="&"),i+=encodeURIComponent(o)+"="+encodeURIComponent(n[o]));s.send(i)}else s.send()}function Q(t,a,e,n,s){var i=new XMLHttpRequest;console.log("Making streaming HTTP request to "+t),i.addEventListener("load",function(){200===this.status?e(this.responseText):n(this.responseText)});var o="",l=0;if(i.onreadystatechange=function(){if(i.readyState>2){var t;o+=i.responseText.substr(l);while((t=o.indexOf("\n"))>=0){var e=o.substring(0,t).trim();if(o=o.substring(t+1),0!==e.length){var n=JSON.parse(e);a(n)}}l=i.responseText.length}},i.addEventListener("error",n),i.open(null==s?"GET":"POST",t+"?nocache="+z++,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),null!=s){var r="";for(var c in s)s.hasOwnProperty(c)&&(""!==r&&(r+="&"),r+=encodeURIComponent(c)+"="+encodeURIComponent(s[c]));i.send(r)}else i.send()}function Z(t){console.error("A AJAX request failed, and was not caught:"),console.error(t)}e("5abe");function tt(t){console[t]=function(){var a=Array.prototype.slice.apply(arguments).join(" ");window.external.invoke(s()({Log:{kind:t,msg:a}}))}}if(i["a"].config.productionTip=!1,void 0!==window.external&&void 0!==window.external.invoke){window.onerror=function(t,a,e){old_onerror(t,a,e),window.external.invoke(s()({Log:{kind:"error",msg:t+" @ "+a+":"+e}}))};for(var at=["log","warn","error"],et=0;et<at.length;et++)tt(at[et])}function nt(t){switch(t.keyCode){case 116:t.preventDefault();break}}K("/api/dark-mode",function(t){t&&document.body.classList.add("has-background-black-ter")}),window.addEventListener("keydown",nt),document.getElementById("window-title").innerText=base_attributes.name+" Installer";new i["a"]({router:F,data:{attrs:base_attributes,config:{},install_location:"",show_install_location:!0,metadata:{database:[],install_path:"",preexisting_install:!1}},render:function(t){return t(u)},methods:{exit:function(){K("/api/exit",function(){},function(t){alert("LiftInstall encountered and error while exiting: "+t+"\nPlease upload the log file (in the same directory as the installer) to the respective maintainers for this application (where you got it from!)")})},ajax:K,stream_ajax:Q}}).$mount("#app")},"64a9":function(t,a,e){},cf05:function(t,a,e){t.exports=e.p+"img/logo.png"}});
|
|
//# sourceMappingURL=app.js.map
|