ドライブ容量の設定をDBに保存するようにしたりリファクタリングしたり
This commit is contained in:
		| @@ -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 }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo