PageSourceSearch

https://demo.foodking.dev/build/assets/LanguageShowComponent-SoOipAVR.js

js foodking.dev collected 2026-10-02 00:21:30 UTC 6,326 bytes, 1 lines download raw bytes

1import{_ as A,r as _,o as i,c as r,h as b,a as v,F as u,b as t,t as n,e as x,v as P,u as L,n as I,w as y,J as F,d as C,g as h,i as T,W as g,j as k,s as p}from"./app-vB7bh4bY.js";const E={name:"MultiInputLanguageComponent",props:["props"]},V={class:"form-col-12 md:form-col-12"},M={key:1,class:"form-col-12 md:form-col-12"},S={for:"name",class:"db-field-title required"};function j(s,e,a,d,c,o){const f=_("MultiInputLanguageComponent",!0);return typeof a.props.text=="object"?(i(!0),r(u,{key:0},b(a.props.text,m=>(i(),r("div",V,[v(f,{props:{text:m,formPost:a.props.formPost}},null,8,["props"])]))),256)):(i(),r("div",M,[t("label",S,n(a.props.text),1),x(t("input",{type:"text",class:"db-field-control","onUpdate:modelValue":e[0]||(e[0]=m=>a.props.formPost[a.props.text.replaceAll(" ","_")]=m)},null,512),[[P,a.props.formPost[a.props.text.replaceAll(" ","_")]]])]))}const D=A(E,[["render",j]]),N={name:"LanguageShowComponent",components:{MultiInputLanguageComponent:D,LoadingComponent:L},data(){return{loading:{isActive:!1},enums:{statusEnum:p,statusEnumArray:{[p.ACTIVE]:this.$t("label.active"),[p.INACTIVE]:this.$t("label.inactive")}},form:{name:"",path:""},editFileInfo:{},formPost:{},errors:{}}},computed:{language:function(){return this.$store.getters["language/show"]},fileList:function(){return this.$store.getters["language/fileList"]},fileText:function(){return this.$store.getters["language/fileText"]}},mounted(){this.loading.isActive=!0,this.$store.dispatch("language/show",this.$route.params.id).then(s=>{this.$store.dispatch("language/fileList",s.data.data.code).then(e=>{this.loading.isActive=!1}).catch(e=>{this.loading.isActive=!1})}).catch(s=>{this.loading.isActive=!1})},methods:{statusClass:function(s){return k.statusClass(s)},getFileText:function(){g.forEach(this.fileList,s=>{s.name===this.form.name&&(this.form.path=s.path)}),this.editFileInfo={name:this.form.name,path:this.form.path},this.$store.dispatch("language/fileText",this.form).then(s=>{s.data&&(this.formPost={},g.forEach(s.data,e=>{if(typeof e=="object")this.fileTextToPostDataCreate(e);else{const a=e,d=e.replaceAll(" ","_");this.formPost[d]=a}})),this.loading.isActive=!1}).catch(s=>{this.loading.isActive=!1})},fileTextToPostDataCreate:function(s){g.forEach(s,e=>{if(typeof e=="object")this.fileTextToPostDataCreate(e);else{const a=e,d=e.replaceAll(" ","_");this.formPost[d]=a}})},saveFileText:function(){this.formPost.x_language_file_name=this.editFileInfo.name,this.formPost.x_language_file_path=this.editFileInfo.path,this.$store.dispatch("language/fileStore",this.formPost).then(s=>{T.success(this.$t("message.file_update_success")),this.loading.isActive=!1}).catch(s=>{T.error(s.response.data.errors),this.loading.isActive=!1})}}},U={class:"db-card"},q={class:"db-card-header"},z={class:"db-card-title"},B={class:"db-card-body"},W={class:"row"},J={class:"col-12 sm:col-5"},O=["src"],Y={class:"col-12 sm:col-7 md:pl-8"},G={class:"text-lg font-medium capitalize mb-2 text-paragraph"},H={class:"db-light-text mb-3"},K={class:"db-card"},Q={class:"db-card-header"},R={class:"db-card-title"},X={class:"db-card-body"},Z={class:"row"},$={class:"col-12 sm:col-12"},tt={class:"form-row"},et={class:"form-col-12"},st={for:"name",class:"db-field-title required"},ot={key:0,class:"db-field-alert"},at={class:"form-col-12"},lt={type:"submit",class:"db-btn py-2 text-white bg-primary"},nt={key:0,class:"db-card"},it={class:"db-card-header"},rt={class:"db-card-title"},ct={class:"db-card-body"},dt={class:"row"},mt={class:"col-12 sm:col-12"},ut={class:"form-row"},ft={key:0,class:"form-row"},ht={key:1,class:"form-col-12 md:form-col-12"},gt={for:"name",class:"db-field-title required"},pt=["onUpdate:modelValue"],_t={class:"form-col-12"},bt={class:"flex flex-wrap gap-3 mt-4"},vt={type:"submit",class:"db-btn py-2 text-white bg-primary"};function xt(s,e,a,d,c,o){const f=_("LoadingComponent"),m=_("MultiInputLanguageComponent");return i(),r(u,null,[v(f,{props:c.loading},null,8,["props"]),t("div",U,[t("div",q,[t("h3",z,n(s.$t("label.language")),1)]),t("div",B,[t("div",W,[t("div",J,[t("img",{class:"db-image",alt:"language",src:o.language.image},null,8,O)]),t("div",Y,[t("h3",G,n(o.language.name),1),t("p",H,n(o.language.code),1),t("label",{class:I(["db-badge",o.statusClass(o.language.status)])},n(c.enums.statusEnumArray[o.language.status]),3)])])])]),e[6]||(e[6]=t("br",null,null,-1)),t("div",K,[t("div",Q,[t("h3",R,n(s.$t("label.files")),1)]),t("div",X,[t("div",Z,[t("div",$,[t("form",{onSubmit:e[1]||(e[1]=y((...l)=>o.getFileText&&o.getFileText(...l),["prevent"]))},[t("div",tt,[t("div",et,[t("label",st,n(s.$t("label.name")),1),x(t("select",{class:"db-field-control","onUpdate:modelValue":e[0]||(e[0]=l=>c.form.name=l)},[(i(!0),r(u,null,b(o.fileList,l=>(i(),r("option",null,n(l.name),1))),256))],512),[[F,c.form.name]]),c.errors.name?(i(),r("small",ot,n(c.errors.name[0]),1)):C("",!0)]),t("div",at,[t("button",lt,[e[3]||(e[3]=t("i",{class:"lab lab-languages"},null,-1)),t("span",null,n(s.$t("button.get_file_content")),1)])])])],32)])])])]),e[7]||(e[7]=t("br",null,null,-1)),Object.keys(o.fileText).length>0?(i(),r("div",nt,[t("div",it,[t("h3",rt,n(c.editFileInfo.name),1)]),t("div",ct,[t("div",dt,[e[5]||
1(e[5]=t("div",{class:"col-12 sm:col-12"},[t("code",{class:"font-color-danger language-note-font-size mb-3"},[h(" * You do not change any word under the curly bracket text {}. example {name}. "),t("br"),h(" * When all language is changed then run some command in your terminal or ssh panel. "),t("br"),t("strong",{class:"strong-left-tab"},[h(" * npm install (run just one time) "),t("br")]),t("strong",{class:"strong-left-tab"}," * npm run prod ")])],-1)),t("div",mt,[t("form",{onSubmit:e[2]||(e[2]=y((...l)=>o.saveFileText&&o.saveFileText(...l),["prevent"]))},[(i(!0),r(u,null,b(o.fileText,l=>(i(),r("div",ut,[typeof l=="object"?(i(),r("div",ft,[v(m,{props:{text:l,formPost:c.formPost}},null,8,["props"])])):(i(),r("div",ht,[t("label",gt,n(l),1),x(t("input",{"onUpdate:modelValue":w=>c.formPost[l.replaceAll(" ","_")]=w,type:"text",class:"db-field-control"},null,8,pt),[[P,c.formPost[l.replaceAll(" ","_")]]])]))]))),256)),t("div",_t,[t("div",bt,[t("button",vt,[e[4]||(e[4]=t("i",{class:"lab lab-save"},null,-1)),t("span",null,n(s.$t("label.save")),1)])])])],32)])])])])):C("",!0)],64)}const Ct=A(N,[["render",xt]]);export{Ct 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.