Skip to content

Commit

Permalink
ステータスページURLとサマリDirectAccessを変更できない問題を修正 (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 authored Nov 30, 2024
1 parent e6eec4c commit a183fe0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/backend/src/server/api/endpoints/admin/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
urlPreviewDirectSummalyProxy: {
type: 'boolean',
optional: false, nullable: false,
},
federation: {
type: 'string',
optional: false, nullable: false,
Expand Down
1 change: 1 addition & 0 deletions packages/cherrypick-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5643,6 +5643,7 @@ export type operations = {
urlPreviewRequireContentLength: boolean;
urlPreviewUserAgent: string | null;
urlPreviewSummaryProxyUrl: string | null;
urlPreviewDirectSummalyProxy: boolean;
federation: string;
federationHosts: string[];
doNotSendNotificationEmailsForAbuseReport: boolean;
Expand Down
14 changes: 9 additions & 5 deletions packages/frontend/src/pages/admin/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #prefix><i class="ti ti-link"></i></template>
</MkInput>

<MkInput v-model="statusUrl" type="url">
<template #label>{{ i18n.ts.statusUrl }}</template>
<MkInput v-model="infoForm.state.statusUrl" type="url">
<template #label>{{ i18n.ts.statusUrl }}<span v-if="infoForm.modifiedStates.statusUrl" class="_modified">{{ i18n.ts.modified }}</span></template>
<template #prefix><i class="ti ti-link"></i></template>
</MkInput>
</div>
Expand Down Expand Up @@ -173,11 +173,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="urlPreviewForm.state.urlPreviewEnabled">
<template #label>{{ i18n.ts._urlPreviewSetting.enable }}<span v-if="urlPreviewForm.modifiedStates.urlPreviewEnabled" class="_modified">{{ i18n.ts.modified }}</span></template>
</MkSwitch>
<MkSwitch v-model="urlPreviewDirectSummalyProxy">
<template #label>DirectAccess</template>
</MkSwitch>

<template v-if="urlPreviewForm.state.urlPreviewEnabled">
<MkSwitch v-model="urlPreviewForm.state.urlPreviewDirectSummalyProxy">
<template #label>DirectAccess<span v-if="urlPreviewForm.modifiedStates.urlPreviewDirectSummalyProxy" class="_modified">{{ i18n.ts.modified }}</span></template>
</MkSwitch>
<MkSwitch v-model="urlPreviewForm.state.urlPreviewRequireContentLength">
<template #label>{{ i18n.ts._urlPreviewSetting.requireContentLength }}<span v-if="urlPreviewForm.modifiedStates.urlPreviewRequireContentLength" class="_modified">{{ i18n.ts.modified }}</span></template>
<template #caption>{{ i18n.ts._urlPreviewSetting.requireContentLengthDescription }}</template>
Expand Down Expand Up @@ -312,6 +312,7 @@ const infoForm = useForm({
inquiryUrl: meta.inquiryUrl ?? '',
repositoryUrl: meta.repositoryUrl ?? '',
impressumUrl: meta.impressumUrl ?? '',
statusUrl: meta.statusUrl ?? '',
}, async (state) => {
await os.apiWithDialog('admin/update-meta', {
name: state.name,
Expand All @@ -324,6 +325,7 @@ const infoForm = useForm({
inquiryUrl: state.inquiryUrl,
repositoryUrl: state.repositoryUrl,
impressumUrl: state.impressumUrl,
statusUrl: state.statusUrl,
});
fetchInstance(true);
});
Expand Down Expand Up @@ -377,6 +379,7 @@ const urlPreviewForm = useForm({
urlPreviewRequireContentLength: meta.urlPreviewRequireContentLength,
urlPreviewUserAgent: meta.urlPreviewUserAgent ?? '',
urlPreviewSummaryProxyUrl: meta.urlPreviewSummaryProxyUrl ?? '',
urlPreviewDirectSummalyProxy: meta.urlPreviewDirectSummalyProxy,
}, async (state) => {
await os.apiWithDialog('admin/update-meta', {
urlPreviewEnabled: state.urlPreviewEnabled,
Expand All @@ -385,6 +388,7 @@ const urlPreviewForm = useForm({
urlPreviewRequireContentLength: state.urlPreviewRequireContentLength,
urlPreviewUserAgent: state.urlPreviewUserAgent,
urlPreviewSummaryProxyUrl: state.urlPreviewSummaryProxyUrl,
urlPreviewDirectSummalyProxy: state.urlPreviewDirectSummalyProxy,
});
fetchInstance(true);
});
Expand Down

0 comments on commit a183fe0

Please sign in to comment.