diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-06 07:14:43 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-06 07:14:43 +0900 |
| commit | 8f714b5b126226346af850337566f0f70bd02d4f (patch) | |
| tree | f647ad5b28e5a4e74a7f7501c09597a1f8f11a81 /src/server/api/endpoints/admin | |
| parent | Clean up (diff) | |
| download | misskey-8f714b5b126226346af850337566f0f70bd02d4f.tar.gz misskey-8f714b5b126226346af850337566f0f70bd02d4f.tar.bz2 misskey-8f714b5b126226346af850337566f0f70bd02d4f.zip | |
ドライブ容量の設定をDBに保存するようにしたりリファクタリングしたり
Diffstat (limited to 'src/server/api/endpoints/admin')
| -rw-r--r-- | src/server/api/endpoints/admin/update-meta.ts | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index a0f2b329aa..4c4a3ac85c 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -65,7 +65,23 @@ export const meta = { desc: { 'ja-JP': '投稿の最大文字数' } - } + }, + + localDriveCapacityMb: { + validator: $.num.optional.min(0), + desc: { + 'ja-JP': 'ローカルユーザーひとりあたりのドライブ容量 (メガバイト単位)', + 'en-US': 'Drive capacity of a local user (MB)' + } + }, + + remoteDriveCapacityMb: { + validator: $.num.optional.min(0), + desc: { + 'ja-JP': 'リモートユーザーひとりあたりのドライブ容量 (メガバイト単位)', + 'en-US': 'Drive capacity of a remote user (MB)' + } + }, } }; @@ -104,6 +120,14 @@ export default define(meta, (ps) => new Promise(async (res, rej) => { set.maxNoteTextLength = ps.maxNoteTextLength; } + if (ps.localDriveCapacityMb !== undefined) { + set.localDriveCapacityMb = ps.localDriveCapacityMb; + } + + if (ps.remoteDriveCapacityMb !== undefined) { + set.remoteDriveCapacityMb = ps.remoteDriveCapacityMb; + } + await Meta.update({}, { $set: set }, { upsert: true }); |