PageSourceSearch

https://www.octoparse.com/_next/static/chunks/pages/data-hub/console/account-087b483ba83cd317.js

js octoparse.com collected 2026-09-24 08:39:49 UTC 10,495 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8061],{8899:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data-hub/console/account",function(){return a(10759)}])},45301:function(e,t,a){"use strict";a.d(t,{Fb:function(){return s},Hv:function(){return m},O6:function(){return i},Sj:function(){return u},ec:function(){return d},or:function(){return o}});var n=a(17888),r=a.n(n);let l={day:92,hour:96},c={day:"YYYY-MM-DD",hour:"YYYY-MM-DDTHH:00"},s=e=>{if(e<=0)return 1;let t=Math.pow(10,Math.floor(Math.log10(e))),a=e/t;return(a<=1?1:a<=2?2:a<=5?5:10)*t},o=function(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"day",s=[...e].sort(),o=t?r()(t).startOf("day"):s.length?r()(s[0]):r()().startOf("day"),i=a?r()(a).endOf("day"):s.length?r()(s[s.length-1]):r()(),d=Math.max(0,i.diff(o,n)),u=Math.min(d,l[n]),m=d>u?i.subtract(u,n):o;return Array.from({length:u+1},(e,t)=>m.add(t,n).format(c[n]))},i=(e,t)=>r()(e).format("day"===t?"M/D":"M/D HH:mm"),d=(e,t)=>"day"===t?e:r()(e).format("YYYY-MM-DD HH:mm"),u=e=>{let t=e-1;return new Set(t<=0?[0]:Array.from({length:Math.min(4,e)},(e,a)=>Math.round(a*t/Math.min(3,t))))},m={width:1e3,height:220,padding:{top:12,right:8,bottom:26,left:46}}},29970:function(e,t,a){"use strict";var n=a(11527),r=a(51875),l=a(50959),c=a(45301);let s=e=>{var t;let{data:a,startDate:s,endDate:o,formatValue:i,color:d="#FF7D00",label:u,granularity:m="day"}=e,{t:x}=(0,r.$G)("open-platform"),f=(0,l.useMemo)(()=>(0,c.or)(Object.keys(a),s,o,m).map(e=>({key:e,value:null!==(t=a[e])&&void 0!==t?t:0})),[a,s,o,m]),{width:h,height:p,padding:b}=c.Hv,y=(0,c.Fb)(Math.max(...f.map(e=>e.value),0)),g=h-b.left-b.right,v=p-b.top-b.bottom,j=g/Math.max(f.length,1),N=Math.min(.6*j,28),_=(0,l.useMemo)(()=>(0,c.Sj)(f.length),[f.length]);return(0,n.jsxs)("svg",{viewBox:"0 0 ".concat(h," ").concat(p),className:"w-full",style:{height:p},role:"img","aria-label":null!=u?u:x("console.chart.dailyAmount"),children:[[0,.5,1].map(e=>{let t=b.top+v*(1-e);return(0,n.jsxs)("g",{children:[(0,n.jsx)("line",{x1:b.left,x2:h-b.right,y1:t,y2:t,stroke:"#eef0f4",strokeWidth:1}),(0,n.jsx)("text",{x:b.left-8,y:t+4,textAnchor:"end",fontSize:11,fill:"#8c8c8c",children:i(y*e)})]},e)}),f.map((e,t)=>{let a=y>0?e.value/y*v:0,r=b.left+j*t+(j-N)/2;return(0,n.jsxs)("g",{children:[a>0&&(0,n.jsx)("rect",{x:r,y:b.top+v-a,width:N,height:a,fill:d,rx:2,children:(0,n.jsx)("title",{children:"".concat((0,c.ec)(e.key,m)," \xb7 ").concat(i(e.value))})}),_.has(t)&&(0,n.jsx)("text",{x:b.left+j*t+j/2,y:p-8,textAnchor:"middle",fontSize:11,fill:"#8c8c8c",children:(0,c.O6)(e.key,m)})]},e.key)})]})};t.Z=s},10759:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return k}});var n=a(11527),r=a(29970),l=a(57838),c=a(62592),s=a(33369),o=a(99358),i=a(43387),d=a(2471),u=a(46211),m=a(82187),x=a.n(m),f=a(51875),h=a(32506),p=a.n(h),b=a(50959),y=a(64819);let g=[{key:"day",label:"account.tabs.day"},{key:"data_app",label:"account.tabs.dataApp"},{key:"credential",label:"account.tabs.credential"}],v=e=>e.namespace&&e.app_name?"".concat(e.namespace,"/").concat(e.app_name):"",j=async e=>{let t=await Promise.all(e.map(async e=>{let[t,a]=e.split("/");if(!t||!a)return null;try{let n=await (0,u.iI)(t,a);return[e,n.identity.name]}catch(e){return null}}));return Object.fromEntries(t.filter(e=>!!(null==e?void 0:e[1])))},N=e=>"$ ".concat(Number(e||0).toFixed(2));function _(){var e,t;let{t:a}=(0,f.$G)("open-platform"),{t:c}=(0,f.$G)("data-hub"),[d,m]=(0,b.useState)(()=>(0,l.mV)("last30")),[h,N]=(0,b.useState)("day"),_=(0,i.kC)(d),{data:w,isLoading:k,error:M}=(0,y.ZP)("datahub/billing?".concat(h,"&").concat(null!==(e=_.created_from)&&void 0!==e?e:"","&").concat(null!==(t=_.created_to)&&void 0!==t?t:""),()=>(0,u.kd)({group_by:h,..._,tz_offset:(0,i.y$)()}),{revalidateOnFocus:!1,shouldRetryOnError:!1}),D=e=>{let t=new URLSearchParams;for(let[a,n]of Object.entries({..._,...e}))n&&t.set(a,n);return"/data-hub/console/runs?".concat(t.toString())},O=(0,b.useMemo)(()=>{var e,t,a;let n=null!==(e=null==w?void 0:w.groups)&&void 0!==e?e:[];return"day"!==h?n:[...n].sort((e,n)=>(null!==(t=n.day)&&void 0!==t?t:"").localeCompare(null!==(a=e.day)&&void 0!==a?a:""))},[w,h]),S=O.reduce((e,t)=>
1e+t.runs,0),Y=(0,b.useMemo)(()=>{let e={};if("day"===h)for(let t of O)t.day&&(e[t.day]=t.amount);return e},[h,O]),Z=(0,b.useMemo)(()=>"data_app"===h?[...new Set(O.map(v).filter(Boolean))]:[],[h,O]),{data:E={}}=(0,y.ZP)(Z.length?"datahub/billing-app-names?".concat(Z.join(",")):null,()=>j(Z),{revalidateOnFocus:!1,shouldRetryOnError:!1,keepPreviousData:!0});return(0,n.jsxs)("section",{children:[(0,n.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-4 max-md:flex-col max-md:items-start",children:[(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:g.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>N(e.key),className:x()("cursor-pointer rounded-full border px-4 py-2 text-sm font-semibold transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",{"border-[#a9c8ff] bg-[#f0f7ff] text-primary":h===e.key,"border-transparent bg-transparent text-[#595959] hover:bg-[#f0f7ff] hover:text-primary":h!==e.key}),children:a(e.label)},e.key))}),(0,n.jsx)(l.ZP,{value:d,onChange:m})]}),(0,n.jsxs)("div",{className:"mb-4 grid grid-cols-2 gap-4 max-md:grid-cols-1",children:[(0,n.jsxs)(s.Zb,{children:[(0,n.jsx)("div",{className:"text-[13px] leading-5 text-[#8c8c8c]",children:a("account.records.rangeTotal")}),(0,n.jsx)("div",{className:"mt-2 flex items-baseline gap-1.5",children:(0,n.jsx)(p(),{href:D({}),className:"text-[28px] font-semibold leading-9 text-[#1f1f1f] transition-colors hover:text-primary",title:a("account.records.rangeTotalTitle"),children:(0,o.dN)(null==w?void 0:w.total)})})]}),(0,n.jsxs)(s.Zb,{children:[(0,n.jsx)("div",{className:"text-[13px] leading-5 text-[#8c8c8c]",children:a("account.records.chargedRuns")}),(0,n.jsx)("div",{className:"mt-2 text-[28px] font-semibold leading-9 text-[#1f1f1f]",children:S.toLocaleString()})]})]}),"day"===h&&(0,n.jsxs)(s.Zb,{className:"mb-4",children:[(0,n.jsx)("h3",{className:"mb-3 text-sm font-semibold text-[#1f1f1f]",children:a("account.records.dailyChart")}),(0,n.jsx)(r.Z,{data:Y,startDate:d.startDate,endDate:d.endDate,formatValue:o.dN,color:"#3D69E1"})]}),(0,n.jsx)(s.Zb,{children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full min-w-[640px]",children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{children:["day"===h?a("account.records.colDate"):"data_app"===h?"Data App":a("account.records.colCredential"),a("account.records.chargedRuns"),a("account.records.colAmount"),""].map((e,t)=>(0,n.jsx)("th",{className:"whitespace-nowrap border-b border-[#edeef1] px-3 py-2.5 text-left text-xs font-medium text-[#8c8c8c]",children:e},t))})}),(0,n.jsx)("tbody",{children:O.length?O.map((e,t)=>{let r="day"===h&&e.day?D((0,i.q$)(e.day)):"data_app"===h?D({data_app:e.namespace&&e.app_name?"".concat(e.namespace,"/").concat(e.app_name):void 0}):D({credential:e.credential}),l=v(e),s=e.app_name||a("account.records.appDeleted"),d=l?E[l]:"",u="data_app"===h&&d&&d!==l,m="day"===h?e.day:"credential"===h?e.credential_name||(0,o.QP)(c,e.credential):null;return(0,n.jsxs)("tr",{className:"hover:bg-[#f5f5f5]",children:[(0,n.jsx)("td",{className:"border-b border-[#edeef1] px-3 py-3 text-[13px] font-medium",children:"data_app"===h?(0,n.jsxs)("div",{className:"min-w-0",title:u?"".concat(d," / ").concat(l):l||s,children:[(0,n.jsx)("span",{className:"block truncate text-[#1f1f1f]",children:u?d:l||s}),u&&(0,n.jsx)("span",{className:"mt-0.5 block truncate font-normal text-[#8c8c8c]",children:l})]}):m}),(0,n.jsx)("td",{className:"border-b border-[#edeef1] px-3 py-3 text-[13px] tabular-nums",children:e.runs.toLocaleString()}),(0,n.jsx)("td",{className:"border-b border-[#edeef1] px-3 py-3 text-[13px] font-semibold tabular-nums",children:(0,o.dN)(e.amount)}),(0,n.jsx)("td",{className:"border-b border-[#edeef1] px-3 py-3 text-right text-[13px]",children:(0,n.jsx)(p(),{href:r,className:"text-primary transition-colors hover:text-[#2557d6]",children:a("account.records.viewRuns")})})]},t)}):(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:4,className:"px-3 py-10 text-center text-[13px] text-[#8c8c8c]",children:k?a("common.loading"):M?a("account.re
1cords.loadError"):a("account.records.empty")})})})]})})}),(0,n.jsx)("p",{className:"mt-3 text-xs leading-[18px] text-[#8c8c8c]",children:a("account.records.footnote")})]})}let w=()=>{var e;let{t}=(0,f.$G)("open-platform"),{data:a}=(0,d.YS)(),{data:r}=(0,y.ZP)("datahub/billing?cumulative",()=>(0,u.kd)(),{revalidateOnFocus:!1,shouldRetryOnError:!1});return(0,n.jsxs)("div",{children:[(0,n.jsx)(s.yG,{title:t("account.pageTitle"),desc:(0,n.jsxs)(n.Fragment,{children:[t("account.pageDesc"),(0,n.jsx)(p(),{href:"/console/payment-plan/orders-invoices",className:"ml-1 text-primary transition-colors hover:text-[#2557d6] focus-visible:rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:t("account.ordersInvoices")})]})}),(0,n.jsxs)("div",{className:"mb-5 grid grid-cols-2 gap-4 max-md:grid-cols-1",children:[(0,n.jsxs)(s.Zb,{className:"flex items-center justify-between gap-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-[#1f1f1f]",children:t("account.balance.title")}),(0,n.jsx)("div",{className:"mt-4 text-[32px] font-semibold leading-10 text-[#1f1f1f]",children:N(null!==(e=null==a?void 0:a.totalBalance)&&void 0!==e?e:null==a?void 0:a.balance)}),(0,n.jsx)("div",{className:"mt-2 text-[13px] leading-[21px] text-[#595959]",children:t("account.balance.shared")})]}),(0,n.jsx)(p(),{href:"/console/balance",className:"inline-flex shrink-0 rounded-lg bg-primary px-6 py-2.5 text-[15px] font-medium leading-5 text-white transition-colors hover:bg-[#2557d6]",children:t("account.balance.recharge")})]}),(0,n.jsxs)(s.Zb,{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-[#1f1f1f]",children:t("account.cumulative")}),(0,n.jsx)("div",{className:"mt-4 flex items-baseline gap-1.5",children:(0,n.jsx)("span",{className:"text-[32px] font-semibold leading-10 text-[#1f1f1f]",children:(0,o.dN)(null==r?void 0:r.total)})})]})]}),(0,n.jsx)(_,{})]})};w.getLayout=c.G;var k=!0;t.default=w}},function(e){e.O(0,[6841,6120,3765,9759,3953,9257,5845,9157,2592,8816,9774,2888,179],function(){return e(e.s=8899)}),_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.