PageSourceSearch

https://www.etown.ru/_nuxt/irNI4N8f.js

js etown.ru collected 2026-10-04 20:04:14 UTC 10,927 bytes, 6 lines download raw bytes

1import{d as le,F as oe,af as ne,E as ie,a0 as se,g as w,ah as z,W as de,o as c,R as p,U as n,aj as d,a as e,x as o,ai as me,an as S,a7 as ue,ac as A,ak as re,al as _e,w as m,B as r,b as D,am as ce,G as B}from"./Z7dTCWOQ.js";import{_ as pe}from"./C8zBVfyf.js";import{_ as ge}from"./BN_kMjxa.js";import{_ as fe}from"./CIAW55ip.js";import{_ as ve}from"./C1U_bPVo.js";import{_ as xe}from"./cu4XvQFQ.js";import{_ as be}from"./DZcOLBK6.js";import{_ as ye}from"./D_JJ2ykJ.js";import"./Jq4ZZfHl.js";import"./ByUBk0lU.js";import"./CMxA97RE.js";import"./DXdLejVb.js";import"./-glsUXw2.js";import"./CwAzvBtT.js";import"./azlD7ewX.js";import"./gzgqJs3L.js";import"./CxH4KCGg.js";import"./iiEZV71x.js";import"./BXrk-eyv.js";import"./bEm-LAVp.js";import"./9up4gYWC.js";import"./Dar9RIBz.js";import"./QXBR4Ub2.js";import"./iJ054nq_.js";import"./P34gHABK.js";import"./CLiS1Kn1.js";import"./D9JtVyih.js";import"./vGO8snls.js";import"./CbYW0g-O.js";import"./CPpWR9YT.js";import"./DK7G04R2.js";import"./COmrvavu.js";import"./D4k11_F0.js";const $e={class:"space-y-4"},Ve={class:"flex items-center justify-between"},ke={class:"text-xl font-bold"},he={class:"text-sm text-muted mt-0.5"},we={class:"flex gap-3 flex-wrap"},Ue={class:"bg-(--ui-bg) rounded-xl border border-(--ui-border) overflow-x-auto"},Ce={class:"w-full text-sm min-w-[600px]"},Se={class:"border-b border-(--ui-border) bg-(--ui-bg-muted)"},Ie={class:"px-4 py-2.5 text-left text-xs font-medium text-muted"},Ee={class:"px-4 py-2.5 text-left text-xs font-medium text-muted"},qe={class:"px-4 py-2.5 text-left text-xs font-medium text-muted"},De={class:"px-4 py-2.5 text-left text-xs font-medium text-muted"},Fe={class:"divide-y divide-(--ui-border)"},Te={key:0},je={colspan:"6",class:"px-4 py-8 text-center text-muted"},Re={key:1},Pe={colspan:"6",class:"px-4 py-8 text-center text-muted"},ze={class:"px-4 py-2.5 text-muted text-xs"},Ae={class:"px-4 py-2.5 font-medium"},Be={class:"px-4 py-2.5 text-muted text-xs"},Me={class:"px-4 py-2.5 text-muted text-xs"},Oe={class:"px-4 py-2.5 text-muted text-xs font-mono"},Ne={class:"px-4 py-2.5 text-right"},Ge={class:"flex justify-end gap-1"},Le={key:0,class:"flex justify-center"},Qe={class:"space-y-3"},We={key:0,class:"space-y-3"},Ye={class:"grid grid-cols-2 gap-3"},He={key:1,class:"space-y-3"},Je={class:"flex justify-end gap-2"},qt=le({__name:"cities",async setup(Ke){let _,U;const{t:l}=oe();ne({title:l("admin.geo_pages.cities.seo_title")});const V=ie(),C=se(),M=w`query { adminRegions(first: 500, page: 1) { data { id name } } }`,O=w`query AdminCities($name: String, $region_id: ID, $first: Int, $page: Int) {
2  adminCities(name: $name, region_id: $region_id, first: $first, page: $page) {
3    data { id slug name lat lng code meta_title meta_keywords meta_description region { id name } }
4    paginatorInfo { total currentPage lastPage }
5  }
6}`,N=w`mutation($region_id: ID!, $slug: String!, $name: String!, $lat: Float, $lng: Float, $code: String, $meta_title: String, $meta_keywords: String, $meta_description: String) { createCity(region_id: $region_id, slug: $slug, name: $name, lat: $lat, lng: $lng, code: $code, meta_title: $meta_title, meta_keywords: $meta_keywords, meta_description: $meta_description) { id } }`,G=w`mutation($id: ID!, $region_id: ID, $slug: String, $name: String, $lat: Float, $lng: Float, $code: String, $meta_title: String, $meta_keywords: String, $meta_description: String) { updateCity(id: $id, region_id: $region_id, slug: $slug, name: $name, lat: $lat, lng: $lng, code: $code, meta_title: $meta_title, meta_keywords: $meta_keywords, meta_description: $meta_description) { id } }`,L=w`mutation($id: ID!) { deleteCity(id: $id) { id } }`,g=r(""),f=r(null),y=r(1),k=r(0),{data:Q}=([_,U]=z(()=>B("admin-geo-regions",()=>V.query({query:M}))),_=await _,U(),_),F=D(()=>[{label:l("admin.geo_pages.cities.all_regions_option"),value:null},...(Q.value?.data?.adminRegions?.data??[]).map(s=>({label:s.name,value:s.id}))]),{data:T,status:W}=([_,U]=z(()=>B(()=>`admin-cities-${y.value}-${g.value}-${f.value}-${k.value}`,()=>V.query({query:O,variables:{name:g.value?`%${g.value}%`:void 0,region_id:f.value||void 0,first:50,page:y.value},fetchPolicy:"network-only"}),{watch:[y,k]})),_=await _,U(),_);de([g,f],()=>{y.value=1,k.value++});const j=D(()=>T.value?.data?.adminCities?.data??[]),I=D(()=>T.value?.data?.adminCities?.paginatorInfo),v=r(!1),x=r(null),$=r("main"),i=ce({regi
6on_id:"",slug:"",name:"",lat:null,lng:null,code:"",meta_title:"",meta_keywords:"",meta_description:""}),E=r(!1);function Y(){x.value=null,$.value="main",Object.assign(i,{region_id:f.value??"",slug:"",name:"",lat:null,lng:null,code:"",meta_title:"",meta_keywords:"",meta_description:""}),v.value=!0}function H(s){x.value=s,$.value="main",Object.assign(i,{region_id:s.region?.id??"",slug:s.slug,name:s.name,lat:s.lat,lng:s.lng,code:s.code??"",meta_title:s.meta_title??"",meta_keywords:s.meta_keywords??"",meta_description:s.meta_description??""}),v.value=!0}async function J(){E.value=!0;try{x.value?await V.mutate({mutation:G,variables:{id:x.value.id,...i}}):await V.mutate({mutation:N,variables:{...i}}),C.add({title:x.value?l("admin.geo_pages.common.updated_toast"):l("admin.geo_pages.common.created_toast"),color:"success"}),v.value=!1,k.value++}catch(s){C.add({title:s?.graphQLErrors?.[0]?.message??l("auth.error"),color:"error"})}finally{E.value=!1}}const q=r(null);async function K(s){q.value=s;try{await V.mutate({mutation:L,variables:{id:s}}),C.add({title:l("admin.geo_pages.common.deleted_toast"),color:"neutral"}),k.value++}catch{C.add({title:l("admin.geo_pages.common.delete_error_toast"),color:"error"})}finally{q.value=null}}return(s,a)=>{const h=me,b=pe,R=ge,X=ue,Z=fe,ee=ve,u=xe,P=be,te=ye;return c(),p("div",$e,[n("div",Ve,[n("div",null,[n("h2",ke,d(e(l)("admin.geo_pages.cities.heading")),1),n("p",he,d(e(l)("admin.geo_pages.common.records_count",{count:e(I)?.total??0})),1)]),o(h,{icon:"i-lucide-plus",label:e(l)("admin.geo_pages.common.add_button"),onClick:Y},null,8,["label"])]),n("div",we,[o(b,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=t=>S(g)?g.value=t:null),placeholder:e(l)("admin.geo_pages.common.search_placeholder"),icon:"i-lucide-search",class:"max-w-xs"},null,8,["modelValue","placeholder"]),o(R,{modelValue:e(f),"onUpdate:modelValue":a[1]||(a[1]=t=>S(f)?f.value=t:null),items:e(F),"value-key":"value",virtualize:"",class:"w-56"},null,8,["modelValue","items"])]),n("div",Ue,[n("table",Ce,[n("thead",Se,[n("tr",null,[a[15]||(a[15]=n("th",{class:"px-4 py-2.5 text-left text-xs font-medium text-muted"},"ID",-1)),n("th",Ie,d(e(l)("admin.geo_pages.common.name_label")),1),n("th",Ee,d(e(l)("admin.geo_pages.common.slug_label")),1),n("th",qe,d(e(l)("admin.geo_pages.cities.region_col")),1),n("th",De,d(e(l)("admin.geo_pages.cities.coords_col")),1),a[16]||(a[16]=n("th",{class:"px-4 py-2.5"},null,-1))])]),n("tbody",Fe,[e(W)==="pending"?(c(),p("tr",Te,[n("td",je,[o(X,{name:"i-lucide-loader-2",class:"animate-spin size-5 mx-auto"})])])):e(j).length===0?(c(),p("tr",Re,[n("td",Pe,d(e(l)("admin.geo_pages.common.not_found")),1)])):A("",!0),(c(!0),p(re,null,_e(e(j),t=>(c(),p("tr",{key:t.id,class:"hover:bg-(--ui-bg-muted) transition-colors"},[n("td",ze,d(t.id),1),n("td",Ae,d(t.name),1),n("td",Be,d(t.slug),1),n("td",Me,d(t.region?.name),1),n("td",Oe,d(t.lat?`${t.lat.toFixed(4)}, ${t.lng?.toFixed(4)}`:"—"),1),n("td",Ne,[n("div",Ge,[o(h,{icon:"i-lucide-pencil",size:"xs",variant:"ghost",color:"neutral",onClick:ae=>H(t)},null,8,["onClick"]),o(h,{icon:"i-lucide-trash-2",size:"xs",variant:"ghost",color:"error",loading:e(q)===t.id,onClick:ae=>K(t.id)},null,8,["loading","onClick"])])])]))),128))])])]),(e(I)?.lastPage??0)>1?(c(),p("div",Le,[o(Z,{page:e(y),total:e(I).total,"items-per-page":50,"onUpdate:page":a[2]||(a[2]=t=>y.value=t)},null,8,["page","total"])])):A("",!0),o(te,{open:e(v),"onUpdate:open":a[14]||(a[14]=t=>S(v)?v.value=t:null),title:e(x)?e(l)("admin.geo_pages.cities.edit_modal_title"):e(l)("admin.geo_pages.cities.create_modal_title")},{body:m(()=>[n("div",Qe,[o(ee,{modelValue:e($),"onUpdate:modelValue":a[3]||(a[3]=t=>S($)?$.value=t:null),items:[{label:e(l)("admin.geo_pages.common.tab_main"),value:"main"},{label:e(l)("admin.geo_pages.common.tab_meta"),value:"meta"}],class:"w-full"},null,8,["modelValue","items"]),e($)==="main"?(c(),p("div",We,[o(u,{label:e(l)("admin.geo_pages.cities.region_label"),required:""},{default:m(()=>[o(R,{modelValue:e(i).region_id,"onUpdate:modelValue":a[4]||(a[4]=t=>e(i).region_id=t),items:e(F).filter(t=>t.value),"value-key":"value",virtualize:"",class:"w-full"},null,8,["modelValue","items"])]),_:1},8,["label"]),o(u,{label:e(l)("admin.geo_pages.common.name_label"),required:""},{default:m(()=>[o(b,{modelValue:e(i).name,"onUpdate:modelValue":a[5]||(a[5]=t=>e(i).name=t),class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"]),o(u,{label:e(l)("admin.geo_pages.common.slug_label"),required:""},{default:m(()=>[o(b,{modelValue:e(i).slug,"onUpdate:modelValue":a[6]||(a[6]=t=>e(i).slug=t),class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"]),n("div",Ye,[o(u,{label:e(l)("admin.geo_pages.cities.lat_label")},{default:m(()=>[o(b,{modelValue:e(i).lat,"onUpdate:modelValue":a[7]||(a[7]=t=>e(i).lat=t),modelModifiers:{number:!0},type:"number",step:"0.0001",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"]),o(u,{label:e(l)("admin.geo_pages.cities.lng_label")},{default:m(()=>[o(b,{modelValue:e(i).lng,"onUpdate:modelValue":a[8]||(a[8]=t=>e(i).lng=t),modelModifiers:{number:!0},type:"number",step:"0.0001",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]),o(u,{label:e(l)("admin.geo_pages.common.code_label"),hint:e(l)("admin.geo_pages.common.code_hint")},{default:m(()=>[o(b,{modelValue:e(i).code,"onUpdate:modelValue":a[9]||(a[9]=t=>e(i).code=t),class:"w-full"},null,8,["modelValue"])]),_:1},8,["label","hint"])])):(c(),p("div",He,[o(u,{label:e(l)("admin.geo_pages.common.meta_title_label")},{default:m(()=>[o(b,{modelValue:e(i).meta_title,"onUpdate:modelValue":a[10]||(a[10]=t=>e(i).meta_title=t),class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"]),o(u,{label:e(l)("admin.geo_pages.common.meta_keywords_label")},{default:m(()=>[o(P,{modelValue:e(i).meta_keywords,"onUpdate:modelValue":a[11]||(a[11]=t=>e(i).meta_keywords=t),rows:4,class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"]),o(u,{label:e(l)("admin.geo_pages.common.meta_description_label")},{default:m(()=>[o(P,{modelValue:e(i).meta_description,"onUpdate:modelValue":a[12]||(a[12]=t=>e(i).meta_description=t),rows:4,class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]))])]),footer:m(()=>[n("div",Je,[o(h,{color:"neutral",variant:"ghost",label:e(l)("admin.geo_pages.common.cancel_button"),onClick:a[13]||(a[13]=t=>v.value=!1)},null,8,["label"]),o(h,{loading:e(E),label:e(x)?e(l)("admin.geo_pages.common.save_button"):e(l)("admin.geo_pages.common.create_button"),onClick:J},null,8,["loading","label"])])]),_:1},8,["open","title"])])}}});
6export{qt 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.