PageSourceSearch

https://console.graffer.jp/aistudio/_next/static/chunks/pages/t/[slug]/admin/billing-a0ca78e3469534a8.js

js graffer.jp collected 2026-09-24 08:43:07 UTC 17,150 bytes, 46 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ad6b5e97-7652-4d55-a858-1b1c612bf512",e._sentryDebugIdIdentifier="sentry-dbid-ad6b5e97-7652-4d55-a858-1b1c612bf512")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6132],{4729:(e,t,n)=>{"use strict";n.d(t,{J:()=>d});var a=n(15383),i=n(24458),l=n.n(i),o=n(12909),r=n(97419),s=n.n(r);let d=({severity:e,usagePercentage:t,isLimitExceeded:n,usageLinkHref:i})=>{let r=n?"テナント全体のプロモデル利用量が当月上限に達しました。":`テナント全体のプロモデル利用量が当月上限の${Math.floor(t)}%を越えています。`;return(0,a.jsx)("div",{className:`${s().banner} ${s()[e]}`,role:"alert",children:(0,a.jsxs)("div",{className:s().message,children:[(0,a.jsx)("span",{className:s().icon,"aria-hidden":"true",children:(0,a.jsx)(o.BS8,{})}),r,(0,a.jsx)(l(),{className:s().link,href:i,children:"利用状況を確認"})]})})}},7837:e=>{e.exports={container:"billing_container__vvGyA","total-token-container":"billing_total-token-container__fb3AX",totalTokenContainer:"billing_total-token-container__fb3AX","total-token-title":"billing_total-token-title__ywIjQ",totalTokenTitle:"billing_total-token-title__ywIjQ","total-token-content":"billing_total-token-content__HU_WR",totalTokenContent:"billing_total-token-content__HU_WR","total-token-card":"billing_total-token-card__TZA2g",totalTokenCard:"billing_total-token-card__TZA2g","total-token-card-title":"billing_total-token-card-title__QdIil",totalTokenCardTitle:"billing_total-token-card-title__QdIil","total-token-card-value":"billing_total-token-card-value__LqzIo",totalTokenCardValue:"billing_total-token-card-value__LqzIo","doughnut-container":"billing_doughnut-container__jyP_1",doughnutContainer:"billing_doughnut-container__jyP_1","chart-container":"billing_chart-container__X9KGb",chartContainer:"billing_chart-container__X9KGb","chart-title":"billing_chart-title__sGPwy",chartTitle:"billing_chart-title__sGPwy","tooltip-container":"billing_tooltip-container__wrSGD",tooltipContainer:"billing_tooltip-container__wrSGD"}},45561:(e,t,n)=>{"use strict";n.d(t,{U:()=>B});var a=n(15383),i=n(14343),l=n(80063),o=n(73754),r=n(53321),s=n(1569),d=n(33794),c=n(96588);let g=({authCtx:e,onLogout:t,onLogoClick:n})=>(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(c.Header,{envText:"production",isDisplayNotification:!1,logoName:"AI Studio",onLogoClick:n,onLogout:t,product:{aiStudio:{urlPath:"/aistudio"}},settingPath:"/settings/users?page=1",tenantName:e.tenant.name,tenantUserName:e.user.name,verified:!0})});var h=n(83939),u=n(87054);let m=(0,u.M)(({children:e,sideMenu:t=(0,a.jsx)(h.o,{})})=>{let n=(0,l.useRouter)(),c=(0,i.useContext)(o.I),u=(0,i.useCallback)(async()=>{try{await r.A.logout()}catch(e){s.oR.error("ログアウトに失敗しました。")}d.RX.toLoginPage()},[]);return c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g,{authCtx:c,onLogoClick:()=>n.push("/"),onLogout:u}),(0,a.jsxs)("div",{className:"columns is-desktop",style:{margin:0},children:[t,(0,a.jsx)("div",{className:"column main",style:{minWidth:"764px"},children:e})]})]}):(0,a.jsx)("div",{style:{height:"100vh",justifyContent:"center",alignItems:"center"},className:"is-flex",children:"loading..."})});var x=n(76324),k=n(90265);let _=({children:e})=>{let t=(0,i.useContext)(o.I),n=(0,l.useRouter)();return t?t.user.tenantRoles?.includes(x.sMp.Admin)?(0,a.jsx)(a.Fragment,{children:e}):void n.push(k.B.Root.link()):(0,a.jsx)(c.Spinner,{loading:!0})};var p=n(4729),j=n(71988),C=n(71383);let b=({children:e})=>{let t=(0,i.useContext)(o.I),{usage:n}=(0,j.A)(),l=null==n?"normal":(0,C.pR)(n.usagePercentage),r=null!=t&&null!=n&&"normal"!==l;return(0,a.jsxs)(a.Fragment,{children:[r&&(0,a.jsx)(p.J,{severity:l,usagePercentage:n.usagePercentage,isLimitExceeded:n.isLimitExceeded,usageLinkHref:k.B.Chat.UsageProModelTenantTokenUsage.link(t.tenant.slug)}),e]})},B=({children:e,...t})=>(0,a.jsx)(u.q,{children:(0,a.jsx)(_,{children:(0,a.jsx)(m,{...t,children:(0,a.jsx)(b,{children:e})})})})}
1,53329:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(15383),i=n(83939),l=n(98096),o=n(82753),r=n(76324),s=n(14343),d=n(46322),c=n(62407),g=n(7837),h=n.n(g),u=n(96588),m=n(64983),x=n.n(m),k=n(88678),_=n.n(k);let p=({queryDate:e,setQueryDate:t})=>{let n=Array.from({length:12},(e,t)=>{let n=x()().subtract(t,"month");return{value:n.format("YYYY-MM"),label:n.format("YYYY年MM月")}}),i=x()(e.value),l=i.startOf("month").format("YYYY/MM/DD"),o=i.isSame(x()(),"month")?x()().format("YYYY/MM/DD HH:mm"):i.endOf("month").format("YYYY/MM/DD"),r=(0,s.useCallback)(async(e,n)=>{"clear"===n.action||t(e)},[t]),d=i.isBefore(x()("2024-09-10"));return(0,a.jsxs)("div",{className:_().filter,children:[(0,a.jsx)(u.FilterContainer,{buttons:[],children:(0,a.jsx)(u.InlineReactSelect,{label:"対象月",onChange:r,options:n,placeholder:"作成年月を選択",value:e,width:"auto"})}),(0,a.jsx)("p",{className:_().date,children:`期間:${l} ~ ${o}`}),d&&(0,a.jsx)(u.WarningBanner,{message:"総画像数は2024年9月10日以降のデータから取得しています。",description:"2024年9月10日より前は画像枚数が集計されていないためご注意ください。"})]})};(0,l.J1)`
2  query GetTenantUsageStats($year: Int!, $month: Int!) {
3    getTenantLlMUsageStatsV2(year: $year, month: $month) {
4      modelStats {
5        model
6        modelTrainingType
7        modelType
8        usageByDate {
9          date
10          charsCount
11          imagesCount
12          generateImagesCount
13        }
14      }
15      originStats {
16        origin
17        charsCount
18        imagesCount
19      }
20    }
21    getTenantPluginUsageStats(year: $year, month: $month) {
22      codeInterpreterUsage {
23        sessionCount
24      }
25      fileSearchUsage {
26        sizeGB
27      }
28    }
29    getTenantGroundingUsageStats(year: $year, month: $month) {
30      requestCount
31    }
32    getTenantImageGenerationUsageStats(year: $year, month: $month) {
33      generateImagesCount
34    }
35  }
36`,d.t1.register(d.PP,d.kc,d.E8,d.hE,d.m_,d.s$,d.Bs);let j={responsive:!0,plugins:{legend:{labels:{boxWidth:10,boxHeight:10,padding:20,usePointStyle:!0}},tooltip:{mode:"index",titleColor:"#393E4A",bodyColor:"#393E4A",backgroundColor:"rgba(255, 255, 255, 0.8)",borderWidth:1,borderColor:"#CFD4E0",boxPadding:4,usePointStyle:!0,caretSize:0,padding:7,bodySpacing:5,titleMarginBottom:10,footerMarginTop:10,callbacks:{afterTitle:e=>{let t=e.reduce((e,t)=>e+BigInt(t.raw),BigInt(0));return`合計: ${t.toLocaleString()}`}}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{callback:e=>
36(e+1)%7==1?`${e+1}日`:null}},y:{title:{display:!0,text:"使用文字数",color:"#5F636D",font:{size:12}},stacked:!0,ticks:{callback:(e,t,n)=>{let a=Math.floor(n.length/3);return 0===t||t===a||t===2*a||t===n.length-1?e.toLocaleString():null}}}},animation:{duration:0}},C=["#DDCC37","#DCAB7E","#F1A6A1","#EAA6E3","#A3C1E3","#84D4E5","#76CABE","#C6E79D","#5F636D","#B2B8C8"],b=()=>{let[e,t]=(0,s.useState)({value:x()().format("YYYY-MM"),label:x()().format("YYYY/MM")}),n=x()(e.value),{data:i,loading:l}=(0,o.I)(r.khL,{variables:{year:n.year(),month:n.month()+1}}),d=i?.getTenantLlMUsageStatsV2,g=i?.getTenantPluginUsageStats,m=i?.getTenantGroundingUsageStats,k=i?.getTenantImageGenerationUsageStats,_=(0,s.useMemo)(()=>({charsCount:d?.originStats.reduce((e,t)=>e+BigInt(t.charsCount),BigInt(0))||BigInt(0),imagesCount:d?.originStats.reduce((e,t)=>e+BigInt(t.imagesCount),BigInt(0))||BigInt(0)}),[d]),b=(0,s.useMemo)(()=>d?.modelStats.map(e=>{let t="IMAGE_GENERATION"===e.modelType,n=e?.usageByDate?.reduce((e,t)=>e+BigInt(t?.charsCount||"0"),BigInt(0))||BigInt(0),a=e.usageByDate.reduce((e,t)=>e+BigInt(t.imagesCount||"0"),BigInt(0))||BigInt(0),i=e.usageByDate.reduce((e,t)=>e+BigInt(t.generateImagesCount||"0"),BigInt(0))||BigInt(0);return{model:T(e.model,e.modelTrainingType),totalCharsCount:t?BigInt(0):n,totalImageCount:a,totalGenerateImagesCount:i,isImageGenerationModel:t}}).sort((e,t)=>e.model.localeCompare(t.model)),[d]);return!l&&d&&g&&m&&k?(0,a.jsxs)("div",{className:h().container,children:[(0,a.jsx)("div",{className:"columns mt-3",children:(0,a.jsx)("div",{className:"column",children:(0,a.jsx)("h1",{className:"title is-size-4",children:"請求項目"})})}),(0,a.jsx)(p,{queryDate:e,setQueryDate:t}),(0,a.jsxs)("div",{className:h()["total-token-container"],children:[(0,a.jsx)("p",{className:h()["total-token-title"],children:"月次使用状況"}),(0,a.jsxs)("div",{className:h()["total-token-content"],children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:h()["total-token-card"],children:[(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"総使用文字数"}),(0,a.jsx)("p",{className:h()["total-token-card-value"],children:_.charsCount.toLocaleString()})]}),(0,a.jsxs)("div",{className:h()["total-token-card"],children:[(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"総画像数"}),(0,a.jsx)("p",{className:h()["total-token-card-value"],children:_.imagesCount.toLocaleString()})]}),(0,a.jsxs)("div",{className:h()["total-token-card"],children:[(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"Assistant API File Search"}),(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"総ベクトルストレージ使用量"}),(0,a.jsxs)("p",{className:h()["total-token-card-value"],children:[g.fileSearchUsage.sizeGB,"GB"]})]}),(0,a.jsxs)("div",{className:h()["total-token-card"],children:[(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"Assistant API Code Interpreter"}),(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"総セッション数"}),(0,a.jsx)("p",{className:h()["total-token-card-value"],children:g.codeInterpreterUsage.sessionCount})]}),(0,a.jsxs)("div",{className:h()["total-token-card"],children:[(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"web検索"}),(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"総リクエスト回数"}),(0,a.jsx)("p",{className:h()["total-token-card-value"],children:m?.requestCount})]}),(0,a.jsxs)("div",{className:h()["total-token-card"],children:[(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"画像生成"}),(0,a.jsx)("p",{className:h()["total-token-card-title"],children:"総生成回数"}),(0,a.jsx)("p",{className:h()["total-token-card-value"],children:k?.generateImagesCount})]})]}),d.originStats.length>0&&(0,a.jsx)("div",{className:h()["doughnut-container"],children:(0,a.jsx)(c.nu,{data:{labels:d.originStats.map(({origin:e})=>B(e)),datasets:[{data:d.originStats.map(({charsCount:e})=>e),backgroundColor:C,hoverBackgroundColor:C}]},options:{plugins:{legend:{position:"bottom"}},maintainAspectRatio:!0,aspectRatio:2}})})]})]}),(0,a.jsxs)("div",{className:h()["chart-container"],children:[(0,a.jsx)("p",{className:h()["chart-title"],children:"各モデルにおける文字使用状況"}),d.modelStats.length>0&&(0,a.jsx)(c.yP,{data:{labels:d.modelStats[0].usageByDate.map(e=>e.date),datasets:d.modelStats.map((e,t)=>{let n=C[t%C.length];return{label:T(e.model,e.modelTrainingType),data:e.usageByDate.map(e=>e.charsCount),backgroundColor:n,borderWidth:1}})},options:j})]}),(0,a.jsx)("div",{style:{width:"100%"},children:(0,a.jsxs)(u.Table,{borderType:"all",children:[(0,a.jsx)(u.TableHeader,{children:(0,a.jsxs)(u.TableRow,{children:[(0,a.jsx)(u.Th,{children:"モデル名"}),(0,a.jsx)(u.Th,{children:"総使用文字数"}),(0,a.jsx)(u.Th,{children:"画像読み取り枚数"}),(0,a.jsx)(u.Th,{children:"画像生成枚数"})]})}),(0,a.jsx)(u.TableBody,{children:b?.map(e=>(0,a.jsxs)(u.TableRow,{children:[(0,a.jsx)(u.Td,{children:e.model}
36),(0,a.jsx)(u.Td,{children:e.totalCharsCount.toLocaleString()}),(0,a.jsx)(u.Td,{children:e.totalImageCount.toLocaleString()}),(0,a.jsx)(u.Td,{children:e.totalGenerateImagesCount.toLocaleString()})]},e.model))})]})})]}):(0,a.jsx)(u.Spinner,{loading:!0})},B=e=>{switch(e){case"BATCH":return"一括処理";case"CHAT":return"チャット";case"CUSTOM_LLM_PRESET_PLAYGROUND":return"カスタムモデルプレビュー";case"INDEX_APP":return"インデックスアプリ";case"TASK_LIBRARY":return"タスクライブラリ";case"IMAGE_GENERATION":return"画像生成";default:throw Error("未定義のCategory: "+e)}},T=(e,t)=>{let n="";switch(t){case r.UVw.Finetuned:n="Finetune";break;case r.UVw.NotTrained:n="";break;default:throw Error("未定義のCategory: "+t)}return`${n}  ${e}`};var y=n(45561);let v=()=>(0,a.jsx)(y.U,{sideMenu:(0,a.jsx)(i.o,{}),children:(0,a.jsx)(b,{})})},60087:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/t/[slug]/admin/billing",function(){return n(53329)}])},71383:(e,t,n)=>{"use strict";n.d(t,{iu:()=>a,pR:()=>i});let a=100,i=e=>e>=90?"danger":e>=70?"warning":"normal"},71988:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(98096),i=n(82753),l=n(76324);(0,a.J1)`
37  query ProModelTenantTokenUsage {
38    proModelTenantTokenUsage {
39      accountCount
40      tenantTokenUsage
41      tenantTokenLimit
42      usagePercentage
43      isLimitExceeded
44    }
45  }
46`;let o=()=>{let{data:e,loading:t,error:n}=(0,i.I)(l.Qp6);return{isLoading:t,isPerTenantLimitScope:e?.proModelTenantTokenUsage!=null,usage:e?.proModelTenantTokenUsage??null,hasError:null!=n}}}
46,83939:(e,t,n)=>{"use strict";n.d(t,{o:()=>h});var a=n(15383),i=n(96588),l=n(24458),o=n.n(l),r=n(90265),s=n(4691),d=n(75910),c=n(15060),g=n(71988);let h=()=>{let e=(0,c.usePathname)(),t=(0,d.l)(),{isPerTenantLimitScope:n}=(0,g.A)();return(0,a.jsx)("aside",{className:"is-menu-pane aside",children:(0,a.jsx)(i.MenuList,{...{items:[{header:"設定",navItems:[{title:r.B.Chat.Policy.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Chat.Policy.link(t),...e}),active:e===r.B.Chat.Policy.link(t),hidden:!1},{title:r.B.Admin.IntegrationSetting.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Admin.IntegrationSetting.link(t),...e}),active:e===r.B.Admin.IntegrationSetting.link(t),hidden:!1},{title:r.B.Admin.ShareOption.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Admin.ShareOption.link(t),...e}),active:e===r.B.Admin.ShareOption.link(t),hidden:!1},{title:r.B.Admin.TemplateSetting.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Admin.TemplateSetting.link(t),...e}),active:e===r.B.Admin.TemplateSetting.link(t),hidden:!1},{title:r.B.Admin.TenantLlmConfiguration.List.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Admin.TenantLlmConfiguration.List.link(t),...e}),active:e===r.B.Admin.TenantLlmConfiguration.List.link(t),hidden:!1},{title:r.B.Admin.ProModelUserTokenCap.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Admin.ProModelUserTokenCap.link(t),...e}),active:e===r.B.Admin.ProModelUserTokenCap.link(t),hidden:!n}]},{header:"データ監査",navItems:[{title:r.B.Chat.ChatHistory.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Chat.ChatHistory.link(t),...e}),active:e===r.B.Chat.ChatHistory.link(t),hidden:!1},{title:r.B.KnowledgeBase.ContextSourceHistory.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.KnowledgeBase.ContextSourceHistory.link(t),...e}),active:e===r.B.KnowledgeBase.ContextSourceHistory.link(t),hidden:!1},{title:r.B.CustomLlmPreset.Audit.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.CustomLlmPreset.Audit.link(t),...e}),active:e===r.B.CustomLlmPreset.Audit.link(t),hidden:!1},{title:r.B.Admin.OAuthStatus.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Admin.OAuthStatus.link(t),...e}),active:e===r.B.Admin.OAuthStatus.link(t),hidden:!s.g.ADMIN_OAUTH_STATUS_ENABLED}]},{header:"モニタリング",navItems:[{title:r.B.Chat.BillingUsage.title,anchor:e=>(0,a.jsx)(o(),{href:r.B.Chat.BillingUsage.link(t),...e}),active:e===r.B.Chat.BillingUsage.link(t),hidden:!1},{title:r.B.Chat.Usage.title,anchor:e=>(0,a.jsx)(o(),{href:`${r.B.Chat.Usage.link(t)}/user-chat-count`,...e}),active:e.includes(r.B.Chat.Usage.link(t)),hidden:!1}]},{header:"サービス",navItems:[{title:"アプリ画面",anchor:e=>(0,a.jsx)(o(),{href:r.B.Root.link(),...e}),hidden:!1}]}]}})})}},87054:(e,t,n)=>{"use strict";n.d(t,{M:()=>u,q:()=>h});var a=n(15383),i=n(73754),l=n(33794),o=n(96588),r=n(14343),s=n(75910),d=n(80063),c=n.n(d),g=n(90265);let h=({children:e})=>{let t=(0,r.useContext)(i.I);return t?t.user.requirePasswordChange?(l.RX.toChangePasswordPage(),(0,a.jsx)(o.Spinner,{loading:!0})):(0,a.jsx)(a.Fragment,{children:e}):(l.RX.toLoginPage(),(0,a.jsx)(o.Spinner,{loading:!0}))},u=e=>t=>{let n=(0,r.useContext)(i.I),d=(0,s.l)(),h=n?.tenant.slug;return((0,r.useEffect)(()=>{n?n.tenant.slug!==d&&c().push(g.B.Root.link()):l.RX.toLoginPage()},[n,d,h]),n)?(0,a.jsx)(e,{...t}):(0,a.jsx)(o.Spinner,{loading:!0})}},88678:e=>{e.exports={filter:"billing-filter_filter__LTvb_",date:"billing-filter_date__4xp8l"}},97419:e=>{e.exports={banner:"pro-model-token-usage-alert-banner_banner__lGzZz",message:"pro-model-token-usage-alert-banner_message__Qnc6X",icon:"pro-model-token-usage-alert-banner_icon__bnNE_",link:"pro-model-token-usage-alert-banner_link__iyXy0",warning:"pro-model-token-usage-alert-banner_warning__k4rTW",danger:"pro-model-token-usage-alert-banner_danger__1r05_"}}},e=>{e.O(0,[3625,4361,5060,8750,8379,636,6593,8792],()=>e(e.s=60087)),_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.