Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
7ad9560f
Unverified
Commit
7ad9560f
authored
6 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
Implement instance info page
parent
c135d028
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/client/assets/misskey-php-like-logo.png
+0
-0
0 additions, 0 deletions
src/client/assets/misskey-php-like-logo.png
src/server/web/index.ts
+24
-0
24 additions, 0 deletions
src/server/web/index.ts
src/server/web/views/info.pug
+113
-0
113 additions, 0 deletions
src/server/web/views/info.pug
with
137 additions
and
0 deletions
src/client/assets/misskey-php-like-logo.png
0 → 100644
+
0
−
0
View file @
7ad9560f
48.8 KiB
This diff is collapsed.
Click to expand it.
src/server/web/index.ts
+
24
−
0
View file @
7ad9560f
...
...
@@ -2,6 +2,7 @@
* Web Client Server
*/
import
*
as
os
from
'
os
'
;
import
ms
=
require
(
'
ms
'
);
import
*
as
Koa
from
'
koa
'
;
import
*
as
Router
from
'
koa-router
'
;
...
...
@@ -18,6 +19,8 @@ import config from '../../config';
import
Note
,
{
pack
as
packNote
}
from
'
../../models/note
'
;
import
getNoteSummary
from
'
../../misc/get-note-summary
'
;
import
fetchMeta
from
'
../../misc/fetch-meta
'
;
import
Emoji
from
'
../../models/emoji
'
;
const
pkg
=
require
(
'
../../../package.json
'
);
const
client
=
`
${
__dirname
}
/../../client/`
;
...
...
@@ -195,6 +198,27 @@ router.get('/notes/:note', async ctx => {
});
//#endregion
router
.
get
(
'
/info
'
,
async
ctx
=>
{
const
meta
=
await
fetchMeta
();
const
emojis
=
await
Emoji
.
find
({
host
:
null
},
{
fields
:
{
_id
:
false
}
});
await
ctx
.
render
(
'
info
'
,
{
version
:
pkg
.
version
,
machine
:
os
.
hostname
(),
os
:
os
.
platform
(),
node
:
process
.
version
,
cpu
:
{
model
:
os
.
cpus
()[
0
].
model
,
cores
:
os
.
cpus
().
length
},
emojis
:
emojis
,
meta
:
meta
});
});
// Render base html for all requests
router
.
get
(
'
*
'
,
async
ctx
=>
{
const
meta
=
await
fetchMeta
();
...
...
This diff is collapsed.
Click to expand it.
src/server/web/views/info.pug
0 → 100644
+
113
−
0
View file @
7ad9560f
doctype html
html
head
meta(charset='utf-8')
meta(name='application-name' content='Misskey')
title Misskey
style.
html {
font-family: sans-serif;
}
main {
max-width: 934px;
margin: 0 auto;
}
header {
padding: 5px;
background: rgb(153, 153, 204);
border: 1px solid #000;
}
header:after {
content: '';
display: block;
clear: both;
}
header > h1 {
float: left;
font-size: 2em;
}
header > img {
float: right;
width: 220px;
}
table {
margin: 1em 0;
width: 100%;
border-collapse: collapse;
}
table tr th {
background-color: #ccf;
border: 1px solid #000;
width: 300px;
font-weight: bold;
padding: 4px 5px;
text-align: left;
}
table tr td {
background-color: #ddd;
border: 1px solid #000;
padding: 4px 5px;
}
body
main
header
h1 Misskey Version #{version}
img(src='/assets/misskey-php-like-logo.png' alt='')
table
tr
th Instance
td= meta.name
tr
th Maintainer
td
= meta.maintainer.name
| <#{meta.maintainer.email}>
tr
th System
td= os
tr
th Node version
td= node
tr
th Machine
td= machine
tr
th CPU
td= cpu.model
tr
th Registration
td= !meta.disableRegistration ? 'yes' : 'no'
tr
th reCAPTCHA enabled
td= meta.enableRecaptcha ? 'yes' : 'no'
tr
th Cache remote files
td= meta.cacheRemoteFiles ? 'yes' : 'no'
tr
th Drive capacity per local user
td
= meta.localDriveCapacityMb
| MB
tr
th Drive capacity per remote user
td
= meta.remoteDriveCapacityMb
| MB
tr
th Max text length
td= meta.maxNoteTextLength
tr
th Emojis
td
each emoji in emojis
| :#{emoji.name}:
= ' '
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment