nextcloud/dist/core-install.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2 lines
15 KiB
JavaScript
Raw Normal View History

(()=>{"use strict";var e,t={85973(e,t,a){var o,n=a(85471),r=a(81222),s=a(53334),i=a(99418),c=a(74095),l=a(32073),d=a(88289),u=a(371),f=a(16044),p=a(82182),m=a(33691);function g(e=""){const t=new Set(e),a=parseInt(Math.log2(Math.pow(parseInt(t.size.toString()),e.length)).toFixed(2));return a<16?o.VeryWeak:a<31?o.Weak:a<46?o.Moderate:a<61?o.Strong:a<76?o.VeryStrong:o.ExtremelyStrong}!function(e){e[e.VeryWeak=0]="VeryWeak",e[e.Weak=1]="Weak",e[e.Moderate=2]="Moderate",e[e.Strong=3]="Strong",e[e.VeryStrong=4]="VeryStrong",e[e.ExtremelyStrong=5]="ExtremelyStrong"}(o||(o={}));const b=(0,n.pM)({name:"Setup",components:{IconArrowRight:m.A,NcButton:c.A,NcCheckboxRadioSwitch:l.A,NcLoadingIcon:d.A,NcNoteCard:u.A,NcPasswordField:f.A,NcTextField:p.A},setup:()=>({t:s.t}),data:()=>({config:{},links:{},isValidAutoconfig:!1,loading:!1}),computed:{passwordHelperText(){if(""===this.config?.adminpass)return"";switch(g(this.config?.adminpass)){case o.VeryWeak:return(0,s.t)("core","Password is too weak");case o.Weak:return(0,s.t)("core","Password is weak");case o.Moderate:return(0,s.t)("core","Password is average");case o.Strong:return(0,s.t)("core","Password is strong");case o.VeryStrong:return(0,s.t)("core","Password is very strong");case o.ExtremelyStrong:return(0,s.t)("core","Password is extremely strong")}return(0,s.t)("core","Unknown password strength")},passwordHelperType(){return g(this.config?.adminpass)<o.Moderate?"error":g(this.config?.adminpass)<o.Strong?"warning":"success"},firstAndOnlyDatabase(){const e=Object.values(this.config?.databases||{});return 1===e.length?e[0]:null},DBTypeGroupDirection(){return Object.keys(this.config?.databases||{}).length>3?"vertical":"horizontal"},htaccessWarning(){const e=[(0,s.t)("core","Your data directory and files are probably accessible from the internet because the <code>.htaccess</code> file does not work."),(0,s.t)("core","For information how to properly configure your server, please {linkStart}see the documentation{linkEnd}",{linkStart:'<a href="'+this.links.adminInstall+'" target="_blank" rel="noreferrer noopener">',linkEnd:"</a>"},{escape:!1})].join("<br>");return i.A.sanitize(e)},errors(){return(this.config?.errors||[]).map(e=>"string"==typeof e?{heading:"",message:e}:""===e.hint?{heading:"",message:e.error}:{heading:e.error,message:e.hint})}},beforeMount(){this.config=(0,r.C)("core","config"),this.links=(0,r.C)("core","links")},mounted(){if(""===this.config.dbtype&&(this.config.dbtype=Object.keys(this.config.databases).at(0)),this.config.hasAutoconfig){const e=this.$refs.form;e.querySelectorAll('input[name="adminlogin"], input[name="adminpass"]').forEach(e=>{e.removeAttribute("required")}),e.checkValidity()&&0===this.config.errors.length?this.isValidAutoconfig=!0:this.isValidAutoconfig=!1,e.querySelectorAll('input[name="adminlogin"], input[name="adminpass"]').forEach(e=>{e.setAttribute("required","true")})}},methods:{async onSubmit(){this.loading=!0}}});var A=a(85072),h=a.n(A),v=a(97825),y=a.n(v),_=a(77659),k=a.n(_),C=a(55056),w=a.n(C),x=a(10540),S=a.n(x),N=a(41113),D=a.n(N),O=a(85325),T={};T.styleTagTransform=D(),T.setAttributes=w(),T.insert=k().bind(null,"head"),T.domAPI=y(),T.insertStyleElement=S(),h()(O.A,T),O.A&&O.A.locals&&O.A.locals;const P=(0,a(14486).A)(b,function(){var e=this,t=e._self._c;return e._self._setupProxy,t("form",{ref:"form",staticClass:"setup-form",class:{"setup-form--loading":e.loading},attrs:{action:"","data-cy-setup-form":"",method:"POST"},on:{submit:e.onSubmit}},[e.config.hasAutoconfig?t("NcNoteCard",{attrs:{heading:e.t("core","Autoconfig file detected"),"data-cy-setup-form-note":"autoconfig",type:"success"}},[e._v("\n\t\t"+e._s(e.t("core","The setup form below is pre-filled with the values from the config file."))+"\n\t")]):e._e(),e._v(" "),!1===e.config.htaccessWorking?t("NcNoteCard",{attrs:{heading:e.t("core","Security warning"),"data-cy-setup-form-note":"htaccess",type:"warning"}},[t("p",{domProps:{innerHTML:e._s(e.htaccessWarning)}})]):e._e(),e._v(" "),e._l(e.errors,function(a,o){return t("NcNoteCard",{key:o,attrs:{heading:a.heading,"data-cy-setup-form-n
//# sourceMappingURL=core-install.js.map?v=a6eb2ad82fa0b3007651