Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22420707
admin.page.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
admin.page.tsx
View Options
import
type
{
Context
}
from
"koa"
;
import
{
TempstreamJSX
}
from
"tempstream"
;
import
{
Page
}
from
"@sealcode/sealgen"
;
import
html
from
"src/back/html.js"
;
import
{
button
}
from
"../elements/button.js"
;
import
{
LoginURL
,
NavbarLinksCRUDListURL
,
PagesCRUDListURL
,
ResetPasswordURL
,
}
from
"./urls.js"
;
export
const
actionName
=
"Admin"
;
export
default
new
(
class
AdminPage
extends
Page
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async
canAccess
(
_
:
Context
)
{
return
{
canAccess
:
true
,
message
:
""
};
}
async
render
(
ctx
:
Context
)
{
if
(
!
ctx
.
$context
.
user_id
)
{
ctx
.
redirect
(
LoginURL
);
ctx
.
status
=
303
;
return
""
;
}
return
html
({
ctx
:
ctx
,
title
:
"Admin"
,
body
:
(
<
div
>
<
h1
>
Admin
panel
<
/h1>
{[
{
text
:
"Edit Pages"
,
href
:
PagesCRUDListURL
},
{
text
:
"Edit Navbar"
,
href
:
NavbarLinksCRUDListURL
},
{
text
:
"Change Password"
,
href
:
ResetPasswordURL
},
].
map
((
e
)
=>
button
({
...
e
,
variant
:
"accent1"
}))}
<
/div>
),
description
:
""
,
});
}
})();
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 28, 02:51 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1192310
Default Alt Text
admin.page.tsx (1 KB)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline