forked from FoundKeyGang/FoundKey
インスタンスの対象言語の設定を実装
This commit is contained in:
parent
1585bb12cf
commit
001bb7bbcd
6 changed files with 22 additions and 1 deletions
|
@ -1079,6 +1079,8 @@ admin/views/instance.vue:
|
||||||
instance-name: "インスタンス名"
|
instance-name: "インスタンス名"
|
||||||
instance-description: "インスタンスの紹介"
|
instance-description: "インスタンスの紹介"
|
||||||
banner-url: "バナー画像URL"
|
banner-url: "バナー画像URL"
|
||||||
|
languages: "インスタンスの対象言語"
|
||||||
|
languages-desc: "スペースで区切って複数設定できます。"
|
||||||
maintainer-config: "管理者情報"
|
maintainer-config: "管理者情報"
|
||||||
maintainer-name: "管理者名"
|
maintainer-name: "管理者名"
|
||||||
maintainer-email: "管理者の連絡先"
|
maintainer-email: "管理者の連絡先"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<ui-input v-model="name">%i18n:@instance-name%</ui-input>
|
<ui-input v-model="name">%i18n:@instance-name%</ui-input>
|
||||||
<ui-textarea v-model="description">%i18n:@instance-description%</ui-textarea>
|
<ui-textarea v-model="description">%i18n:@instance-description%</ui-textarea>
|
||||||
<ui-input v-model="bannerUrl"><i slot="icon"><fa icon="link"/></i>%i18n:@banner-url%</ui-input>
|
<ui-input v-model="bannerUrl"><i slot="icon"><fa icon="link"/></i>%i18n:@banner-url%</ui-input>
|
||||||
|
<ui-input v-model="languages"><i slot="icon"><fa icon="language"/></i>%i18n:@languages%<span slot="desc">%i18n:@languages-desc%</span></ui-input>
|
||||||
</section>
|
</section>
|
||||||
<section class="fit-bottom">
|
<section class="fit-bottom">
|
||||||
<header><fa icon="headset"/> %i18n:@maintainer-config%</header>
|
<header><fa icon="headset"/> %i18n:@maintainer-config%</header>
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
<section>
|
<section>
|
||||||
<header><fa icon="ghost"/> %i18n:@proxy-account-config%</header>
|
<header><fa icon="ghost"/> %i18n:@proxy-account-config%</header>
|
||||||
<ui-info>%i18n:@proxy-account-info%</ui-info>
|
<ui-info>%i18n:@proxy-account-info%</ui-info>
|
||||||
<ui-input v-model="proxyAccount"><i slot="prefix">@</i>%i18n:@proxy-account-username%<span slot="desc">%i18n:@proxy-account-username-desc%</span></ui-input>
|
<ui-input v-model="proxyAccount"><span slot="prefix">@</span>%i18n:@proxy-account-username%<span slot="desc">%i18n:@proxy-account-username-desc%</span></ui-input>
|
||||||
<ui-info warn>%i18n:@proxy-account-warn%</ui-info>
|
<ui-info warn>%i18n:@proxy-account-warn%</ui-info>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
|
@ -68,6 +69,7 @@ export default Vue.extend({
|
||||||
bannerUrl: null,
|
bannerUrl: null,
|
||||||
name: null,
|
name: null,
|
||||||
description: null,
|
description: null,
|
||||||
|
languages: null,
|
||||||
cacheRemoteFiles: false,
|
cacheRemoteFiles: false,
|
||||||
localDriveCapacityMb: null,
|
localDriveCapacityMb: null,
|
||||||
remoteDriveCapacityMb: null,
|
remoteDriveCapacityMb: null,
|
||||||
|
@ -87,6 +89,7 @@ export default Vue.extend({
|
||||||
this.bannerUrl = meta.bannerUrl;
|
this.bannerUrl = meta.bannerUrl;
|
||||||
this.name = meta.name;
|
this.name = meta.name;
|
||||||
this.description = meta.description;
|
this.description = meta.description;
|
||||||
|
this.languages = meta.langs.join(' ');
|
||||||
this.cacheRemoteFiles = meta.cacheRemoteFiles;
|
this.cacheRemoteFiles = meta.cacheRemoteFiles;
|
||||||
this.localDriveCapacityMb = meta.driveCapacityPerLocalUserMb;
|
this.localDriveCapacityMb = meta.driveCapacityPerLocalUserMb;
|
||||||
this.remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb;
|
this.remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb;
|
||||||
|
@ -119,6 +122,7 @@ export default Vue.extend({
|
||||||
bannerUrl: this.bannerUrl,
|
bannerUrl: this.bannerUrl,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
description: this.description,
|
description: this.description,
|
||||||
|
langs: this.languages.split(' '),
|
||||||
cacheRemoteFiles: this.cacheRemoteFiles,
|
cacheRemoteFiles: this.cacheRemoteFiles,
|
||||||
localDriveCapacityMb: parseInt(this.localDriveCapacityMb, 10),
|
localDriveCapacityMb: parseInt(this.localDriveCapacityMb, 10),
|
||||||
remoteDriveCapacityMb: parseInt(this.remoteDriveCapacityMb, 10),
|
remoteDriveCapacityMb: parseInt(this.remoteDriveCapacityMb, 10),
|
||||||
|
|
|
@ -2,6 +2,7 @@ import Meta, { IMeta } from '../models/meta';
|
||||||
|
|
||||||
const defaultMeta: any = {
|
const defaultMeta: any = {
|
||||||
name: 'Misskey',
|
name: 'Misskey',
|
||||||
|
langs: [],
|
||||||
cacheRemoteFiles: true,
|
cacheRemoteFiles: true,
|
||||||
localDriveCapacityMb: 256,
|
localDriveCapacityMb: 256,
|
||||||
remoteDriveCapacityMb: 8,
|
remoteDriveCapacityMb: 8,
|
||||||
|
|
|
@ -119,6 +119,8 @@ export type IMeta = {
|
||||||
email?: string;
|
email?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
langs?: string[];
|
||||||
|
|
||||||
broadcasts?: any[];
|
broadcasts?: any[];
|
||||||
|
|
||||||
stats?: {
|
stats?: {
|
||||||
|
|
|
@ -130,6 +130,13 @@ export const meta = {
|
||||||
desc: {
|
desc: {
|
||||||
'ja-JP': 'インスタンス管理者の連絡先メールアドレス'
|
'ja-JP': 'インスタンス管理者の連絡先メールアドレス'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
langs: {
|
||||||
|
validator: $.arr($.str).optional,
|
||||||
|
desc: {
|
||||||
|
'ja-JP': 'インスタンスの対象言語'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -205,6 +212,10 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
|
||||||
set['maintainer.email'] = ps.maintainerEmail;
|
set['maintainer.email'] = ps.maintainerEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ps.langs !== undefined) {
|
||||||
|
set.langs = ps.langs;
|
||||||
|
}
|
||||||
|
|
||||||
await Meta.update({}, {
|
await Meta.update({}, {
|
||||||
$set: set
|
$set: set
|
||||||
}, { upsert: true });
|
}, { upsert: true });
|
||||||
|
|
|
@ -43,6 +43,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||||
|
|
||||||
name: instance.name,
|
name: instance.name,
|
||||||
description: instance.description,
|
description: instance.description,
|
||||||
|
langs: instance.langs,
|
||||||
|
|
||||||
secure: config.https != null,
|
secure: config.https != null,
|
||||||
machine: os.hostname(),
|
machine: os.hostname(),
|
||||||
|
|
Loading…
Reference in a new issue