outsideprismisskey

This commit is contained in:
mattyatea 2024-05-04 23:21:05 +09:00
parent 1a8d91355d
commit 206d7c9a18
6 changed files with 83 additions and 6 deletions

View file

@ -14,6 +14,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #prefix><i class="ti ti-link"></i></template>
<template #label>{{ i18n.ts._serverSettings.iconUrl }}</template>
</MkInput>
<MkInput v-model="iconDark" type="url">
<template #prefix><i class="ti ti-link"></i></template>
<template #label>{{ i18n.ts._serverSettings.iconUrl }} (Dark)</template>
</MkInput>
<MkInput v-model="iconLight" type="url">
<template #prefix><i class="ti ti-link"></i></template>
<template #label>{{ i18n.ts._serverSettings.iconUrl }} (Light)</template>
</MkInput>
<MkInput v-model="app192IconUrl" type="url">
<template #prefix><i class="ti ti-link"></i></template>
@ -41,6 +49,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #prefix><i class="ti ti-link"></i></template>
<template #label>{{ i18n.ts.bannerUrl }}</template>
</MkInput>
<MkInput v-model="bannerDark" type="url">
<template #prefix><i class="ti ti-link"></i></template>
<template #label>{{ i18n.ts.bannerUrl }} (Dark)</template>
</MkInput>
<MkInput v-model="bannerLight" type="url">
<template #prefix><i class="ti ti-link"></i></template>
<template #label>{{ i18n.ts.bannerUrl }} (Light)</template>
</MkInput>
<MkInput v-model="backgroundImageUrl" type="url">
<template #prefix><i class="ti ti-link"></i></template>
@ -132,6 +148,10 @@ const infoImageUrl = ref<string | null>(null);
const notFoundImageUrl = ref<string | null>(null);
const repositoryUrl = ref<string | null>(null);
const feedbackUrl = ref<string | null>(null);
const iconDark = ref<string | null>(null);
const iconLight = ref<string | null>(null);
const bannerDark = ref<string | null>(null);
const bannerLight = ref<string | null>(null);
const manifestJsonOverride = ref<string>('{}');
async function init() {
@ -150,6 +170,10 @@ async function init() {
repositoryUrl.value = meta.repositoryUrl;
feedbackUrl.value = meta.feedbackUrl;
manifestJsonOverride.value = meta.manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON.parse(meta.manifestJsonOverride), null, '\t');
iconDark.value = meta.iconDark;
iconLight.value = meta.iconLight;
bannerDark.value = meta.bannerDark;
bannerLight.value = meta.bannerLight;
}
function save() {
@ -168,6 +192,10 @@ function save() {
repositoryUrl: repositoryUrl.value === '' ? null : repositoryUrl.value,
feedbackUrl: feedbackUrl.value === '' ? null : feedbackUrl.value,
manifestJsonOverride: manifestJsonOverride.value === '' ? '{}' : JSON.stringify(JSON5.parse(manifestJsonOverride.value)),
iconDark: iconDark.value === '' ? null : iconDark.value,
iconLight: iconLight.value === '' ? null : iconLight.value,
bannerDark: bannerDark.value === '' ? null : bannerDark.value,
bannerLight: bannerLight.value === '' ? null : bannerLight.value,
}).then(() => {
fetchInstance(true);
});

View file

@ -9,6 +9,7 @@ import { miLocalStorage } from './local-storage.js';
import type { SoundType } from '@/scripts/sound.js';
import { Storage } from '@/pizzax.js';
import { hemisphere } from '@/scripts/intl-const.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
interface PostFormAction {
title: string,
@ -52,17 +53,14 @@ export type SoundStore = {
volume: number;
}
import { instance } from '@/instance.js';
export const postFormActions: PostFormAction[] = [];
export const userActions: UserAction[] = [];
export const noteActions: NoteAction[] = [];
export const noteViewInterruptors: NoteViewInterruptor[] = [];
export const notePostInterruptors: NotePostInterruptor[] = [];
export const pageViewInterruptors: PageViewInterruptor[] = [];
export const bannerDark = 'https://files.prismisskey.space/misskey/e088c6d1-b07f-4312-8d41-fee2f64071e9.png';
export const bannerLight = 'https://files.prismisskey.space/misskey/85500d2f-41a9-48ff-a737-65d6fdf74604.png';
export const iconDark = 'https://files.prismisskey.space/misskey/484efc68-de41-4786-b2b6-e5085c31c2c4.webp';
export const iconLight = 'https://files.prismisskey.space/misskey/c3d722fe-379f-4c85-9414-90c232d53237.webp';
export const { bannerDark, bannerLight, iconDark, iconLight } = instance;
// TODO: それぞれいちいちwhereとかdefaultというキーを付けなきゃいけないの冗長なのでなんとかする(ただ型定義が面倒になりそう)
// あと、現行の定義の仕方なら「whereが何であるかに関わらずキー名の重複不可」という制約を付けられるメリットもあるからそのメリットを引き継ぐ方法も考えないといけない