2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
import{D as m}from"./Dropdown-Cks-nQIq.js";import{n as o}from"./index-DDNMzpZj.js";const u={components:{Dropdown:m},props:{object:{type:Object,required:!0}}};var d=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-row flex-wrap items-center"},[e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.object.percent,expression:"object.percent",modifiers:{number:!0}}],staticClass:"input",staticStyle:{width:"7ch"},attrs:{type:"number"},domProps:{value:t.object.percent},on:{input:function(a){a.target.composing||t.$set(t.object,"percent",t._n(a.target.value))},blur:function(a){return t.$forceUpdate()}}}),t._v("% "),t._v(" Element "),e("dropdown",{staticClass:"w-16",model:{value:t.object.element,callback:function(a){t.$set(t.object,"element",a)},expression:"object.element"}},[e("option",{attrs:{value:"fire"}},[t._v("Fire")]),e("option",{attrs:{value:"wind"}},[t._v("Wind")]),e("option",{attrs:{value:"earth"}},[t._v("Earth")]),e("option",{attrs:{value:"water"}},[t._v("Water")]),e("option",{attrs:{value:"light"}},[t._v("Light")]),e("option",{attrs:{value:"dark"}},[t._v("Dark")]),e("option",{attrs:{value:"any"}},[t._v("Any")])]),t._v(" Aura "),e("dropdown",{staticClass:"w-24",model:{value:t.object.aura_type,callback:function(a){t.$set(t.object,"aura_type",a)},expression:"object.aura_type"}},[e("option",{attrs:{value:"elemental"}},[t._v("elemental")]),e("option",{attrs:{value:"normal"}},[t._v("normal")]),e("option",{attrs:{value:"optimus"}},[t._v("optimus")]),e("option",{attrs:{value:"omega"}},[t._v("omega")]),e("option",{attrs:{value:"seraphic"}},[t._v("seraphic")]),e("option",{attrs:{value:"mysterious"}},[t._v("mysterious")])]),t._v(" Stat "),e("dropdown",{staticClass:"w-16",model:{value:t.object.stat,callback:function(a){t.$set(t.object,"stat",a)},expression:"object.stat"}},[e("option",{attrs:{value:"atk"}},[t._v("atk")]),e("option",{attrs:{value:"atk_cap"}},[t._v("atk_cap")]),e("option",{attrs:{value:"hp"}},[t._v("hp")]),e("option",{attrs:{value:"da"}},[t._v("da")]),e("option",{attrs:{value:"ta"}},[t._v("ta")]),e("option",{attrs:{value:"crit"}},[t._v("crit")]),e("option",{attrs:{value:"ca_dmg"}},[t._v("ca_dmg")]),e("option",{attrs:{value:"ca_cap"}},[t._v("ca_cap")]),e("option",{attrs:{value:"chainburst_dmg"}},[t._v("chainburst_dmg")]),e("option",{attrs:{value:"chainburst_cap"}},[t._v("chainburst_cap")]),e("option",{attrs:{value:"stamina"}},[t._v("stamina")]),e("option",{attrs:{value:"enmity"}},[t._v("enmity")])]),t._v(" Slot "),e("dropdown",{staticClass:"w-16",model:{value:t.object.slot,callback:function(a){t.$set(t.object,"slot",a)},expression:"object.slot"}},[e("option",{domProps:{value:void 0}},[t._v("[All]")]),e("option",{attrs:{value:"sub"}},[t._v("sub")]),e("option",{attrs:{value:"main"}},[t._v("main")]),e("option",{attrs:{value:"friend"}},[t._v("friend")])])],1)},p=[],v=o(u,d,p,!1,null,null);const _=v.exports,h={components:{SummonProps:_},props:{item:{type:Object,required:!0},index:{type:Number,required:!0},page:{type:Number,required:!0}},methods:{addProp(s){this.item.data||this.$set(this.item,"data",{}),this.item.data.hasOwnProperty(s)||this.$set(this.item.data,s,[]),this.item.data[s].push({})},removeProp(s){this.item.data&&(this.item.data[s].pop(),this.item.data[s].length===0&&this.$delete(this.item.data,s),Object.keys(this.item.data).length===0&&this.$delete(this.item,"data"))}},computed:{getObjectJSON:{get(){return JSON.stringify(this.item.data)},set(s){this.$set(this.item,"data",{});for(let[t,e]of Object.entries(JSON.parse(s)))this.$set(this.item.data,t,e)}}}};var f=function(){var t=this,e=t._self._c;return e("tr",{staticClass:"text-sm"},[e("td",{staticClass:"w-32"},[t._v(" "+t._s(t.page*10+t.index)+"- "),e("a",{attrs:{href:"https://gbf.wiki/"+t.item.nameen,target:"_blank"}},[t._v(t._s(t.item.nameen))]),e("br"),t._v(" "+t._s(t.item.starsmax)+"*"),e("br"),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.item.ignore,expression:"item.ignore"}],attrs:{type:"checkbox",tabindex:"-1"},domProps:{checked:Array.isArray(t.item.ignore)?t._i(t.item.ignore,null)>-1:t.item.ignore},on:{change:function(a){var n=t.item.ignore,i=a.target,c=!!i.checked;if(Array.isArray(n)){var l=null,r=t._i(n,l);i.checked?r<0&&t.$set(t.item,"ignore",n.concat([l])):r>-1&&t.$set(t.item,"ignore",n.slice(0,r).concat(n.slice(r+1)))}else t.$set(t.item,"ignore",c)}}}),t._v(" Ignore")])]),e("td",{staticClass:"w-1/2"},t._l([{name:"aura",index:0},{name:"auramlb",index:3},{name:"auraflb",index:4},{name:"auraulb",index:5}],function(a){return e("div",{key:a.index},[t.item[a.name]!==null?e("span",[e("span",{staticClass:"flex flex-row items-center"},[e("button",{staticClass:"btn btn-blue btn-sm mr-1",attrs:{tabindex:"-1"},on:{click:function(n){return t.addProp(a.index)}}},[t._v("+")]),e("button",{staticClass:"btn btn-blue btn-sm mr-1",attrs:{tabindex:"-1"},on:{click:function(n){return t.removeProp(a.index)}}},[t._v("-")]),e("span",[t._v(" "+t._s(a.index)+": "+t._s(t.item[a.name])+" "),t.item["sub"+a.name]!==null?e("span",[e("br"),t._v(t._s(a.index)+"s: "+t._s(t.item["sub"+a.name]))]):t._e()])]),t.item.data?e("span",t._l(t.item.data[a.index],function(n,i){return e("summon-props",{key:i,attrs:{object:n}})}),1):t._e()]):t._e()])}),0),e("td",{staticClass:"align-top h-full"},[e("textarea",{directives:[{name:"model",rawName:"v-model.lazy",value:t.getObjectJSON,expression:"getObjectJSON",modifiers:{lazy:!0}}],staticClass:"font-mono text-primary bg-tertiary w-full h-full",attrs:{spellcheck:"false"},domProps:{value:t.getObjectJSON},on:{change:function(a){t.getObjectJSON=a.target.value}}})])])},b=[],g=o(h,f,b,!1,null,null);const x=g.exports,y={components:{SummonLine:x},data(){return{message:[],index:0,slice_size:10}},methods:{saveData(){let s={ignore:[],data:[]};this.message.forEach(t=>{s.ignore.push([t.summonid,t.ignore]),t.data?s.data.push([t.summonid,t.data]):s.data.push([t.summonid,null])}),this.axios.post("/admin/summons",s).then(t=>this.$store.dispatch("addMessage",{message:"Saved"})).catch(t=>this.$store.dispatch("addAxiosErrorMessage",t))},hideNonEmptySkills(){this.message.forEach(s=>{s.data!==null&&this.$set(s,"hide",!0)})}},computed:{getSummons(){return this.message.flatMap(s=>s.hide?[]:[s]).slice(this.index*this.slice_size,this.index*this.slice_size+this.slice_size)}},mounted(){this.axios.get("/admin/summons").then(s=>this.message=s.data).catch(s=>this.$store.dispatch("addAxiosErrorMessage",s))}};var k=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-col"},[e("div",{staticClass:"flex flex-row flex-wrap items-center mb-4"},[e("a",{staticClass:"mr-4",attrs:{href:"/admin"}},[t._v("Up")]),e("button",{staticClass:"btn btn-white mr-4",on:{click:function(a){return t.saveData()}}},[t._v("Save")]),e("button",{staticClass:"btn btn-white",on:{click:function(a){return t.hideNonEmptySkills()}}},[t._v("Hide")])]),e("nav",{staticClass:"mb-4",attrs:{role:"navigation","aria-label":"pagination"}},[e("ul",{staticClass:"flex flex-row flex-wrap"},t._l(Math.ceil(t.message.length/t.slice_size),function(a){return e("li",{key:a},[e("a",{staticClass:"text-primary mr-2 py-1 px-2 rounded cursor-pointer",class:t.index===a-1?"bg-tertiary":"bg-secondary",on:{click:function(n){t.index=a-1}}},[t._v(t._s(a))])])}),0)]),e("table",{staticClass:"table mb-4"},[e("tbody",t._l(t.getSummons,function(a,n){return e("summon-line",{key:a.summonid,attrs:{item:a,index:n,page:t.index}})}),1)]),e("nav",{attrs:{role:"navigation","aria-label":"pagination"}},[e("ul",{staticClass:"flex flex-row flex-wrap"},t._l(Math.ceil(t.message.length/t.slice_size),function(a){return e("li",{key:a},[e("a",{staticClass:"text-primary mr-2 py-1 px-2 rounded cursor-pointer",class:t.index===a-1?"bg-tertiary":"bg-secondary",on:{click:function(n){t.index=a-1}}},[t._v(t._s(a))])])}),0)])])},w=[],$=o(y,k,w,!1,null,null);const S=$.exports;export{S as default};
|