feat: license violation protection (#13285)
* spec(frontend): aboutページにリポジトリ・フィードバックのURLを表示させる Cherry-picked from MisskeyIO#441 Cherry-picked from MisskeyIO#438 * feat: license violation protection * build: fix typo * build: fix typo * fix: farewell to the static type land * fix: key typo * fix: import typo * fix: properly interpret `prominently` * docs: add disclaimer * docs: update CHANGELOG * chore: add gap --------- Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
fa243276c5
commit
acba96c1d3
@@ -76,6 +76,16 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #caption>{{ i18n.ts.instanceDefaultThemeDescription }}</template>
|
||||
</MkTextarea>
|
||||
|
||||
<MkInput v-model="repositoryUrl" type="url">
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
<template #label>{{ i18n.ts.repositoryUrl }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInput v-model="feedbackUrl" type="url">
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
<template #label>{{ i18n.ts.feedbackUrl }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkTextarea v-model="manifestJsonOverride">
|
||||
<template #label>{{ i18n.ts._serverSettings.manifestJsonOverride }}</template>
|
||||
</MkTextarea>
|
||||
@@ -120,6 +130,8 @@ const defaultDarkTheme = ref<string | null>(null);
|
||||
const serverErrorImageUrl = ref<string | null>(null);
|
||||
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 manifestJsonOverride = ref<string>('{}');
|
||||
|
||||
async function init() {
|
||||
@@ -135,6 +147,8 @@ async function init() {
|
||||
serverErrorImageUrl.value = meta.serverErrorImageUrl;
|
||||
infoImageUrl.value = meta.infoImageUrl;
|
||||
notFoundImageUrl.value = meta.notFoundImageUrl;
|
||||
repositoryUrl.value = meta.repositoryUrl;
|
||||
feedbackUrl.value = meta.feedbackUrl;
|
||||
manifestJsonOverride.value = meta.manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON.parse(meta.manifestJsonOverride), null, '\t');
|
||||
}
|
||||
|
||||
@@ -151,6 +165,8 @@ function save() {
|
||||
infoImageUrl: infoImageUrl.value === '' ? null : infoImageUrl.value,
|
||||
notFoundImageUrl: notFoundImageUrl.value === '' ? null : notFoundImageUrl.value,
|
||||
serverErrorImageUrl: serverErrorImageUrl.value === '' ? null : serverErrorImageUrl.value,
|
||||
repositoryUrl: repositoryUrl.value === '' ? null : repositoryUrl.value,
|
||||
feedbackUrl: feedbackUrl.value === '' ? null : feedbackUrl.value,
|
||||
manifestJsonOverride: manifestJsonOverride.value === '' ? '{}' : JSON.stringify(JSON5.parse(manifestJsonOverride.value)),
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
|
@@ -34,6 +34,16 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</MkInput>
|
||||
</FormSplit>
|
||||
|
||||
<MkInput v-model="repositoryUrl" type="url">
|
||||
<template #label>{{ i18n.ts.repositoryUrl }}</template>
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
<template #caption>{{ i18n.ts.repositoryUrlDescription }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInfo v-if="!instance.providesTarball && !repositoryUrl" warn>
|
||||
{{ i18n.ts.repositoryUrlOrTarballRequired }}
|
||||
</MkInfo>
|
||||
|
||||
<MkInput v-model="impressumUrl" type="url">
|
||||
<template #label>{{ i18n.ts.impressumUrl }}</template>
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
@@ -159,7 +169,7 @@ import FormSplit from '@/components/form/split.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { fetchInstance, instance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
@@ -169,6 +179,7 @@ const shortName = ref<string | null>(null);
|
||||
const description = ref<string | null>(null);
|
||||
const maintainerName = ref<string | null>(null);
|
||||
const maintainerEmail = ref<string | null>(null);
|
||||
const repositoryUrl = ref<string | null>(null);
|
||||
const impressumUrl = ref<string | null>(null);
|
||||
const pinnedUsers = ref<string>('');
|
||||
const cacheRemoteFiles = ref<boolean>(false);
|
||||
@@ -191,6 +202,7 @@ async function init(): Promise<void> {
|
||||
description.value = meta.description;
|
||||
maintainerName.value = meta.maintainerName;
|
||||
maintainerEmail.value = meta.maintainerEmail;
|
||||
repositoryUrl.value = meta.repositoryUrl;
|
||||
impressumUrl.value = meta.impressumUrl;
|
||||
pinnedUsers.value = meta.pinnedUsers.join('\n');
|
||||
cacheRemoteFiles.value = meta.cacheRemoteFiles;
|
||||
@@ -214,6 +226,7 @@ async function save(): void {
|
||||
description: description.value,
|
||||
maintainerName: maintainerName.value,
|
||||
maintainerEmail: maintainerEmail.value,
|
||||
repositoryUrl: repositoryUrl.value,
|
||||
impressumUrl: impressumUrl.value,
|
||||
pinnedUsers: pinnedUsers.value.split('\n'),
|
||||
cacheRemoteFiles: cacheRemoteFiles.value,
|
||||
|
Reference in New Issue
Block a user