mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-01 18:50:40 +01:00
Improve doc
This commit is contained in:
parent
b67f3438e9
commit
31802c9749
10 changed files with 85 additions and 16 deletions
|
@ -35,7 +35,7 @@ export default Vue.extend({
|
|||
|
||||
created() {
|
||||
this.$root.getMeta().then(meta => {
|
||||
this.announcements = meta.broadcasts;
|
||||
this.announcements = meta.announcements;
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -65,7 +65,7 @@ export default Vue.extend({
|
|||
|
||||
save(silent) {
|
||||
this.$root.api('admin/update-meta', {
|
||||
broadcasts: this.announcements
|
||||
announcements: this.announcements
|
||||
}).then(() => {
|
||||
if (!silent) {
|
||||
this.$root.dialog({
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</svg>
|
||||
</div>
|
||||
<p class="fetching" v-if="fetching">{{ $t('fetching') }}<mk-ellipsis/></p>
|
||||
<h1 v-if="!fetching">{{ announcements.length == 0 ? this.$t('no-broadcasts') : announcements[i].title }}</h1>
|
||||
<h1 v-if="!fetching">{{ announcements.length == 0 ? $t('no-broadcasts') : announcements[i].title }}</h1>
|
||||
<p v-if="!fetching">
|
||||
<span v-if="announcements.length != 0" v-html="announcements[i].text"></span>
|
||||
<template v-if="announcements.length == 0">{{ $t('have-a-nice-day') }}</template>
|
||||
|
@ -47,7 +47,7 @@ export default define({
|
|||
},
|
||||
mounted() {
|
||||
this.$root.getMeta().then(meta => {
|
||||
this.announcements = meta.broadcasts;
|
||||
this.announcements = meta.announcements;
|
||||
this.fetching = false;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -174,7 +174,7 @@ export default Vue.extend({
|
|||
this.meta = meta;
|
||||
this.name = meta.name;
|
||||
this.description = meta.description;
|
||||
this.announcements = meta.broadcasts;
|
||||
this.announcements = meta.announcements;
|
||||
this.banner = meta.bannerUrl;
|
||||
});
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ export default Vue.extend({
|
|||
|
||||
mounted() {
|
||||
this.$root.getMeta().then(meta => {
|
||||
this.announcements = meta.broadcasts;
|
||||
this.announcements = meta.announcements;
|
||||
});
|
||||
|
||||
if (this.$store.getters.isSignedIn) {
|
||||
|
|
|
@ -98,7 +98,7 @@ export default Vue.extend({
|
|||
this.meta = meta;
|
||||
this.name = meta.name;
|
||||
this.description = meta.description;
|
||||
this.announcements = meta.broadcasts;
|
||||
this.announcements = meta.announcements;
|
||||
this.banner = meta.bannerUrl;
|
||||
});
|
||||
|
||||
|
|
|
@ -151,6 +151,15 @@ if ((config as any).sw) {
|
|||
}
|
||||
});
|
||||
}
|
||||
Meta.findOne({}).then(m => {
|
||||
if (m != null && (m as any).broadcasts != null) {
|
||||
Meta.update({}, {
|
||||
$rename: {
|
||||
broadcasts: 'announcements'
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export type IMeta = {
|
||||
name?: string;
|
||||
|
@ -173,7 +182,7 @@ export type IMeta = {
|
|||
|
||||
langs?: string[];
|
||||
|
||||
broadcasts?: any[];
|
||||
announcements?: any[];
|
||||
|
||||
stats?: {
|
||||
notesCount: number;
|
||||
|
|
|
@ -13,10 +13,10 @@ export const meta = {
|
|||
requireModerator: true,
|
||||
|
||||
params: {
|
||||
broadcasts: {
|
||||
announcements: {
|
||||
validator: $.optional.nullable.arr($.obj()),
|
||||
desc: {
|
||||
'ja-JP': 'ブロードキャスト'
|
||||
'ja-JP': 'お知らせ'
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -328,8 +328,8 @@ export const meta = {
|
|||
export default define(meta, async (ps) => {
|
||||
const set = {} as any;
|
||||
|
||||
if (ps.broadcasts) {
|
||||
set.broadcasts = ps.broadcasts;
|
||||
if (ps.announcements) {
|
||||
set.announcements = ps.announcements;
|
||||
}
|
||||
|
||||
if (typeof ps.disableRegistration === 'boolean') {
|
||||
|
|
|
@ -12,7 +12,19 @@ export const meta = {
|
|||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
kind: 'drive-read',
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
capacity: {
|
||||
type: 'number'
|
||||
},
|
||||
usage: {
|
||||
type: 'number'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
|
|
@ -24,6 +24,54 @@ export const meta = {
|
|||
default: true
|
||||
}
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
version: {
|
||||
type: 'string',
|
||||
description: 'The version of Misskey of this instance.',
|
||||
example: pkg.version
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'The name of this instance.',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'The description of this instance.',
|
||||
},
|
||||
announcements: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'The title of the announcement.',
|
||||
},
|
||||
text: {
|
||||
type: 'string',
|
||||
description: 'The text of the announcement. (can be HTML)',
|
||||
},
|
||||
}
|
||||
},
|
||||
description: 'The description of this instance.',
|
||||
},
|
||||
disableRegistration: {
|
||||
type: 'boolean',
|
||||
description: 'Whether disabled open registration.',
|
||||
},
|
||||
disableLocalTimeline: {
|
||||
type: 'boolean',
|
||||
description: 'Whether disabled LTL and STL.',
|
||||
},
|
||||
disableGlobalTimeline: {
|
||||
type: 'boolean',
|
||||
description: 'Whether disabled GTL.',
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, me) => {
|
||||
|
@ -55,7 +103,7 @@ export default define(meta, async (ps, me) => {
|
|||
cores: os.cpus().length
|
||||
},
|
||||
|
||||
broadcasts: instance.broadcasts || [],
|
||||
announcements: instance.announcements || [],
|
||||
disableRegistration: instance.disableRegistration,
|
||||
disableLocalTimeline: instance.disableLocalTimeline,
|
||||
disableGlobalTimeline: instance.disableGlobalTimeline,
|
||||
|
|
|
@ -20,7 +20,7 @@ export const links = [/* (awaiting release) {
|
|||
|
||||
const nodeinfo2 = async () => {
|
||||
const [
|
||||
{ name, description, maintainer, langs, broadcasts, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker },
|
||||
{ name, description, maintainer, langs, announcements, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker },
|
||||
// total,
|
||||
// activeHalfyear,
|
||||
// activeMonth,
|
||||
|
@ -52,7 +52,7 @@ const nodeinfo2 = async () => {
|
|||
// localPosts,
|
||||
// localComments
|
||||
},
|
||||
metadata: { name, description, maintainer, langs, broadcasts, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker }
|
||||
metadata: { name, description, maintainer, langs, announcements, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker }
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue