feat: instance default theme
This commit is contained in:
		
							parent
							
								
									bc9157a03b
								
							
						
					
					
						commit
						ba4ef23d6b
					
				
					 10 changed files with 93 additions and 5 deletions
				
			
		|  | @ -0,0 +1,13 @@ | |||
| export class instanceDefaultTheme1646143552768 { | ||||
|     name = 'instanceDefaultTheme1646143552768' | ||||
| 
 | ||||
|     async up(queryRunner) { | ||||
|         await queryRunner.query(`ALTER TABLE "meta" ADD "defaultLightTheme" character varying(8192)`); | ||||
|         await queryRunner.query(`ALTER TABLE "meta" ADD "defaultDarkTheme" character varying(8192)`); | ||||
|     } | ||||
| 
 | ||||
|     async down(queryRunner) { | ||||
|         await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "defaultDarkTheme"`); | ||||
|         await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "defaultLightTheme"`); | ||||
|     } | ||||
| } | ||||
|  | @ -344,6 +344,20 @@ export class Meta { | |||
| 	}) | ||||
| 	public feedbackUrl: string | null; | ||||
| 
 | ||||
| 	@Column('varchar', { | ||||
| 		length: 8192, | ||||
| 		default: null, | ||||
| 		nullable: true, | ||||
| 	}) | ||||
| 	public defaultLightTheme: string | null; | ||||
| 
 | ||||
| 	@Column('varchar', { | ||||
| 		length: 8192, | ||||
| 		default: null, | ||||
| 		nullable: true, | ||||
| 	}) | ||||
| 	public defaultDarkTheme: string | null; | ||||
| 
 | ||||
| 	@Column('boolean', { | ||||
| 		default: false, | ||||
| 	}) | ||||
|  |  | |||
|  | @ -36,6 +36,8 @@ export const paramDef = { | |||
| 		logoImageUrl: { type: 'string', nullable: true }, | ||||
| 		name: { type: 'string', nullable: true }, | ||||
| 		description: { type: 'string', nullable: true }, | ||||
| 		defaultLightTheme: { type: 'string', nullable: true }, | ||||
| 		defaultDarkTheme: { type: 'string', nullable: true }, | ||||
| 		localDriveCapacityMb: { type: 'integer' }, | ||||
| 		remoteDriveCapacityMb: { type: 'integer' }, | ||||
| 		cacheRemoteFiles: { type: 'boolean' }, | ||||
|  | @ -162,6 +164,14 @@ export default define(meta, paramDef, async (ps, me) => { | |||
| 		set.description = ps.description; | ||||
| 	} | ||||
| 
 | ||||
| 	if (ps.defaultLightTheme !== undefined) { | ||||
| 		set.defaultLightTheme = ps.defaultLightTheme; | ||||
| 	} | ||||
| 
 | ||||
| 	if (ps.defaultDarkTheme !== undefined) { | ||||
| 		set.defaultDarkTheme = ps.defaultDarkTheme; | ||||
| 	} | ||||
| 
 | ||||
| 	if (ps.localDriveCapacityMb !== undefined) { | ||||
| 		set.localDriveCapacityMb = ps.localDriveCapacityMb; | ||||
| 	} | ||||
|  |  | |||
|  | @ -69,6 +69,14 @@ export const meta = { | |||
| 				optional: false, nullable: false, | ||||
| 				default: false, | ||||
| 			}, | ||||
| 			defaultDarkTheme: { | ||||
| 				type: 'string', | ||||
| 				optional: false, nullable: true, | ||||
| 			}, | ||||
| 			defaultLightTheme: { | ||||
| 				type: 'string', | ||||
| 				optional: false, nullable: true, | ||||
| 			}, | ||||
| 			disableRegistration: { | ||||
| 				type: 'boolean', | ||||
| 				optional: false, nullable: false, | ||||
|  | @ -504,6 +512,8 @@ export default define(meta, paramDef, async (ps, me) => { | |||
| 		logoImageUrl: instance.logoImageUrl, | ||||
| 		maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, // 後方互換性のため
 | ||||
| 		emojis: await Emojis.packMany(emojis), | ||||
| 		defaultLightTheme: instance.defaultLightTheme, | ||||
| 		defaultDarkTheme: instance.defaultDarkTheme, | ||||
| 		ads: ads.map(ad => ({ | ||||
| 			id: ad.id, | ||||
| 			url: ad.url, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue