Feat: タイムライン更新中に広告を挿入 (#11989)

* Feat: タイムライン更新中に広告を挿入

* 翻訳を変更

* Run api extractor

* fix api extractor

* Update locales/ja-JP.yml

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>

* confirm -> mkinfo

* MkInputにmin, maxを指定できるように

* 負の値が指定されたら何もしない

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
かっこかり 2023-10-08 17:56:44 +09:00 committed by GitHub
parent 9240db35f3
commit 4bbfc98883
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 88 additions and 5 deletions

View file

@ -107,6 +107,22 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkInput>
</div>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts._ad.adsSettings }}</template>
<div class="_gaps_m">
<div class="_gaps_s">
<MkInput v-model="notesPerOneAd" min="0" type="number">
<template #label>{{ i18n.ts._ad.notesPerOneAd }}</template>
<template #caption>{{ i18n.ts._ad.setZeroToDisable }}</template>
</MkInput>
<MkInfo v-if="notesPerOneAd > 0 && notesPerOneAd < 20" :warn="true">
{{ i18n.ts._ad.adsTooClose }}
</MkInfo>
</div>
</div>
</FormSection>
</div>
</FormSuspense>
</MkSpacer>
@ -127,6 +143,7 @@ import XHeader from './_header_.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkInput from '@/components/MkInput.vue';
import MkTextarea from '@/components/MkTextarea.vue';
import MkInfo from '@/components/MkInfo.vue';
import FormSection from '@/components/form/section.vue';
import FormSplit from '@/components/form/split.vue';
import FormSuspense from '@/components/form/suspense.vue';
@ -152,6 +169,7 @@ let perLocalUserUserTimelineCacheMax: number = $ref(0);
let perRemoteUserUserTimelineCacheMax: number = $ref(0);
let perUserHomeTimelineCacheMax: number = $ref(0);
let perUserListTimelineCacheMax: number = $ref(0);
let notesPerOneAd: number = $ref(0);
async function init(): Promise<void> {
const meta = await os.api('admin/meta');
@ -171,10 +189,11 @@ async function init(): Promise<void> {
perRemoteUserUserTimelineCacheMax = meta.perRemoteUserUserTimelineCacheMax;
perUserHomeTimelineCacheMax = meta.perUserHomeTimelineCacheMax;
perUserListTimelineCacheMax = meta.perUserListTimelineCacheMax;
notesPerOneAd = meta.notesPerOneAd;
}
function save(): void {
os.apiWithDialog('admin/update-meta', {
async function save(): void {
await os.apiWithDialog('admin/update-meta', {
name,
shortName: shortName === '' ? null : shortName,
description,
@ -191,9 +210,10 @@ function save(): void {
perRemoteUserUserTimelineCacheMax,
perUserHomeTimelineCacheMax,
perUserListTimelineCacheMax,
}).then(() => {
fetchInstance();
notesPerOneAd,
});
fetchInstance();
}
const headerTabs = $computed(() => []);