PageSourceSearch

https://habitica.com/assets/index-B0k4LsuJ.js

js habitica.com collected 2026-10-01 08:43:57 UTC 6,618 bytes, 1 lines download raw bytes

1import{n as i,ai as n,m as c,aj as d,ak as u}from"./index-BD5k_6PB.js";const v={name:"BlockerForm",props:{isNew:{type:Boolean,default:!1},blocker:{type:Object,default:()=>({type:"",area:"",value:"",reason:""})}},data(){return{isValid:!1}},mounted(){this.validateValue()},methods:{onTypeChanged(){this.blocker.type==="email"&&(this.blocker.area="full"),this.validateValue()},validateValue(){this.blocker.type==="ipaddress"?this.validateValueAsIpAddress():this.blocker.type==="client"?this.validateValueAsClient():this.blocker.type==="email"&&this.validateValueAsEmail()},validateValueAsEmail(){const s=/^([a-zA-Z0-9._%+-]*)@(?:[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$/;this.isValid=s.test(this.blocker.value)&&this.blocker.value.length>3},validateValueAsIpAddress(){this.isValid=n(this.blocker.value)},validateValueAsClient(){this.isValid=this.blocker.value.length>0}}};var p=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{display:"contents"}},[t("td",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.blocker.type,expression:"blocker.type"}],staticClass:"form-control",on:{change:[function(a){var l=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});e.$set(e.blocker,"type",a.target.multiple?l:l[0])},e.onTypeChanged]}},[t("option",{attrs:{value:"ipaddress"}},[e._v(" IP-Address ")]),t("option",{attrs:{value:"client"}},[e._v(" Client Identifier ")]),t("option",{attrs:{value:"email"}},[e._v(" E-Mail ")])])]),t("td",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.blocker.area,expression:"blocker.area"}],staticClass:"form-control",on:{change:function(a){var l=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});e.$set(e.blocker,"area",a.target.multiple?l:l[0])}}},[t("option",{attrs:{value:"full"}},[e._v(" Full ")])])]),t("td",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.blocker.value,expression:"blocker.value"}],staticClass:"form-control",class:{"is-invalid input-invalid":!e.isValid},attrs:{autocorrect:"off",autocapitalize:"off"},domProps:{value:e.blocker.value},on:{input:[function(a){a.target.composing||e.$set(e.blocker,"value",a.target.value)},e.validateValue]}})]),t("td",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.blocker.reason,expression:"blocker.reason"}],staticClass:"form-control",domProps:{value:e.blocker.reason},on:{input:function(a){a.target.composing||e.$set(e.blocker,"reason",a.target.value)}}})]),t("td",{staticClass:"text-right",attrs:{colspan:"3"}},[t("button",{staticClass:"btn btn-primary mr-2",class:{disabled:!e.isValid},attrs:{disabled:!e.isValid},on:{click:function(a){return e.$emit("save",e.blocker)}}},[t("span",[e._v("Save")])]),t("button",{staticClass:"btn btn-danger",on:{click:function(a){return e.$emit("cancel")}}},[t("span",[e._v("Cancel")])])])])},_=[],m=i(v,p,_,!1,null,"8b48b723");const f=m.exports,h={components:{BlockerForm:f},data(){return{showCreateForm:!1,newBlocker:{type:"",area:"full",value:"",reason:""},blockers:[],editedBlockerId:null,icons:Object.freeze({editIcon:u,deleteIcon:d})}},computed:{...c({user:"user.data"})},mounted(){this.$store.dispatch("common:setTitle",{section:this.$t("siteBlockers")}),this.loadBlockers()},methods:{async loadBlockers(){this.blockers=await this.$store.dispatch("blockers:getBlockers")},editBlocker(s){this.editedBlockerId=s},async saveBlocker(s){await this.$store.dispatch("blockers:updateBlocker",{blocker:s}),this.editedBlockerId=null,this.loadBlockers()},async deleteBlocker(s){window.confirm("Are you sure you want to delete this blocker?")&&(await this.$store.dispatch("blockers:deleteBlocker",{blockerId:s}),this.loadBlockers())},async createBlocker(s){await this.$store.dispatch("blockers:createBlocker",{blocker:s}),this.showCreateForm=!1,this.newBlocker={type:"",area:"full",value:"",reason:""},this.loadBlockers()},getTypeName(s){switch(s){case"ipaddress":return"IP-Address";case"email":return"E-Mail";case"client":return"Client Identifier";default:return s}},getAreaName(s){switch(s){case"full":return"Full";case"payments":return"Payments";default:return s}}}};var k=function(){var e=this,t=e._self._c;
1return t("div",{staticClass:"row standard-page col-12 d-flex justify-content-center"},[t("div",{staticClass:"blocker-content"},[t("h1",[e._v(" Blockers "),t("button",{staticClass:"btn btn-primary float-right",on:{click:function(a){e.showCreateForm=!0}}},[e._v(" Create ")])]),t("table",{staticClass:"table table-bordered"},[t("thead",[t("tr",[t("th",[e._v(" Type "),t("span",{staticClass:"info-icon",attrs:{id:"type_tooltip"}},[e._v("?")]),t("b-tooltip",{attrs:{target:"type_tooltip"}},[t("b",[e._v("IP-Address")]),e._v(" - Block access for a specific IP-Address "),t("br"),t("br"),t("b",[e._v("Client")]),e._v(' - Block access for a client based on the "x-client" header. '),t("br"),t("br"),t("b",[e._v("E-Mail")]),e._v(" - Blocks e-mails from being used for signup. ")])],1),t("th",[e._v(" Area "),t("span",{staticClass:"info-icon",attrs:{id:"area_tooltip"}},[e._v("?")]),t("b-tooltip",{attrs:{target:"area_tooltip"}},[t("b",[e._v("Full")]),e._v(" - Block access to the entire site. "),t("br"),t("br"),t("b",[e._v("Payments")]),e._v(" - Block access to any payment related functionality. ")])],1),t("th",[e._v("Value")]),t("th",[e._v("Reason")]),t("th",[e._v("Source")]),t("th",[e._v("Created at")]),t("th",{staticClass:"btncol"})])]),t("tbody",[e.showCreateForm?t("tr",[t("BlockerForm",{attrs:{"is-new":!0,blocker:e.newBlocker},on:{save:e.createBlocker,cancel:function(a){e.showCreateForm=!1}}})],1):e._e(),e._l(e.blockers,function(a){return t("tr",{key:a._id},[a._id===e.editedBlockerId?t("BlockerForm",{attrs:{blocker:a},on:{save:function(l){return e.saveBlocker(a)},cancel:function(l){e.editedBlockerId=null}}}):[t("td",[e._v(e._s(e.getTypeName(a.type)))]),t("td",[e._v(e._s(e.getAreaName(a.area)))]),t("td",[e._v(e._s(a.value))]),t("td",[e._v(e._s(a.reason||"--"))]),t("td",[e._v(e._s(a.blockSource))]),t("td",[e._v(e._s(a.createdAt))]),t("td",[t("button",{staticClass:"btn btn-primary mr-2",on:{click:function(l){return e.editBlocker(a._id)}}},[e._o(t("span",{staticClass:"svg-icon icon-16",domProps:{innerHTML:e._s(e.icons.editIcon)}}),0,a._id)]),t("button",{staticClass:"btn btn-danger",on:{click:function(l){return e.deleteBlocker(a._id)}}},[e._o(t("span",{staticClass:"svg-icon icon-16",domProps:{innerHTML:e._s(e.icons.deleteIcon)}}),1,a._id)])])]],2)})],2)])])])},b=[],y=i(h,k,b,!1,null,"c2ef74d2");const C=y.exports;export{C as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.