PageSourceSearch

https://hyundai-motor.md/_nuxt/eOJHjFNb.js

js hyundai-motor.md collected 2026-10-07 05:29:23 UTC 3,799 bytes, 1 lines download raw bytes

1import{i as D,d as T,A as E,j as d,k as n,y as u,p as c,t as o,x as F,l as s,F as L,s as V,r as k,C as B,o as _,_ as I,m as w,I as H,D as P}from"./BACDSJ2L.js";import{_ as S}from"./BT3gFE1k.js";import{u as U}from"./CL0qfQaj.js";import"./DrFpU6Ft.js";const j={key:0,class:"mb-3 text-sm text-red-600"},z={class:"bg-white border border-black/10 divide-y divide-black/5"},M={class:"min-w-0 flex-1"},R={class:"text-xs text-gray-500"},q={class:"hidden sm:block text-sm text-right shrink-0"},G={class:"font-semibold text-[#002c5f]"},J={class:"text-xs text-gray-500"},K={class:"flex items-center gap-1 shrink-0"},O=["title","disabled","onClick"],Q=["disabled","onClick"],te=D({__name:"index",async setup(W){let r,x;T({title:"Модели авто — Админка"});const{call:g,errorText:v}=U(),{data:b,refresh:f}=([r,x]=E(()=>B("admin-models",()=>$fetch("/api/admin/models"),{default:()=>[]})),r=await r,x(),r),l=k(null),i=k(""),h=t=>typeof t.name=="string"?t.name:t.name?.ro||t.name?.ru||t.slug,y=(t,a)=>`${new Intl.NumberFormat("ru-MD").format(t||0)} ${a||""}`.trim();async function $(t){l.value=t.slug,i.value="";try{await g(`/api/admin/models/${t.slug}`,{method:"PUT",body:{active:!t.active}}),await f()}catch(a){i.value=v(a)}finally{l.value=null}}async function C(t){if(confirm(`Удалить модель «${h(t)}»? Она исчезнет с сайта и из конфигуратора. Действие необратимо.`)){l.value=t.slug,i.value="";try{await g(`/api/admin/models/${t.slug}`,{method:"DELETE"}),await f()}catch(a){i.value=v(a)}finally{l.value=null}}}return(t,a)=>{const m=I,A=S,p=P;return _(),d("div",null,[n(A,{title:"Модели авто",subtitle:`${c(b).length} моделей · цены и комплектации сразу уходят на сайт и в конфигуратор`},{actions:u(()=>[n(m,{to:"/admin/models/new",class:"px-4 py-2.5 bg-[#002c5f] text-white text-sm font-semibold uppercase hover:bg-[#00417f]"},{default:u(()=>[...a[0]||(a[0]=[w(" Добавить модель ",-1)])]),_:1})]),_:1},8,["subtitle"]),c(i)?(_(),d("p",j,o(c(i)),1)):F("",!0),s("div",z,[(_(!0),d(L,null,V(c(b),e=>(_(),d("div",{key:e.slug,class:"flex items-center gap-3 p-3"},[s("div",M,[n(m,{to:`/admin/models/${e.slug}`,class:"block font-semibold text-sm hover:text-[#00aad2]"},{default:u(()=>[w(o(h(e)),1)]),_:2},1032,["to"]),s("div",R,o(e.slug)+" · "+o(e.category),1)]),s("div",q,[s("div",G,"от "+o(y(e.priceFrom,e.currency)),1),s("div",J,"до "+o(y(e.priceTo,e.currency)),1)]),s("span",{class:H(["hidden md:inline text-xs px-2 py-1 shrink-0",e.active?"bg-green-50 text-green-700":"bg-gray-100 text-gray-500"])},o(e.active?"На сайте":"Скрыта"),3),s("div",K,[s("button",{class:"p-2 hover:bg-black/5 disabled:opacity-40",title:e.active?"Скрыть":"Показать",disabled:c(l)===e.slug,onClick:N=>$(e)},[n(p,{name:e.active?"lucide:eye":"lucide:eye-off",class:"w-4 h-4"},null,8,["name"])],8,O),n(m,{to:`/admin/models/${e.slug}`,class:"p-2 hover:bg-black/5",title:"Редактировать"},{default:u(()=>[n(p,{name:"lucide:pencil",class:"w-4 h-4"})]),_:1},8,["to"]),s("button",{class:"p-2 text-red-600 hover:bg-red-50 disabled:opacity-40",title:"Удалить",disabled:c(l)===e.slug,onClick:N=>C(e)},[n(p,{name:"lucide:trash-2",class:"w-4 h-4"})],8,Q)])]))),128))]),a[1]||(a[1]=s("p",{class:"mt-4 text-xs text-gray-500"}," Новая модель создаётся скрытой — наполните её цветами, комплектациями, характеристиками и фото в редакторе, затем включите «Показывать модель на сайте». Slug связан с URL и редиректами — задавайте осмысленно. ",-1))])}}});export{te 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.