playの公開範囲を設定できるように
This commit is contained in:
parent
bc3f69df60
commit
b9e1300e19
|
|
@ -680,6 +680,7 @@ createNewClip: "Create new clip"
|
||||||
unclip: "Unclip"
|
unclip: "Unclip"
|
||||||
confirmToUnclipAlreadyClippedNote: "This note is already part of the \"{name}\" clip. Do you want to remove it from this clip instead?"
|
confirmToUnclipAlreadyClippedNote: "This note is already part of the \"{name}\" clip. Do you want to remove it from this clip instead?"
|
||||||
public: "Public"
|
public: "Public"
|
||||||
|
private: "Private"
|
||||||
i18nInfo: "Misskey is being translated into various languages by volunteers. You can help at {link}."
|
i18nInfo: "Misskey is being translated into various languages by volunteers. You can help at {link}."
|
||||||
manageAccessTokens: "Manage access tokens"
|
manageAccessTokens: "Manage access tokens"
|
||||||
accountInfo: "Account Info"
|
accountInfo: "Account Info"
|
||||||
|
|
|
||||||
|
|
@ -683,6 +683,7 @@ export interface Locale {
|
||||||
"unclip": string;
|
"unclip": string;
|
||||||
"confirmToUnclipAlreadyClippedNote": string;
|
"confirmToUnclipAlreadyClippedNote": string;
|
||||||
"public": string;
|
"public": string;
|
||||||
|
"private": string;
|
||||||
"i18nInfo": string;
|
"i18nInfo": string;
|
||||||
"manageAccessTokens": string;
|
"manageAccessTokens": string;
|
||||||
"accountInfo": string;
|
"accountInfo": string;
|
||||||
|
|
|
||||||
|
|
@ -680,6 +680,7 @@ createNewClip: "新しいクリップを作成"
|
||||||
unclip: "クリップ解除"
|
unclip: "クリップ解除"
|
||||||
confirmToUnclipAlreadyClippedNote: "このノートはすでにクリップ「{name}」に含まれています。ノートをこのクリップから除外しますか?"
|
confirmToUnclipAlreadyClippedNote: "このノートはすでにクリップ「{name}」に含まれています。ノートをこのクリップから除外しますか?"
|
||||||
public: "パブリック"
|
public: "パブリック"
|
||||||
|
private: "非公開"
|
||||||
i18nInfo: "Misskeyは有志によって様々な言語に翻訳されています。{link}で翻訳に協力できます。"
|
i18nInfo: "Misskeyは有志によって様々な言語に翻訳されています。{link}で翻訳に協力できます。"
|
||||||
manageAccessTokens: "アクセストークンの管理"
|
manageAccessTokens: "アクセストークンの管理"
|
||||||
accountInfo: "アカウント情報"
|
accountInfo: "アカウント情報"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class PlayVisibility1689102832143 {
|
||||||
|
name = 'PlayVisibility1690796169261'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "public"."flash" ADD "visibility" "page_visibility_enum" NOT NULL DEFAULT 'public'`, undefined);
|
||||||
|
}
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "public"."flash" DROP COLUMN "visibility"`, undefined);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -61,4 +61,11 @@ export class Flash {
|
||||||
default: 0,
|
default: 0,
|
||||||
})
|
})
|
||||||
public likedCount: number;
|
public likedCount: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* public ... 公開
|
||||||
|
* private ... プロフィールには表示しない
|
||||||
|
*/
|
||||||
|
@Column('enum', { enum: ['public', 'private'] })
|
||||||
|
public visibility: 'public' | 'private';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export const paramDef = {
|
||||||
script: { type: 'string' },
|
script: { type: 'string' },
|
||||||
permissions: { type: 'array', items: {
|
permissions: { type: 'array', items: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
} },
|
},
|
||||||
|
},
|
||||||
|
visibility: { type: 'string', enum: ['public', 'private'] },
|
||||||
},
|
},
|
||||||
required: ['flashId', 'title', 'summary', 'script', 'permissions'],
|
required: ['flashId', 'title', 'summary', 'script', 'permissions'],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId)
|
const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId)
|
||||||
.andWhere('flash.userId = :userId', { userId: ps.userId });
|
.andWhere('flash.userId = :userId', { userId: ps.userId })
|
||||||
|
.andWhere('flash.visibility = \'public\'');
|
||||||
|
|
||||||
const pages = await query
|
const flashs = await query
|
||||||
.limit(ps.limit)
|
.limit(ps.limit)
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|
||||||
return await this.flashEntityService.packMany(pages);
|
return await this.flashEntityService.packMany(flashs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<MkButton @click="show"><i class="ti ti-eye"></i> {{ i18n.ts.show }}</MkButton>
|
<MkButton @click="show"><i class="ti ti-eye"></i> {{ i18n.ts.show }}</MkButton>
|
||||||
<MkButton v-if="flash" danger @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
<MkButton v-if="flash" danger @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
|
<MkSelect v-model="visibility">
|
||||||
|
<template #label>{{ i18n.ts.uiLanguage }}</template>
|
||||||
|
<option :key="'public'" :value="'public'">{{ i18n.ts.public }}</option>
|
||||||
|
<option :key="'private'" :value="'private'">{{ i18n.ts.private }}</option>
|
||||||
|
</MkSelect>
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</MkStickyContainer>
|
</MkStickyContainer>
|
||||||
|
|
@ -36,6 +41,7 @@ import { i18n } from '@/i18n';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
import { useRouter } from '@/router';
|
import { useRouter } from '@/router';
|
||||||
|
|
||||||
const PRESET_DEFAULT = `/// @ 0.15.0
|
const PRESET_DEFAULT = `/// @ 0.15.0
|
||||||
|
|
@ -358,7 +364,7 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let flash = $ref(null);
|
let flash = $ref(null);
|
||||||
|
let visibility = $ref("public");
|
||||||
if (props.id) {
|
if (props.id) {
|
||||||
flash = await os.api('flash/show', {
|
flash = await os.api('flash/show', {
|
||||||
flashId: props.id,
|
flashId: props.id,
|
||||||
|
|
@ -402,6 +408,7 @@ async function save() {
|
||||||
summary,
|
summary,
|
||||||
permissions,
|
permissions,
|
||||||
script,
|
script,
|
||||||
|
visibility,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const created = await os.apiWithDialog('flash/create', {
|
const created = await os.apiWithDialog('flash/create', {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue