feat: 非ログイン時に表示されるトップページのスタイルを選択できるように
This commit is contained in:
parent
3b4879133c
commit
3980172243
|
@ -33,6 +33,7 @@
|
|||
- `g` キーを連打する
|
||||
- URLに`?safemode=true`を付ける
|
||||
- PWAのショートカットで Safemode を選択して起動する
|
||||
- Feat: 非ログイン時に表示されるトップページのスタイルを選択できるように
|
||||
- Feat: ページのタブバーを下部に表示できるように
|
||||
- Feat: (実験的)iOSでの触覚フィードバックを有効にできるように
|
||||
- Enhance: 「自動でもっと見る」オプションが有効になり、安定性が向上しました
|
||||
|
|
|
@ -6622,6 +6622,18 @@ export interface Locale extends ILocale {
|
|||
* 現在の一部の設定はリセットされます。
|
||||
*/
|
||||
"restartServerSetupWizardConfirm_text": string;
|
||||
/**
|
||||
* エントランスページのスタイル
|
||||
*/
|
||||
"entrancePageStyle": string;
|
||||
/**
|
||||
* タイムラインを表示する
|
||||
*/
|
||||
"showTimelineForVisitor": string;
|
||||
/**
|
||||
* アクティビティを表示する
|
||||
*/
|
||||
"showActivityiesForVisitor": string;
|
||||
"_userGeneratedContentsVisibilityForVisitor": {
|
||||
/**
|
||||
* 全て公開
|
||||
|
|
|
@ -1683,6 +1683,9 @@ _serverSettings:
|
|||
userGeneratedContentsVisibilityForVisitor_description2: "サーバーで受信したリモートのコンテンツを含め、サーバー内の全てのコンテンツを無条件でインターネットに公開することはリスクが伴います。特に、分散型の特性を知らない閲覧者にとっては、リモートのコンテンツであってもサーバー内で作成されたコンテンツであると誤って認識してしまう可能性があるため、注意が必要です。"
|
||||
restartServerSetupWizardConfirm_title: "サーバーの初期設定ウィザードをやり直しますか?"
|
||||
restartServerSetupWizardConfirm_text: "現在の一部の設定はリセットされます。"
|
||||
entrancePageStyle: "エントランスページのスタイル"
|
||||
showTimelineForVisitor: "タイムラインを表示する"
|
||||
showActivityiesForVisitor: "アクティビティを表示する"
|
||||
|
||||
_userGeneratedContentsVisibilityForVisitor:
|
||||
all: "全て公開"
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export class EntrancePageStyle1755574887486 {
|
||||
name = 'EntrancePageStyle1755574887486'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "clientOptions" jsonb NOT NULL DEFAULT '{}'`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "clientOptions"`);
|
||||
}
|
||||
}
|
|
@ -109,6 +109,7 @@ export class MetaEntityService {
|
|||
maxNoteTextLength: MAX_NOTE_TEXT_LENGTH,
|
||||
defaultLightTheme,
|
||||
defaultDarkTheme,
|
||||
clientOptions: instance.clientOptions,
|
||||
ads: ads.map(ad => ({
|
||||
id: ad.id,
|
||||
url: ad.url,
|
||||
|
|
|
@ -716,6 +716,11 @@ export class MiMeta {
|
|||
default: 90, // days
|
||||
})
|
||||
public remoteNotesCleaningExpiryDaysForEachNotes: number;
|
||||
|
||||
@Column('jsonb', {
|
||||
default: { },
|
||||
})
|
||||
public clientOptions: Record<string, any>;
|
||||
}
|
||||
|
||||
export type SoftwareSuspension = {
|
||||
|
|
|
@ -71,6 +71,10 @@ export const packedMetaLiteSchema = {
|
|||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
clientOptions: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
disableRegistration: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
@ -425,6 +425,10 @@ export const meta = {
|
|||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
clientOptions: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
|
@ -650,6 +654,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
logoImageUrl: instance.logoImageUrl,
|
||||
defaultLightTheme: instance.defaultLightTheme,
|
||||
defaultDarkTheme: instance.defaultDarkTheme,
|
||||
clientOptions: instance.clientOptions,
|
||||
enableEmail: instance.enableEmail,
|
||||
enableServiceWorker: instance.enableServiceWorker,
|
||||
translatorAvailable: instance.deeplAuthKey != null,
|
||||
|
|
|
@ -67,6 +67,7 @@ export const paramDef = {
|
|||
description: { type: 'string', nullable: true },
|
||||
defaultLightTheme: { type: 'string', nullable: true },
|
||||
defaultDarkTheme: { type: 'string', nullable: true },
|
||||
clientOptions: { type: 'object', nullable: false },
|
||||
cacheRemoteFiles: { type: 'boolean' },
|
||||
cacheRemoteSensitiveFiles: { type: 'boolean' },
|
||||
emailRequiredForSignup: { type: 'boolean' },
|
||||
|
@ -326,6 +327,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
set.defaultDarkTheme = ps.defaultDarkTheme;
|
||||
}
|
||||
|
||||
if (ps.clientOptions !== undefined) {
|
||||
set.clientOptions = ps.clientOptions;
|
||||
}
|
||||
|
||||
if (ps.cacheRemoteFiles !== undefined) {
|
||||
set.cacheRemoteFiles = ps.cacheRemoteFiles;
|
||||
}
|
||||
|
|
|
@ -132,6 +132,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div>{{ serverSettings.enableReactionsBuffering ? i18n.ts.yes : i18n.ts.no }}</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div><b>{{ i18n.ts._serverSettings.entrancePageStyle }}:</b></div>
|
||||
<div>{{ serverSettings.clientOptions.entrancePageStyle }}</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div><b>{{ i18n.ts._role.baseRole }}/{{ i18n.ts._role._options.rateLimitFactor }}:</b></div>
|
||||
<div>{{ defaultPolicies.rateLimitFactor }}</div>
|
||||
|
@ -233,6 +238,9 @@ const serverSettings = computed<Misskey.entities.AdminUpdateMetaRequest>(() => {
|
|||
enableFanoutTimeline: true,
|
||||
enableFanoutTimelineDbFallback: q_use.value === 'single',
|
||||
enableReactionsBuffering,
|
||||
clientOptions: {
|
||||
entrancePageStyle: q_use.value === 'open' ? 'classic' : 'simple',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="stats" :class="$style.stats">
|
||||
<div v-if="stats && instance.clientOptions.showActivityiesForVisitor !== false" :class="$style.stats">
|
||||
<div :class="[$style.statsItem, $style.panel]">
|
||||
<div :class="$style.statsItemLabel">{{ i18n.ts.users }}</div>
|
||||
<div :class="$style.statsItemCount"><MkNumber :value="stats.originalUsersCount"/></div>
|
||||
|
@ -40,13 +40,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div :class="$style.statsItemCount"><MkNumber :value="stats.originalNotesCount"/></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="instance.policies.ltlAvailable" :class="[$style.tl, $style.panel]">
|
||||
<div v-if="instance.policies.ltlAvailable && instance.clientOptions.showTimelineForVisitor !== false" :class="[$style.tl, $style.panel]">
|
||||
<div :class="$style.tlHeader">{{ i18n.ts.letsLookAtTimeline }}</div>
|
||||
<div :class="$style.tlBody">
|
||||
<MkStreamingNotesTimeline src="local"/>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="$style.panel">
|
||||
<div v-if="instance.clientOptions.showActivityiesForVisitor !== false" :class="$style.panel">
|
||||
<XActiveUsersChart/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -55,12 +55,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { instanceName } from '@@/js/config.js';
|
||||
import type { MenuItem } from '@/types/menu.js';
|
||||
import XSigninDialog from '@/components/MkSigninDialog.vue';
|
||||
import XSignupDialog from '@/components/MkSignupDialog.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkStreamingNotesTimeline from '@/components/MkStreamingNotesTimeline.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import { instanceName } from '@@/js/config.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
@ -68,13 +69,14 @@ import { instance } from '@/instance.js';
|
|||
import MkNumber from '@/components/MkNumber.vue';
|
||||
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
|
||||
import { openInstanceMenu } from '@/ui/_common_/common.js';
|
||||
import type { MenuItem } from '@/types/menu.js';
|
||||
|
||||
const stats = ref<Misskey.entities.StatsResponse | null>(null);
|
||||
|
||||
misskeyApi('stats', {}).then((res) => {
|
||||
stats.value = res;
|
||||
});
|
||||
if (instance.clientOptions.showActivityiesForVisitor !== false) {
|
||||
misskeyApi('stats', {}).then((res) => {
|
||||
stats.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
function signin() {
|
||||
const { dispose } = os.popup(XSigninDialog, {
|
||||
|
|
|
@ -8,6 +8,26 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div class="_spacer" style="--MI_SPACER-w: 700px; --MI_SPACER-min: 16px; --MI_SPACER-max: 32px;">
|
||||
<SearchMarker path="/admin/branding" :label="i18n.ts.branding" :keywords="['branding']" icon="ti ti-paint">
|
||||
<div class="_gaps_m">
|
||||
<SearchMarker :keywords="['entrance', 'welcome', 'landing', 'front', 'home', 'page', 'style']">
|
||||
<MkRadios v-model="entrancePageStyle">
|
||||
<template #label><SearchLabel>{{ i18n.ts._serverSettings.entrancePageStyle }}</SearchLabel></template>
|
||||
<option value="classic">Classic</option>
|
||||
<option value="simple">Simple</option>
|
||||
</MkRadios>
|
||||
</SearchMarker>
|
||||
|
||||
<SearchMarker :keywords="['timeline']">
|
||||
<MkSwitch v-model="showTimelineForVisitor">
|
||||
<template #label><SearchLabel>{{ i18n.ts._serverSettings.showTimelineForVisitor }}</SearchLabel></template>
|
||||
</MkSwitch>
|
||||
</SearchMarker>
|
||||
|
||||
<SearchMarker :keywords="['activity', 'activities']">
|
||||
<MkSwitch v-model="showActivityiesForVisitor">
|
||||
<template #label><SearchLabel>{{ i18n.ts._serverSettings.showActivityiesForVisitor }}</SearchLabel></template>
|
||||
</MkSwitch>
|
||||
</SearchMarker>
|
||||
|
||||
<SearchMarker :keywords="['icon', 'image']">
|
||||
<MkInput v-model="iconUrl" type="url">
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
|
@ -141,9 +161,14 @@ import { i18n } from '@/i18n.js';
|
|||
import { definePage } from '@/page.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkColorInput from '@/components/MkColorInput.vue';
|
||||
import MkRadios from '@/components/MkRadios.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
|
||||
const entrancePageStyle = ref(meta.clientOptions.entrancePageStyle ?? 'classic');
|
||||
const showTimelineForVisitor = ref(meta.clientOptions.showTimelineForVisitor ?? true);
|
||||
const showActivityiesForVisitor = ref(meta.clientOptions.showActivityiesForVisitor ?? true);
|
||||
const iconUrl = ref(meta.iconUrl);
|
||||
const app192IconUrl = ref(meta.app192IconUrl);
|
||||
const app512IconUrl = ref(meta.app512IconUrl);
|
||||
|
@ -161,6 +186,11 @@ const manifestJsonOverride = ref(meta.manifestJsonOverride === '' ? '{}' : JSON.
|
|||
|
||||
function save() {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
clientOptions: {
|
||||
entrancePageStyle: entrancePageStyle.value,
|
||||
showTimelineForVisitor: showTimelineForVisitor.value,
|
||||
showActivityiesForVisitor: showActivityiesForVisitor.value,
|
||||
},
|
||||
iconUrl: iconUrl.value,
|
||||
app192IconUrl: app192IconUrl.value,
|
||||
app512IconUrl: app512IconUrl.value,
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div v-if="meta" :class="$style.root">
|
||||
<MkFeaturedPhotos :class="$style.bg"/>
|
||||
<div :class="$style.logoWrapper">
|
||||
<div :class="$style.poweredBy">Powered by</div>
|
||||
<img :src="misskeysvg" :class="$style.misskey"/>
|
||||
</div>
|
||||
<div :class="$style.contents">
|
||||
<MkVisitorDashboard/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MkFeaturedPhotos from '@/components/MkFeaturedPhotos.vue';
|
||||
import misskeysvg from '/client-assets/misskey.svg';
|
||||
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
|
||||
import { instance as meta } from '@/instance.js';
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
.root {
|
||||
height: 100cqh;
|
||||
overflow: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 80vw; // 100%からshapeの幅を引いている
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.logoWrapper {
|
||||
position: fixed;
|
||||
top: 36px;
|
||||
left: 36px;
|
||||
flex: auto;
|
||||
color: #fff;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.poweredBy {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.misskey {
|
||||
width: 120px;
|
||||
|
||||
@media (max-width: 450px) {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
.contents {
|
||||
position: relative;
|
||||
width: min(430px, calc(100% - 32px));
|
||||
margin: auto;
|
||||
padding: 100px 0 100px 0;
|
||||
}
|
||||
</style>
|
|
@ -6,16 +6,18 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template>
|
||||
<div v-if="instance">
|
||||
<XSetup v-if="instance.requireSetup"/>
|
||||
<XEntrance v-else/>
|
||||
<XEntranceClassic v-else-if="(instance.clientOptions.entrancePageStyle ?? 'classic') === 'classic'"/>
|
||||
<XEntranceSimple v-else/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import XSetup from './welcome.setup.vue';
|
||||
import XEntrance from './welcome.entrance.a.vue';
|
||||
import { instanceName } from '@@/js/config.js';
|
||||
import XSetup from './welcome.setup.vue';
|
||||
import XEntranceClassic from './welcome.entrance.classic.vue';
|
||||
import XEntranceSimple from './welcome.entrance.simple.vue';
|
||||
import { definePage } from '@/page.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
|
||||
|
|
|
@ -5330,6 +5330,7 @@ export type components = {
|
|||
feedbackUrl: string | null;
|
||||
defaultDarkTheme: string | null;
|
||||
defaultLightTheme: string | null;
|
||||
clientOptions: Record<string, never>;
|
||||
disableRegistration: boolean;
|
||||
emailRequiredForSignup: boolean;
|
||||
enableHcaptcha: boolean;
|
||||
|
@ -9340,6 +9341,7 @@ export interface operations {
|
|||
deeplIsPro: boolean;
|
||||
defaultDarkTheme: string | null;
|
||||
defaultLightTheme: string | null;
|
||||
clientOptions: Record<string, never>;
|
||||
description: string | null;
|
||||
disableRegistration: boolean;
|
||||
impressumUrl: string | null;
|
||||
|
@ -12575,6 +12577,7 @@ export interface operations {
|
|||
description?: string | null;
|
||||
defaultLightTheme?: string | null;
|
||||
defaultDarkTheme?: string | null;
|
||||
clientOptions?: Record<string, never>;
|
||||
cacheRemoteFiles?: boolean;
|
||||
cacheRemoteSensitiveFiles?: boolean;
|
||||
emailRequiredForSignup?: boolean;
|
||||
|
|
Loading…
Reference in New Issue