refactor(frontend): 非推奨となったReactivity Transformを使わないように (#12539)
* refactor(frontend): 非推奨となったReactivity Transformを使わないように * refactor: 不要な括弧を除去 * fix: 不要なアノテーションを除去 * fix: Refの配列をrefしている部分の対応 * refactor: 不要な括弧を除去 * fix: lint * refactor: Ref、ShallowRef、ComputedRefの変数の宣言をletからconstに置換 * fix: type error * chore: drop reactivity transform from eslint configuration * refactor: remove unnecessary import * fix: 対応漏れ
This commit is contained in:
		| @@ -94,7 +94,7 @@ SPDX-License-Identifier: AGPL-3.0-only | ||||
| </template> | ||||
|  | ||||
| <script lang="ts" setup> | ||||
| import { } from 'vue'; | ||||
| import { ref, computed } from 'vue'; | ||||
| import JSON5 from 'json5'; | ||||
| import XHeader from './_header_.vue'; | ||||
| import MkSwitch from '@/components/MkSwitch.vue'; | ||||
| @@ -111,55 +111,55 @@ import MkButton from '@/components/MkButton.vue'; | ||||
| import MkColorInput from '@/components/MkColorInput.vue'; | ||||
| import { host } from '@/config.js'; | ||||
|  | ||||
| let iconUrl: string | null = $ref(null); | ||||
| let app192IconUrl: string | null = $ref(null); | ||||
| let app512IconUrl: string | null = $ref(null); | ||||
| let bannerUrl: string | null = $ref(null); | ||||
| let backgroundImageUrl: string | null = $ref(null); | ||||
| let themeColor: any = $ref(null); | ||||
| let defaultLightTheme: any = $ref(null); | ||||
| let defaultDarkTheme: any = $ref(null); | ||||
| let serverErrorImageUrl: string | null = $ref(null); | ||||
| let infoImageUrl: string | null = $ref(null); | ||||
| let notFoundImageUrl: string | null = $ref(null); | ||||
| let manifestJsonOverride: string = $ref('{}'); | ||||
| const iconUrl = ref<string | null>(null); | ||||
| const app192IconUrl = ref<string | null>(null); | ||||
| const app512IconUrl = ref<string | null>(null); | ||||
| const bannerUrl = ref<string | null>(null); | ||||
| const backgroundImageUrl = ref<string | null>(null); | ||||
| const themeColor = ref<any>(null); | ||||
| const defaultLightTheme = ref<any>(null); | ||||
| const defaultDarkTheme = ref<any>(null); | ||||
| const serverErrorImageUrl = ref<string | null>(null); | ||||
| const infoImageUrl = ref<string | null>(null); | ||||
| const notFoundImageUrl = ref<string | null>(null); | ||||
| const manifestJsonOverride = ref<string>('{}'); | ||||
|  | ||||
| async function init() { | ||||
| 	const meta = await os.api('admin/meta'); | ||||
| 	iconUrl = meta.iconUrl; | ||||
| 	app192IconUrl = meta.app192IconUrl; | ||||
| 	app512IconUrl = meta.app512IconUrl; | ||||
| 	bannerUrl = meta.bannerUrl; | ||||
| 	backgroundImageUrl = meta.backgroundImageUrl; | ||||
| 	themeColor = meta.themeColor; | ||||
| 	defaultLightTheme = meta.defaultLightTheme; | ||||
| 	defaultDarkTheme = meta.defaultDarkTheme; | ||||
| 	serverErrorImageUrl = meta.serverErrorImageUrl; | ||||
| 	infoImageUrl = meta.infoImageUrl; | ||||
| 	notFoundImageUrl = meta.notFoundImageUrl; | ||||
| 	manifestJsonOverride = meta.manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON.parse(meta.manifestJsonOverride), null, '\t'); | ||||
| 	iconUrl.value = meta.iconUrl; | ||||
| 	app192IconUrl.value = meta.app192IconUrl; | ||||
| 	app512IconUrl.value = meta.app512IconUrl; | ||||
| 	bannerUrl.value = meta.bannerUrl; | ||||
| 	backgroundImageUrl.value = meta.backgroundImageUrl; | ||||
| 	themeColor.value = meta.themeColor; | ||||
| 	defaultLightTheme.value = meta.defaultLightTheme; | ||||
| 	defaultDarkTheme.value = meta.defaultDarkTheme; | ||||
| 	serverErrorImageUrl.value = meta.serverErrorImageUrl; | ||||
| 	infoImageUrl.value = meta.infoImageUrl; | ||||
| 	notFoundImageUrl.value = meta.notFoundImageUrl; | ||||
| 	manifestJsonOverride.value = meta.manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON.parse(meta.manifestJsonOverride), null, '\t'); | ||||
| } | ||||
|  | ||||
| function save() { | ||||
| 	os.apiWithDialog('admin/update-meta', { | ||||
| 		iconUrl, | ||||
| 		app192IconUrl, | ||||
| 		app512IconUrl, | ||||
| 		bannerUrl, | ||||
| 		backgroundImageUrl, | ||||
| 		themeColor: themeColor === '' ? null : themeColor, | ||||
| 		defaultLightTheme: defaultLightTheme === '' ? null : defaultLightTheme, | ||||
| 		defaultDarkTheme: defaultDarkTheme === '' ? null : defaultDarkTheme, | ||||
| 		infoImageUrl, | ||||
| 		notFoundImageUrl, | ||||
| 		serverErrorImageUrl, | ||||
| 		manifestJsonOverride: manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON5.parse(manifestJsonOverride)), | ||||
| 		iconUrl: iconUrl.value, | ||||
| 		app192IconUrl: app192IconUrl.value, | ||||
| 		app512IconUrl: app512IconUrl.value, | ||||
| 		bannerUrl: bannerUrl.value, | ||||
| 		backgroundImageUrl: backgroundImageUrl.value, | ||||
| 		themeColor: themeColor.value === '' ? null : themeColor.value, | ||||
| 		defaultLightTheme: defaultLightTheme.value === '' ? null : defaultLightTheme.value, | ||||
| 		defaultDarkTheme: defaultDarkTheme.value === '' ? null : defaultDarkTheme.value, | ||||
| 		infoImageUrl: infoImageUrl.value, | ||||
| 		notFoundImageUrl: notFoundImageUrl.value, | ||||
| 		serverErrorImageUrl: serverErrorImageUrl.value, | ||||
| 		manifestJsonOverride: manifestJsonOverride.value === '' ? '{}' : JSON.stringify(JSON5.parse(manifestJsonOverride.value)), | ||||
| 	}).then(() => { | ||||
| 		fetchInstance(); | ||||
| 	}); | ||||
| } | ||||
|  | ||||
| const headerTabs = $computed(() => []); | ||||
| const headerTabs = computed(() => []); | ||||
|  | ||||
| definePageMetadata({ | ||||
| 	title: i18n.ts.branding, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 zyoshoka
					zyoshoka