Files
vuefilemanager/public/chunks/app-others.js
2022-01-13 11:43:04 +01:00

1 line
19 KiB
JavaScript
Vendored

(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{ijzm:function(t,e,i){"use strict";i.r(e);var a=i("o0o1"),s=i.n(a),o=i("CjXH"),r=i("A5+z"),n=i("gahf"),l=i("4TWA"),c=i("xxrA"),d=i("D+dh"),u=i("jH4x"),p=i("eZ9V"),g=i("Nv84"),m=i("13Td"),v=i("UD3w"),f=i("qefO"),_=i("KnjL"),b=i("TJPC"),h=i("xCqy"),C=i("L2JU"),w=i("vDqi"),$=i.n(w);function y(t,e,i,a,s,o,r){try{var n=t[o](r),l=n.value}catch(t){return void i(t)}n.done?e(l):Promise.resolve(l).then(a,s)}function k(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function S(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var x={name:"AppOthers",components:{AppInputButton:i("gBgQ").a,ValidationObserver:r.ValidationObserver,ValidationProvider:r.ValidationProvider,AppInputSwitch:u.a,AppInputText:v.a,PageTabGroup:n.a,SwitchInput:c.a,SelectInput:l.a,ImageInput:d.a,ButtonBase:g.a,Edit2Icon:o.y,FormLabel:p.a,SetupBox:m.a,required:b.a,PageTab:f.a,InfoBox:_.a},computed:function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?k(Object(i),!0).forEach((function(e){S(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},Object(C.b)(["config"])),data:function(){return{isLoading:!0,isFlushingCache:!1,app:void 0,facebook:{allowedService:!1,isVisibleCredentialsForm:!1,credentials:{key:void 0,secret:void 0}},google:{allowedService:!1,isVisibleCredentialsForm:!1,credentials:{key:void 0,secret:void 0}},github:{allowedService:!1,isVisibleCredentialsForm:!1,credentials:{key:void 0,secret:void 0}}}},methods:{storeCredentials:function(t){var e,i=this;return(e=s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.$refs.credentialsForm.validate();case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:i.isLoading=!0,$.a.post("/api/admin/settings/social-service",{client_id:i[t].credentials.client_id,client_secret:i[t].credentials.client_secret,service:t}).then((function(){i.$store.commit("SET_SOCIAL_LOGIN_CONFIGURED",t),i[t].allowedService=!0,i[t].isVisibleCredentialsForm=!1,h.a.$emit("toaster",{type:"success",message:i.$t("toaster.credentials_set",{service:t})})})).catch((function(t){500===t.response.status&&(i.isError=!0,i.errorMessage=t.response.data.message)})).finally((function(){return i.isLoading=!1}));case 7:case"end":return e.stop()}}),e)})),function(){var t=this,i=arguments;return new Promise((function(a,s){var o=e.apply(t,i);function r(t){y(o,a,s,r,n,"next",t)}function n(t){y(o,a,s,r,n,"throw",t)}r(void 0)}))})()},flushCache:function(){var t=this;this.isFlushingCache=!0,$.a.get("/api/admin/settings/flush-cache").then((function(){h.a.$emit("toaster",{type:"success",message:"Your cache was successfully deleted."})})).finally((function(){t.isFlushingCache=!1}))}},mounted:function(){var t=this;this.facebook.allowedService=this.config.allowedFacebookLogin,this.google.allowedService=this.config.allowedGoogleLogin,this.github.allowedService=this.config.allowedGithubLogin,$.a.get("/api/admin/settings",{params:{column:"contact_email|google_analytics|default_max_storage_amount|registration|storage_limitation|mimetypes_blacklist|upload_limit|user_verification"}}).then((function(e){t.isLoading=!1,t.app={contactMail:e.data.contact_email,googleAnalytics:e.data.google_analytics,defaultStorage:e.data.default_max_storage_amount,userRegistration:parseInt(e.data.registration),storageLimitation:parseInt(e.data.storage_limitation),mimetypesBlacklist:e.data.mimetypes_blacklist,uploadLimit:e.data.upload_limit,userVerification:parseInt(e.data.user_verification)}}))}},L=i("KHd+"),I=Object(L.a)(x,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("PageTab",{attrs:{"is-loading":t.isLoading}},[i("div",{staticClass:"card shadow-card"},[i("FormLabel",[t._v("\n\t\t\t\t"+t._s(t.$t("Storage & Upload"))+"\n\t\t\t")]),t._v(" "),"metered"!==t.config.subscriptionType?i("div",[i("AppInputSwitch",{attrs:{title:t.$t("admin_settings.others.storage_limit"),description:t.$t("admin_settings.others.storage_limit_help")}},[i("SwitchInput",{staticClass:"switch",attrs:{state:t.app.storageLimitation},on:{input:function(e){return t.$updateText("/admin/settings","storage_limitation",t.app.storageLimitation)}},model:{value:t.app.storageLimitation,callback:function(e){t.$set(t.app,"storageLimitation",e)},expression:"app.storageLimitation"}})],1),t._v(" "),t.app.storageLimitation?i("AppInputText",{attrs:{title:t.$t("admin_settings.others.default_storage")}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.app.defaultStorage,expression:"app.defaultStorage"}],staticClass:"focus-border-theme input-dark",attrs:{min:"1",max:"999999999",placeholder:t.$t("admin_settings.others.default_storage_plac"),type:"number"},domProps:{value:t.app.defaultStorage},on:{input:[function(e){e.target.composing||t.$set(t.app,"defaultStorage",e.target.value)},function(e){return t.$updateText("/admin/settings","default_max_storage_amount",t.app.defaultStorage)}]}})]):t._e()],1):t._e(),t._v(" "),i("AppInputText",{attrs:{title:t.$t("admin_settings.others.upload_limit"),description:t.$t("admin_settings.others.upload_limit_help")}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.app.uploadLimit,expression:"app.uploadLimit"}],staticClass:"focus-border-theme input-dark",attrs:{placeholder:t.$t("admin_settings.others.upload_limit_plac"),type:"number",min:"0",step:"1"},domProps:{value:t.app.uploadLimit},on:{input:[function(e){e.target.composing||t.$set(t.app,"uploadLimit",e.target.value)},function(e){return t.$updateText("/admin/settings","upload_limit",t.app.uploadLimit,!0)}]}})]),t._v(" "),i("AppInputText",{attrs:{title:t.$t("admin_settings.others.mimetypes_blacklist"),description:t.$t("admin_settings.others.mimetypes_blacklist_help"),"is-last":!0}},[i("textarea",{directives:[{name:"model",rawName:"v-model",value:t.app.mimetypesBlacklist,expression:"app.mimetypesBlacklist"}],staticClass:"focus-border-theme input-dark",attrs:{rows:"2",placeholder:t.$t("admin_settings.others.mimetypes_blacklist_plac"),type:"text"},domProps:{value:t.app.mimetypesBlacklist},on:{input:[function(e){e.target.composing||t.$set(t.app,"mimetypesBlacklist",e.target.value)},function(e){return t.$updateText("/admin/settings","mimetypes_blacklist",t.app.mimetypesBlacklist,!0)}]}})])],1),t._v(" "),i("div",{staticClass:"card shadow-card"},[i("FormLabel",[t._v("\n\t\t\t\t"+t._s(t.$t("Application"))+"\n\t\t\t")]),t._v(" "),i("AppInputButton",{attrs:{title:t.$t("Cache"),description:t.$t("Did you change anything in your .env file? Then clear your cache.")}},[i("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{loading:t.isFlushingCache,disabled:t.isFlushingCache,"button-style":"theme"},nativeOn:{click:function(e){return t.flushCache.apply(null,arguments)}}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("admin_settings.others.cache_clear"))+"\n\t\t\t\t")])],1),t._v(" "),i("AppInputText",{attrs:{title:t.$t("admin_settings.others.contact_email")}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.app.contactMail,expression:"app.contactMail"}],staticClass:"focus-border-theme input-dark",attrs:{placeholder:t.$t("admin_settings.others.contact_email_plac"),type:"email"},domProps:{value:t.app.contactMail},on:{input:[function(e){e.target.composing||t.$set(t.app,"contactMail",e.target.value)},function(e){return t.$updateText("/admin/settings","contact_email",t.app.contactMail)}]}})]),t._v(" "),i("AppInputText",{attrs:{title:t.$t("admin_settings.others.google_analytics"),"is-last":!0}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.app.googleAnalytics,expression:"app.googleAnalytics"}],staticClass:"focus-border-theme input-dark",attrs:{placeholder:t.$t("admin_settings.others.google_analytics_plac"),type:"text"},domProps:{value:t.app.googleAnalytics},on:{input:[function(e){e.target.composing||t.$set(t.app,"googleAnalytics",e.target.value)},function(e){return t.$updateText("/admin/settings","google_analytics",t.app.googleAnalytics,!0)}]}})])],1),t._v(" "),i("div",{staticClass:"card shadow-card"},[i("FormLabel",[t._v("\n\t\t\t\t"+t._s(t.$t("User Login/Registration"))+"\n\t\t\t")]),t._v(" "),i("AppInputSwitch",{attrs:{title:t.$t("admin_settings.others.allow_registration"),description:t.$t("admin_settings.others.allow_registration_help")}},[i("SwitchInput",{staticClass:"switch",attrs:{state:t.app.userRegistration},on:{input:function(e){return t.$updateText("/admin/settings","registration",t.app.userRegistration)}},model:{value:t.app.userRegistration,callback:function(e){t.$set(t.app,"userRegistration",e)},expression:"app.userRegistration"}})],1),t._v(" "),i("AppInputSwitch",{attrs:{title:t.$t("Require Email Verification"),description:t.$t("admin_settings.others.allow_user_verification_help"),"is-last":!0}},[i("SwitchInput",{staticClass:"switch",attrs:{state:t.app.userVerification},on:{input:function(e){return t.$updateText("/admin/settings","user_verification",t.app.userVerification)}},model:{value:t.app.userVerification,callback:function(e){t.$set(t.app,"userVerification",e)},expression:"app.userVerification"}})],1)],1),t._v(" "),i("div",{staticClass:"card shadow-card"},[i("img",{staticClass:"mb-8 h-5",attrs:{src:t.$getSocialLogo("facebook"),alt:"Facebook"}}),t._v(" "),i("AppInputSwitch",{attrs:{title:t.$t("Allow Login via Facebook"),description:t.$t("You users will be able to login via Facebook account."),"is-last":!t.facebook.allowedService}},[i("SwitchInput",{staticClass:"switch",attrs:{state:t.facebook.allowedService},on:{input:function(e){return t.$updateText("/admin/settings","allowed_facebook_login",t.facebook.allowedService)}},model:{value:t.facebook.allowedService,callback:function(e){t.$set(t.facebook,"allowedService",e)},expression:"facebook.allowedService"}})],1),t._v(" "),t.config.isFacebookLoginConfigured&&t.facebook.allowedService?i("div",{staticClass:"flex items-center cursor-pointer",class:{"mb-4":t.facebook.isVisibleCredentialsForm},on:{click:function(e){t.facebook.isVisibleCredentialsForm=!t.facebook.isVisibleCredentialsForm}}},[i("edit2-icon",{staticClass:"vue-feather text-theme mr-2",attrs:{size:"12"}}),t._v(" "),i("b",{staticClass:"text-xs"},[t._v(t._s(t.$t("Update Your Credentials")))])],1):t._e(),t._v(" "),t.config.isFacebookLoginConfigured&&!t.facebook.isVisibleCredentialsForm||!t.facebook.allowedService?t._e():i("ValidationObserver",{ref:"credentialsForm",staticClass:"p-5 shadow-lg rounded-xl",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.storeCredentials("facebook")}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[t.config.isFacebookLoginConfigured?t._e():i("FormLabel",{attrs:{icon:"shield"}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Configure Credentials"))+"\n\t\t\t\t")]),t._v(" "),i("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Client ID",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.errors;return[i("AppInputText",{attrs:{title:t.$t("Client ID"),error:a[0]}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.facebook.credentials.client_id,expression:"facebook.credentials.client_id"}],staticClass:"focus-border-theme input-dark",class:{"border-red":a[0]},attrs:{placeholder:t.$t("Paste your Client ID here"),type:"text"},domProps:{value:t.facebook.credentials.client_id},on:{input:function(e){e.target.composing||t.$set(t.facebook.credentials,"client_id",e.target.value)}}})])]}}],null,!0)}),t._v(" "),i("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Client Secret",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.errors;return[i("AppInputText",{attrs:{title:t.$t("Client Secret"),error:a[0]}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.facebook.credentials.client_secret,expression:"facebook.credentials.client_secret"}],staticClass:"focus-border-theme input-dark",class:{"border-red":a[0]},attrs:{placeholder:t.$t("Paste your Client Secret here"),type:"text"},domProps:{value:t.facebook.credentials.client_secret},on:{input:function(e){e.target.composing||t.$set(t.facebook.credentials,"client_secret",e.target.value)}}})])]}}],null,!0)}),t._v(" "),i("ButtonBase",{staticClass:"w-full",attrs:{disabled:t.isLoading,loading:t.isLoading,"button-style":"theme",type:"submit"}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Store Credentials"))+"\n\t\t\t\t")])]}}],null,!1,3791599801)})],1),t._v(" "),i("div",{staticClass:"card shadow-card"},[i("img",{staticClass:"mb-8 h-7",attrs:{src:t.$getSocialLogo("google"),alt:"Google"}}),t._v(" "),i("AppInputSwitch",{attrs:{title:t.$t("Allow Login via Google"),description:t.$t("You users will be able to login via Google account."),"is-last":!t.google.allowedService}},[i("SwitchInput",{staticClass:"switch",attrs:{state:t.google.allowedService},on:{input:function(e){return t.$updateText("/admin/settings","allowed_google_login",t.google.allowedService)}},model:{value:t.google.allowedService,callback:function(e){t.$set(t.google,"allowedService",e)},expression:"google.allowedService"}})],1),t._v(" "),t.config.isGoogleLoginConfigured&&t.google.allowedService?i("div",{staticClass:"flex items-center cursor-pointer",class:{"mb-4":t.google.isVisibleCredentialsForm},on:{click:function(e){t.google.isVisibleCredentialsForm=!t.google.isVisibleCredentialsForm}}},[i("edit2-icon",{staticClass:"vue-feather text-theme mr-2",attrs:{size:"12"}}),t._v(" "),i("b",{staticClass:"text-xs"},[t._v(t._s(t.$t("Update Your Credentials")))])],1):t._e(),t._v(" "),t.config.isGoogleLoginConfigured&&!t.google.isVisibleCredentialsForm||!t.google.allowedService?t._e():i("ValidationObserver",{ref:"credentialsForm",staticClass:"p-5 shadow-lg rounded-xl",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.storeCredentials("google")}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[t.config.isGoogleLoginConfigured?t._e():i("FormLabel",{attrs:{icon:"shield"}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Configure Credentials"))+"\n\t\t\t\t")]),t._v(" "),i("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Client ID",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.errors;return[i("AppInputText",{attrs:{title:t.$t("Client ID"),error:a[0]}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.google.credentials.client_id,expression:"google.credentials.client_id"}],staticClass:"focus-border-theme input-dark",class:{"border-red":a[0]},attrs:{placeholder:t.$t("Paste your Client ID here"),type:"text"},domProps:{value:t.google.credentials.client_id},on:{input:function(e){e.target.composing||t.$set(t.google.credentials,"client_id",e.target.value)}}})])]}}],null,!0)}),t._v(" "),i("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Client Secret",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.errors;return[i("AppInputText",{attrs:{title:t.$t("Client Secret"),error:a[0]}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.google.credentials.client_secret,expression:"google.credentials.client_secret"}],staticClass:"focus-border-theme input-dark",class:{"border-red":a[0]},attrs:{placeholder:t.$t("Paste your Client Secret here"),type:"text"},domProps:{value:t.google.credentials.client_secret},on:{input:function(e){e.target.composing||t.$set(t.google.credentials,"client_secret",e.target.value)}}})])]}}],null,!0)}),t._v(" "),i("ButtonBase",{staticClass:"w-full",attrs:{disabled:t.isLoading,loading:t.isLoading,"button-style":"theme",type:"submit"}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Store Credentials"))+"\n\t\t\t\t")])]}}],null,!1,3645737368)})],1),t._v(" "),i("div",{staticClass:"card shadow-card"},[i("img",{staticClass:"mb-8 h-5",attrs:{src:t.$getSocialLogo("github"),alt:"Github"}}),t._v(" "),i("AppInputSwitch",{attrs:{title:t.$t("Allow Login via GitHub"),description:t.$t("You users will be able to login via GitHub account."),"is-last":!t.github.allowedService}},[i("SwitchInput",{staticClass:"switch",attrs:{state:t.github.allowedService},on:{input:function(e){return t.$updateText("/admin/settings","allowed_github_login",t.github.allowedService)}},model:{value:t.github.allowedService,callback:function(e){t.$set(t.github,"allowedService",e)},expression:"github.allowedService"}})],1),t._v(" "),t.config.isGithubLoginConfigured&&t.github.allowedService?i("div",{staticClass:"flex items-center cursor-pointer",class:{"mb-4":t.github.isVisibleCredentialsForm},on:{click:function(e){t.github.isVisibleCredentialsForm=!t.github.isVisibleCredentialsForm}}},[i("edit2-icon",{staticClass:"vue-feather text-theme mr-2",attrs:{size:"12"}}),t._v(" "),i("b",{staticClass:"text-xs"},[t._v(t._s(t.$t("Update Your Credentials")))])],1):t._e(),t._v(" "),t.config.isGithubLoginConfigured&&!t.github.isVisibleCredentialsForm||!t.github.allowedService?t._e():i("ValidationObserver",{ref:"credentialsForm",staticClass:"p-5 shadow-lg rounded-xl",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.storeCredentials("github")}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[t.config.isGithubLoginConfigured?t._e():i("FormLabel",{attrs:{icon:"shield"}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Configure Credentials"))+"\n\t\t\t\t")]),t._v(" "),i("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Client ID",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.errors;return[i("AppInputText",{attrs:{title:t.$t("Client ID"),error:a[0]}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.github.credentials.client_id,expression:"github.credentials.client_id"}],staticClass:"focus-border-theme input-dark",class:{"border-red":a[0]},attrs:{placeholder:t.$t("Paste your Client ID here"),type:"text"},domProps:{value:t.github.credentials.client_id},on:{input:function(e){e.target.composing||t.$set(t.github.credentials,"client_id",e.target.value)}}})])]}}],null,!0)}),t._v(" "),i("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Client Secret",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.errors;return[i("AppInputText",{attrs:{title:t.$t("Client Secret"),error:a[0]}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.github.credentials.client_secret,expression:"github.credentials.client_secret"}],staticClass:"focus-border-theme input-dark",class:{"border-red":a[0]},attrs:{placeholder:t.$t("Paste your Client Secret here"),type:"text"},domProps:{value:t.github.credentials.client_secret},on:{input:function(e){e.target.composing||t.$set(t.github.credentials,"client_secret",e.target.value)}}})])]}}],null,!0)}),t._v(" "),i("ButtonBase",{staticClass:"w-full",attrs:{disabled:t.isLoading,loading:t.isLoading,"button-style":"theme",type:"submit"}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Store Credentials"))+"\n\t\t\t\t")])]}}],null,!1,2594802900)})],1)])}),[],!1,null,null,null);e.default=I.exports}}]);