supython 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- supython/__init__.py +24 -0
- supython/admin/__init__.py +3 -0
- supython/admin/api/__init__.py +24 -0
- supython/admin/api/auth.py +118 -0
- supython/admin/api/auth_templates.py +67 -0
- supython/admin/api/auth_users.py +225 -0
- supython/admin/api/db.py +174 -0
- supython/admin/api/functions.py +92 -0
- supython/admin/api/jobs.py +192 -0
- supython/admin/api/ops.py +224 -0
- supython/admin/api/realtime.py +281 -0
- supython/admin/api/service_auth.py +49 -0
- supython/admin/api/service_auth_templates.py +83 -0
- supython/admin/api/service_auth_users.py +346 -0
- supython/admin/api/service_db.py +214 -0
- supython/admin/api/service_functions.py +287 -0
- supython/admin/api/service_jobs.py +282 -0
- supython/admin/api/service_ops.py +213 -0
- supython/admin/api/service_realtime.py +30 -0
- supython/admin/api/service_storage.py +220 -0
- supython/admin/api/storage.py +117 -0
- supython/admin/api/system.py +37 -0
- supython/admin/audit.py +29 -0
- supython/admin/deps.py +22 -0
- supython/admin/errors.py +16 -0
- supython/admin/schemas.py +310 -0
- supython/admin/session.py +52 -0
- supython/admin/spa.py +38 -0
- supython/admin/static/assets/Alert-dluGVkos.js +49 -0
- supython/admin/static/assets/Audit-Njung3HI.js +2 -0
- supython/admin/static/assets/Backups-DzPlFgrm.js +2 -0
- supython/admin/static/assets/Buckets-ByacGkU1.js +2 -0
- supython/admin/static/assets/Channels-BoIuTtam.js +353 -0
- supython/admin/static/assets/ChevronRight-CtQH1EQ1.js +2 -0
- supython/admin/static/assets/CodeViewer-Bqy7-wvH.js +2 -0
- supython/admin/static/assets/Crons-B67vc39F.js +2 -0
- supython/admin/static/assets/DashboardView-CUTFVL6k.js +2 -0
- supython/admin/static/assets/DataTable-COAAWEft.js +747 -0
- supython/admin/static/assets/DescriptionsItem-P8JUDaBs.js +75 -0
- supython/admin/static/assets/DrawerContent-TpYTFgF1.js +139 -0
- supython/admin/static/assets/Empty-cr2r7e2u.js +25 -0
- supython/admin/static/assets/EmptyState-DeDck-OL.js +2 -0
- supython/admin/static/assets/Grid-hFkp9F4P.js +2 -0
- supython/admin/static/assets/Input-DppYTq9C.js +259 -0
- supython/admin/static/assets/Invoke-DW3Nveeh.js +2 -0
- supython/admin/static/assets/JsonField-DibyJgun.js +2 -0
- supython/admin/static/assets/LoginView-BjLyE3Ds.css +1 -0
- supython/admin/static/assets/LoginView-CoOjECT_.js +111 -0
- supython/admin/static/assets/Logs-D9WYrnIT.js +2 -0
- supython/admin/static/assets/Logs-DS1XPa0h.css +1 -0
- supython/admin/static/assets/Migrations-DOSC2ddQ.js +2 -0
- supython/admin/static/assets/ObjectBrowser-_5w8vOX8.js +2 -0
- supython/admin/static/assets/Queue-CywZs6vI.js +2 -0
- supython/admin/static/assets/RefreshTokens-Ccjr53jg.js +2 -0
- supython/admin/static/assets/RlsEditor-BSlH9vSc.js +2 -0
- supython/admin/static/assets/Routes-BiLXE49D.js +2 -0
- supython/admin/static/assets/Routes-C-ianIGD.css +1 -0
- supython/admin/static/assets/SchemaBrowser-DKy2_KQi.css +1 -0
- supython/admin/static/assets/SchemaBrowser-XFvFbtDB.js +2 -0
- supython/admin/static/assets/Select-DIzZyRZb.js +434 -0
- supython/admin/static/assets/Space-n5-XcguU.js +400 -0
- supython/admin/static/assets/SqlEditor-b8pTsILY.js +3 -0
- supython/admin/static/assets/SqlWorkspace-BUS7IntH.js +104 -0
- supython/admin/static/assets/TableData-CQIagLKn.js +2 -0
- supython/admin/static/assets/Tag-D1fOKpTH.js +72 -0
- supython/admin/static/assets/Templates-BS-ugkdq.js +2 -0
- supython/admin/static/assets/Thing-CEAniuMg.js +107 -0
- supython/admin/static/assets/Users-wzwajhlh.js +2 -0
- supython/admin/static/assets/_plugin-vue_export-helper-DGA9ry_j.js +1 -0
- supython/admin/static/assets/dist-VXIJLCYq.js +13 -0
- supython/admin/static/assets/format-length-CGCY1rMh.js +2 -0
- supython/admin/static/assets/get-Ca6unauB.js +2 -0
- supython/admin/static/assets/index-CeE6v959.js +951 -0
- supython/admin/static/assets/pinia-COXwfrOX.js +2 -0
- supython/admin/static/assets/resources-Bt6thQCD.js +44 -0
- supython/admin/static/assets/use-locale-mtgM0a3a.js +2 -0
- supython/admin/static/assets/use-merged-state-BvhkaHNX.js +2 -0
- supython/admin/static/assets/useConfirm-tMjvBFXR.js +2 -0
- supython/admin/static/assets/useResource-C_rJCY8C.js +2 -0
- supython/admin/static/assets/useTable-CnZc5zhi.js +363 -0
- supython/admin/static/assets/useTable-Dg0XlRlq.css +1 -0
- supython/admin/static/assets/useToast-DsZKx0IX.js +2 -0
- supython/admin/static/assets/utils-sbXoq7Ir.js +2 -0
- supython/admin/static/favicon.svg +1 -0
- supython/admin/static/icons.svg +24 -0
- supython/admin/static/index.html +24 -0
- supython/app.py +162 -0
- supython/auth/__init__.py +3 -0
- supython/auth/_email_job.py +11 -0
- supython/auth/providers/__init__.py +34 -0
- supython/auth/providers/github.py +22 -0
- supython/auth/providers/google.py +19 -0
- supython/auth/providers/oauth.py +56 -0
- supython/auth/providers/registry.py +16 -0
- supython/auth/ratelimit.py +39 -0
- supython/auth/router.py +282 -0
- supython/auth/schemas.py +79 -0
- supython/auth/service.py +587 -0
- supython/backups/__init__.py +24 -0
- supython/backups/_backup_job.py +170 -0
- supython/backups/schemas.py +18 -0
- supython/backups/service.py +217 -0
- supython/body_size.py +184 -0
- supython/cli.py +1663 -0
- supython/client/__init__.py +67 -0
- supython/client/_auth.py +249 -0
- supython/client/_client.py +145 -0
- supython/client/_config.py +92 -0
- supython/client/_functions.py +69 -0
- supython/client/_storage.py +255 -0
- supython/client/py.typed +0 -0
- supython/db.py +151 -0
- supython/db_admin.py +8 -0
- supython/extensions.py +36 -0
- supython/functions/__init__.py +19 -0
- supython/functions/context.py +262 -0
- supython/functions/loader.py +307 -0
- supython/functions/router.py +228 -0
- supython/functions/schemas.py +50 -0
- supython/gen/__init__.py +5 -0
- supython/gen/_introspect.py +137 -0
- supython/gen/types_py.py +270 -0
- supython/gen/types_ts.py +365 -0
- supython/health.py +229 -0
- supython/hooks.py +117 -0
- supython/jobs/__init__.py +31 -0
- supython/jobs/backends.py +97 -0
- supython/jobs/context.py +58 -0
- supython/jobs/cron.py +152 -0
- supython/jobs/cron_inproc.py +119 -0
- supython/jobs/decorators.py +76 -0
- supython/jobs/registry.py +79 -0
- supython/jobs/router.py +136 -0
- supython/jobs/schemas.py +92 -0
- supython/jobs/service.py +311 -0
- supython/jobs/worker.py +219 -0
- supython/jwks.py +257 -0
- supython/keyset.py +279 -0
- supython/logging_config.py +291 -0
- supython/mail.py +33 -0
- supython/mailer.py +65 -0
- supython/migrate.py +81 -0
- supython/migrations/0001_extensions_and_roles.sql +46 -0
- supython/migrations/0002_auth_schema.sql +66 -0
- supython/migrations/0003_demo_todos.sql +42 -0
- supython/migrations/0004_auth_v0_2.sql +47 -0
- supython/migrations/0005_storage_schema.sql +117 -0
- supython/migrations/0006_realtime_schema.sql +206 -0
- supython/migrations/0007_jobs_schema.sql +254 -0
- supython/migrations/0008_jobs_last_error.sql +56 -0
- supython/migrations/0009_auth_rate_limits.sql +33 -0
- supython/migrations/0010_worker_heartbeat.sql +14 -0
- supython/migrations/0011_admin_schema.sql +45 -0
- supython/migrations/0012_auth_banned_until.sql +10 -0
- supython/migrations/0013_email_templates.sql +19 -0
- supython/migrations/0014_realtime_payload_warning.sql +96 -0
- supython/migrations/0015_backups_schema.sql +14 -0
- supython/passwords.py +15 -0
- supython/realtime/__init__.py +6 -0
- supython/realtime/broker.py +814 -0
- supython/realtime/protocol.py +234 -0
- supython/realtime/router.py +184 -0
- supython/realtime/schemas.py +207 -0
- supython/realtime/service.py +261 -0
- supython/realtime/topics.py +175 -0
- supython/realtime/websocket.py +586 -0
- supython/scaffold/__init__.py +5 -0
- supython/scaffold/init_project.py +144 -0
- supython/scaffold/templates/Caddyfile.tmpl +4 -0
- supython/scaffold/templates/README.md.tmpl +22 -0
- supython/scaffold/templates/apps_hooks.py.tmpl +11 -0
- supython/scaffold/templates/apps_jobs.py.tmpl +8 -0
- supython/scaffold/templates/asgi.py.tmpl +14 -0
- supython/scaffold/templates/docker-compose.prod.yml.tmpl +84 -0
- supython/scaffold/templates/docker-compose.yml.tmpl +45 -0
- supython/scaffold/templates/docker_postgres_Dockerfile.tmpl +9 -0
- supython/scaffold/templates/docker_postgres_postgresql.conf.tmpl +3 -0
- supython/scaffold/templates/env.example.tmpl +168 -0
- supython/scaffold/templates/functions_README.md.tmpl +21 -0
- supython/scaffold/templates/gitignore.tmpl +14 -0
- supython/scaffold/templates/manage.py.tmpl +11 -0
- supython/scaffold/templates/migrations/.gitkeep +0 -0
- supython/scaffold/templates/package_init.py.tmpl +1 -0
- supython/scaffold/templates/settings.py.tmpl +31 -0
- supython/secretset.py +347 -0
- supython/security_headers.py +78 -0
- supython/settings.py +244 -0
- supython/settings_module.py +117 -0
- supython/storage/__init__.py +5 -0
- supython/storage/backends.py +392 -0
- supython/storage/router.py +341 -0
- supython/storage/schemas.py +50 -0
- supython/storage/service.py +445 -0
- supython/storage/signing.py +119 -0
- supython/tokens.py +85 -0
- supython-0.1.0.dist-info/METADATA +756 -0
- supython-0.1.0.dist-info/RECORD +200 -0
- supython-0.1.0.dist-info/WHEEL +4 -0
- supython-0.1.0.dist-info/entry_points.txt +2 -0
- supython-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import{$ as e,At as t,Bt as n,Dt as r,E as i,En as a,Fn as o,Gn as s,Gt as c,In as l,Jt as u,Kn as d,Kt as f,Ln as p,O as m,On as h,Pn as g,Rn as _,S as v,Sn as y,St as b,Tt as x,Un as S,Wn as ee,Xt as C,Yt as w,Zt as T,_n as E,_t as D,ar as O,bn as k,bt as A,c as j,gn as M,hn as N,kn as P,lt as te,mn as F,nt as ne,on as I,ot as L,pn as R,r as re,rn as ie,rr as ae,sn as z,sr as B,t as V,tr as H,un as oe,ur as U,ut as se,vn as W,wn as G,xn as K,xt as q,zt as ce}from"./Space-n5-XcguU.js";import{A as J,H as le,k as Y,v as ue}from"./Select-DIzZyRZb.js";import{t as de}from"./Input-DppYTq9C.js";import{t as fe}from"./use-merged-state-BvhkaHNX.js";import{r as pe,t as X}from"./Tag-D1fOKpTH.js";import{t as me}from"./DataTable-COAAWEft.js";import{l as he,o as ge}from"./resources-Bt6thQCD.js";import{R as Z,c as Q,p as _e}from"./index-CeE6v959.js";import{t as ve}from"./useResource-C_rJCY8C.js";import{n as ye,t as $}from"./EmptyState-DeDck-OL.js";import{t as be}from"./JsonField-DibyJgun.js";var xe=Y(`.v-x-scroll`,{overflow:`auto`,scrollbarWidth:`none`},[Y(`&::-webkit-scrollbar`,{width:0,height:0})]),Se=y({name:`XScroll`,props:{disabled:Boolean,onScroll:Function},setup(){let e=H(null);function t(e){!(e.currentTarget.offsetWidth<e.currentTarget.scrollWidth)||e.deltaY===0||(e.currentTarget.scrollLeft+=e.deltaY+e.deltaX,e.preventDefault())}let n=r();return xe.mount({id:`vueuc/x-scroll`,head:!0,anchorMetaName:J,ssr:n}),Object.assign({selfRef:e,handleWheel:t},{scrollTo(...t){var n;(n=e.value)==null||n.scrollTo(...t)}})},render(){return G(`div`,{ref:`selfRef`,onScroll:this.onScroll,onWheel:this.disabled?void 0:this.handleWheel,class:`v-x-scroll`},this.$slots)}}),Ce=/\s/;function we(e){for(var t=e.length;t--&&Ce.test(e.charAt(t)););return t}var Te=/^\s+/;function Ee(e){return e&&e.slice(0,we(e)+1).replace(Te,``)}var De=NaN,Oe=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Ae=/^0o[0-7]+$/i,je=parseInt;function Me(t){if(typeof t==`number`)return t;if(ne(t))return De;if(e(t)){var n=typeof t.valueOf==`function`?t.valueOf():t;t=e(n)?n+``:n}if(typeof t!=`string`)return t===0?t:+t;t=Ee(t);var r=ke.test(t);return r||Ae.test(t)?je(t.slice(2),r?2:8):Oe.test(t)?De:+t}var Ne=function(){return L.Date.now()},Pe=`Expected a function`,Fe=Math.max,Ie=Math.min;function Le(t,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof t!=`function`)throw TypeError(Pe);n=Me(n)||0,e(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?Fe(Me(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(e){var n=i,r=a;return i=a=void 0,u=e,s=t.apply(r,n),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var t=e-l,r=e-u,i=n-t;return f?Ie(i,o-r):i}function _(e){var t=e-l,r=e-u;return l===void 0||t>=n||t<0||f&&r>=o}function v(){var e=Ne();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(Ne())}function S(){var e=Ne(),t=_(e);if(i=arguments,a=this,l=e,t){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var Re=`Expected a function`;function ze(t,n,r){var i=!0,a=!0;if(typeof t!=`function`)throw TypeError(Re);return e(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),Le(t,n,{leading:i,maxWait:n,trailing:a})}var Be=y({name:`Add`,render(){return G(`svg`,{width:`512`,height:`512`,viewBox:`0 0 512 512`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},G(`path`,{d:`M256 112V400M400 256H112`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linecap":`round`,"stroke-linejoin":`round`}))}}),Ve=t(`n-tabs`),He={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:`if`},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},Ue=y({__TAB_PANE__:!0,name:`TabPane`,alias:[`TabPanel`],props:He,slots:Object,setup(e){let t=a(Ve,null);return t||b(`tab-pane`,"`n-tab-pane` must be placed inside `n-tabs`."),{style:t.paneStyleRef,class:t.paneClassRef,mergedClsPrefix:t.mergedClsPrefixRef}},render(){return G(`div`,{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),We=y({__TAB__:!0,inheritAttrs:!1,name:`Tab`,props:Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},Z(He,[`displayDirective`])),setup(e){let{mergedClsPrefixRef:t,valueRef:n,typeRef:r,closableRef:i,tabStyleRef:o,addTabStyleRef:s,tabClassRef:c,addTabClassRef:l,tabChangeIdRef:u,onBeforeLeaveRef:d,triggerRef:f,handleAdd:p,activateTab:m,handleClose:h}=a(Ve);return{trigger:f,mergedClosable:F(()=>{if(e.internalAddable)return!1;let{closable:t}=e;return t===void 0?i.value:t}),style:o,addStyle:s,tabClass:c,addTabClass:l,clsPrefix:t,value:n,type:r,handleClose(t){t.stopPropagation(),!e.disabled&&h(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){p();return}let{name:t}=e,r=++u.id;if(t!==n.value){let{value:i}=d;i?Promise.resolve(i(e.name,n.value)).then(e=>{e&&u.id===r&&m(t)}):m(t)}}}},render(){let{internalAddable:e,clsPrefix:t,name:n,disabled:r,label:a,tab:o,value:s,mergedClosable:c,trigger:l,$slots:{default:u}}=this,d=a??o;return G(`div`,{class:`${t}-tabs-tab-wrapper`},this.internalLeftPadded?G(`div`,{class:`${t}-tabs-tab-pad`}):null,G(`div`,Object.assign({key:n,"data-name":n,"data-disabled":r?!0:void 0},h({class:[`${t}-tabs-tab`,s===n&&`${t}-tabs-tab--active`,r&&`${t}-tabs-tab--disabled`,c&&`${t}-tabs-tab--closable`,e&&`${t}-tabs-tab--addable`,e?this.addTabClass:this.tabClass],onClick:l===`click`?this.activateTab:void 0,onMouseenter:l===`hover`?this.activateTab:void 0,style:e?this.addStyle:this.style},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),G(`span`,{class:`${t}-tabs-tab__label`},e?G(oe,null,G(`div`,{class:`${t}-tabs-tab__height-placeholder`},`\xA0`),G(i,{clsPrefix:t},{default:()=>G(Be,null)})):u?u():typeof d==`object`?d:ue(d??n)),c&&this.type===`card`?G(v,{clsPrefix:t,class:`${t}-tabs-tab__close`,onClick:this.handleClose,disabled:r}):null))}}),Ge=f(`tabs`,`
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
transition:
|
|
7
|
+
background-color .3s var(--n-bezier),
|
|
8
|
+
border-color .3s var(--n-bezier);
|
|
9
|
+
`,[w(`segment-type`,[f(`tabs-rail`,[c(`&.transition-disabled`,[f(`tabs-capsule`,`
|
|
10
|
+
transition: none;
|
|
11
|
+
`)])])]),w(`top`,[f(`tab-pane`,`
|
|
12
|
+
padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left);
|
|
13
|
+
`)]),w(`left`,[f(`tab-pane`,`
|
|
14
|
+
padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top);
|
|
15
|
+
`)]),w(`left, right`,`
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
`,[f(`tabs-bar`,`
|
|
18
|
+
width: 2px;
|
|
19
|
+
right: 0;
|
|
20
|
+
transition:
|
|
21
|
+
top .2s var(--n-bezier),
|
|
22
|
+
max-height .2s var(--n-bezier),
|
|
23
|
+
background-color .3s var(--n-bezier);
|
|
24
|
+
`),f(`tabs-tab`,`
|
|
25
|
+
padding: var(--n-tab-padding-vertical);
|
|
26
|
+
`)]),w(`right`,`
|
|
27
|
+
flex-direction: row-reverse;
|
|
28
|
+
`,[f(`tab-pane`,`
|
|
29
|
+
padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom);
|
|
30
|
+
`),f(`tabs-bar`,`
|
|
31
|
+
left: 0;
|
|
32
|
+
`)]),w(`bottom`,`
|
|
33
|
+
flex-direction: column-reverse;
|
|
34
|
+
justify-content: flex-end;
|
|
35
|
+
`,[f(`tab-pane`,`
|
|
36
|
+
padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left);
|
|
37
|
+
`),f(`tabs-bar`,`
|
|
38
|
+
top: 0;
|
|
39
|
+
`)]),f(`tabs-rail`,`
|
|
40
|
+
position: relative;
|
|
41
|
+
padding: 3px;
|
|
42
|
+
border-radius: var(--n-tab-border-radius);
|
|
43
|
+
width: 100%;
|
|
44
|
+
background-color: var(--n-color-segment);
|
|
45
|
+
transition: background-color .3s var(--n-bezier);
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
`,[f(`tabs-capsule`,`
|
|
49
|
+
border-radius: var(--n-tab-border-radius);
|
|
50
|
+
position: absolute;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
background-color: var(--n-tab-color-segment);
|
|
53
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
|
|
54
|
+
transition: transform 0.3s var(--n-bezier);
|
|
55
|
+
`),f(`tabs-tab-wrapper`,`
|
|
56
|
+
flex-basis: 0;
|
|
57
|
+
flex-grow: 1;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
`,[f(`tabs-tab`,`
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
border-radius: var(--n-tab-border-radius);
|
|
64
|
+
width: 100%;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
`,[w(`active`,`
|
|
69
|
+
font-weight: var(--n-font-weight-strong);
|
|
70
|
+
color: var(--n-tab-text-color-active);
|
|
71
|
+
`),c(`&:hover`,`
|
|
72
|
+
color: var(--n-tab-text-color-hover);
|
|
73
|
+
`)])])]),w(`flex`,[f(`tabs-nav`,`
|
|
74
|
+
width: 100%;
|
|
75
|
+
position: relative;
|
|
76
|
+
`,[f(`tabs-wrapper`,`
|
|
77
|
+
width: 100%;
|
|
78
|
+
`,[f(`tabs-tab`,`
|
|
79
|
+
margin-right: 0;
|
|
80
|
+
`)])])]),f(`tabs-nav`,`
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
line-height: 1.5;
|
|
83
|
+
display: flex;
|
|
84
|
+
transition: border-color .3s var(--n-bezier);
|
|
85
|
+
`,[u(`prefix, suffix`,`
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
`),u(`prefix`,`padding-right: 16px;`),u(`suffix`,`padding-left: 16px;`)]),w(`top, bottom`,[c(`>`,[f(`tabs-nav`,[f(`tabs-nav-scroll-wrapper`,[c(`&::before`,`
|
|
89
|
+
top: 0;
|
|
90
|
+
bottom: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
width: 20px;
|
|
93
|
+
`),c(`&::after`,`
|
|
94
|
+
top: 0;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
right: 0;
|
|
97
|
+
width: 20px;
|
|
98
|
+
`),w(`shadow-start`,[c(`&::before`,`
|
|
99
|
+
box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
|
|
100
|
+
`)]),w(`shadow-end`,[c(`&::after`,`
|
|
101
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
|
|
102
|
+
`)])])])])]),w(`left, right`,[f(`tabs-nav-scroll-content`,`
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
`),c(`>`,[f(`tabs-nav`,[f(`tabs-nav-scroll-wrapper`,[c(`&::before`,`
|
|
105
|
+
top: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
height: 20px;
|
|
109
|
+
`),c(`&::after`,`
|
|
110
|
+
bottom: 0;
|
|
111
|
+
left: 0;
|
|
112
|
+
right: 0;
|
|
113
|
+
height: 20px;
|
|
114
|
+
`),w(`shadow-start`,[c(`&::before`,`
|
|
115
|
+
box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12);
|
|
116
|
+
`)]),w(`shadow-end`,[c(`&::after`,`
|
|
117
|
+
box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12);
|
|
118
|
+
`)])])])])]),f(`tabs-nav-scroll-wrapper`,`
|
|
119
|
+
flex: 1;
|
|
120
|
+
position: relative;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
`,[f(`tabs-nav-y-scroll`,`
|
|
123
|
+
height: 100%;
|
|
124
|
+
width: 100%;
|
|
125
|
+
overflow-y: auto;
|
|
126
|
+
scrollbar-width: none;
|
|
127
|
+
`,[c(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
128
|
+
width: 0;
|
|
129
|
+
height: 0;
|
|
130
|
+
display: none;
|
|
131
|
+
`)]),c(`&::before, &::after`,`
|
|
132
|
+
transition: box-shadow .3s var(--n-bezier);
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
content: "";
|
|
135
|
+
position: absolute;
|
|
136
|
+
z-index: 1;
|
|
137
|
+
`)]),f(`tabs-nav-scroll-content`,`
|
|
138
|
+
display: flex;
|
|
139
|
+
position: relative;
|
|
140
|
+
min-width: 100%;
|
|
141
|
+
min-height: 100%;
|
|
142
|
+
width: fit-content;
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
`),f(`tabs-wrapper`,`
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
flex-wrap: nowrap;
|
|
147
|
+
position: relative;
|
|
148
|
+
`),f(`tabs-tab-wrapper`,`
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-wrap: nowrap;
|
|
151
|
+
flex-shrink: 0;
|
|
152
|
+
flex-grow: 0;
|
|
153
|
+
`),f(`tabs-tab`,`
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
flex-wrap: nowrap;
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
color: var(--n-tab-text-color);
|
|
160
|
+
font-size: var(--n-tab-font-size);
|
|
161
|
+
background-clip: padding-box;
|
|
162
|
+
padding: var(--n-tab-padding);
|
|
163
|
+
transition:
|
|
164
|
+
box-shadow .3s var(--n-bezier),
|
|
165
|
+
color .3s var(--n-bezier),
|
|
166
|
+
background-color .3s var(--n-bezier),
|
|
167
|
+
border-color .3s var(--n-bezier);
|
|
168
|
+
`,[w(`disabled`,{cursor:`not-allowed`}),u(`close`,`
|
|
169
|
+
margin-left: 6px;
|
|
170
|
+
transition:
|
|
171
|
+
background-color .3s var(--n-bezier),
|
|
172
|
+
color .3s var(--n-bezier);
|
|
173
|
+
`),u(`label`,`
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
z-index: 1;
|
|
177
|
+
`)]),f(`tabs-bar`,`
|
|
178
|
+
position: absolute;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
height: 2px;
|
|
181
|
+
border-radius: 1px;
|
|
182
|
+
background-color: var(--n-bar-color);
|
|
183
|
+
transition:
|
|
184
|
+
left .2s var(--n-bezier),
|
|
185
|
+
max-width .2s var(--n-bezier),
|
|
186
|
+
opacity .3s var(--n-bezier),
|
|
187
|
+
background-color .3s var(--n-bezier);
|
|
188
|
+
`,[c(`&.transition-disabled`,`
|
|
189
|
+
transition: none;
|
|
190
|
+
`),w(`disabled`,`
|
|
191
|
+
background-color: var(--n-tab-text-color-disabled)
|
|
192
|
+
`)]),f(`tabs-pane-wrapper`,`
|
|
193
|
+
position: relative;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
transition: max-height .2s var(--n-bezier);
|
|
196
|
+
`),f(`tab-pane`,`
|
|
197
|
+
color: var(--n-pane-text-color);
|
|
198
|
+
width: 100%;
|
|
199
|
+
transition:
|
|
200
|
+
color .3s var(--n-bezier),
|
|
201
|
+
background-color .3s var(--n-bezier),
|
|
202
|
+
opacity .2s var(--n-bezier);
|
|
203
|
+
left: 0;
|
|
204
|
+
right: 0;
|
|
205
|
+
top: 0;
|
|
206
|
+
`,[c(`&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active`,`
|
|
207
|
+
transition:
|
|
208
|
+
color .3s var(--n-bezier),
|
|
209
|
+
background-color .3s var(--n-bezier),
|
|
210
|
+
transform .2s var(--n-bezier),
|
|
211
|
+
opacity .2s var(--n-bezier);
|
|
212
|
+
`),c(`&.next-transition-leave-active, &.prev-transition-leave-active`,`
|
|
213
|
+
position: absolute;
|
|
214
|
+
`),c(`&.next-transition-enter-from, &.prev-transition-leave-to`,`
|
|
215
|
+
transform: translateX(32px);
|
|
216
|
+
opacity: 0;
|
|
217
|
+
`),c(`&.next-transition-leave-to, &.prev-transition-enter-from`,`
|
|
218
|
+
transform: translateX(-32px);
|
|
219
|
+
opacity: 0;
|
|
220
|
+
`),c(`&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to`,`
|
|
221
|
+
transform: translateX(0);
|
|
222
|
+
opacity: 1;
|
|
223
|
+
`)]),f(`tabs-tab-pad`,`
|
|
224
|
+
box-sizing: border-box;
|
|
225
|
+
width: var(--n-tab-gap);
|
|
226
|
+
flex-grow: 0;
|
|
227
|
+
flex-shrink: 0;
|
|
228
|
+
`),w(`line-type, bar-type`,[f(`tabs-tab`,`
|
|
229
|
+
font-weight: var(--n-tab-font-weight);
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
vertical-align: bottom;
|
|
232
|
+
`,[c(`&:hover`,{color:`var(--n-tab-text-color-hover)`}),w(`active`,`
|
|
233
|
+
color: var(--n-tab-text-color-active);
|
|
234
|
+
font-weight: var(--n-tab-font-weight-active);
|
|
235
|
+
`),w(`disabled`,{color:`var(--n-tab-text-color-disabled)`})])]),f(`tabs-nav`,[w(`line-type`,[w(`top`,[u(`prefix, suffix`,`
|
|
236
|
+
border-bottom: 1px solid var(--n-tab-border-color);
|
|
237
|
+
`),f(`tabs-nav-scroll-content`,`
|
|
238
|
+
border-bottom: 1px solid var(--n-tab-border-color);
|
|
239
|
+
`),f(`tabs-bar`,`
|
|
240
|
+
bottom: -1px;
|
|
241
|
+
`)]),w(`left`,[u(`prefix, suffix`,`
|
|
242
|
+
border-right: 1px solid var(--n-tab-border-color);
|
|
243
|
+
`),f(`tabs-nav-scroll-content`,`
|
|
244
|
+
border-right: 1px solid var(--n-tab-border-color);
|
|
245
|
+
`),f(`tabs-bar`,`
|
|
246
|
+
right: -1px;
|
|
247
|
+
`)]),w(`right`,[u(`prefix, suffix`,`
|
|
248
|
+
border-left: 1px solid var(--n-tab-border-color);
|
|
249
|
+
`),f(`tabs-nav-scroll-content`,`
|
|
250
|
+
border-left: 1px solid var(--n-tab-border-color);
|
|
251
|
+
`),f(`tabs-bar`,`
|
|
252
|
+
left: -1px;
|
|
253
|
+
`)]),w(`bottom`,[u(`prefix, suffix`,`
|
|
254
|
+
border-top: 1px solid var(--n-tab-border-color);
|
|
255
|
+
`),f(`tabs-nav-scroll-content`,`
|
|
256
|
+
border-top: 1px solid var(--n-tab-border-color);
|
|
257
|
+
`),f(`tabs-bar`,`
|
|
258
|
+
top: -1px;
|
|
259
|
+
`)]),u(`prefix, suffix`,`
|
|
260
|
+
transition: border-color .3s var(--n-bezier);
|
|
261
|
+
`),f(`tabs-nav-scroll-content`,`
|
|
262
|
+
transition: border-color .3s var(--n-bezier);
|
|
263
|
+
`),f(`tabs-bar`,`
|
|
264
|
+
border-radius: 0;
|
|
265
|
+
`)]),w(`card-type`,[u(`prefix, suffix`,`
|
|
266
|
+
transition: border-color .3s var(--n-bezier);
|
|
267
|
+
`),f(`tabs-pad`,`
|
|
268
|
+
flex-grow: 1;
|
|
269
|
+
transition: border-color .3s var(--n-bezier);
|
|
270
|
+
`),f(`tabs-tab-pad`,`
|
|
271
|
+
transition: border-color .3s var(--n-bezier);
|
|
272
|
+
`),f(`tabs-tab`,`
|
|
273
|
+
font-weight: var(--n-tab-font-weight);
|
|
274
|
+
border: 1px solid var(--n-tab-border-color);
|
|
275
|
+
background-color: var(--n-tab-color);
|
|
276
|
+
box-sizing: border-box;
|
|
277
|
+
position: relative;
|
|
278
|
+
vertical-align: bottom;
|
|
279
|
+
display: flex;
|
|
280
|
+
justify-content: space-between;
|
|
281
|
+
font-size: var(--n-tab-font-size);
|
|
282
|
+
color: var(--n-tab-text-color);
|
|
283
|
+
`,[w(`addable`,`
|
|
284
|
+
padding-left: 8px;
|
|
285
|
+
padding-right: 8px;
|
|
286
|
+
font-size: 16px;
|
|
287
|
+
justify-content: center;
|
|
288
|
+
`,[u(`height-placeholder`,`
|
|
289
|
+
width: 0;
|
|
290
|
+
font-size: var(--n-tab-font-size);
|
|
291
|
+
`),C(`disabled`,[c(`&:hover`,`
|
|
292
|
+
color: var(--n-tab-text-color-hover);
|
|
293
|
+
`)])]),w(`closable`,`padding-right: 8px;`),w(`active`,`
|
|
294
|
+
background-color: #0000;
|
|
295
|
+
font-weight: var(--n-tab-font-weight-active);
|
|
296
|
+
color: var(--n-tab-text-color-active);
|
|
297
|
+
`),w(`disabled`,`color: var(--n-tab-text-color-disabled);`)])]),w(`left, right`,`
|
|
298
|
+
flex-direction: column;
|
|
299
|
+
`,[u(`prefix, suffix`,`
|
|
300
|
+
padding: var(--n-tab-padding-vertical);
|
|
301
|
+
`),f(`tabs-wrapper`,`
|
|
302
|
+
flex-direction: column;
|
|
303
|
+
`),f(`tabs-tab-wrapper`,`
|
|
304
|
+
flex-direction: column;
|
|
305
|
+
`,[f(`tabs-tab-pad`,`
|
|
306
|
+
height: var(--n-tab-gap-vertical);
|
|
307
|
+
width: 100%;
|
|
308
|
+
`)])]),w(`top`,[w(`card-type`,[f(`tabs-scroll-padding`,`border-bottom: 1px solid var(--n-tab-border-color);`),u(`prefix, suffix`,`
|
|
309
|
+
border-bottom: 1px solid var(--n-tab-border-color);
|
|
310
|
+
`),f(`tabs-tab`,`
|
|
311
|
+
border-top-left-radius: var(--n-tab-border-radius);
|
|
312
|
+
border-top-right-radius: var(--n-tab-border-radius);
|
|
313
|
+
`,[w(`active`,`
|
|
314
|
+
border-bottom: 1px solid #0000;
|
|
315
|
+
`)]),f(`tabs-tab-pad`,`
|
|
316
|
+
border-bottom: 1px solid var(--n-tab-border-color);
|
|
317
|
+
`),f(`tabs-pad`,`
|
|
318
|
+
border-bottom: 1px solid var(--n-tab-border-color);
|
|
319
|
+
`)])]),w(`left`,[w(`card-type`,[f(`tabs-scroll-padding`,`border-right: 1px solid var(--n-tab-border-color);`),u(`prefix, suffix`,`
|
|
320
|
+
border-right: 1px solid var(--n-tab-border-color);
|
|
321
|
+
`),f(`tabs-tab`,`
|
|
322
|
+
border-top-left-radius: var(--n-tab-border-radius);
|
|
323
|
+
border-bottom-left-radius: var(--n-tab-border-radius);
|
|
324
|
+
`,[w(`active`,`
|
|
325
|
+
border-right: 1px solid #0000;
|
|
326
|
+
`)]),f(`tabs-tab-pad`,`
|
|
327
|
+
border-right: 1px solid var(--n-tab-border-color);
|
|
328
|
+
`),f(`tabs-pad`,`
|
|
329
|
+
border-right: 1px solid var(--n-tab-border-color);
|
|
330
|
+
`)])]),w(`right`,[w(`card-type`,[f(`tabs-scroll-padding`,`border-left: 1px solid var(--n-tab-border-color);`),u(`prefix, suffix`,`
|
|
331
|
+
border-left: 1px solid var(--n-tab-border-color);
|
|
332
|
+
`),f(`tabs-tab`,`
|
|
333
|
+
border-top-right-radius: var(--n-tab-border-radius);
|
|
334
|
+
border-bottom-right-radius: var(--n-tab-border-radius);
|
|
335
|
+
`,[w(`active`,`
|
|
336
|
+
border-left: 1px solid #0000;
|
|
337
|
+
`)]),f(`tabs-tab-pad`,`
|
|
338
|
+
border-left: 1px solid var(--n-tab-border-color);
|
|
339
|
+
`),f(`tabs-pad`,`
|
|
340
|
+
border-left: 1px solid var(--n-tab-border-color);
|
|
341
|
+
`)])]),w(`bottom`,[w(`card-type`,[f(`tabs-scroll-padding`,`border-top: 1px solid var(--n-tab-border-color);`),u(`prefix, suffix`,`
|
|
342
|
+
border-top: 1px solid var(--n-tab-border-color);
|
|
343
|
+
`),f(`tabs-tab`,`
|
|
344
|
+
border-bottom-left-radius: var(--n-tab-border-radius);
|
|
345
|
+
border-bottom-right-radius: var(--n-tab-border-radius);
|
|
346
|
+
`,[w(`active`,`
|
|
347
|
+
border-top: 1px solid #0000;
|
|
348
|
+
`)]),f(`tabs-tab-pad`,`
|
|
349
|
+
border-top: 1px solid var(--n-tab-border-color);
|
|
350
|
+
`),f(`tabs-pad`,`
|
|
351
|
+
border-top: 1px solid var(--n-tab-border-color);
|
|
352
|
+
`)])])])]),Ke=ze,qe=y({name:`Tabs`,props:Object.assign(Object.assign({},m.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:`click`},type:{type:String,default:`bar`},closable:Boolean,justifyContent:String,size:String,placement:{type:String,default:`top`},tabStyle:[String,Object],tabClass:String,addTabStyle:[String,Object],addTabClass:String,barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),slots:Object,setup(e,{slots:t}){let{mergedClsPrefixRef:r,inlineThemeDisabled:i,mergedComponentPropsRef:a}=se(e),o=m(`Tabs`,`-tabs`,Ge,_e,e,r),s=H(null),c=H(null),l=H(null),u=H(null),d=H(null),f=H(null),h=H(!0),_=H(!0),v=pe(e,[`labelSize`,`size`]),y=F(()=>v.value?v.value:a?.value?.Tabs?.size||`medium`),b=pe(e,[`activeName`,`value`]),x=H(b.value??e.defaultValue??(t.default?A(t.default())[0]?.props?.name:null)),C=fe(b,x),w={id:0},E=F(()=>{if(!(!e.justifyContent||e.type===`card`))return{display:`flex`,justifyContent:e.justifyContent}});S(C,()=>{w.id=0,N(),ne()});function D(){let{value:e}=C;return e===null?null:s.value?.querySelector(`[data-name="${e}"]`)}function k(t){if(e.type===`card`)return;let{value:n}=c;if(!n)return;let i=n.style.opacity===`0`;if(t){let a=`${r.value}-tabs-bar--disabled`,{barWidth:o,placement:s}=e;if(t.dataset.disabled===`true`?n.classList.add(a):n.classList.remove(a),[`top`,`bottom`].includes(s)){if(M([`top`,`maxHeight`,`height`]),typeof o==`number`&&t.offsetWidth>=o){let e=Math.floor((t.offsetWidth-o)/2)+t.offsetLeft;n.style.left=`${e}px`,n.style.maxWidth=`${o}px`}else n.style.left=`${t.offsetLeft}px`,n.style.maxWidth=`${t.offsetWidth}px`;n.style.width=`8192px`,i&&(n.style.transition=`none`),n.offsetWidth,i&&(n.style.transition=``,n.style.opacity=`1`)}else{if(M([`left`,`maxWidth`,`width`]),typeof o==`number`&&t.offsetHeight>=o){let e=Math.floor((t.offsetHeight-o)/2)+t.offsetTop;n.style.top=`${e}px`,n.style.maxHeight=`${o}px`}else n.style.top=`${t.offsetTop}px`,n.style.maxHeight=`${t.offsetHeight}px`;n.style.height=`8192px`,i&&(n.style.transition=`none`),n.offsetHeight,i&&(n.style.transition=``,n.style.opacity=`1`)}}}function j(){if(e.type===`card`)return;let{value:t}=c;t&&(t.style.opacity=`0`)}function M(e){let{value:t}=c;if(t)for(let n of e)t.style[n]=``}function N(){if(e.type===`card`)return;let t=D();t?k(t):j()}function ne(){let e=d.value?.$el;if(!e)return;let t=D();if(!t)return;let{scrollLeft:n,offsetWidth:r}=e,{offsetLeft:i,offsetWidth:a}=t;n>i?e.scrollTo({top:0,left:i,behavior:`smooth`}):i+a>n+r&&e.scrollTo({top:0,left:i+a-r,behavior:`smooth`})}let I=H(null),L=0,R=null;function re(e){let t=I.value;if(t){L=e.getBoundingClientRect().height;let n=`${L}px`,r=()=>{t.style.height=n,t.style.maxHeight=n};R?(r(),R(),R=null):R=r}}function ie(e){let t=I.value;if(t){let n=e.getBoundingClientRect().height,r=()=>{document.body.offsetHeight,t.style.maxHeight=`${n}px`,t.style.height=`${Math.max(L,n)}px`};R?(R(),R=null,r()):R=r}}function ae(){let t=I.value;if(t){t.style.maxHeight=``,t.style.height=``;let{paneWrapperStyle:n}=e;if(typeof n==`string`)t.style.cssText=n;else if(n){let{maxHeight:e,height:r}=n;e!==void 0&&(t.style.maxHeight=e),r!==void 0&&(t.style.height=r)}}}let z={value:[]},B=H(`next`);function V(e){let t=C.value,n=`next`;for(let r of z.value){if(r===t)break;if(r===e){n=`prev`;break}}B.value=n,oe(e)}function oe(t){let{onActiveNameChange:n,onUpdateValue:r,"onUpdate:value":i}=e;n&&q(n,t),r&&q(r,t),i&&q(i,t),x.value=t}function U(t){let{onClose:n}=e;n&&q(n,t)}let W=!0;function G(){let{value:e}=c;if(!e)return;W||=!1;let t=`transition-disabled`;e.classList.add(t),N(),e.classList.remove(t)}let K=H(null);function J({transitionDisabled:e}){let t=s.value;if(!t)return;e&&t.classList.add(`transition-disabled`);let n=D();n&&K.value&&(K.value.style.width=`${n.offsetWidth}px`,K.value.style.height=`${n.offsetHeight}px`,K.value.style.transform=`translateX(${n.offsetLeft-ce(getComputedStyle(t).paddingLeft)}px)`,e&&K.value.offsetWidth),e&&t.classList.remove(`transition-disabled`)}S([C],()=>{e.type===`segment`&&P(()=>{J({transitionDisabled:!1})})}),g(()=>{e.type===`segment`&&J({transitionDisabled:!0})});let Y=0;function ue(t){if(t.contentRect.width===0&&t.contentRect.height===0||Y===t.contentRect.width)return;Y=t.contentRect.width;let{type:n}=e;if((n===`line`||n===`bar`)&&(W||e.justifyContent?.startsWith(`space`))&&G(),n!==`segment`){let{placement:t}=e;Z((t===`top`||t===`bottom`?d.value?.$el:f.value)||null)}}let de=Ke(ue,64);S([()=>e.justifyContent,()=>e.size],()=>{P(()=>{let{type:t}=e;(t===`line`||t===`bar`)&&G()})});let X=H(!1);function me(t){let{target:n,contentRect:{width:r,height:i}}=t,a=n.parentElement.parentElement.offsetWidth,o=n.parentElement.parentElement.offsetHeight,{placement:s}=e;if(!X.value)s===`top`||s===`bottom`?a<r&&(X.value=!0):o<i&&(X.value=!0);else{let{value:e}=u;if(!e)return;s===`top`||s===`bottom`?a-r>e.$el.offsetWidth&&(X.value=!1):o-i>e.$el.offsetHeight&&(X.value=!1)}Z(d.value?.$el||null)}let he=Ke(me,64);function ge(){let{onAdd:t}=e;t&&t(),P(()=>{let e=D(),{value:t}=d;!e||!t||t.scrollTo({left:e.offsetLeft,top:0,behavior:`smooth`})})}function Z(t){if(!t)return;let{placement:n}=e;if(n===`top`||n===`bottom`){let{scrollLeft:e,scrollWidth:n,offsetWidth:r}=t;h.value=e<=0,_.value=e+r>=n}else{let{scrollTop:e,scrollHeight:n,offsetHeight:r}=t;h.value=e<=0,_.value=e+r>=n}}let Q=Ke(e=>{Z(e.target)},64);p(Ve,{triggerRef:O(e,`trigger`),tabStyleRef:O(e,`tabStyle`),tabClassRef:O(e,`tabClass`),addTabStyleRef:O(e,`addTabStyle`),addTabClassRef:O(e,`addTabClass`),paneClassRef:O(e,`paneClass`),paneStyleRef:O(e,`paneStyle`),mergedClsPrefixRef:r,typeRef:O(e,`type`),closableRef:O(e,`closable`),valueRef:C,tabChangeIdRef:w,onBeforeLeaveRef:O(e,`onBeforeLeave`),activateTab:V,handleClose:U,handleAdd:ge}),le(()=>{N(),ne()}),ee(()=>{let{value:e}=l;if(!e)return;let{value:t}=r,n=`${t}-tabs-nav-scroll-wrapper--shadow-start`,i=`${t}-tabs-nav-scroll-wrapper--shadow-end`;h.value?e.classList.remove(n):e.classList.add(n),_.value?e.classList.remove(i):e.classList.add(i)});let ve={syncBarPosition:()=>{N()}},ye=()=>{J({transitionDisabled:!0})},$=F(()=>{let{value:t}=y,{type:r}=e,i=`${t}${{card:`Card`,bar:`Bar`,line:`Line`,segment:`Segment`}[r]}`,{self:{barColor:a,closeIconColor:s,closeIconColorHover:c,closeIconColorPressed:l,tabColor:u,tabBorderColor:d,paneTextColor:f,tabFontWeight:p,tabBorderRadius:m,tabFontWeightActive:h,colorSegment:g,fontWeightStrong:_,tabColorSegment:v,closeSize:b,closeIconSize:x,closeColorHover:S,closeColorPressed:ee,closeBorderRadius:C,[T(`panePadding`,t)]:w,[T(`tabPadding`,i)]:E,[T(`tabPaddingVertical`,i)]:D,[T(`tabGap`,i)]:O,[T(`tabGap`,`${i}Vertical`)]:k,[T(`tabTextColor`,r)]:A,[T(`tabTextColorActive`,r)]:j,[T(`tabTextColorHover`,r)]:M,[T(`tabTextColorDisabled`,r)]:N,[T(`tabFontSize`,t)]:P},common:{cubicBezierEaseInOut:te}}=o.value;return{"--n-bezier":te,"--n-color-segment":g,"--n-bar-color":a,"--n-tab-font-size":P,"--n-tab-text-color":A,"--n-tab-text-color-active":j,"--n-tab-text-color-disabled":N,"--n-tab-text-color-hover":M,"--n-pane-text-color":f,"--n-tab-border-color":d,"--n-tab-border-radius":m,"--n-close-size":b,"--n-close-icon-size":x,"--n-close-color-hover":S,"--n-close-color-pressed":ee,"--n-close-border-radius":C,"--n-close-icon-color":s,"--n-close-icon-color-hover":c,"--n-close-icon-color-pressed":l,"--n-tab-color":u,"--n-tab-font-weight":p,"--n-tab-font-weight-active":h,"--n-tab-padding":E,"--n-tab-padding-vertical":D,"--n-tab-gap":O,"--n-tab-gap-vertical":k,"--n-pane-padding-left":n(w,`left`),"--n-pane-padding-right":n(w,`right`),"--n-pane-padding-top":n(w,`top`),"--n-pane-padding-bottom":n(w,`bottom`),"--n-font-weight-strong":_,"--n-tab-color-segment":v}}),be=i?te(`tabs`,F(()=>`${y.value[0]}${e.type[0]}`),$,e):void 0;return Object.assign({mergedClsPrefix:r,mergedValue:C,renderedNames:new Set,segmentCapsuleElRef:K,tabsPaneWrapperRef:I,tabsElRef:s,barElRef:c,addTabInstRef:u,xScrollInstRef:d,scrollWrapperElRef:l,addTabFixed:X,tabWrapperStyle:E,handleNavResize:de,mergedSize:y,handleScroll:Q,handleTabsResize:he,cssVars:i?void 0:$,themeClass:be?.themeClass,animationDirection:B,renderNameListRef:z,yScrollElRef:f,handleSegmentResize:ye,onAnimationBeforeLeave:re,onAnimationEnter:ie,onAnimationAfterEnter:ae,onRender:be?.onRender},ve)},render(){let{mergedClsPrefix:e,type:t,placement:n,addTabFixed:r,addable:i,mergedSize:a,renderNameListRef:o,onRender:s,paneWrapperClass:c,paneWrapperStyle:l,$slots:{default:u,prefix:d,suffix:f}}=this;s?.();let p=u?A(u()).filter(e=>e.type.__TAB_PANE__===!0):[],m=u?A(u()).filter(e=>e.type.__TAB__===!0):[],h=!m.length,g=t===`card`,_=t===`segment`,v=!g&&!_&&this.justifyContent;o.value=[];let y=()=>{let t=G(`div`,{style:this.tabWrapperStyle,class:`${e}-tabs-wrapper`},v?null:G(`div`,{class:`${e}-tabs-scroll-padding`,style:n===`top`||n===`bottom`?{width:`${this.tabsPadding}px`}:{height:`${this.tabsPadding}px`}}),h?p.map((e,t)=>(o.value.push(e.props.name),Ze(G(We,Object.assign({},e.props,{internalCreatedByPane:!0,internalLeftPadded:t!==0&&(!v||v===`center`||v===`start`||v===`end`)}),e.children?{default:e.children.tab}:void 0)))):m.map((e,t)=>(o.value.push(e.props.name),Ze(t!==0&&!v?Xe(e):e))),!r&&i&&g?Ye(i,(h?p.length:m.length)!==0):null,v?null:G(`div`,{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return G(`div`,{ref:`tabsElRef`,class:`${e}-tabs-nav-scroll-content`},g&&i?G(x,{onResize:this.handleTabsResize},{default:()=>t}):t,g?G(`div`,{class:`${e}-tabs-pad`}):null,g?null:G(`div`,{ref:`barElRef`,class:`${e}-tabs-bar`}))},b=_?`top`:n;return G(`div`,{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${t}-type`,`${e}-tabs--${a}-size`,v&&`${e}-tabs--flex`,`${e}-tabs--${b}`],style:this.cssVars},G(`div`,{class:[`${e}-tabs-nav--${t}-type`,`${e}-tabs-nav--${b}`,`${e}-tabs-nav`]},D(d,t=>t&&G(`div`,{class:`${e}-tabs-nav__prefix`},t)),_?G(x,{onResize:this.handleSegmentResize},{default:()=>G(`div`,{class:`${e}-tabs-rail`,ref:`tabsElRef`},G(`div`,{class:`${e}-tabs-capsule`,ref:`segmentCapsuleElRef`},G(`div`,{class:`${e}-tabs-wrapper`},G(`div`,{class:`${e}-tabs-tab`}))),h?p.map((e,t)=>(o.value.push(e.props.name),G(We,Object.assign({},e.props,{internalCreatedByPane:!0,internalLeftPadded:t!==0}),e.children?{default:e.children.tab}:void 0))):m.map((e,t)=>(o.value.push(e.props.name),t===0?e:Xe(e))))}):G(x,{onResize:this.handleNavResize},{default:()=>G(`div`,{class:`${e}-tabs-nav-scroll-wrapper`,ref:`scrollWrapperElRef`},[`top`,`bottom`].includes(b)?G(Se,{ref:`xScrollInstRef`,onScroll:this.handleScroll},{default:y}):G(`div`,{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll,ref:`yScrollElRef`},y()))}),r&&i&&g?Ye(i,!0):null,D(f,t=>t&&G(`div`,{class:`${e}-tabs-nav__suffix`},t))),h&&(this.animated&&(b===`top`||b===`bottom`)?G(`div`,{ref:`tabsPaneWrapperRef`,style:l,class:[`${e}-tabs-pane-wrapper`,c]},Je(p,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):Je(p,this.mergedValue,this.renderedNames)))}});function Je(e,t,n,r,i,a,o){let s=[];return e.forEach(e=>{let{name:r,displayDirective:i,"display-directive":a}=e.props,o=e=>i===e||a===e,c=t===r;if(e.key!==void 0&&(e.key=r),c||o(`show`)||o(`show:lazy`)&&n.has(r)){n.has(r)||n.add(r);let t=!o(`if`);s.push(t?d(e,[[I,c]]):e)}}),o?G(ie,{name:`${o}-transition`,onBeforeLeave:r,onEnter:i,onAfterEnter:a},{default:()=>s}):s}function Ye(e,t){return G(We,{ref:`addTabInstRef`,key:`__addable`,name:`__addable`,internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:t,disabled:typeof e==`object`&&e.disabled})}function Xe(e){let t=R(e);return t.props?t.props.internalLeftPadded=!0:t.props={internalLeftPadded:!0},t}function Ze(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes(`internalLeftPadded`)||e.dynamicProps.push(`internalLeftPadded`):e.dynamicProps=[`internalLeftPadded`],e}var Qe={key:0,style:{padding:`40px`,"text-align":`center`}},$e={style:{"min-width":`0`,flex:`1`}},et=y({__name:`LiveTail`,props:{events:{},connected:{type:Boolean},paused:{type:Boolean}},emits:[`pause`,`resume`,`clear`],setup(e,{emit:t}){let n=e,r=t,i=H(null),a=H(!0);function o(e){return e===`postgres_changes`?`info`:e===`broadcast`?`success`:e===`presence`?`warning`:e===`error`?`error`:`default`}function c(e){return e.toLocaleTimeString(`en-US`,{hour12:!1,fractionalSecondDigits:3})}S(()=>n.events.length,async()=>{if(!a.value)return;await P();let e=i.value;e&&(e.scrollTop=e.scrollHeight)});function u(){let e=i.value;e&&(a.value=e.scrollHeight-e.scrollTop-e.clientHeight<40)}return(t,n)=>(l(),W(`div`,null,[K(B(V),{align:`center`,size:8,style:{"margin-bottom":`8px`}},{default:s(()=>[K(B(X),{type:e.connected?`success`:`default`,size:`small`,bordered:!1},{default:s(()=>[k(U(e.connected?`Connected`:`Disconnected`),1)]),_:1},8,[`type`]),e.paused?(l(),M(B(X),{key:0,type:`warning`,size:`small`,bordered:!1},{default:s(()=>[...n[3]||=[k(` Paused `,-1)]]),_:1})):E(``,!0),K(B(Q),{depth:`3`,style:{"font-size":`12px`}},{default:s(()=>[k(U(e.events.length.toLocaleString())+` events `,1)]),_:1}),e.paused?(l(),M(B(j),{key:2,size:`tiny`,type:`info`,onClick:n[1]||=e=>r(`resume`)},{default:s(()=>[...n[5]||=[k(`Resume`,-1)]]),_:1})):(l(),M(B(j),{key:1,size:`tiny`,onClick:n[0]||=e=>r(`pause`)},{default:s(()=>[...n[4]||=[k(`Pause`,-1)]]),_:1})),K(B(j),{size:`tiny`,onClick:n[2]||=e=>r(`clear`)},{default:s(()=>[...n[6]||=[k(`Clear`,-1)]]),_:1})]),_:1}),N(`div`,{ref_key:`listEl`,ref:i,style:{height:`calc(100vh - 380px)`,"min-height":`200px`,"overflow-y":`auto`,border:`1px solid rgba(255, 255, 255, 0.08)`,"border-radius":`4px`,background:`rgba(0, 0, 0, 0.15)`},onScroll:u},[e.events.length===0?(l(),W(`div`,Qe,[K(B(Q),{depth:`3`,style:{"font-size":`13px`}},{default:s(()=>[...n[7]||=[k(` Waiting for events… `,-1)]]),_:1})])):E(``,!0),(l(!0),W(oe,null,_(e.events,(e,t)=>(l(),W(`div`,{key:t,style:{display:`flex`,"align-items":`flex-start`,gap:`10px`,padding:`6px 12px`,"border-bottom":`1px solid rgba(255, 255, 255, 0.04)`,"font-family":`monospace`,"font-size":`12px`}},[K(B(Q),{depth:`3`,style:{"white-space":`nowrap`,"flex-shrink":`0`,"min-width":`88px`}},{default:s(()=>[k(U(c(e.receivedAt)),1)]),_:2},1024),K(B(X),{type:o(e.event),size:`tiny`,style:{"flex-shrink":`0`}},{default:s(()=>[k(U(e.event),1)]),_:2},1032,[`type`]),N(`div`,$e,[K(be,{value:e.payload},null,8,[`value`])])]))),128))],544)]))}});function tt(e,t,n){let r=ae([]),i=H(!1),a=H(!1),s=new EventSource(`/admin/api/v1${e}`,{withCredentials:!0});s.onopen=()=>{i.value=!0},s.onerror=()=>{i.value=!1};let c=(e,n)=>{a.value||(r.value=[...r.value,t(e,n)],r.value.length>1e3&&(r.value=r.value.slice(-1e3)))};if(n&&n.length>0)for(let e of n)s.addEventListener(e,t=>{c(e,t.data)});else s.onmessage=e=>{c(`message`,e.data)};let l=()=>{a.value=!0},u=()=>{a.value=!1},d=()=>{r.value=[]},f=!1,p=()=>{f||(f=!0,i.value=!1,s.close())};return o(()=>p()),{events:r,connected:i,paused:a,pause:l,resume:u,clear:d,close:p}}var nt=y({__name:`Tables`,setup(e){let{data:t,loading:n,error:r,refresh:i}=ve(()=>ge.tables()),a=[{title:`Schema`,key:`schema_name`,width:140},{title:`Table`,key:`table_name`,width:200},{title:`Primary Key`,key:`pk_columns`,width:180,render:e=>e.pk_columns.length?G(X,{size:`small`,type:`info`,bordered:!1},{default:()=>e.pk_columns.join(`, `)}):G(Q,{depth:3},{default:()=>`—`})},{title:`Owner Column`,key:`owner_column`,width:140,render:e=>e.owner_column??G(Q,{depth:3},{default:()=>`—`})},{title:`Enabled At`,key:`created_at`,width:170,render:e=>new Date(e.created_at).toLocaleString()}];return(e,o)=>(l(),M(B(re),{title:`Enabled Tables`,size:`small`},{default:s(()=>[K(ye,{error:B(r),retry:B(i)},null,8,[`error`,`retry`]),K(B(he),{show:B(n)},{default:s(()=>[B(t)&&B(t).length>0?(l(),M(B(me),{key:0,columns:a,data:B(t),bordered:!1,size:`small`},null,8,[`data`])):B(t)&&B(t).length===0?(l(),M($,{key:1,description:`No tables are realtime-enabled. Enable tables via SQL migrations.`})):E(``,!0)]),_:1},8,[`show`])]),_:1}))}}),rt=y({__name:`Channels`,setup(e){let t=H(`inspector`),n=H(`realtime:public`),r=H(null),i=ae(null);function a(e,t){let n=JSON.parse(t);return{event:e,topic:n.topic??``,payload:n.payload??{raw:t},receivedAt:new Date}}let o=[`postgres_changes`,`broadcast`,`presence`,`presence_diff`,`presence_state`,`connected`,`heartbeat`,`error`];function c(){let e=n.value.trim();e&&(u(),r.value=e,i.value=tt(`/realtime/inspect?topic=${encodeURIComponent(e)}`,a,o))}function u(){i.value&&i.value.close(),i.value=null,r.value=null}return(e,r)=>(l(),W(`div`,null,[r[7]||=N(`div`,{style:{display:`flex`,"align-items":`center`,"justify-content":`space-between`,"margin-bottom":`16px`}},[N(`h1`,{style:{margin:`0`,"font-size":`20px`,"font-weight":`600`}},` Realtime `)],-1),K(B(qe),{value:t.value,"onUpdate:value":r[4]||=e=>t.value=e,type:`line`,animated:``},{default:s(()=>[K(B(Ue),{name:`inspector`,tab:`Inspector`},{default:s(()=>[K(B(re),{size:`small`},{default:s(()=>[K(B(V),{vertical:``,size:16},{default:s(()=>[K(B(V),{align:`center`,size:8},{default:s(()=>[K(B(de),{value:n.value,"onUpdate:value":r[0]||=e=>n.value=e,placeholder:`e.g. realtime:room-42`,style:{width:`340px`},disabled:!!i.value,onKeyup:z(c,[`enter`])},null,8,[`value`,`disabled`]),i.value?(l(),M(B(j),{key:1,size:`small`,onClick:u},{default:s(()=>[...r[6]||=[k(` Disconnect `,-1)]]),_:1})):(l(),M(B(j),{key:0,type:`primary`,size:`small`,onClick:c},{default:s(()=>[...r[5]||=[k(` Connect `,-1)]]),_:1}))]),_:1}),i.value?(l(),M(et,{key:0,events:i.value.events.value,connected:i.value.connected.value,paused:i.value.paused.value,onPause:r[1]||=e=>i.value.pause(),onResume:r[2]||=e=>i.value.resume(),onClear:r[3]||=e=>i.value.clear()},null,8,[`events`,`connected`,`paused`])):(l(),M($,{key:1,description:`Subscribe to a topic to begin tailing.`}))]),_:1})]),_:1})]),_:1}),K(B(Ue),{name:`tables`,tab:`Enabled Tables`},{default:s(()=>[K(nt)]),_:1})]),_:1},8,[`value`])]))}});export{rt as default};
|
|
353
|
+
//# sourceMappingURL=Channels-BoIuTtam.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Sn as e,wn as t}from"./Space-n5-XcguU.js";var n=e({name:`ChevronRight`,render(){return t(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},t(`path`,{d:`M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z`,fill:`currentColor`}))}});export{n as t};
|
|
2
|
+
//# sourceMappingURL=ChevronRight-CtQH1EQ1.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{In as e,Mn as t,Pn as n,Sn as r,Un as i,lr as a,tr as o,vn as s}from"./Space-n5-XcguU.js";import{S as c,b as l,n as u,t as d}from"./dist-VXIJLCYq.js";var f=r({__name:`CodeViewer`,props:{modelValue:{},readOnly:{type:Boolean},height:{}},emits:[`update:modelValue`],setup(r,{emit:f}){let p=r,m=f,h=o(),g;return n(()=>{let e=[u,d,l.updateListener.of(e=>{e.docChanged&&m(`update:modelValue`,e.state.doc.toString())}),c.readOnly.of(p.readOnly??!1),l.theme({"&":{height:`100%`},".cm-scroller":{overflow:`auto`}})];g=new l({doc:p.modelValue,extensions:e,parent:h.value})}),t(()=>g?.destroy()),i(()=>p.modelValue,e=>{g&&e!==g.state.doc.toString()&&g.dispatch({changes:{from:0,to:g.state.doc.length,insert:e}})}),(t,n)=>(e(),s(`div`,{ref_key:`host`,ref:h,style:a({height:r.height??`320px`,border:`1px solid var(--n-border-color)`})},null,4))}});export{f as t};
|
|
2
|
+
//# sourceMappingURL=CodeViewer-Bqy7-wvH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Gn as e,In as t,Sn as n,_n as r,bn as i,c as a,gn as o,mn as s,r as c,sr as l,ur as u,wn as d,xn as f}from"./Space-n5-XcguU.js";import{t as p}from"./Tag-D1fOKpTH.js";import{t as m}from"./DataTable-COAAWEft.js";import{t as h}from"./Alert-dluGVkos.js";import{i as g,l as _}from"./resources-Bt6thQCD.js";import{t as v}from"./useResource-C_rJCY8C.js";import{n as y,t as b}from"./EmptyState-DeDck-OL.js";import{t as x}from"./useToast-DsZKx0IX.js";import{t as S}from"./useConfirm-tMjvBFXR.js";var C=n({__name:`Crons`,setup(n){let C=x(),w=S(),{data:T,error:E,loading:D,refresh:O}=v(()=>g.cronHealth()),k=s(()=>T.value?T.value.installed?{type:`success`,message:`pg_cron v${T.value.extension_version??`?`} — ${T.value.active_jobs} active schedule(s)`}:{type:`warning`,message:`pg_cron is not installed. Cron jobs will not fire automatically.`}:null),{data:A,error:j,loading:M,refresh:N}=v(()=>g.crons());function P(e){return e?new Date(e).toLocaleString():`—`}let F=[{title:`Name`,key:`name`,ellipsis:{tooltip:!0}},{title:`Schedule`,key:`cron_expr`,width:120},{title:`Job`,key:`job_name`,width:140},{title:`Enabled`,key:`enabled`,width:100,render:e=>d(p,{type:e.enabled?`success`:`default`,size:`small`},{default:()=>e.enabled?`Yes`:`No`})},{title:`pg_cron Active`,key:`pg_cron_active`,width:130,render:e=>e.pg_cron_active===null?`—`:d(p,{type:e.pg_cron_active?`success`:`warning`,size:`small`},{default:()=>e.pg_cron_active?`Yes`:`No`})},{title:`Last Fire`,key:`last_fire_at`,width:160,render:e=>P(e.last_fire_at)},{title:`Created`,key:`created_at`,width:160,render:e=>P(e.created_at)},{title:``,key:`actions`,width:100,render:e=>d(a,{size:`tiny`,type:`info`,onClick:()=>I(e)},{default:()=>`Run now`})}];async function I(e){if(await w(`Run cron "${e.name}" now?`,`This will enqueue a ${e.job_name} job immediately.`))try{await g.runCronNow(e.name),C.success(`Enqueued ${e.job_name}`),await N()}catch(e){C.error(e.message??`Run-now failed`)}}return(n,a)=>(t(),o(l(c),{title:`Cron Schedules`,size:`small`},{default:e(()=>[f(l(_),{show:l(D),size:`small`,style:{"margin-bottom":`16px`}},{default:e(()=>[f(y,{error:l(E),retry:l(O)},null,8,[`error`,`retry`]),k.value?(t(),o(l(h),{key:0,type:k.value.type,"show-icon":!0,style:{"margin-bottom":`16px`}},{default:e(()=>[i(u(k.value.message),1)]),_:1},8,[`type`])):r(``,!0)]),_:1},8,[`show`]),f(l(_),{show:l(M)},{default:e(()=>[f(y,{error:l(j),retry:l(N)},null,8,[`error`,`retry`]),l(A)&&l(A).length>0?(t(),o(l(m),{key:0,columns:F,data:l(A),bordered:!1},null,8,[`data`])):l(A)&&l(A).length===0?(t(),o(b,{key:1,description:`No cron schedules defined.`})):r(``,!0)]),_:1},8,[`show`])]),_:1}))}});export{C as default};
|
|
2
|
+
//# sourceMappingURL=Crons-B67vc39F.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Gn as e,In as t,Rn as n,Sn as r,_n as i,bn as a,c as o,gn as s,hn as c,mn as l,r as u,sr as d,t as f,un as p,ur as m,vn as h,xn as g}from"./Space-n5-XcguU.js";import{t as _}from"./Tag-D1fOKpTH.js";import{n as v,t as y}from"./Grid-hFkp9F4P.js";import{t as b}from"./Alert-dluGVkos.js";import{n as x,r as S,t as C}from"./Thing-CEAniuMg.js";import{c as w,l as T,t as E}from"./resources-Bt6thQCD.js";import{c as D,s as O}from"./index-CeE6v959.js";import{t as k}from"./useResource-C_rJCY8C.js";var A=r({__name:`DashboardView`,setup(r){let A=O(),{data:j,error:M,loading:N,refresh:P}=k(()=>w.status()),{data:F,error:I,loading:L}=k(()=>E.audit({limit:5})),R=l(()=>F.value?.rows??[]);function z(e){return e===void 0?`default`:e?`success`:`error`}function B(e,t,n){return e===void 0?n:e?t:n}function V(e){return e&&e>=16?`error`:`success`}return(r,l)=>(t(),h(`div`,null,[l[17]||=c(`h1`,{style:{margin:`0 0 16px 0`,"font-size":`20px`,"font-weight":`600`}},`Dashboard`,-1),d(M)?(t(),s(d(b),{key:0,type:`error`,title:d(M).message,style:{"margin-bottom":`16px`}},{default:e(()=>[g(d(f),null,{default:e(()=>[g(d(D),null,{default:e(()=>[...l[4]||=[a(`Unable to load system status.`,-1)]]),_:1}),g(d(o),{size:`small`,onClick:d(P)},{default:e(()=>[...l[5]||=[a(`Retry`,-1)]]),_:1},8,[`onClick`])]),_:1})]),_:1},8,[`title`])):i(``,!0),g(d(T),{show:d(N)},{default:e(()=>[g(d(y),{cols:`1 s:2 m:3`,responsive:`screen`,"x-gap":16,"y-gap":16},{default:e(()=>[g(d(v),null,{default:e(()=>[g(d(u),{size:`small`,segmented:{content:!0},hoverable:``,onClick:l[0]||=e=>d(A).push(`/db/sql`)},{header:e(()=>[g(d(f),{align:`center`},{default:e(()=>[g(d(_),{type:V(d(j)?.pool_size),size:`small`},{default:e(()=>[...l[6]||=[a(`Pool`,-1)]]),_:1},8,[`type`]),g(d(D),{strong:``},{default:e(()=>[...l[7]||=[a(`DB Pool`,-1)]]),_:1})]),_:1})]),default:e(()=>[g(d(f),{vertical:``},{default:e(()=>[g(d(D),{style:{"font-size":`24px`,"font-weight":`700`}},{default:e(()=>[a(m(d(j)?.pool_size??`-`),1)]),_:1}),g(d(D),{depth:`3`,style:{"font-size":`12px`}},{default:e(()=>[...l[8]||=[a(`active connections`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),g(d(v),null,{default:e(()=>[g(d(u),{size:`small`,segmented:{content:!0},hoverable:``},{header:e(()=>[g(d(f),{align:`center`},{default:e(()=>[g(d(_),{type:`default`,size:`small`},{default:e(()=>[...l[9]||=[a(`JWKS`,-1)]]),_:1}),g(d(D),{strong:``},{default:e(()=>[...l[10]||=[a(`Active Key`,-1)]]),_:1})]),_:1})]),default:e(()=>[g(d(f),{vertical:``},{default:e(()=>[g(d(D),{code:``,style:{"font-size":`14px`}},{default:e(()=>[a(m(d(j)?.jwks_kid??`-`),1)]),_:1}),g(d(D),{depth:`3`,style:{"font-size":`12px`}},{default:e(()=>[...l[11]||=[a(`current kid`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),g(d(v),null,{default:e(()=>[g(d(u),{size:`small`,segmented:{content:!0},hoverable:``,onClick:l[1]||=e=>d(A).push(`/realtime`)},{header:e(()=>[g(d(f),{align:`center`},{default:e(()=>[g(d(_),{type:z(d(j)?.broker),size:`small`},{default:e(()=>[a(m(B(d(j)?.broker,`ON`,`OFF`)),1)]),_:1},8,[`type`]),g(d(D),{strong:``},{default:e(()=>[...l[12]||=[a(`Realtime`,-1)]]),_:1})]),_:1})]),default:e(()=>[g(d(f),{vertical:``},{default:e(()=>[g(d(D),{style:{"font-size":`24px`,"font-weight":`700`}},{default:e(()=>[a(m(B(d(j)?.broker,`Connected`,`Disconnected`)),1)]),_:1}),g(d(D),{depth:`3`,style:{"font-size":`12px`}},{default:e(()=>[...l[13]||=[a(`broker status`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),g(d(v),null,{default:e(()=>[g(d(u),{size:`small`,segmented:{content:!0},hoverable:``,onClick:l[2]||=e=>d(A).push(`/jobs`)},{header:e(()=>[g(d(f),{align:`center`},{default:e(()=>[g(d(_),{type:z(d(j)?.jobs),size:`small`},{default:e(()=>[a(m(B(d(j)?.jobs,`ON`,`OFF`)),1)]),_:1},8,[`type`]),g(d(D),{strong:``},{default:e(()=>[...l[14]||=[a(`Jobs`,-1)]]),_:1})]),_:1})]),default:e(()=>[g(d(f),{vertical:``},{default:e(()=>[g(d(D),{style:{"font-size":`24px`,"font-weight":`700`}},{default:e(()=>[a(m(B(d(j)?.jobs,`Enabled`,`Disabled`)),1)]),_:1}),g(d(D),{depth:`3`,style:{"font-size":`12px`}},{default:e(()=>[...l[15]||=[a(`worker heartbeat`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,[`show`]),g(d(u),{title:`Recent Audit Events`,size:`small`,style:{"margin-top":`24px`},segmented:{content:!0}},{default:e(()=>[g(d(T),{show:d(L)},{default:e(()=>[d(I)?(t(),s(d(b),{key:0,type:`error`,title:d(I).message},null,8,[`title`])):R.value.length?(t(),s(d(S),{key:1,hoverable:``,clickable:``},{default:e(()=>[(t(!0),h(p,null,n(R.value,n=>(t(),s(d(x),{key:n.id??JSON.stringify(n),onClick:l[3]||=e=>d(A).push(`/auth/audit`)},{default:e(()=>[g(d(C),{title:n.event??n.action??`Unknown`,description:n.target??``},{"header-extra":e(()=>[g(d(D),{depth:`3`,style:{"font-size":`12px`}},{default:e(()=>[a(m(n.at?new Date(n.at).toLocaleString():``),1)]),_:2},1024)]),_:2},1032,[`title`,`description`])]),_:2},1024))),128))]),_:1})):(t(),s(d(f),{key:2,vertical:``,align:`center`,style:{padding:`32px`}},{default:e(()=>[g(d(D),{depth:`3`},{default:e(()=>[...l[16]||=[a(`No recent audit events.`,-1)]]),_:1})]),_:1}))]),_:1},8,[`show`])]),_:1})]))}});export{A as default};
|
|
2
|
+
//# sourceMappingURL=DashboardView-CUTFVL6k.js.map
|