PageSourceSearch

https://dainesejapan.com/_next/static/chunks/pages/admin/quantity-limits-bd20d53d99ee7683.js

js dainesejapan.com collected 2026-10-03 22:20:07 UTC 8,880 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2256],{49292:(e,a,c)=>{"use strict";c.r(a),c.d(a,{default:()=>j});var s=c(37876),d=c(94250),t=c.n(d),r=c(14232),i=c(77328),l=c.n(i),n=c(48230),o=c.n(n);let x="/api/admin/quantity-limits";function j(){let[e,a]=(0,r.useState)([]),[c,d]=(0,r.useState)(""),[i,n]=(0,r.useState)(!0),[j,m]=(0,r.useState)(!1),[h,u]=(0,r.useState)(""),[p,b]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),N=(0,r.useCallback)(async()=>{n(!0),u("");try{let e=await fetch(x,{credentials:"same-origin"});if(!e.ok)return void u(401===e.status?"認証が必要です。再読み込みしてください。":"設定の取得に失敗しました。");let c=await e.json();a(Array.isArray(c.limits)?c.limits:[]),d(c.siteId||""),g(!1)}catch(e){u("通信に失敗しました。")}finally{n(!1)}},[]);(0,r.useEffect)(()=>{N()},[N]);let y=(e,c)=>{a(a=>a.map((a,s)=>s===e?{...a,...c}:a)),g(!0),b("")},k=async()=>{m(!0),u(""),b("");try{let c=await fetch(x,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({limits:e.map(e=>({handle:e.handle,maxQuantity:Number(e.maxQuantity),note:e.note||""}))})}),s=await c.json();if(!c.ok||!s.success)return void u(s.error||"保存に失敗しました。");a(Array.isArray(s.limits)?s.limits:[]),g(!1),b("保存しました。反映まで最大30秒かかります。")}catch(e){u("通信に失敗しました。")}finally{m(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{className:"jsx-203ce0aced15e258",children:"数量制限設定 | Admin"}),(0,s.jsx)("meta",{name:"robots",content:"noindex, nofollow",className:"jsx-203ce0aced15e258"}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1",className:"jsx-203ce0aced15e258"})]}),(0,s.jsxs)("div",{className:"jsx-203ce0aced15e258 page",children:[(0,s.jsxs)("header",{className:"jsx-203ce0aced15e258 head",children:[(0,s.jsx)(o(),{href:"/admin/contents-mgr",className:"back",children:"← 管理メニューへ戻る"}),(0,s.jsx)("h1",{className:"jsx-203ce0aced15e258",children:"数量制限設定"}),(0,s.jsxs)("p",{className:"jsx-203ce0aced15e258 sub",children:["商品ハンドル(slug)単位で「おひとり様N点まで」を設定します。",c?" 対象サイト: ".concat(c):""]})]}),(0,s.jsxs)("main",{className:"jsx-203ce0aced15e258 body",children:[(0,s.jsx)("section",{className:"jsx-203ce0aced15e258 guide",children:(0,s.jsxs)("ul",{className:"jsx-203ce0aced15e258",children:[(0,s.jsxs)("li",{className:"jsx-203ce0aced15e258",children:[(0,s.jsx)("strong",{className:"jsx-203ce0aced15e258",children:"同一ハンドルであればサイズ違い(別SKU・別EAN)も合算"}),"してカウントします。"]}),(0,s.jsx)("li",{className:"jsx-203ce0aced15e258",children:"カート内の合計が上限を超える追加・数量変更は、サーバー側で拒否されます。"}),(0,s.jsx)("li",{className:"jsx-203ce0aced15e258",children:"ハンドルは商品ページURLの末尾です。商品ページのURLをそのまま貼り付けても構いません。"}),(0,s.jsx)("li",{className:"jsx-203ce0aced15e258",children:"この設定はこのサイト専用です。他サイトの設定には影響しません。"})]})}),h&&(0,s.jsx)("p",{className:"jsx-203ce0aced15e258 alert error",children:h}),p&&(0,s.jsx)("p",{className:"jsx-203ce0aced15e258 alert ok",children:p}),i?(0,s.jsx)("p",{className:"jsx-203ce0aced15e258 muted",children:"読み込み中…"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("table",{className:"jsx-203ce0aced15e258",children:[(0,s.jsx)("thead",{className:"jsx-203ce0aced15e258",children:(0,s.jsxs)("tr",{className:"jsx-203ce0aced15e258",children:[(0,s.jsx)("th",{style:{width:"32%"},className:"jsx-203ce0aced15e258",children:"商品ハンドル(slug)"}),(0,s.jsx)("th",{style:{width:"12%"},className:"jsx-203ce0aced15e258",children:"上限個数"}),(0,s.jsx)("th",{className:"jsx-203ce0aced15e258",children:"メモ"}),(0,s.jsx)("th",{style:{width:"16%"},className:"jsx-203ce0aced15e258",children:"最終更新"}),(0,s.jsx)("th",{style:{width:"8%"},className:"jsx-203ce0aced15e258"})]})}),(0,s.jsxs)("tbody",{className:"jsx-203ce0aced15e258",children:[0===e.length&&(0,s.jsx)("tr",{className:"jsx-203ce0aced15e258",children:(0,s.jsx)("td",{colSpan:5,className:"jsx-203ce0aced15e258 muted center",children:"設定はまだありません。「行を追加」から登録してください。"})}),e.map((e,c)=>(0,s.jsxs)("tr",{className:"jsx-203ce0aced15e258",children:[(0,s.jsx)("td",{className:"jsx-203ce0aced15e258",children:(0,s.jsx)("input",{type:"text",value:e.handle,onChange:e=>y(c,{handle:e.target.value}
1),placeholder:"例: 1d000008",className:"jsx-203ce0aced15e258"})}),(0,s.jsx)("td",{className:"jsx-203ce0aced15e258",children:(0,s.jsx)("input",{type:"number",min:1,max:99,value:e.maxQuantity,onChange:e=>y(c,{maxQuantity:Number(e.target.value)}),className:"jsx-203ce0aced15e258"})}),(0,s.jsx)("td",{className:"jsx-203ce0aced15e258",children:(0,s.jsx)("input",{type:"text",value:e.note||"",onChange:e=>y(c,{note:e.target.value}),placeholder:"例: D-AIR ROAD シールドジェネレーター",className:"jsx-203ce0aced15e258"})}),(0,s.jsx)("td",{className:"jsx-203ce0aced15e258 muted small",children:function(e){if(!e)return"—";let a=new Date(e);return Number.isNaN(a.getTime())?"—":a.toLocaleString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}(e.updatedAt)}),(0,s.jsx)("td",{className:"jsx-203ce0aced15e258",children:(0,s.jsx)("button",{type:"button",onClick:()=>{a(e=>e.filter((e,a)=>a!==c)),g(!0),b("")},className:"jsx-203ce0aced15e258 danger",children:"削除"})})]},c))]})]}),(0,s.jsxs)("div",{className:"jsx-203ce0aced15e258 actions",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{a(e=>[...e,{handle:"",maxQuantity:2,note:""}]),g(!0),b("")},className:"jsx-203ce0aced15e258",children:"行を追加"}),(0,s.jsx)("button",{type:"button",onClick:k,disabled:j||!f,className:"jsx-203ce0aced15e258 primary",children:j?"保存中…":f?"保存する":"変更なし"}),(0,s.jsx)("button",{type:"button",onClick:N,disabled:j,className:"jsx-203ce0aced15e258",children:"再読み込み"})]})]})]})]}),(0,s.jsx)(t(),{id:"203ce0aced15e258",children:'.page.jsx-203ce0aced15e258{min-height:100vh;background-color:#fff;color:#000;font-family:"Montserrat","Noto Sans JP",sans-serif}.head.jsx-203ce0aced15e258{background-color:#000;color:#fff;padding:20px 24px;position:sticky;top:0;z-index:100}.head.jsx-203ce0aced15e258 h1.jsx-203ce0aced15e258{margin:8px 0 4px;font-size:1.35rem}.sub.jsx-203ce0aced15e258{margin:0;font-size:.8rem;color:#bbb}.back.jsx-203ce0aced15e258{color:#999;font-size:.8rem;text-decoration:none}.back.jsx-203ce0aced15e258:hover{color:#fff}.body.jsx-203ce0aced15e258{padding:24px;max-width:1100px}.guide.jsx-203ce0aced15e258{background-color:#f8f9fa;border:1px solid#e5e7eb;border-radius:8px;padding:14px 18px;margin-bottom:18px}.guide.jsx-203ce0aced15e258 ul.jsx-203ce0aced15e258{margin:0;padding-left:1.1rem}.guide.jsx-203ce0aced15e258 li.jsx-203ce0aced15e258{font-size:.82rem;line-height:1.8;color:#444}.alert.jsx-203ce0aced15e258{padding:10px 14px;border-radius:6px;font-size:.85rem;margin:0 0 14px}.alert.error.jsx-203ce0aced15e258{background-color:#fef2f2;color:#dc2626;border:1px solid#fecaca}.alert.ok.jsx-203ce0aced15e258{background-color:#f0fdf4;color:#2c5530;border:1px solid#bbf7d0}table.jsx-203ce0aced15e258{width:100%;border-collapse:collapse}th.jsx-203ce0aced15e258,td.jsx-203ce0aced15e258{border-bottom:1px solid#e5e7eb;padding:10px 8px;text-align:left;vertical-align:middle}th.jsx-203ce0aced15e258{font-size:.75rem;color:#666;font-weight:600;border-bottom:2px solid#d1d5db}input.jsx-203ce0aced15e258{width:100%;padding:8px 10px;border:1px solid#d1d5db;border-radius:4px;font-size:.9rem;font-family:inherit}input.jsx-203ce0aced15e258:focus{outline:none;border-color:#2c5530}.actions.jsx-203ce0aced15e258{display:flex;gap:10px;margin-top:18px}button.jsx-203ce0aced15e258{padding:9px 18px;border:1px solid#d1d5db;border-radius:4px;background-color:#fff;font-size:.85rem;font-family:inherit;cursor:pointer}button.jsx-203ce0aced15e258:hover:not(:disabled){background-color:#f3f4f6}button.primary.jsx-203ce0aced15e258{background-color:#000;border-color:#000;color:#fff}button.primary.jsx-203ce0aced15e258:disabled{background-color:#9ca3af;border-color:#9ca3af;cursor:not-allowed}button.danger.jsx-203ce0aced15e258{color:#dc2626;border-color:#fecaca}.muted.jsx-203ce0aced15e258{color:#666;font-size:.85rem}.small.jsx-203ce0aced15e258{font-size:.75rem}.center.jsx-203ce0aced15e258{text-align:center;padding:28px 8px}'})]})}},70193:(e,a,c)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/quantity-limits",function(){return c(49292)}])}},e=>{e.O(0,[8230,636,6593,8792],()=>e(e.s=70193)),_N_E=e.O()}]);

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.