~ K    A     L    I ~
UNAME : Linux web64.extendcp.co.uk 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
SERVER IP : 10.0.187.64 -________- CLIENT IP : 216.73.216.230
PATH :/usr/share/maxscale/gui/js/
UP FILE :
MINI SHELL D ZAB '
Current File : //usr/share/maxscale/gui/js/app~d2612881.d63a308b.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app~d2612881"],{"0608":function(t,e,a){"use strict";a("1f45")},"1f45":function(t,e,a){},"2c3f":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-text-field",{staticClass:"vuetify-input--override fill-height align-center",attrs:{id:t.targetCell.id,name:t.targetCell.id,"single-line":"",outlined:"",dense:"",height:26,autocomplete:"off","hide-details":""},on:{input:t.onInput},model:{value:t.targetCell.value,callback:function(e){t.$set(t.targetCell,"value","string"===typeof e?e.trim():e)},expression:"targetCell.value"}})},i=[],r={name:"editable-cell",props:{cellItem:{type:Object,required:!0},changedCells:{type:Array,required:!0}},data(){return{targetCell:{}}},computed:{hasChanged(){return!this.$helpers.lodash.isEqual(this.targetCell,this.cellItem)}},watch:{cellItem:{deep:!0,immediate:!0,handler(t,e){this.$helpers.lodash.isEqual(t,e)||(this.targetCell=this.$helpers.lodash.cloneDeep(t))}}},methods:{onInput(){let t=this.$helpers.lodash.cloneDeep(this.changedCells);const e=t.findIndex(t=>t.id===this.targetCell.id);this.hasChanged?(-1===e?t.push(this.targetCell):t[e]=this.targetCell,this.$emit("update:changedCells",t)):e>-1&&(t.splice(e,1),this.$emit("update:changedCells",t))}}},n=r,l=a("2877"),o=a("6544"),c=a.n(o),d=a("8654"),h=Object(l["a"])(n,s,i,!1,null,null,null);e["a"]=h.exports;c()(h,{VTextField:d["a"]})},"3f17":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"fill-height"},[a("div",{ref:"header",staticClass:"pb-2 result-header d-flex align-center"},[t.activePrvwTblNodeId?[a("div",{staticClass:"d-flex align-center mr-4"},[a("b",{staticClass:"mr-1"},[t._v("Table:")]),a("mxs-truncate-str",{attrs:{tooltipItem:{txt:t.activePrvwTblNodeId,nudgeLeft:16},maxWidth:260}})],1),a("data-prvw-nav-ctr",{attrs:{isLoading:t.isLoading,resultData:t.resultData}}),a("v-spacer"),a("keep-alive",[a("duration-timer",{key:t.currQueryMode,attrs:{startTime:t.requestSentTime,executionTime:t.execTime,totalDuration:t.totalDuration}})],1)]:a("span",{domProps:{innerHTML:t._s(t.$mxs_t("prvwTabGuide"))}})],2),t.isLoading?a("v-skeleton-loader",{attrs:{loading:t.isLoading,type:"table: table-thead, table-tbody",height:t.dynDim.height-t.headerHeight}}):[a("keep-alive",[t.$typy(t.resultData,"fields").safeArray.length?a("result-data-table",t._g({key:t.currQueryMode,attrs:{height:t.dynDim.height-t.headerHeight,width:t.dynDim.width,headers:t.$typy(t.resultData,"fields").safeArray.map((function(t){return{text:t}})),rows:t.$typy(t.resultData,"data").safeArray,showGroupBy:""}},t.$listeners)):a("div",t._l(t.resultData,(function(e,s){return a("div",{key:s},[a("b",[t._v(t._s(s)+":")]),a("span",{staticClass:"d-inline-block ml-4"},[t._v(t._s(e))])])})),0)],1)]],2)},i=[],r=a("a4a6"),n=a("786a"),l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-tabs",{staticClass:"v-tabs--query-editor-style",attrs:{"hide-slider":"",height:20},model:{value:t.activeView,callback:function(e){t.activeView=e},expression:"activeView"}},[a("v-tab",{key:t.SQL_QUERY_MODES.PRVW_DATA,staticClass:"tab-btn px-3 text-uppercase",attrs:{href:"#"+t.SQL_QUERY_MODES.PRVW_DATA,"active-class":"tab-btn--active font-weight-medium"}},[t._v(" "+t._s(t.$mxs_t("data"))+" ")]),a("v-tab",{key:t.SQL_QUERY_MODES.PRVW_DATA_DETAILS,staticClass:"tab-btn px-3 text-uppercase",attrs:{href:"#"+t.SQL_QUERY_MODES.PRVW_DATA_DETAILS,"active-class":"tab-btn--active font-weight-medium"}},[t._v(" "+t._s(t.$mxs_t("details"))+" ")])],1)},o=[],c=a("2f62"),d={name:"data-prvw-nav-ctr",props:{isLoading:{type:Boolean,required:!0},resultData:{type:Object,required:!0}},computed:{...Object(c["e"])({SQL_QUERY_MODES:t=>t.queryEditorConfig.config.SQL_QUERY_MODES,curr_query_mode:t=>t.queryResult.curr_query_mode}),...Object(c["c"])({getActivePrvwTblNode:"schemaSidebar/getActivePrvwTblNode",getActiveSessionId:"querySession/getActiveSessionId"}),activeView:{get(){return this.curr_query_mode},set(t){this.curr_query_mode!==this.SQL_QUERY_MODES.PRVW_DATA&&this.curr_query_mode!==this.SQL_QUERY_MODES.PRVW_DATA_DETAILS||this.SET_CURR_QUERY_MODE({payload:t,id:this.getActiveSessionId})}}},watch:{activeView:async function(t){this.isLoading||await this.handleFetch(t)}},methods:{...Object(c["d"])({SET_CURR_QUERY_MODE:"queryResult/SET_CURR_QUERY_MODE"}),...Object(c["b"])({fetchPrvw:"queryResult/fetchPrvw"}),async handleFetch(t){switch(t){case this.SQL_QUERY_MODES.PRVW_DATA:case this.SQL_QUERY_MODES.PRVW_DATA_DETAILS:this.resultData.fields||await this.fetchPrvw({tblId:this.$typy(this.getActivePrvwTblNode,"id").safeObject,prvwMode:t});break}}}},h=d,u=a("2877"),p=a("6544"),m=a.n(p),_=a("71a3"),b=a("fe57"),f=Object(u["a"])(h,l,o,!1,null,null,null),y=f.exports;m()(f,{VTab:_["a"],VTabs:b["a"]});var v={name:"data-prvw",components:{ResultDataTable:r["a"],DurationTimer:n["a"],DataPrvwNavCtr:y},props:{dynDim:{type:Object,validator(t){return"width"in t&&"height"in t},required:!0},currQueryMode:{type:String,required:!0},isLoading:{type:Boolean,required:!0},data:{type:Object,required:!0},requestSentTime:{type:Number,required:!0},execTime:{type:Number,required:!0},totalDuration:{type:Number,required:!0},activePrvwTblNodeId:{type:String,required:!0}},data(){return{headerHeight:0}},computed:{resultData(){return this.$typy(this.data,"data.attributes.results[0]").safeObjectOrEmpty}},activated(){this.setHeaderHeight()},methods:{setHeaderHeight(){this.$refs.header&&(this.headerHeight=this.$refs.header.clientHeight)}}},x=v,C=a("3129"),g=a("2fa4"),O=Object(u["a"])(x,s,i,!1,null,null,null);e["a"]=O.exports;m()(O,{VSkeletonLoader:C["a"],VSpacer:g["a"]})},"40cc":function(t,e,a){"use strict";a("7505")},4470:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"resize",rawName:"v-resize.quiet",value:t.setDim,expression:"setDim",modifiers:{quiet:!0}},{name:"shortkey",rawName:"v-shortkey",value:t.QUERY_SHORTCUT_KEYS,expression:"QUERY_SHORTCUT_KEYS"}],ref:"queryViewCtr",staticClass:"query-editor fill-height",on:{shortkey:function(e){return t.eventBus.$emit("shortkey",e.srcKey)}}},[a("div",{staticClass:"fill-height d-flex flex-column",class:{"query-editor--fullscreen":t.is_fullscreen}},[t.$slots["query-editor-top"]?a("div",{ref:"queryEditorTopSlot"},[t._t("query-editor-top")],2):t._e(),t.is_validating_conn?a("v-progress-linear",{attrs:{indeterminate:"",color:"primary"}}):[t.hidden_comp.includes("wke-nav-ctr")?t._e():a("wke-nav-ctr",{attrs:{height:t.wkeNavCtrHeight}}),t._l(t.worksheets_arr,(function(e){return a("keep-alive",{key:e.id,attrs:{max:"15"}},[t.active_wke_id===e.id&&t.ctrDim.height?a("wke-ctr",{ref:"wke",refInFor:!0,attrs:{ctrDim:t.ctrDim}},[t._l(t.$slots,(function(e,a){return t._t(a,null,{slot:a})}))],2):t._e()],1)}))]],2)])},i=[],r=(a("caad"),a("2f62")),n=(a("cc451"),a("cdb8")),l=a("6fc0"),o=a("f67c"),c={name:"query-editor",components:{WkeCtr:n["a"],WkeNavCtr:l["a"]},data(){return{dim:{},queryEditorTopSlotHeight:0}},computed:{...Object(r["e"])({active_wke_id:t=>t.wke.active_wke_id,is_fullscreen:t=>t.wke.is_fullscreen,is_validating_conn:t=>t.queryConn.is_validating_conn,QUERY_SHORTCUT_KEYS:t=>t.queryEditorConfig.config.QUERY_SHORTCUT_KEYS,worksheets_arr:t=>t.wke.worksheets_arr,hidden_comp:t=>t.queryEditorConfig.hidden_comp}),...Object(r["c"])({getActiveWke:"wke/getActiveWke",getIsTxtEditor:"editor/getIsTxtEditor"}),wkeNavCtrHeight(){return this.hidden_comp.includes("wke-nav-ctr")?0:32},ctrDim(){return{width:this.dim.width,height:this.dim.height-this.wkeNavCtrHeight-this.queryEditorTopSlotHeight}},eventBus(){return o["a"]}},watch:{active_wke_id:{immediate:!0,handler(t){t&&this.handleSyncWke(this.getActiveWke)}},is_fullscreen(t){t?this.dim={width:document.body.clientWidth,height:document.body.clientHeight}:this.$helpers.doubleRAF(()=>this.setDim())}},created(){this.handleAutoClearQueryHistory()},mounted(){this.$nextTick(()=>this.setDim(),this.setQueryEditorTopSlotHeight())},methods:{...Object(r["b"])({handleSyncWke:"wke/handleSyncWke",handleAutoClearQueryHistory:"queryPersisted/handleAutoClearQueryHistory"}),setDim(){const{width:t,height:e}=this.$refs.queryViewCtr.getBoundingClientRect();this.dim={width:t,height:e}},setQueryEditorTopSlotHeight(){if(this.$refs.queryEditorTopSlot){const{height:t}=this.$refs.queryEditorTopSlot.getBoundingClientRect();this.queryEditorTopSlotHeight=t}}}},d=c,h=(a("7973"),a("2877")),u=a("6544"),p=a.n(u),m=a("8e36"),_=a("269a"),b=a.n(_),f=a("dc22"),y=Object(h["a"])(d,s,i,!1,null,"04ec0d2a",null);e["a"]=y.exports;p()(y,{VProgressLinear:m["a"]}),b()(y,{Resize:f["a"]})},"4b91":function(t,e,a){"use strict";a("ef78")},"4e9b":function(t,e,a){},7505:function(t,e,a){},7641:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"chart-pane fill-height"},[a("div",{ref:"chartTool",staticClass:"d-flex pt-2 pr-3"},[a("v-spacer"),a("mxs-tooltip-btn",{attrs:{small:"",icon:"",depressed:"",color:"accent-dark"},on:{click:t.exportToJpeg},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{attrs:{size:"16",color:"accent-dark"}},[t._v(" mdi-download ")])]},proxy:!0}])},[t._v(" "+t._s(t.$mxs_t("exportChart"))+" ")]),a("mxs-tooltip-btn",{attrs:{small:"",icon:"",depressed:""},on:{click:function(e){t.chartOpt.isMaximized=!t.chartOpt.isMaximized}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{attrs:{size:"18",color:"accent-dark"}},[t._v(" mdi-fullscreen"+t._s(t.chartOpt.isMaximized?"-exit":"")+" ")])]},proxy:!0}])},[t._v(" "+t._s(t.chartOpt.isMaximized?t.$mxs_t("minimize"):t.$mxs_t("maximize"))+" ")]),a("mxs-tooltip-btn",{attrs:{btnClass:"close-chart",small:"",icon:"",depressed:"",color:"accent-dark"},on:{click:function(e){return t.$emit("close-chart")}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{attrs:{size:"12",color:"accent-dark"}},[t._v(" $vuetify.icons.mxs_close")])]},proxy:!0}])},[t._v(" "+t._s(t.$mxs_t("close"))+" ")])],1),a("div",{key:t.chartHeight,ref:"chartWrapper",staticClass:"chart-wrapper"},[t.type===t.chartTypes.LINE?a("mxs-line-chart",{style:t.chartStyle,attrs:{id:"query-chart",hasVertCrossHair:"",chartData:t.chartData,opts:t.chartOptions}}):t.type===t.chartTypes.SCATTER?a("mxs-scatter-chart",{style:t.chartStyle,attrs:{id:"query-chart",chartData:t.chartData,opts:t.chartOptions}}):t.type===t.chartTypes.BAR_VERT?a("mxs-vert-bar-chart",{style:t.chartStyle,attrs:{id:"query-chart",chartData:t.chartData,opts:t.chartOptions}}):t.type===t.chartTypes.BAR_HORIZ?a("mxs-horiz-bar-chart",{style:t.chartStyle,attrs:{id:"query-chart",chartData:t.chartData,opts:t.chartOptions}}):t._e()],1)])},i=[],r=a("163d"),n={name:"chart-pane",props:{value:{type:Object,required:!0},containerHeight:{type:Number,default:0},chartTypes:{type:Object,required:!0},axisTypes:{type:Object,required:!0}},data(){return{uniqueTooltipId:this.$helpers.lodash.uniqueId("tooltip_"),dataPoint:null,chartToolHeight:0}},computed:{chartOpt:{get(){return this.value},set(t){this.$emit("input",t)}},chartData(){return this.chartOpt.data},chartStyle(){return{minHeight:this.chartHeight+"px",minWidth:this.minWidth}},axesType(){return this.chartOpt.axesType},scaleLabels(){return this.chartOpt.scaleLabels},type(){return this.chartOpt.type},minWidth(){return this.autoSkipTick(this.axesType.x)||this.type===this.chartTypes.BAR_HORIZ?"unset":this.$typy(this.chartData,"xLabels").isDefined?Math.min(15*this.chartData.xLabels.length,15e3)+"px":"0px"},chartHeight(){return this.autoSkipTick(this.axesType.y)?this.containerHeight-(this.chartToolHeight+12):Math.max(this.containerHeight-(this.chartToolHeight+12),Math.min(15*this.$typy(this.chartData,"yLabels").safeArray.length,15e3))},chartOptions(){const t=this;return{layout:{padding:{left:12,bottom:12,right:24,top:24}},responsive:!0,maintainAspectRatio:!1,hover:{mode:"nearest",onHover:(t,e)=>{t.target.style.cursor=e[0]?"pointer":"default"},animationDuration:0,intersect:!1},tooltips:{mode:"nearest",enabled:!1,intersect:!1,position:"cursor",custom:function(e){const a=this,s=a._chart.canvas.getBoundingClientRect();Object(r["a"])({tooltipModel:e,tooltipId:t.uniqueTooltipId,position:s,dataPoint:t.dataPoint,alignTooltipToLeft:e.caretX>=t.$refs.chartWrapper.clientWidth/2})},callbacks:{label(e,a){t.dataPoint=a.datasets[e.datasetIndex].data[e.index]}}},legend:{display:!1},scales:{xAxes:[{type:this.axesType.x,scaleLabel:{display:!0,labelString:this.scaleLabels.x,fontSize:14,lineHeight:1,padding:{top:16},fontColor:"#424f62"},ticks:this.getAxisTicks({axisId:"x",axisType:this.axesType.x})}],yAxes:[{type:this.axesType.y,scaleLabel:{display:!0,labelString:this.scaleLabels.y,fontSize:14,padding:{bottom:16},fontColor:"#424f62"},ticks:this.getAxisTicks({axisId:"y",axisType:this.axesType.y})}]}}}},watch:{chartData(t){this.$typy(t,"datasets[0].data[0]").safeObject||this.removeTooltip()}},mounted(){this.$nextTick(()=>{this.chartToolHeight=this.$refs.chartTool.offsetHeight})},beforeDestroy(){this.removeTooltip()},methods:{autoSkipTick(t){const{LINEAR:e,TIME:a}=this.axisTypes;return t===e||t===a},getAxisTicks({axisId:t,axisType:e}){const{CATEGORY:a}=this.axisTypes,{LINE:s,SCATTER:i,BAR_VERT:r,BAR_HORIZ:n}=this.chartTypes,l=this.autoSkipTick(this.axesType[e]);let o={autoSkip:l,callback:this.truncateLabel,beginAtZero:!0};switch(l&&(o.autoSkipPadding=15),this.type){case s:case i:case r:case n:"x"===t&&e===a&&(o.maxRotation=this.autoSkipTick(this.axesType[e])?0:90,o.minRotation=this.autoSkipTick(this.axesType[e])?0:90);break}return o},removeTooltip(){let t=document.getElementById(this.uniqueTooltipId);t&&t.remove()},truncateLabel(t){const e=""+t;return e.length>10?e.substr(0,10)+"...":t},getDefFileName(){return`MaxScale ${this.type} Chart - ${this.$helpers.dateFormat({moment:this.$moment,value:new Date,formatType:"DATE_RFC2822"})}`},createCanvasFrame(){const t=document.querySelector("#query-chart"),e=t.getElementsByTagName("canvas")[0];let a=document.createElement("canvas");a.width=e.width,a.height=e.height;let s=a.getContext("2d");return s.fillStyle="#FFFFFF",s.fillRect(0,0,a.width,a.height),s.drawImage(e,0,0),s.scale(2,2),a},exportToJpeg(){const t=this.createCanvasFrame(),e=t.toDataURL("image/jpeg",1);let a=document.createElement("a");a.href=e,a.download=this.getDefFileName()+".jpeg",document.body.appendChild(a),a.click(),document.body.removeChild(a)}}},l=n,o=(a("7e23a"),a("2877")),c=a("6544"),d=a.n(c),h=a("132d"),u=a("2fa4"),p=Object(o["a"])(l,s,i,!1,null,"6ad9fae6",null);e["a"]=p.exports;d()(p,{VIcon:h["a"],VSpacer:u["a"]})},"76ee":function(t,e,a){},"786a":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.isActivated?a("v-tooltip",{attrs:{disabled:t.isGettingEndTime,top:"",transition:"slide-y-transition","content-class":"shadow-drop white pa-3"},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[a("span",t._g({},s),[t._v(" "+t._s(t.$mxs_tc("seconds",1===t.duration?1:2,{value:t.duration})))])]}}],null,!1,1994478401)},[a("v-sheet",{staticClass:"mxs-color-helper text-small-text",attrs:{"min-width":"220","max-width":"450"}},[a("div",{staticClass:"d-flex align-center mxs-color-helper text-navigation font-weight-bold"},[a("span",[t._v(t._s(t.$mxs_t("totalDuration"))+":")]),a("v-spacer"),a("span",[t._v(" "+t._s(t.$mxs_tc("seconds",1===t.duration?1:2,{value:t.duration})))])],1),a("div",{staticClass:"d-flex align-center"},[a("span",[t._v(t._s(t.$mxs_t("networkDelay"))+" ")]),a("v-spacer"),a("span",{staticClass:"mxs-color-helper text-navigation"},[t._v(" "+t._s(t.$mxs_tc("seconds",1===t.networkDelay?1:2,{value:t.networkDelay}))+" ")])],1),a("div",{staticClass:"d-flex align-center"},[a("span",[t._v(t._s(t.$mxs_t("exeTime"))+": ")]),a("v-spacer"),a("span",{staticClass:"mxs-color-helper text-navigation"},[t._v(" "+t._s(t.$mxs_tc("seconds",1===t.executionTime?1:2,{value:t.executionTime}))+" ")])],1)])],1):t._e()},i=[],r={name:"duration-timer",props:{executionTime:{type:Number,required:!0},startTime:{type:Number,required:!0},totalDuration:{type:Number,required:!0}},data(){return{duration:0,isActivated:!1}},computed:{isGettingEndTime(){return 0===this.totalDuration},networkDelay(){return Math.abs(this.duration-this.executionTime).toFixed(4)}},activated(){this.isActivated=!0,this.duration=this.totalDuration,this.watch_executionTime()},deactivated(){this.$typy(this.unwatch_executionTime).safeFunction(),this.isActivated=!1},methods:{watch_executionTime(){this.unwatch_executionTime=this.$watch("executionTime",t=>{-1===t&&this.updateSecond()},{immediate:!0})},updateSecond(){const t=(new Date).valueOf(),e=((t-this.startTime)/1e3).toFixed(4);this.isGettingEndTime?(this.duration=parseFloat(e),requestAnimationFrame(this.updateSecond)):this.duration=this.totalDuration}}},n=r,l=a("2877"),o=a("6544"),c=a.n(o),d=a("8dd9"),h=a("2fa4"),u=a("3a2f"),p=Object(l["a"])(n,s,i,!1,null,null,null);e["a"]=p.exports;c()(p,{VSheet:d["a"],VSpacer:h["a"],VTooltip:u["a"]})},7973:function(t,e,a){"use strict";a("76ee")},"7e23a":function(t,e,a){"use strict";a("4e9b")},"85c6d":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"pa-4"},[a("h5",{staticClass:"mb-4"},[t._v(t._s(t.$mxs_t("visualization")))]),a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("graph")))]),a("v-select",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom",attrs:{items:Object.values(t.chartTypes),outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"",height:36,"hide-details":"auto"},model:{value:t.chartOpt.type,callback:function(e){t.$set(t.chartOpt,"type",e)},expression:"chartOpt.type"}}),t.chartOpt.type?a("div",{staticClass:"mt-4"},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("selectResultSet"))+" ")]),a("v-select",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom",attrs:{items:t.resultSets,outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"",height:36,"hide-details":"auto","item-text":"id","item-value":"id","return-object":""},model:{value:t.resSet,callback:function(e){t.resSet=e},expression:"resSet"}}),t.resSet?[t.$typy(t.resSet,"data").isEmptyArray?a("div",{staticClass:"mt-4 mxs-color-helper text-small-text"},[t._v(" "+t._s(t.$mxs_t("emptySet"))+" ")]):t._l(t.scaleLabels,(function(e,s){return a("div",{key:s},[a("div",{staticClass:"mt-2"},[a("label",{staticClass:"field__label mxs-color-helper text-small-text text-capitalize label-required"},[t._v(" "+t._s(s)+" axis ")]),a("v-select",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom",attrs:{items:t.axisFields,outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"",height:36,"hide-details":"auto"},model:{value:t.scaleLabels[s],callback:function(e){t.$set(t.scaleLabels,s,e)},expression:"scaleLabels[axisId]"}})],1),a("div",{staticClass:"mt-2"},[a("label",{staticClass:"field__label mxs-color-helper text-small-text text-capitalize label-required"},[t._v(" "+t._s(s)+" axis type ")]),a("v-select",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom",attrs:{items:Object.values(t.axisTypes),outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"",height:36,"hide-details":"auto"},scopedSlots:t._u([{key:"selection",fn:function(e){var a=e.item;return[t._v(" "+t._s(t.labelingAxisType(a))+" ")]}},{key:"item",fn:function(e){var a=e.item;return[t._v(" "+t._s(t.labelingAxisType(a))+" ")]}}],null,!0),model:{value:t.axesType[s],callback:function(e){t.$set(t.axesType,s,e)},expression:"axesType[axisId]"}})],1)])})),t.supportTrendLine?a("v-checkbox",{staticClass:"mt-2 v-checkbox--custom-label",attrs:{dense:"",color:"primary","hide-details":""},scopedSlots:t._u([{key:"label",fn:function(){return[a("label",{staticClass:"v-label"},[t._v(t._s(t.$mxs_t("showTrendline")))]),a("v-tooltip",{attrs:{top:"",transition:"slide-y-transition","content-class":"shadow-drop mxs-color-helper white text-navigation py-1 px-4"},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[a("v-icon",t._g({staticClass:"ml-1 material-icons-outlined pointer",attrs:{size:"16",color:"#9DB4BB"}},s),[t._v(" mdi-information-outline ")])]}}],null,!1,2698777940)},[a("span",[t._v(t._s(t.$mxs_t("info.showTrendline")))])])]},proxy:!0}],null,!1,437442532),model:{value:t.showTrendline,callback:function(e){t.showTrendline=e},expression:"showTrendline"}}):t._e()]:t._e()],2):t._e()],1)},i=[],r=(a("caad"),a("ddb0"),{name:"chart-config",props:{value:{type:Object,required:!0},chartTypes:{type:Object,required:!0},axisTypes:{type:Object,required:!0},sqlQueryModes:{type:Object,required:!0},resultSets:{type:Array,required:!0}},data(){return{resSet:null,scaleLabels:{x:"",y:""},axesType:{x:"",y:""},showTrendline:!1}},computed:{chartOpt:{get(){return this.value},set(t){this.$emit("input",t)}},axisFields(){return this.$typy(this.resSet,"fields").isEmptyArray?[]:this.resSet.fields},supportTrendLine(){const{LINE:t,SCATTER:e,BAR_VERT:a,BAR_HORIZ:s}=this.chartTypes;return[t,e,a,s].includes(this.chartOpt.type)}},watch:{"chartOpt.type"(){this.clearAxes()},resSet:{deep:!0,handler(){this.clearAxes()}},scaleLabels:{deep:!0,handler(){this.genChartData()}},axesType:{deep:!0,handler(){this.genChartData()}},showTrendline(){this.genChartData()}},deactivated(){this.$typy(this.unwatch_resultSets).safeFunction()},activated(){this.watch_resultSets()},methods:{watch_resultSets(){this.unwatch_resultSets=this.$watch("resultSets",(t,e)=>{this.$helpers.lodash.isEqual(t,e)||(this.clearAxes(),this.resSet=null,this.genChartData())})},clearAxes(){this.scaleLabels={x:"",y:""},this.axesType={x:"",y:""}},labelingAxisType(t){const{LINEAR:e,CATEGORY:a}=this.axisTypes;switch(t){case e:return t+" (Numerical data)";case a:return t+" (String data)";default:return t}},genDataset({colorIndex:t,data:e}){const a=this.$helpers.dynamicColors(t);let s={data:e};const i=a.lastIndexOf(")")-1,r=this.$helpers.strReplaceAt({str:a,index:i,newChar:"0.2"}),{LINE:n,SCATTER:l,BAR_VERT:o,BAR_HORIZ:c}=this.chartTypes;switch(this.chartOpt.type){case n:s={...s,backgroundColor:r,borderColor:a,lineTension:0,borderWidth:1,pointBorderColor:"transparent",pointBackgroundColor:"transparent",pointHoverBorderColor:a,pointHoverBackgroundColor:r};break;case l:s={...s,borderWidth:1,backgroundColor:r,borderColor:a,pointHoverBackgroundColor:a,pointHoverRadius:5};break;case o:case c:s={...s,barPercentage:.5,categoryPercentage:1,barThickness:"flex",maxBarThickness:48,minBarLength:2,backgroundColor:r,borderColor:a,borderWidth:1,hoverBackgroundColor:a,hoverBorderColor:"#4f5051"};break}return this.showTrendline&&this.supportTrendLine&&(s.trendlineLinear={style:"#2d9cdb",lineStyle:"solid",width:2}),s},sortingChartData({data:t,axisId:e,axisType:a}){const{LINEAR:s,TIME:i}=this.axisTypes;switch(a){case s:t.xLabels.sort((t,e)=>t-e),t.datasets[0].data.sort((t,a)=>t[e]-a[e]);break;case i:t.xLabels.sort((t,e)=>this.$moment(t)-this.$moment(e)),t.datasets[0].data.sort((t,a)=>this.$moment(t[e])-this.$moment(a[e]));break}},genChartData(){let t=this.axesType,e=this.scaleLabels,a={xLabels:[],yLabels:[],datasets:[]};if(e.x&&e.y&&t.x&&t.y){let s=[];const i=this.$helpers.getObjectRows({columns:this.resSet.fields,rows:this.resSet.data});for(const t of i){const i=t[e.x],r=t[e.y];s.push({dataPointObj:t,x:i,y:r,scaleLabelX:e.x,scaleLabelY:e.y}),a.xLabels.push(i),a.yLabels.push(r)}const r=this.genDataset({colorIndex:0,data:s});a.datasets=[r];const{BAR_HORIZ:n}=this.chartTypes;let l="x";switch(this.chartOpt.type){case n:l="y";break}this.sortingChartData({data:a,axisId:l,axisType:t[l]})}this.chartOpt={...this.chartOpt,data:a,scaleLabels:e,axesType:t}}}}),n=r,l=a("2877"),o=a("6544"),c=a.n(o),d=a("ac7c"),h=a("132d"),u=a("b974"),p=a("3a2f"),m=Object(l["a"])(n,s,i,!1,null,null,null);e["a"]=m.exports;c()(m,{VCheckbox:d["a"],VIcon:h["a"],VSelect:u["a"],VTooltip:p["a"]})},cee7:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"ddl-editor-ctr fill-height",attrs:{loading:t.isLoading,tile:""}},[a("div",{directives:[{name:"show",rawName:"v-show",value:!t.isLoading,expression:"!isLoading"}],staticClass:"relative fill-height"},[a("ddl-editor-toolbar",{attrs:{height:t.ddlEditorToolbarHeight,disableRevert:!t.hasChanged,disableApply:!t.hasValidChanges},on:{"on-revert":t.revertChanges,"on-apply":t.applyChanges}},[t._l(t.$slots,(function(e,a){return t._t(a,null,{slot:a})}))],2),a("ddl-editor-form-ctr",{attrs:{initialData:t.initialData,dim:t.formDim},on:{"is-form-valid":function(e){t.isFormValid=e}},model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}})],1)])},i=[],r=(a("13d5"),a("2f62")),n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-form",{model:{value:t.isFormValid,callback:function(e){t.isFormValid=e},expression:"isFormValid"}},[a("div",{ref:"header"},[a("alter-table-opts",{attrs:{engines:t.engines,charsetCollationMap:t.charset_collation_map,defDbCharset:t.$typy(t.def_db_charset_map,""+t.$typy(t.tableOptsData,"dbName").safeString).safeString},model:{value:t.tableOptsData,callback:function(e){t.tableOptsData=e},expression:"tableOptsData"}})],1),!t.isEmptyFormData&&t.activated?a("v-tabs",{staticClass:"v-tabs--mariadb-style",attrs:{height:24},model:{value:t.activeColSpec,callback:function(e){t.activeColSpec=e},expression:"activeColSpec"}},t._l(t.SQL_DDL_ALTER_SPECS,(function(e){return a("v-tab",{key:e,attrs:{color:"primary",href:"#"+e}},[a("span",[t._v(" "+t._s(t.$mxs_t(e.toLowerCase())))])])})),1):t._e(),a("div",{staticClass:"px-3 py-2"},[a("v-slide-x-transition",[a("keep-alive",[t.activeColSpec===t.SQL_DDL_ALTER_SPECS.COLUMNS?a("alter-cols-opts",{attrs:{charsetCollationMap:t.charset_collation_map,initialData:t.$typy(t.initialData,"cols_opts_data").safeObjectOrEmpty,height:t.tabDim.height,boundingWidth:t.tabDim.width,defTblCharset:t.$typy(t.tableOptsData,"table_charset").safeString,defTblCollation:t.$typy(t.tableOptsData,"table_collation").safeString},model:{value:t.colsOptsData,callback:function(e){t.colsOptsData=e},expression:"colsOptsData"}}):t._e()],1)],1)],1)],1)},l=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("mxs-collapse",{attrs:{toggleOnClick:function(){return t.showInputs=!t.showInputs},isContentVisible:t.showInputs,wrapperClass:"tbl-opts px-1 pt-2",title:t.$mxs_t("alterTbl")},scopedSlots:t._u([{key:"arrow-toggle",fn:function(e){var s=e.toggleOnClick,i=e.isContentVisible;return[a("v-btn",{staticClass:"arrow-toggle",attrs:{icon:"",small:""},on:{click:s}},[a("v-icon",{class:[i?"rotate-down":"rotate-right"],attrs:{size:"28",color:"deep-ocean"}},[t._v(" mdi-chevron-down ")])],1)]}}])},[a("v-container",{staticClass:"py-0 px-1 pb-3",attrs:{fluid:""}},[a("v-row",{staticClass:"ma-0"},[a("v-col",{staticClass:"py-0 px-1",attrs:{cols:"12",md:"6"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("name"))+" ")]),a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom",attrs:{id:"table_name",rules:t.rules.table_name,required:"",name:"table_name",height:28,"hide-details":"auto",dense:"",outlined:""},model:{value:t.tableOptsData.table_name,callback:function(e){t.$set(t.tableOptsData,"table_name",e)},expression:"tableOptsData.table_name"}})],1),a("v-col",{staticClass:"py-0 px-1",attrs:{cols:"12",md:"6"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text"},[t._v(" "+t._s(t.$mxs_t("comment"))+" ")]),a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom error--text__bottom--no-margin",attrs:{"single-line":"",outlined:"",dense:"",height:28,"hide-details":"auto"},model:{value:t.tableOptsData.table_comment,callback:function(e){t.$set(t.tableOptsData,"table_comment",e)},expression:"tableOptsData.table_comment"}})],1)],1),a("v-row",{staticClass:"ma-0"},[a("v-col",{staticClass:"py-0 px-1",attrs:{cols:"6",md:"4"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("engine"))+" ")]),a("v-select",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom",attrs:{items:t.engines,name:"table_engine",outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"",height:28,"hide-details":"auto"},model:{value:t.tableOptsData.table_engine,callback:function(e){t.$set(t.tableOptsData,"table_engine",e)},expression:"tableOptsData.table_engine"}})],1),a("v-col",{staticClass:"py-0 px-1",attrs:{cols:"6",md:"4"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("charset"))+" ")]),a("charset-collate-select",{attrs:{items:Object.keys(t.charsetCollationMap),defItem:t.defDbCharset,height:28},on:{input:t.onInputCharset},model:{value:t.tableOptsData.table_charset,callback:function(e){t.$set(t.tableOptsData,"table_charset",e)},expression:"tableOptsData.table_charset"}})],1),a("v-col",{staticClass:"py-0 px-1",attrs:{cols:"6",md:"4"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("collation"))+" ")]),a("charset-collate-select",{attrs:{items:t.$typy(t.charsetCollationMap,"["+t.tableOptsData.table_charset+"].collations").safeArray,defItem:t.defCollation,height:28},model:{value:t.tableOptsData.table_collation,callback:function(e){t.$set(t.tableOptsData,"table_collation",e)},expression:"tableOptsData.table_collation"}})],1)],1)],1)],1)},c=[],d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-combobox",t._g(t._b({staticClass:"vuetify-input--override mariadb-select-input error--text__bottom error--text__bottom--no-margin",attrs:{outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"","hide-details":"auto"},scopedSlots:t._u([{key:"item",fn:function(e){var s=e.item,i=e.on,r=e.attrs;return[a("div",t._g(t._b({staticClass:"v-list-item__title d-flex align-center flex-row flex-grow-1"},"div",r,!1),i),[t._v(" "+t._s(s)+" "+t._s(s===t.defItem?"("+t.$mxs_t("default")+")":"")+" ")])]}}])},"v-combobox",Object.assign({},t.$attrs),!1),t.$listeners))},h=[],u={name:"charset-collate-select",inheritAttrs:!1,props:{defItem:{type:String,required:!0}}},p=u,m=a("2877"),_=a("6544"),b=a.n(_),f=a("2b5d"),y=Object(m["a"])(p,d,h,!1,null,null,null),v=y.exports;b()(y,{VCombobox:f["a"]});var x={name:"alter-table-opts",components:{CharsetCollateSelect:v},props:{value:{type:Object,required:!0},engines:{type:Array,required:!0},defDbCharset:{type:String,required:!0},charsetCollationMap:{type:Object,required:!0}},data(){return{rules:{table_name:[t=>!!t||this.$mxs_t("errors.requiredInput",{inputName:this.$mxs_t("name")})]},showInputs:!0}},computed:{tableOptsData:{get(){return this.value},set(t){this.$emit("input",t)}},defCollation(){return this.$typy(this.charsetCollationMap,`[${this.tableOptsData.table_charset}].defCollation`).safeString}},methods:{onInputCharset(){this.tableOptsData.table_collation=this.defCollation}}},C=x,g=(a("40cc"),a("8336")),O=a("62ad"),T=a("a523"),D=a("132d"),$=a("0fd9"),S=a("b974"),k=a("8654"),I=Object(m["a"])(C,o,c,!1,null,null,null),w=I.exports;b()(I,{VBtn:g["a"],VCol:O["a"],VContainer:T["a"],VIcon:D["a"],VRow:$["a"],VSelect:S["a"],VTextField:k["a"]});var E=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"fill-height"},[a("div",{ref:"header",staticClass:"pb-2 d-flex align-center flex-1"},[a("v-spacer"),t.selectedItems.length?a("mxs-tooltip-btn",{attrs:{btnClass:"mr-2 pa-1 text-capitalize","x-small":"",outlined:"",depressed:"",color:"error"},on:{click:function(e){return t.deleteSelectedRows(t.selectedItems)}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[t._v(" "+t._s(t.$mxs_t("drop"))+" ("+t._s(t.selectedItems.length)+" ")]},proxy:!0}],null,!1,4089087477)},[t._v(" "+t._s(t.$mxs_t("dropSelectedCols"))+" ")]):t._e(),a("mxs-tooltip-btn",{attrs:{btnClass:"mr-2 pa-1 text-capitalize","x-small":"",outlined:"",depressed:"",color:"accent-dark"},on:{click:t.addNewCol},scopedSlots:t._u([{key:"btn-content",fn:function(){return[t._v(" "+t._s(t.$mxs_t("add"))+" ")]},proxy:!0}])},[t._v(" "+t._s(t.$mxs_t("addNewCol"))+" ")]),a("mxs-filter-list",{attrs:{returnObject:"",label:t.$mxs_t("alterSpecs"),items:t.colSpecs,maxHeight:t.tableMaxHeight-20},model:{value:t.selectedColSpecs,callback:function(e){t.selectedColSpecs=e},expression:"selectedColSpecs"}}),a("mxs-tooltip-btn",{attrs:{btnClass:"ml-2 pa-1","x-small":"",outlined:"",depressed:"",color:"accent-dark"},on:{click:function(e){t.isVertTable=!t.isVertTable}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{class:{"rotate-left":!t.isVertTable},attrs:{size:"14",color:"accent-dark"}},[t._v(" mdi-format-rotate-90 ")])]},proxy:!0}])},[t._v(" "+t._s(t.$mxs_t(t.isVertTable?"switchToHorizTable":"switchToVertTable"))+" ")])],1),a("mxs-virtual-scroll-tbl",t._g({attrs:{headers:t.visHeaders,rows:t.rows,itemHeight:40,maxHeight:t.tableMaxHeight,boundingWidth:t.boundingWidth,showSelect:"",isVertTable:t.isVertTable},on:{"selected-rows":function(e){t.selectedItems=e}},scopedSlots:t._u([t._l(t.visHeaders,(function(e,s){return{key:e.text,fn:function(i){var r=i.data,n=r.rowData,l=r.cell,o=r.rowIdx;return[a("div",{key:e.text,staticClass:"fill-height d-flex align-center"},[a("col-opt-input",{ref:"colOptInput-alterColIdx-"+o+"-colOptIdx-"+s,refInFor:!0,attrs:{initialColOptsData:t.$typy(t.initialData,"data['"+o+"']").safeArray,data:{field:e.text,value:l,alterColIdx:o,colOptIdx:s,rowObj:t.rowDataToObj(n)},height:28,charsetCollationMap:t.charsetCollationMap,defTblCharset:t.defTblCharset,defTblCollation:t.defTblCollation,dataTypes:t.dataTypes},on:{"on-input":t.onCellInput,"on-input-column_type":t.onInputColumnType,"on-input-PK":t.onInputPK,"on-input-NN":t.onInputNN,"on-input-AI":t.onInputAI,"on-input-generated":t.onInputGenerated,"on-input-charset":t.onInputCharset}})],1)]}}})),{key:"header-column_name",fn:function(t){var e=t.data,s=e.maxWidth,i=e.activatorID;return[a("mxs-truncate-str",{attrs:{tooltipItem:{txt:"Column Name",activatorID:i},maxWidth:s}})]}},{key:"header-column_type",fn:function(t){var e=t.data,s=e.maxWidth,i=e.activatorID;return[a("mxs-truncate-str",{attrs:{tooltipItem:{txt:"Column Type",activatorID:i},maxWidth:s}})]}},t._l(t.abbreviatedHeaders,(function(e,s){return{key:t.abbrHeaderSlotName(s),fn:function(i){var r=i.data,n=r.header,l=r.maxWidth;return[a("v-tooltip",{key:s,attrs:{top:"",transition:"slide-y-transition","content-class":"shadow-drop mxs-color-helper white text-navigation py-1 px-4",disabled:t.isVertTable},scopedSlots:t._u([{key:"activator",fn:function(s){var i=s.on;return[a("div",t._g({staticClass:"d-inline-block text-truncate",style:{maxWidth:l+"px"}},i),[t._v(" "+t._s(t.isVertTable?e:n.text)+" ")])]}}],null,!0)},[a("span",[t._v(t._s(e))])])]}}}))],null,!0)},t.$listeners))],1)},A=[],N=(a("ddb0"),a("caad"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return"column_type"===t.input.type?a("v-combobox",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom error--text__bottom--no-margin",class:t.input.type,attrs:{"menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},items:t.input.enum_values,"item-text":"value","item-value":"value",outlined:"",dense:"",height:t.height,"hide-details":"auto","return-object":!1},on:{input:t.onInput},model:{value:t.input.value,callback:function(e){t.$set(t.input,"value",e)},expression:"input.value"}}):"enum"===t.input.type?a("v-select",{staticClass:"vuetify-input--override mariadb-select-input error--text__bottom error--text__bottom--no-margin",class:t.input.type,attrs:{"menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},items:t.input.enum_values,outlined:"",dense:"",height:t.height,"hide-details":"auto",disabled:t.isDisabled},on:{input:t.onInput},model:{value:t.input.value,callback:function(e){t.$set(t.input,"value",e)},expression:"input.value"}}):"bool"===t.input.type?a("v-checkbox",{staticClass:"v-checkbox--scale-reduce ma-0 pa-0",attrs:{dense:"",primary:"","hide-details":"",disabled:t.isDisabled},on:{change:t.onInput},model:{value:t.input.value,callback:function(e){t.$set(t.input,"value",e)},expression:"input.value"}}):"charset"===t.input.type||"collation"===t.input.type?a("charset-collate-select",{attrs:{items:"charset"===t.input.type?Object.keys(t.charsetCollationMap):t.$typy(t.charsetCollationMap,"["+t.columnCharset+"].collations").safeArray,defItem:"charset"===t.input.type?t.defTblCharset:t.defTblCollation,disabled:t.isDisabled,height:t.height},on:{input:t.onInput},model:{value:t.input.value,callback:function(e){t.$set(t.input,"value",e)},expression:"input.value"}}):a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom error--text__bottom--no-margin",class:""+t.input.type,attrs:{"single-line":"",outlined:"",dense:"",height:t.height,"hide-details":"auto"},on:{input:t.onInput},model:{value:t.input.value,callback:function(e){t.$set(t.input,"value",e)},expression:"input.value"}})}),R=[],q=a("ceb86"),L={name:"col-opt-input",components:{CharsetCollateSelect:v},props:{data:{type:Object,required:!0},height:{type:Number,required:!0},charsetCollationMap:{type:Object,required:!0},defTblCharset:{type:String,default:""},defTblCollation:{type:String,default:""},dataTypes:{type:Array,default:()=>[]},initialColOptsData:{type:Array,required:!0}},data(){return{input:{}}},computed:{hasChanged(){return!this.$helpers.lodash.isEqual(this.input,this.data)},columnCharset(){return this.$typy(this.input,"rowObj.charset").safeString},columnType(){return this.$typy(this.input,"rowObj.column_type").safeString},isPK(){return"YES"===this.$typy(this.input,"rowObj.PK").safeString},isGenerated(){return"(none)"!==this.$typy(this.input,"rowObj.generated").safeString},isAI(){return"AUTO_INCREMENT"===this.$typy(this.input,"rowObj.AI").safeString},uniqueIdxName(){const t=this.$typy(this.initialColOptsData,`['${this.data.colOptIdx}']`).safeString;return t||this.$typy(this.data,"rowObj.column_name").safeString+"_UNIQUE"},isDisabled(){switch(this.$typy(this.input,"field").safeString){case"charset":case"collation":return"utf8"===this.columnCharset||!Object(q["c"])(this.columnType);case"PK":return this.isGenerated;case"UN":case"ZF":return!Object(q["b"])(this.columnType);case"AI":return!Object(q["a"])(this.columnType);case"NN":return this.isAI||this.isPK||this.isGenerated;case"UQ":return this.isPK;case"generated":return this.isPK;default:return!1}}},watch:{data:{deep:!0,handler(t,e){this.$helpers.lodash.isEqual(t,e)||this.initInputType(t)}}},created(){this.initInputType(this.data)},methods:{initInputType(t){this.input=this.handleAddType(t)},handleAddType(t){const e=this.$helpers.lodash.cloneDeep(t);switch(e.field){case"column_name":e.type="string";break;case"column_type":e.type="column_type",e.enum_values=this.dataTypes;break;case"NN":e.type="bool",e.value="NOT NULL"===e.value;break;case"UN":e.type="bool",e.value="UNSIGNED"===e.value;break;case"ZF":e.type="bool",e.value="ZEROFILL"===e.value;break;case"AI":e.type="bool",e.value="AUTO_INCREMENT"===e.value;break;case"generated":e.type="enum",e.enum_values=["(none)","VIRTUAL","STORED"];break;case"PK":e.type="bool",e.value="YES"===e.value;break;case"UQ":e.type="bool",e.value=Boolean(e.value);break;case"charset":case"collation":e.type=e.field;break}return e},handleRemoveType(){const t=this.$helpers.lodash.cloneDeep(this.input);return delete t.type,delete t.enum_values,t},onInput(){if(this.hasChanged){let t=this.handleRemoveType();switch(this.input.type){case"column_type":this.$emit("on-input-column_type",t);break;case"charset":this.$emit("on-input-charset",t);break;case"enum":"generated"===t.field?this.$emit("on-input-generated",t):this.$emit("on-input",t);break;case"bool":{const e=t.field;switch(e){case"NN":t.value=t.value?"NOT NULL":"NULL";break;case"UN":t.value=t.value?"UNSIGNED":"";break;case"ZF":t.value=t.value?"ZEROFILL":"";break;case"AI":t.value=t.value?"AUTO_INCREMENT":"";break;case"PK":t.value=t.value?"YES":"NO";break;case"UQ":t.value=t.value?this.uniqueIdxName:""}"AI"===e?this.$emit("on-input-AI",t):"PK"===e?this.$emit("on-input-PK",t):"NN"===e?this.$emit("on-input-NN",t):this.$emit("on-input",t);break}default:this.$emit("on-input",t);break}}}}},j=L,U=a("ac7c"),V=Object(m["a"])(j,N,R,!1,null,null,null),P=V.exports;b()(V,{VCheckbox:U["a"],VCombobox:f["a"],VSelect:S["a"],VTextField:k["a"]});var H={name:"alter-cols-opts",components:{ColOptInput:P},props:{value:{type:Object,required:!0},initialData:{type:Object,required:!0},height:{type:Number,required:!0},boundingWidth:{type:Number,required:!0},defTblCharset:{type:String,required:!0},defTblCollation:{type:String,required:!0},charsetCollationMap:{type:Object,required:!0}},data(){return{selectedItems:[],headerHeight:0,isVertTable:!1,selectedColSpecs:[]}},computed:{tableMaxHeight(){return this.height-this.headerHeight},colsOptsData:{get(){return this.value},set(t){this.$emit("input",t)}},headers(){return this.$typy(this.colsOptsData,"fields").safeArray.map(t=>{let e={text:t,sortable:!1,capitalize:!0};switch(t){case"PK":case"NN":case"UN":case"UQ":case"ZF":case"AI":e.minWidth=50,e.maxWidth=50,e.resizable=!1;break;case"generated":e.width=144,e.minWidth=126;break;case"id":e.hidden=!0;break}return e})},colSpecs(){return this.headers.filter(t=>!t.hidden)},visHeaders(){return this.headers.map(t=>this.selectedColSpecs.find(e=>e.text===t.text)?t:{...t,hidden:!0})},abbreviatedHeaders(){return{PK:"PRIMARY KEY",NN:"NOT NULL",UN:"UNSIGNED",UQ:"UNIQUE INDEX",ZF:"ZEROFILL",AI:"AUTO_INCREMENT",generated:"Generated column"}},rows(){return this.$typy(this.colsOptsData,"data").safeArray},dataTypes(){let t=[];return Object(q["d"])().forEach(e=>{t=[...t,{header:e.header},...e.types,{divider:!0}]}),t},idxOfId(){return this.findColOptIdx("id")},idxOfCollation(){return this.findColOptIdx("collation")},idxOfCharset(){return this.findColOptIdx("charset")},idxOfAI(){return this.findColOptIdx("AI")},idxOfGenerated(){return this.findColOptIdx("generated")},idxOfUN(){return this.findColOptIdx("UN")},idxOfNN(){return this.findColOptIdx("NN")},idxOfUQ(){return this.findColOptIdx("UQ")},idxOfDefAndExp(){return this.findColOptIdx("default/expression")},hasAI(){let t=0;return this.rows.forEach(e=>{"AUTO_INCREMENT"===e[this.idxOfAI]&&t++}),1===t},initialDataFirstCellId(){return this.$typy(this.initialData.data,`[0]['${this.idxOfId}']`).safeString}},watch:{colsOptsData(t){this.$typy(t).isEmptyObject||this.setHeaderHeight()}},activated(){this.watch_initialDataFirstCellId(),this.watch_width_breakpoint()},deactivated(){this.$typy(this.unwatch_initialDataFirstCellId).safeFunction(),this.$typy(this.unwatch_width_breakpoint).safeFunction()},methods:{watch_initialDataFirstCellId(){this.unwatch_initialDataFirstCellId=this.$watch("initialDataFirstCellId",t=>{t&&this.handleShowColSpecs()})},watch_width_breakpoint(){this.unwatch_width_breakpoint=this.$watch("$vuetify.breakpoint.width",()=>this.handleShowColSpecs())},handleShowColSpecs(){const t=this.$helpers.lodash.cloneDeep(this.colSpecs);if(this.$vuetify.breakpoint.width>=1680)this.selectedColSpecs=t;else{const e=["charset","collation","comment"];this.selectedColSpecs=t.filter(t=>!e.includes(t.text))}},abbrHeaderSlotName(t){return"header-"+t},setHeaderHeight(){this.$refs.header&&(this.headerHeight=this.$refs.header.clientHeight)},deleteSelectedRows(t){const{xorWith:e,isEqual:a}=this.$helpers.lodash;this.colsOptsData={...this.colsOptsData,data:e(this.colsOptsData.data,t,a)}},addNewCol(){let t=[];this.headers.forEach(e=>{switch(e.text){case"id":t.push(this.$helpers.uuidv1());break;case"NN":t.push("NULL");break;case"PK":t.push("NO");break;default:t.push("");break}}),this.colsOptsData.data.push(t)},rowDataToObj(t){const e=this.$helpers.getObjectRows({columns:this.$typy(this.colsOptsData,"fields").safeArray,rows:[t]});return e.length?e[0]:[]},findColOptIdx(t){return this.headers.findIndex(e=>e.text===t)},onCellInput(t){this.colsOptsData=this.$helpers.immutableUpdate(this.colsOptsData,{data:{[t.alterColIdx]:{[t.colOptIdx]:{$set:t.value}}}})},patchCharsetCollation({colsOptsData:t,alterColIdx:e,charset:a}){return this.$helpers.immutableUpdate(t,{data:{[e]:{[this.idxOfCharset]:{$set:a},[this.idxOfCollation]:{$set:this.$typy(this.charsetCollationMap,`[${a}].defCollation`).safeString}}}})},handleNationalType({colsOptsData:t,item:e}){return e.value.includes("NATIONAL")?this.patchCharsetCollation({colsOptsData:t,alterColIdx:e.alterColIdx,charset:"utf8"}):t},handleUncheck_UN_ZF_AI({colsOptsData:t,item:e}){if(!Object(q["b"])(e.value)||!Object(q["a"])(e.value)){const a=this.findColOptIdx("ZF");return this.$helpers.immutableUpdate(t,{data:{[e.alterColIdx]:{[this.idxOfUN]:{$set:""},[a]:{$set:""},[this.idxOfAI]:{$set:""}}}})}return t},handleSetDefCharset({colsOptsData:t,item:e}){let a=null,s=null;return Object(q["c"])(e.value)&&(a=this.defTblCharset,s=this.defTblCollation),this.$helpers.immutableUpdate(t,{data:{[e.alterColIdx]:{[this.idxOfCharset]:{$set:a},[this.idxOfCollation]:{$set:s}}}})},handleSerialType({colsOptsData:t,item:e}){if("SERIAL"===e.value){const a=this.$refs[`colOptInput-alterColIdx-${e.alterColIdx}-colOptIdx-${this.idxOfUQ}`][0];return this.$helpers.immutableUpdate(t,{data:{[e.alterColIdx]:{[this.idxOfUN]:{$set:"UNSIGNED"},[this.idxOfNN]:{$set:"NOT NULL"},[this.idxOfAI]:{$set:"AUTO_INCREMENT"},[this.idxOfUQ]:{$set:a.uniqueIdxName}}}})}return t},onInputColumnType(t){let e=this.$helpers.immutableUpdate(this.colsOptsData,{data:{[t.alterColIdx]:{[t.colOptIdx]:{$set:t.value}}}});e=this.handleSetDefCharset({colsOptsData:e,item:t}),e=this.handleUncheck_UN_ZF_AI({colsOptsData:e,item:t}),e=this.handleNationalType({colsOptsData:e,item:t}),e=this.handleSerialType({colsOptsData:e,item:t}),this.colsOptsData=e},uncheckOtherAI({colsOptsData:t,alterColIdx:e}){let a;for(const[s,i]of this.rows.entries())if("AUTO_INCREMENT"===i[this.idxOfAI]&&s!==e){a=s;break}return a>=0?this.$helpers.immutableUpdate(t,{data:{[a]:{[this.idxOfAI]:{$set:""}}}}):t},notNullSideEffect({colsOptsData:t,alterColIdx:e,valOfNN:a,valueOfDefault:s=null}){let i=this.$typy(t,`data['${e}']['${this.idxOfDefAndExp}']`).safeString;return"NULL"===i&&"NOT NULL"===a&&(i=""),null!==s&&(i=s),this.$helpers.immutableUpdate(t,{data:{[e]:{[this.idxOfNN]:{$set:a},[this.idxOfDefAndExp]:{$set:i}}}})},onInputAI(t){let e=this.colsOptsData;this.hasAI&&(e=this.uncheckOtherAI({colsOptsData:e,alterColIdx:t.alterColIdx})),e=this.$helpers.immutableUpdate(e,{data:{[t.alterColIdx]:{[t.colOptIdx]:{$set:t.value},[this.idxOfGenerated]:{$set:"(none)"}}}}),this.colsOptsData=this.notNullSideEffect({colsOptsData:e,alterColIdx:t.alterColIdx,valOfNN:"NOT NULL",valueOfDefault:t.value?"":null})},onInputGenerated(t){let e=this.colsOptsData,a="";if("(none)"===t.value){const s=this.$typy(e,`data['${t.alterColIdx}']['${this.idxOfNN}']`).safeString;"NULL"===s?a="NULL":"NOT NULL"===s&&(a="")}else a=this.$typy(this.initialData.data,`['${t.alterColIdx}']['${this.idxOfDefAndExp}']`).safeString;e=this.$helpers.immutableUpdate(e,{data:{[t.alterColIdx]:{[t.colOptIdx]:{$set:t.value},[this.idxOfAI]:{$set:""},[this.idxOfNN]:{$set:""},[this.idxOfDefAndExp]:{$set:a}}}}),this.colsOptsData=e},onInputCharset(t){this.colsOptsData=this.patchCharsetCollation({colsOptsData:this.colsOptsData,alterColIdx:t.alterColIdx,charset:t.value})},onInputPK(t){let e=this.$helpers.immutableUpdate(this.colsOptsData,{data:{[t.alterColIdx]:{[t.colOptIdx]:{$set:t.value},[this.idxOfUQ]:{$set:""}}}});this.colsOptsData=this.notNullSideEffect({colsOptsData:e,alterColIdx:t.alterColIdx,valOfNN:"NOT NULL"})},onInputNN(t){this.colsOptsData=this.notNullSideEffect({colsOptsData:this.colsOptsData,alterColIdx:t.alterColIdx,valOfNN:t.value})}}},F=H,M=a("2fa4"),Q=a("3a2f"),W=Object(m["a"])(F,E,A,!1,null,null,null),B=W.exports;b()(W,{VIcon:D["a"],VSpacer:M["a"],VTooltip:Q["a"]});var Y={name:"ddl-editor-form-ctr",components:{AlterTableOpts:w,AlterColsOpts:B},model:{prop:"formData",event:"input"},props:{formData:{type:Object,required:!0},initialData:{type:Object,required:!0},dim:{type:Object,required:!0}},data(){return{isFormValid:!0,headerHeight:0,activated:!1}},computed:{...Object(r["e"])({SQL_DDL_ALTER_SPECS:t=>t.queryEditorConfig.config.SQL_DDL_ALTER_SPECS,curr_ddl_alter_spec:t=>t.editor.curr_ddl_alter_spec,charset_collation_map:t=>t.editor.charset_collation_map,engines:t=>t.editor.engines,def_db_charset_map:t=>t.editor.def_db_charset_map}),...Object(r["c"])({getActiveSessionId:"querySession/getActiveSessionId"}),tableOptsData:{get(){return this.$typy(this.formData,"table_opts_data").safeObjectOrEmpty},set(t){this.$emit("input",{...this.formData,table_opts_data:t})}},colsOptsData:{get(){return this.$typy(this.formData,"cols_opts_data").safeObjectOrEmpty},set(t){this.$emit("input",{...this.formData,cols_opts_data:t})}},activeColSpec:{get(){return this.curr_ddl_alter_spec},set(t){this.SET_CURR_DDL_ALTER_SPEC({payload:t,id:this.getActiveSessionId})}},tabDim(){return{width:this.dim.width-24,height:this.dim.height-this.headerHeight-24-16}},isEmptyFormData(){return this.$typy(this.formData).isEmptyObject}},watch:{isFormValid(t){this.$emit("is-form-valid",t)},isEmptyFormData(t){t||this.setHeaderHeight()}},activated(){this.activated=!0},deactivated(){this.activated=!1},methods:{...Object(r["d"])({SET_CURR_DDL_ALTER_SPEC:"editor/SET_CURR_DDL_ALTER_SPEC"}),setHeaderHeight(){this.$refs.header&&(this.headerHeight=this.$refs.header.clientHeight)}}},z=Y,K=a("4bd4"),G=a("0789"),Z=a("71a3"),X=a("fe57"),J=Object(m["a"])(z,n,l,!1,null,null,null),tt=J.exports;b()(J,{VForm:K["a"],VSlideXTransition:G["d"],VTab:Z["a"],VTabs:X["a"]});var et=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"d-flex align-center mxs-color-helper border-bottom-table-border",style:{height:t.height+"px"}},[a("mxs-tooltip-btn",{attrs:{btnClass:"toolbar-square-btn",text:"",color:"accent-dark",disabled:t.disableRevert},on:{click:function(e){return t.$emit("on-revert")}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{attrs:{size:"16"}},[t._v("$vuetify.icons.mxs_reload")])]},proxy:!0}])},[t._v(" "+t._s(t.$mxs_t("revertChanges"))+" ")]),a("mxs-tooltip-btn",{attrs:{btnClass:"toolbar-square-btn",text:"",color:"accent-dark",disabled:t.disableApply},on:{click:function(e){return t.$emit("on-apply")}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{attrs:{size:"16"}},[t._v("$vuetify.icons.mxs_running")])]},proxy:!0}])},[t._v(" "+t._s(t.$mxs_t("applyChanges"))+" ")]),t._t("ddl-editor-toolbar-right-slot")],2)},at=[],st={name:"ddl-editor-toolbar",props:{disableApply:{type:Boolean,required:!0},disableRevert:{type:Boolean,required:!0},height:{type:Number,required:!0}}},it=st,rt=Object(m["a"])(it,et,at,!1,null,null,null),nt=rt.exports;b()(rt,{VIcon:D["a"]});var lt={name:"ddl-editor-ctr",components:{DdlEditorFormCtr:tt,DdlEditorToolbar:nt},props:{dim:{type:Object,required:!0},execSqlDlg:{type:Object,required:!0},isExecFailed:{type:Boolean,required:!0}},data(){return{ddlEditorToolbarHeight:28,formData:{},isFormValid:!0}},computed:{...Object(r["e"])({active_wke_id:t=>t.wke.active_wke_id,tbl_creation_info:t=>t.editor.tbl_creation_info}),...Object(r["c"])({getLoadingTblCreationInfo:"editor/getLoadingTblCreationInfo",getActiveSessionId:"querySession/getActiveSessionId"}),formDim(){return{...this.dim,height:this.dim.height-this.ddlEditorToolbarHeight}},isLoading(){return Boolean(this.getLoadingTblCreationInfo&&this.$typy(this.initialData).isEmptyObject)},initialData(){return this.$typy(this.tbl_creation_info,"data").safeObjectOrEmpty},hasChanged(){return!this.$helpers.lodash.isEqual(this.$typy(this.initialData).safeObject,this.$typy(this.formData).safeObject)},hasValidChanges(){return this.isFormValid&&this.hasChanged},isTblOptsChanged(){return!this.$helpers.lodash.isEqual(this.$typy(this.initialData,"table_opts_data").safeObject,this.$typy(this.formData,"table_opts_data").safeObject)},isColsOptsChanged(){return!this.$helpers.lodash.isEqual(this.$typy(this.initialData,"cols_opts_data.data").safeArray,this.$typy(this.formData,"cols_opts_data.data").safeArray)},currColsData(){return this.$typy(this.formData,"cols_opts_data.data").safeArray},initialColsData(){return this.$typy(this.initialData,"cols_opts_data.data").safeArray},currPkCols(){return this.getPKCols(this.currColsData)},initialPkCols(){return this.getPKCols(this.initialColsData)}},activated(){this.watch_initialData()},deactivated(){this.$typy(this.unwatch_initialData).safeFunction()},methods:{...Object(r["d"])({PATCH_EXE_STMT_RESULT_MAP:"schemaSidebar/PATCH_EXE_STMT_RESULT_MAP",SET_TBL_CREATION_INFO:"editor/SET_TBL_CREATION_INFO"}),...Object(r["b"])({exeStmtAction:"schemaSidebar/exeStmtAction"}),watch_initialData(){this.unwatch_initialData=this.$watch("initialData",t=>{t&&!this.$helpers.lodash.isEqual(this.formData,t)&&(this.formData=this.$helpers.lodash.cloneDeep(t))},{deep:!0,immediate:!0})},revertChanges(){this.formData=this.$helpers.lodash.cloneDeep(this.initialData)},getPKCols(t){const e=this.$typy(this.formData,"cols_opts_data.fields").safeArray;let a=[];const s=e.findIndex(t=>"PK"===t),i=e.findIndex(t=>"column_name"===t);return t.forEach(t=>{"YES"===t[s]&&a.push(t[i])}),a},handleAddComma:({ignore:t=!1}={})=>t?"":", ",buildTblOptSql({dbName:t}){let e="";const{escapeIdentifiers:a,deepDiff:s}=this.$helpers,i=s(this.initialData.table_opts_data,this.formData.table_opts_data);return i.forEach((s,i)=>{e+=this.handleAddComma({ignore:0===i});const r=s.path[0];switch(r){case"table_name":e+=`RENAME TO ${a(t)}.${a(s.rhs)}`;break;case"table_engine":e+="ENGINE = "+s.rhs;break;case"table_charset":e+="CHARACTER SET = "+s.rhs;break;case"table_collation":e+="COLLATE = "+s.rhs;break;case"table_comment":e+=`COMMENT = '${s.rhs}'`;break}}),e},buildDropColSql({removedCols:t}){let e="";const{escapeIdentifiers:a}=this.$helpers;return t.forEach((t,s)=>{e+=this.handleAddComma({ignore:0===s}),e+="DROP COLUMN "+a(t.column_name)}),e},buildColsDfnSQL({cols:t,isChanging:e}){let a="";const{escapeIdentifiers:s}=this.$helpers;return t.forEach((t,i)=>{a+=this.handleAddComma({ignore:0===i});const r=e?this.$typy(t,"newObj").safeObject:t,{column_name:n,column_type:l,UN:o,ZF:c,NN:d,AI:h,generated:u,charset:p,collation:m,"default/expression":_,comment:b}=r;if(e){const e=this.$typy(t,"oriObj.column_name").safeString;a+=`CHANGE COLUMN ${s(e)} `}else a+="ADD COLUMN ";a+=""+s(n),a+=" "+l,o&&(a+=" "+o),c&&(a+=" "+c),p&&(a+=` CHARACTER SET ${p} COLLATE ${m}`),d&&"(none)"===u&&(a+=" "+d),h&&(a+=" "+h),"(none)"===u&&_?a+=" DEFAULT "+_:_&&(a+=` AS (${_}) ${u}`),b&&(a+=` COMMENT '${b}'`)}),a},buildAddColSQL({addedCols:t}){const{escapeIdentifiers:e}=this.$helpers;let a="";return a+=this.buildColsDfnSQL({cols:t,isChanging:!1}),t.forEach(({UQ:t,column_name:s})=>{t&&(a+=this.handleAddComma(),a+=`ADD UNIQUE INDEX ${e(t)} (${e(s)})`)}),a},buildPKSQL(){let t="";const{escapeIdentifiers:e}=this.$helpers,a="DROP PRIMARY KEY",s=this.initialPkCols.length>0&&0===this.currPkCols.length,i=this.currPkCols.length>0;if(s)t+=a;else if(i){const s=this.currPkCols.map(t=>e(t)).join(", "),i=`ADD PRIMARY KEY (${s})`;this.initialPkCols.length>0?t+=`${a}, ${i}`:t+=i}return t},buildUQSQL({uqColsChanged:t}){let e="";const{escapeIdentifiers:a}=this.$helpers;return t.forEach((t,s)=>{e+=this.handleAddComma({ignore:0===s});const{column_name:i}=t.newObj;t.diff.forEach(t=>{t.lhs?t.rhs||(e+="DROP INDEX "+a(t.lhs)):e+=`ADD UNIQUE INDEX ${a(t.rhs)} (${a(i)})`})}),e},buildChangeColSQL({updatedCols:t}){let e="",a="",s="";const i=t.reduce((t,e)=>{const a=e.diff.filter(t=>"E"===t.kind&&"UQ"===t.path[0]);return a.length&&t.push({...e,diff:a}),t},[]),r=t.reduce((t,e)=>{const a=e.diff.filter(t=>"E"===t.kind&&"PK"!==t.path[0]&&"UQ"!==t.path[0]);return a.length&&t.push({...e,diff:a}),t},[]);return r.length&&(a=this.buildColsDfnSQL({cols:r,isChanging:!0})),i.length&&(s=this.buildUQSQL({uqColsChanged:i})),e+=a,s&&(a&&(e+=this.handleAddComma()),e+=s),e},buildColsAlterSQL(){let t="",e="";const{arrOfObjsDiff:a,getObjectRows:s,lodash:{isEqual:i}}=this.$helpers,r=s({columns:this.$typy(this.initialData,"cols_opts_data.fields").safeArray,rows:this.$typy(this.initialData,"cols_opts_data.data").safeArray}),n=s({columns:this.$typy(this.formData,"cols_opts_data.fields").safeArray,rows:this.$typy(this.formData,"cols_opts_data.data").safeArray}),l=a({base:r,newArr:n,idField:"id"}),o=l.get("removed"),c=l.get("updated"),d=l.get("added");let h="",u="",p="";return o.length&&(h=this.buildDropColSql({removedCols:o})),c.length&&(u=this.buildChangeColSQL({updatedCols:c})),d.length&&(p=this.buildAddColSQL({addedCols:d})),i(this.initialPkCols,this.currPkCols)||(e=this.buildPKSQL()),t+=h,u&&(h&&(t+=this.handleAddComma()),t+=u),p&&((h||u)&&(t+=this.handleAddComma()),t+=p),e&&((h||u||p)&&(t+=this.handleAddComma()),t+=e),t},applyChanges(){const{escapeIdentifiers:t,formatSQL:e}=this.$helpers,{dbName:a,table_name:s}=this.initialData.table_opts_data;let i=`ALTER TABLE ${t(a)}.${t(s)}`,r="",n="";this.isTblOptsChanged&&(r=this.buildTblOptSql({sql:i,dbName:a})),this.isColsOptsChanged&&(n=this.buildColsAlterSQL()),i+=r,n&&(r&&(i+=this.handleAddComma()),i+=n),this.$emit("update:execSqlDlg",{...this.execSqlDlg,isOpened:!0,sql:e(i+";"),onExec:this.confirmAlter,onAfterClose:this.clearAlterResult,onAfterCancel:this.clearAlterResult})},async confirmAlter(){const{escapeIdentifiers:t}=this.$helpers,{dbName:e,table_name:a}=this.formData.table_opts_data;await this.exeStmtAction({sql:this.execSqlDlg.sql,action:`Apply changes to ${t(e)}.${t(a)}`}),this.isExecFailed||this.SET_TBL_CREATION_INFO({id:this.getActiveSessionId,payload:{...this.tbl_creation_info,data:this.$helpers.lodash.cloneDeep(this.formData)}})},clearAlterResult(){this.PATCH_EXE_STMT_RESULT_MAP({id:this.active_wke_id})}}},ot=lt,ct=(a("4b91"),a("b0af")),dt=Object(m["a"])(ot,s,i,!1,null,"e50f9d60",null);e["a"]=dt.exports;b()(dt,{VCard:ct["a"]})},ef78:function(t,e,a){},fbfb:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{style:{maxWidth:"225px"}},[a("v-select",{staticClass:"vuetify-input--override mariadb-select-input conn-dropdown",attrs:{items:t.connOptions,outlined:"",dense:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},height:28,"hide-details":"","item-text":"name","return-object":"",placeholder:t.$mxs_t("selectConnection"),"no-data-text":t.$mxs_t("noConnAvail"),disabled:t.getIsConnBusy},on:{change:t.onSelectConn},scopedSlots:t._u([{key:"selection",fn:function(e){var s=e.item;return[a("div",{staticClass:"d-flex align-center pl-1"},[a("v-icon",{staticClass:"mr-2",attrs:{size:"16",color:"accent-dark"}},[t._v(" $vuetify.icons.mxs_server ")]),a("mxs-truncate-str",{attrs:{tooltipItem:{txt:s.name,nudgeLeft:32},maxWidth:145}})],1)]}},{key:"item",fn:function(e){var s=e.item;return[a("div",{staticClass:"v-list-item__title d-flex align-center flex-row flex-grow-1"},[a("v-icon",{staticClass:"mr-2",attrs:{size:"16",color:s.disabled?"":"accent-dark"}},[t._v(" $vuetify.icons.mxs_server ")]),a("mxs-truncate-str",{attrs:{tooltipItem:{txt:s.name,nudgeLeft:32},maxWidth:135}}),a("v-spacer"),a("mxs-tooltip-btn",{attrs:{btnClass:"ml-2 disconnect-conn",small:"",icon:"",fab:"",height:"24",width:"24"},on:{click:function(e){return e.stopPropagation(),t.unlinkConn(s)}},scopedSlots:t._u([{key:"btn-content",fn:function(){return[a("v-icon",{attrs:{size:"18",color:"error"}},[t._v("$vuetify.icons.mxs_unlink")])]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.$mxs_t("disconnect"))+" ")])],1)]}},{key:"append-item",fn:function(){return[a("v-divider"),a("v-list-item",{staticClass:"text-decoration-underline mxs-color-helper text-primary",attrs:{ripple:"",link:""},on:{click:t.openConnDialog}},[t._v(" "+t._s(t.$mxs_t("newConnection"))+" ")])]},proxy:!0}]),model:{value:t.chosenWkeConn,callback:function(e){t.chosenWkeConn=e},expression:"chosenWkeConn"}}),a("conn-dlg-ctr",{attrs:{connOptions:t.connOptions,handleSave:t.handleOpenConn},model:{value:t.isConnDlgOpened,callback:function(e){t.isConnDlgOpened=e},expression:"isConnDlgOpened"}}),a("mxs-conf-dlg",{attrs:{title:t.$mxs_t("disconnectConn"),saveText:"disconnect",type:"disconnect",closeImmediate:!0,item:t.connToBeDel,onSave:t.confirmDelConn},model:{value:t.isConfDlgOpened,callback:function(e){t.isConfDlgOpened=e},expression:"isConfDlgOpened"}}),a("reconn-dlg-ctr",{attrs:{onReconnectCb:t.onReconnectCb}})],1)},i=[],r=a("2f62"),n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("mxs-dlg",t._g({attrs:{onSave:t.onSave,title:t.$mxs_t("connectTo")+"...",lazyValidation:!1,minBodyWidth:"512px",hasSavingErr:t.hasSavingErr,hasFormDivider:""},on:{"is-form-valid":function(e){t.isFormValid=e}},scopedSlots:t._u([{key:"actions",fn:function(e){var s=e.cancel,i=e.save;return[a("v-spacer"),a("v-btn",{staticClass:"cancel font-weight-medium px-7 text-capitalize",attrs:{small:"",height:"36",color:"primary",rounded:"",outlined:"",depressed:""},on:{click:s}},[t._v(" "+t._s(t.$mxs_t("cancel"))+" ")]),a("v-btn",{staticClass:"save font-weight-medium px-7 text-capitalize",attrs:{small:"",height:"36",color:"primary",rounded:"",depressed:"",disabled:!t.isFormValid},on:{click:i}},[t._v(" "+t._s(t.$mxs_t("connect"))+" ")])]}},t.isOpened?{key:"body",fn:function(){return[a("v-select",{staticClass:"mt-4 vuetify-input--override mariadb-select-input error--text__bottom resource-type-dropdown",attrs:{items:t.resourceTypes,name:"resourceName",outlined:"","menu-props":{contentClass:"mariadb-select-v-menu",bottom:!0,offsetY:!0},dense:"",height:36,"hide-details":"auto"},scopedSlots:t._u([{key:"selection",fn:function(e){var s=e.item;return[a("div",{staticClass:"v-select__selection v-select__selection--comma"},[t._v(" "+t._s(t.$helpers.resourceTxtTransform(s))+" ")])]}},{key:"item",fn:function(e){var s=e.item,i=e.on,r=e.attrs;return[a("div",t._g(t._b({staticClass:"v-list-item__title"},"div",r,!1),i),[t._v(" "+t._s(t.$helpers.resourceTxtTransform(s))+" ")])]}}],null,!1,2046871315),model:{value:t.resourceType,callback:function(e){t.resourceType=e},expression:"resourceType"}})]},proxy:!0}:null,{key:"form-body",fn:function(){return[a("v-container",{staticClass:"pa-1"},[a("v-row",{staticClass:"my-0 mx-n1"},[t.resourceType?a("v-col",{staticClass:"pa-1",attrs:{cols:"12",md:"12"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("resourceLabelName",{resourceName:t.$helpers.resourceTxtTransform(t.resourceType)}))+" ")]),a("mxs-select",{staticClass:"resource-dropdown",attrs:{items:t.resourceItems,entityName:t.resourceType,clearable:"",showPlaceHolder:"",required:"",errorMessages:t.errRsrcMsg},model:{value:t.selectedResource,callback:function(e){t.selectedResource=e},expression:"selectedResource"}})],1):t._e(),a("v-col",{staticClass:"pa-1",attrs:{cols:"12",md:"6"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("username"))+" ")]),a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom user",attrs:{id:"db-user",rules:t.rules.user,name:"db-user",autocomplete:"new-username",dense:"",height:36,"hide-details":"auto",outlined:"",required:""},model:{value:t.body.user,callback:function(e){t.$set(t.body,"user","string"===typeof e?e.trim():e)},expression:"body.user"}})],1),a("v-col",{staticClass:"pa-1",attrs:{cols:"12",md:"6"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text label-required"},[t._v(" "+t._s(t.$mxs_t("password"))+" ")]),a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom password",attrs:{id:"db-password",rules:t.rules.password,type:t.isPwdVisible?"text":"password",name:"db-password",autocomplete:"new-password",dense:"",height:36,"hide-details":"auto",outlined:"",required:""},model:{value:t.body.password,callback:function(e){t.$set(t.body,"password","string"===typeof e?e.trim():e)},expression:"body.password"}},[a("v-icon",{attrs:{slot:"append",size:"20"},on:{click:function(e){t.isPwdVisible=!t.isPwdVisible}},slot:"append"},[t._v(" "+t._s(t.isPwdVisible?"mdi-eye-off":"mdi-eye")+" ")])],1)],1),a("v-col",{staticClass:"pa-1",attrs:{cols:"12",md:"6"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text"},[t._v(" "+t._s(t.$mxs_t("database"))+" ")]),a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom",attrs:{name:"db",dense:"",height:36,"hide-details":"auto",outlined:"",required:""},model:{value:t.body.db,callback:function(e){t.$set(t.body,"db","string"===typeof e?e.trim():e)},expression:"body.db"}})],1),a("v-col",{staticClass:"pa-1",attrs:{cols:"12",md:"6"}},[a("label",{staticClass:"field__label mxs-color-helper text-small-text"},[t._v(" "+t._s(t.$mxs_t("timeout"))+" ")]),a("v-text-field",{staticClass:"vuetify-input--override error--text__bottom timeout",attrs:{type:"number",name:"timeout",dense:"",height:36,"hide-details":"auto",outlined:"",required:""},model:{value:t.body.timeout,callback:function(e){t.$set(t.body,"timeout",t._n(e))},expression:"body.timeout"}})],1)],1)],1)]},proxy:!0}],null,!0),model:{value:t.isOpened,callback:function(e){t.isOpened=e},expression:"isOpened"}},t.$listeners))},l=[],o=(a("13d5"),a("caad"),{name:"conn-dlg-ctr",props:{value:{type:Boolean,required:!0},connOptions:{type:Array,required:!0},handleSave:{type:Function,required:!0}},data(){return{resourceType:"",selectedResource:{},isPwdVisible:!1,body:{user:"",password:"",db:"",timeout:300},rules:{user:[t=>!!t||this.$mxs_t("errors.requiredInput",{inputName:this.$mxs_t("username")})],password:[t=>!!t||this.$mxs_t("errors.requiredInput",{inputName:this.$mxs_t("password")})]},isFormValid:!1,resourceTypes:["listeners","servers","services"],errRsrcMsg:""}},computed:{...Object(r["e"])({rc_target_names_map:t=>t.queryConn.rc_target_names_map,conn_err_state:t=>t.queryConn.conn_err_state,pre_select_conn_rsrc:t=>t.queryConn.pre_select_conn_rsrc}),isOpened:{get(){return this.value},set(t){this.$emit("input",t)}},resourceItems(){const t=this.resourceType,e=this.connOptions.reduce((e,a)=>(a.type===t&&e.push(a.name),e),[]),a=this.rc_target_names_map[t]||[],s=a.reduce((t,a)=>(e.includes(a.id)||t.push(a),t),[]);return s},hasSavingErr(){return this.conn_err_state}},watch:{isOpened:{immediate:!0,async handler(t){if(t){let t=this.resourceTypes[0];this.pre_select_conn_rsrc&&(t=this.pre_select_conn_rsrc.type),this.resourceType=t}else this.$nextTick(()=>Object.assign(this.$data,this.$options.data.apply(this))),this.SET_PRE_SELECT_CONN_RSRC(null)}},resourceType:{immediate:!0,async handler(t){t&&(await this.handleFetchRsrcs(t),this.handleChooseDefRsrc(t))}}},methods:{...Object(r["b"])({fetchRcTargetNames:"queryConn/fetchRcTargetNames"}),...Object(r["d"])({SET_PRE_SELECT_CONN_RSRC:"queryConn/SET_PRE_SELECT_CONN_RSRC"}),async handleFetchRsrcs(t){this.rc_target_names_map[t]||await this.fetchRcTargetNames(t)},handleChooseDefRsrc(t){this.resourceItems.length?(this.pre_select_conn_rsrc?this.selectedResource=this.pre_select_conn_rsrc:this.selectedResource=this.resourceItems[0],this.errRsrcMsg=""):this.errRsrcMsg=this.$mxs_t("errors.existingRsrcConnection",{resourceType:t})},async onSave(){const{id:t=null}=this.selectedResource;await this.handleSave({body:{target:t,...this.body},resourceType:this.resourceType})}}}),c=o,d=a("2877"),h=a("6544"),u=a.n(h),p=a("8336"),m=a("62ad"),_=a("a523"),b=a("132d"),f=a("0fd9"),y=a("b974"),v=a("2fa4"),x=a("8654"),C=Object(d["a"])(c,n,l,!1,null,null,null),g=C.exports;u()(C,{VBtn:p["a"],VCol:m["a"],VContainer:_["a"],VIcon:b["a"],VRow:f["a"],VSelect:y["a"],VSpacer:v["a"],VTextField:x["a"]});var O=a("1fd7"),T={name:"conn-man-ctr",components:{ConnDlgCtr:g,ReconnDlgCtr:O["a"]},data(){return{isConnDlgOpened:!1,chosenWkeConn:{},targetConn:{},isConfDlgOpened:!1}},computed:{...Object(r["e"])({pre_select_conn_rsrc:t=>t.queryConn.pre_select_conn_rsrc,active_wke_id:t=>t.wke.active_wke_id,sql_conns:t=>t.queryConn.sql_conns}),...Object(r["c"])({getWkeConns:"queryConn/getWkeConns",getCurrWkeConn:"queryConn/getCurrWkeConn",getIsConnBusy:"queryConn/getIsConnBusy"}),connOptions(){return this.getWkeConns.map(t=>({...t,disabled:Boolean(t.wke_id_fk)}))},availableConnOpts(){return this.connOptions.filter(t=>!t.disabled)},connToBeDel(){return{id:this.targetConn.name}}},watch:{active_wke_id:{deep:!0,immediate:!0,async handler(){this.assignActiveWkeConn()}},pre_select_conn_rsrc:{async handler(t){t&&await this.handlePreSelectConnRsrc()}}},async created(){this.pre_select_conn_rsrc?await this.handlePreSelectConnRsrc():this.connOptions.length||this.openConnDialog()},methods:{...Object(r["b"])({openConnect:"queryConn/openConnect",disconnect:"queryConn/disconnect",onChangeConn:"queryConn/onChangeConn",validateConns:"queryConn/validateConns"}),async handlePreSelectConnRsrc(){const t=this.availableConnOpts.find(t=>t.name===this.pre_select_conn_rsrc.id);t?(this.chosenWkeConn=t,await this.onSelectConn(t)):this.openConnDialog()},async onSelectConn(t){await this.onChangeConn(t),this.assignActiveWkeConn()},assignActiveWkeConn(){this.$typy(this.getCurrWkeConn).isEmptyObject?this.chosenWkeConn={}:this.chosenWkeConn=this.getCurrWkeConn},openConnDialog(){this.isConnDlgOpened=!0},unlinkConn(t){this.isConfDlgOpened=!0,this.targetConn=t},async handleOpenConn(t){await this.openConnect(t),this.assignActiveWkeConn()},async confirmDelConn(){await this.disconnect({showSnackbar:!0,id:this.targetConn.id})},async onReconnectCb(){await this.validateConns({sqlConns:this.sql_conns,silentValidation:!0})}}},D=T,$=(a("0608"),a("ce7e")),S=a("da13"),k=Object(d["a"])(D,s,i,!1,null,null,null);e["a"]=k.exports;u()(k,{VDivider:$["a"],VIcon:b["a"],VListItem:S["a"],VSelect:y["a"],VSpacer:v["a"]})}}]);
Coded by KALI :v Greetz to DR HARD ../ kali.zbi@hotmail.com