enhance(frontend): 外部サイトへのリンクは移動の前に警告を表示するように (MisskeyIO#558)
This commit is contained in:
parent
722f01c4e7
commit
01ec286f3f
15 changed files with 141 additions and 7 deletions
|
@ -0,0 +1,11 @@
|
|||
export class ExternalWebsiteWarn1711008460816 {
|
||||
name = 'ExternalWebsiteWarn1711008460816'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "wellKnownWebsites" character varying(3072) array NOT NULL DEFAULT '{}'`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "wellKnownWebsites"`);
|
||||
}
|
||||
}
|
|
@ -99,6 +99,7 @@ export class MetaEntityService {
|
|||
imageUrl: ad.imageUrl,
|
||||
dayOfWeek: ad.dayOfWeek,
|
||||
})),
|
||||
wellKnownWebsites: instance.wellKnownWebsites,
|
||||
notesPerOneAd: instance.notesPerOneAd,
|
||||
enableEmail: instance.enableEmail,
|
||||
enableServiceWorker: instance.enableServiceWorker,
|
||||
|
|
|
@ -594,6 +594,11 @@ export class MiMeta {
|
|||
})
|
||||
public notesPerOneAd: number;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 3072, array: true, default: '{}',
|
||||
})
|
||||
public wellKnownWebsites: string[];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 3072, array: true, default: '{}',
|
||||
})
|
||||
|
|
|
@ -183,6 +183,14 @@ export const packedMetaLiteSchema = {
|
|||
},
|
||||
},
|
||||
},
|
||||
wellKnownWebsites: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
notesPerOneAd: {
|
||||
type: 'number',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
@ -381,9 +381,17 @@ export const meta = {
|
|||
type: 'number',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
wellKnownWebsites: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
urlPreviewDenyList: {
|
||||
type: 'array',
|
||||
optional: true, nullable: false,
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
|
@ -602,6 +610,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
perRemoteUserUserTimelineCacheMax: instance.perRemoteUserUserTimelineCacheMax,
|
||||
perUserHomeTimelineCacheMax: instance.perUserHomeTimelineCacheMax,
|
||||
perUserListTimelineCacheMax: instance.perUserListTimelineCacheMax,
|
||||
wellKnownWebsites: instance.wellKnownWebsites,
|
||||
notesPerOneAd: instance.notesPerOneAd,
|
||||
urlPreviewDenyList: instance.urlPreviewDenyList,
|
||||
featuredGameChannels: instance.featuredGameChannels,
|
||||
|
|
|
@ -155,6 +155,11 @@ export const paramDef = {
|
|||
type: 'string',
|
||||
},
|
||||
},
|
||||
wellKnownWebsites: {
|
||||
type: 'array', nullable: true, items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
urlPreviewDenyList: {
|
||||
type: 'array', nullable: true, items: {
|
||||
type: 'string',
|
||||
|
@ -220,6 +225,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}).map(x => x.toLowerCase());
|
||||
}
|
||||
|
||||
if (Array.isArray(ps.wellKnownWebsites)) {
|
||||
set.wellKnownWebsites = ps.wellKnownWebsites.filter(Boolean);
|
||||
}
|
||||
|
||||
if (Array.isArray(ps.urlPreviewDenyList)) {
|
||||
set.urlPreviewDenyList = ps.urlPreviewDenyList.filter(Boolean);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue