1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["settings"],{"3f42":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"account"},[i("md-app",{attrs:{"md-waterfall":"","md-mode":"fixed"}},[i("md-app-toolbar",{staticClass:"md-primary toolbar"},[i("div",{staticClass:"md-toolbar-section-start"},[i("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.back()}}},[i("md-icon",[t._v("arrow_back")])],1),i("h3",{staticClass:"md-title",staticStyle:{flex:"1"}},[t._v(t._s(t.lang.title))])],1)]),i("md-app-content",[i("v-touch",{attrs:{"swipe-options":{direction:"horizontal"}},on:{swiperight:function(e){return t.back()}}},[i("div",{ref:"list_placeholder",staticStyle:{height:"54px"}}),i("md-list",[i("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.subheader[0]))]),i("md-list-item",{on:{click:function(e){return t.openResetDialog("account")}}},[i("md-icon",[t._v("person")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.reset_list[0]))]),t.account_loading?i("md-progress-spinner",{attrs:{"md-diameter":22,"md-stroke":3,"md-mode":"indeterminate"}}):t._e()],1),i("md-list-item",{on:{click:function(e){return t.openResetDialog("codebook")}}},[i("md-icon",[t._v("format_align_left")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.reset_list[1]))]),t.codebook_loading?i("md-progress-spinner",{attrs:{"md-diameter":22,"md-stroke":3,"md-mode":"indeterminate"}}):t._e()],1),i("md-list-item",{on:{click:function(e){return t.openResetDialog("application")}}},[i("md-icon",[t._v("layers")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.reset_list[2]))]),t.application_loading?i("md-progress-spinner",{attrs:{"md-diameter":22,"md-stroke":3,"md-mode":"indeterminate"}}):t._e()],1),i("md-list-item",{on:{click:t.open_dialog}},[i("md-icon",[t._v("vpn_key")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.reset_list[3]))])],1),i("md-divider"),i("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.subheader[1]))]),i("md-list-item",[i("md-icon",[t._v("format_color_text")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.option_list[0]))]),i("md-switch",{staticClass:"md-primary",model:{value:t.is_chinese,callback:function(e){t.is_chinese=e},expression:"is_chinese"}})],1),i("md-list-item",[i("md-icon",[t._v("brightness_6")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.option_list[1]))]),i("md-switch",{staticClass:"md-primary",model:{value:t.is_dark_mode,callback:function(e){t.is_dark_mode=e},expression:"is_dark_mode"}})],1),i("md-list-item",[i("md-icon",[t._v("update")]),i("md-field",[i("label",{attrs:{for:"expired_time"}},[t._v(t._s(t.lang.option_list[2]))]),i("md-select",{attrs:{name:"expired_time",id:"expired_time"},model:{value:t.expired_time,callback:function(e){t.expired_time=e},expression:"expired_time"}},[i("md-option",{attrs:{value:"300000"}},[t._v("5 min")]),i("md-option",{attrs:{value:"600000"}},[t._v("10 min")]),i("md-option",{attrs:{value:"900000"}},[t._v("15 min")]),i("md-option",{attrs:{value:Number.MAX_SAFE_INTEGER}},[t._v(t._s(t.lang.expired_time))])],1)],1)],1),i("md-divider"),i("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.subheader[2]))]),i("md-list-item",{staticStyle:{"list-style-type":"none"},on:{click:function(e){t.reset_row_data_active=!0}}},[i("md-icon",[t._v("call_merge")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.import_export_list[0]))])],1),i("md-list-item",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.copy_data,expression:"copy_data",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.onCopyCodebook,expression:"onCopyCodebook",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:t.onErrorCodebook,expression:"onErrorCodebook",arg:"error"}],staticStyle:{"list-style-type":"none"}},[i("md-icon",[t._v("call_split")]),i("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.import_export_list[1]))])],1)],1),i("div",{staticStyle:{height:"1rem"}}),i("md-dialog-prompt",{attrs:{"md-active":t.reset_row_data_active,"md-title":t.lang.import_dialog.title,"md-input-placeholder":t.lang.import_dialog.placeholder,"md-confirm-text":t.lang.import_dialog.confirm,"md-cancel-text":t.lang.import_dialog.cancel},on:{"update:mdActive":function(e){t.reset_row_data_active=e},"update:md-active":function(e){t.reset_row_data_active=e},"md-confirm":t.resetRowData},model:{value:t.new_row_data,callback:function(e){t.new_row_data=e},expression:"new_row_data"}}),i("md-dialog-prompt",{attrs:{"md-active":t.reset_main_pwd_active,"md-title":t.lang.dialog.title,"md-input-maxlength":"30","md-input-placeholder":t.lang.dialog.placeholder,"md-confirm-text":t.lang.dialog.confirm,"md-cancel-text":t.lang.dialog.cancel},on:{"update:mdActive":function(e){t.reset_main_pwd_active=e},"update:md-active":function(e){t.reset_main_pwd_active=e},"md-confirm":t.resetPwd},model:{value:t.new_main_pwd,callback:function(e){t.new_main_pwd=e},expression:"new_main_pwd"}}),i("md-dialog-confirm",{attrs:{"md-active":t.reset_confirm,"md-title":t.lang.reset_dialog.title,"md-content":t.lang.reset_dialog.content,"md-confirm-text":t.lang.reset_dialog.confirm,"md-cancel-text":t.lang.reset_dialog.cancel},on:{"update:mdActive":function(e){t.reset_confirm=e},"update:md-active":function(e){t.reset_confirm=e},"md-cancel":function(e){t.reset_confirm=!1},"md-confirm":t.resetStart}}),i("md-snackbar",{attrs:{"md-position":"center","md-active":t.show_snackbar,"md-persistent":""},on:{"update:mdActive":function(e){t.show_snackbar=e},"update:md-active":function(e){t.show_snackbar=e}}},[i("span",[t._v(t._s(t.snakebar_msg))])])],1)],1)],1)],1)},a=[],n=(i("fae2"),i("0bd5"),i("9b42"),i("0861"),i("d211")),o=i("cf6b"),c=i("c71e"),r=(i("2503"),i("36f0")),d=i("e6a3"),l=i("bfd3"),_={name:"Add",data:function(){return{account_loading:!1,codebook_loading:!1,application_loading:!1,reset_main_pwd_active:!1,new_row_data:"",reset_row_data_active:!1,new_main_pwd:"",reset_active:!1,is_chinese:!1,is_dark_mode:!1,expired_time:3e5,show_snackbar:!1,snakebar_msg:"",has_init:!1,lang:"",clientHeight:"",reset_confirm:!1,reset_type:""}},computed:Object(n["a"])(Object(n["a"])({},Object(o["c"])(["user_infos","row_data","row_pwd","settings"])),{},{copy_data:function(){return this.row_data?this.row_data:"无内容"}}),methods:Object(n["a"])(Object(n["a"])({},Object(o["b"])(["setUserInfo","setRowData","setRowPwd","setSettings"])),{},{changeFixed:function(t){this.$refs.list_placeholder.parentNode.parentNode.style.maxHeight=t+"px",this.$refs.list_placeholder.parentNode.style.minHeight=t-32+"px",window.document.documentElement.setAttribute("data-theme",this.settings.is_dark_mode?"dark":"light")},init:function(){if(l["a"].call(this),0!=Object.keys(this.row_pwd).length){var t=(new Date).getTime();t-this.row_pwd.create_time<this.settings.expired_time?(this.is_chinese=this.settings.is_chinese,this.is_dark_mode=this.settings.is_dark_mode,this.expired_time=this.settings.expired_time,this.initLanguage(),setTimeout(function(){this.has_init=!0,console.log("本页信息覆写完成")}.bind(this),10)):this.turnToHome("密码超时")}else this.turnToHome("无密码")},initLanguage:function(){this.settings.is_chinese?this.lang=Object(r["a"])().settings.CHS:this.lang=Object(r["a"])().settings.EN,console.log("语言配置完成")},back:function(){this.reset_active||this.$router.go(-1)},turnToHome:function(t){console.log(t),this.$router.replace("/")},resetAccount:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.reset_active=!0,t&&(this.account_loading=!0,setTimeout(function(){this.account_loading=!1,this.snakebar_msg=this.lang.snakebar_msg.reset_account,this.show_snackbar=!0}.bind(this),1e3));var i={user_name:"A Little Canary",cid:"Codebook",row_login_pwd:"",drivce:e?"":this.user_infos.drivce,cloud_drivce:this.settings.is_chinese?"暂无":"unknown",update_time:(new Date).getTime()};this.setUserInfo([i,this]),console.log("用户信息覆写完成"),this.reset_active=!1},resetCodebook:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.reset_active=!0,t&&(this.codebook_loading=!0,setTimeout(function(){this.codebook_loading=!1,this.snakebar_msg=this.lang.snakebar_msg.reset_codebook,this.show_snackbar=!0}.bind(this),1e3)),this.setRowData(["",this]),console.log("密码本覆写完成"),this.reset_active=!1},resetApplication:function(){this.application_loading=!0,this.reset_active=!0,this.resetAccount(!1,!0),this.resetCodebook(!1),this.setRowPwd(["",this]),console.log("主密码覆写完成");var t={is_chinese:!0,is_dark_mode:!1,expired_time:3e5};this.setSettings([t,this]),console.log("个性化设置覆写完成"),this.reset_active=!1,this.application_loading=!1,this.turnToHome("项目重置完成")},resetSettings:function(){var t={is_chinese:this.is_chinese,is_dark_mode:this.is_dark_mode,expired_time:this.expired_time};this.setSettings([t,this]),console.log("个性化设置覆写完成"),this.settings.is_chinese?this.lang=Object(r["a"])().settings.CHS:this.lang=Object(r["a"])().settings.EN,window.document.documentElement.setAttribute("data-theme",this.settings.is_dark_mode?"dark":"light"),console.log("语言配置完成"),this.snakebar_msg=this.lang.snakebar_msg.reset_settings,this.show_snackbar=!0},open_dialog:function(){this.reset_main_pwd_active=!0},resetRowData:function(t){if(!t.trim())return this.snakebar_msg=this.lang.snakebar_msg.reset_row_data_failed,void(this.show_snackbar=!0);this.setRowData([t,this]),this.snakebar_msg=this.lang.snakebar_msg.reset_row_data_successful,this.show_snackbar=!0},resetPwd:function(t){if(t.trim()||(this.snakebar_msg=this.lang.snakebar_msg.reset_pwd_failed,this.show_snackbar=!0),this.row_data){var e,i=Object(c["b"])(this.row_pwd.main_code);try{e=Object(c["a"])(i,this.row_data)}catch(r){return console.log(r),void this.turnToHome("密码错误")}var s=JSON.parse(e),a=Object(c["c"])(t,s);this.setRowData([a,this]),console.log("密码本密码修改成功,覆写完成")}var n=Object(c["d"])(t),o={main_code:n,create_time:(new Date).getTime()};this.setRowPwd([o,this]),this.snakebar_msg=this.lang.snakebar_msg.reset_pwd_successful,this.show_snackbar=!0},openResetDialog:function(t){this.reset_confirm=!0,this.reset_type=t},resetStart:function(){switch(console.log("用户点击继续,重置开始"),this.reset_type){case"account":this.resetAccount();break;case"codebook":this.resetCodebook();break;case"application":this.resetApplication();break;default:return}this.reset_type=""},onCopyCodebook:function(t){this.snakebar_msg=this.lang.copy.successful,this.show_snackbar=!0},onErrorCodebook:function(t){this.snakebar_msg=this.lang.copy.failed,this.show_snackbar=!0}}),created:function(){this.lang=Object(r["a"])().settings.CHS,console.log("临时语言系统加载完成"),this.init()},mounted:function(){this.clientHeight="".concat(document.documentElement.clientHeight),window.onresize=function(){this.clientHeight="".concat(document.documentElement.clientHeight),Object(d["a"])()}.bind(this)},watch:{clientHeight:function(){this.changeFixed(this.clientHeight)},is_chinese:function(){this.has_init&&this.resetSettings()},is_dark_mode:function(){this.has_init&&this.resetSettings()},expired_time:function(){this.has_init&&this.resetSettings()}},beforeDestroy:function(){},components:{}},m=_,h=(i("dced"),i("5d22")),p=Object(h["a"])(m,s,a,!1,null,"3f5a369c",null);e["default"]=p.exports},"9ab5":function(t,e,i){},dced:function(t,e,i){"use strict";i("9ab5")}}]); |