From 282caa0b7ed23a93b1ce15a4dd570ae20833d803 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 20 Mar 2025 12:36:48 +0900
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20for=20install-extensions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
locales/index.d.ts | 12 +-
locales/ja-JP.yml | 3 +-
.../src/components/MkExtensionInstaller.vue | 136 +++++++++++-------
.../frontend/src/pages/install-extensions.vue | 23 ++-
4 files changed, 101 insertions(+), 73 deletions(-)
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 0c6e73aac4..2ac82edd37 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -5354,6 +5354,10 @@ export interface Locale extends ILocale {
* 文字数
*/
"textCount": string;
+ /**
+ * 情報
+ */
+ "information": string;
"_emojiPalette": {
/**
* パレット
@@ -10359,20 +10363,12 @@ export interface Locale extends ILocale {
* このプラグインをインストールしますか?
*/
"title": string;
- /**
- * プラグイン情報
- */
- "metaTitle": string;
};
"_theme": {
/**
* このテーマをインストールしますか?
*/
"title": string;
- /**
- * テーマ情報
- */
- "metaTitle": string;
};
"_meta": {
/**
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index d6af72ab57..35f368d3ed 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1334,6 +1334,7 @@ paste: "ペースト"
emojiPalette: "絵文字パレット"
postForm: "投稿フォーム"
textCount: "文字数"
+information: "情報"
_emojiPalette:
palettes: "パレット"
@@ -2749,10 +2750,8 @@ _externalResourceInstaller:
checkVendorBeforeInstall: "配布元が信頼できるかを確認した上でインストールしてください。"
_plugin:
title: "このプラグインをインストールしますか?"
- metaTitle: "プラグイン情報"
_theme:
title: "このテーマをインストールしますか?"
- metaTitle: "テーマ情報"
_meta:
base: "基本のカラースキーム"
_vendorInfo:
diff --git a/packages/frontend/src/components/MkExtensionInstaller.vue b/packages/frontend/src/components/MkExtensionInstaller.vue
index b8a0fab2f4..a2247d844b 100644
--- a/packages/frontend/src/components/MkExtensionInstaller.vue
+++ b/packages/frontend/src/components/MkExtensionInstaller.vue
@@ -11,54 +11,91 @@ SPDX-License-Identifier: AGPL-3.0-only
-
{{ i18n.ts._externalResourceInstaller[`_${extension.type}`].title }}
- {{ i18n.ts._externalResourceInstaller.checkVendorBeforeInstall }}
- {{ i18n.ts._plugin.installWarn }}
-
- {{ i18n.ts._externalResourceInstaller[`_${extension.type}`].metaTitle }}
-
-
-
- {{ i18n.ts.name }}
- {{ extension.meta.name }}
-
-
- {{ i18n.ts.author }}
- {{ extension.meta.author }}
-
-
-
- {{ i18n.ts.description }}
- {{ extension.meta.description ?? i18n.ts.none }}
-
-
- {{ i18n.ts.version }}
- {{ extension.meta.version }}
-
-
- {{ i18n.ts.permission }}
-
-
- - {{ i18n.ts._permissions[permission] }}
-
- {{ i18n.ts.none }}
-
-
-
- {{ i18n.ts._externalResourceInstaller._meta.base }}
- {{ i18n.ts[extension.meta.base ?? 'none'] }}
-
-
-
- {{ i18n.ts._plugin.viewSource }}
-
-
-
-
+ {{ i18n.ts._externalResourceInstaller._plugin.title }}
+ {{ i18n.ts._externalResourceInstaller._theme.title }}
+
+ {{ i18n.ts._externalResourceInstaller.checkVendorBeforeInstall }}
+
+
+
+
+ {{ i18n.ts.metadata }}
+
+
+
+
+ {{ i18n.ts.name }}
+ {{ extension.meta.name }}
+
+
+ {{ i18n.ts.author }}
+ {{ extension.meta.author }}
+
+
+
+ {{ i18n.ts.description }}
+ {{ extension.meta.description ?? i18n.ts.none }}
+
+
+ {{ i18n.ts.version }}
+ {{ extension.meta.version }}
+
+
+ {{ i18n.ts.permission }}
+
+
+ - {{ i18n.ts._permissions[permission] }}
+
+ {{ i18n.ts.none }}
+
+
+
+
+
+
+
+ {{ i18n.ts._plugin.viewSource }}
+
+
+
+
+
+
+
+ {{ i18n.ts.metadata }}
+
+
+
+
+ {{ i18n.ts.name }}
+ {{ extension.meta.name }}
+
+
+ {{ i18n.ts.author }}
+ {{ extension.meta.author }}
+
+
+
+ {{ i18n.ts._externalResourceInstaller._meta.base }}
+ {{ i18n.ts[extension.meta.base ?? 'none'] }}
+
+
+
+
+
+
+ {{ i18n.ts._theme.code }}
+
+
+
+
+
+
- {{ i18n.ts.install }}
+ {{ i18n.ts.cancel }}
+ {{ i18n.ts.install }}
@@ -105,6 +142,7 @@ const props = defineProps<{
const emits = defineEmits<{
(ev: 'confirm'): void;
+ (ev: 'cancel'): void;
}>();
@@ -112,13 +150,13 @@ const emits = defineEmits<{
.extInstallerRoot {
border-radius: var(--MI-radius);
background: var(--MI_THEME-panel);
- padding: 1.5rem;
+ padding: 20px;
}
.extInstallerIconWrapper {
width: 48px;
height: 48px;
- font-size: 24px;
+ font-size: 20px;
line-height: 48px;
text-align: center;
border-radius: 50%;
@@ -135,10 +173,6 @@ const emits = defineEmits<{
margin: 0;
}
-.extInstallerNormDesc {
- text-align: center;
-}
-
.extInstallerKVList {
margin-top: 0;
margin-bottom: 0;
diff --git a/packages/frontend/src/pages/install-extensions.vue b/packages/frontend/src/pages/install-extensions.vue
index 95f8c878c9..3f4a846586 100644
--- a/packages/frontend/src/pages/install-extensions.vue
+++ b/packages/frontend/src/pages/install-extensions.vue
@@ -6,12 +6,11 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
-
+
- {{ i18n.ts._externalResourceInstaller._vendorInfo.title }}
{{ i18n.ts._externalResourceInstaller._vendorInfo.endpoint }}
@@ -35,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ errorKV?.title }}
{{ errorKV?.description }}
- {{ i18n.ts.goBack }}
+ {{ i18n.ts.close }}
{{ i18n.ts.goToMisskey }}
@@ -75,8 +74,8 @@ const hash = ref(null);
const data = ref(null);
-function goBack(): void {
- history.back();
+function close(): void {
+ window.close();
}
function goToMisskey(): void {
@@ -207,9 +206,9 @@ async function install() {
try {
await installPlugin(data.value.raw, data.value.meta as AiScriptPluginMeta);
os.success();
- nextTick(() => {
- unisonReload('/');
- });
+ window.setTimeout(() => {
+ close();
+ }, 3000);
} catch (err) {
errorKV.value = {
title: i18n.ts._externalResourceInstaller._errors._pluginInstallFailed.title,
@@ -223,9 +222,9 @@ async function install() {
if (!data.value.meta) return;
await installTheme(data.value.raw);
os.success();
- nextTick(() => {
- location.href = '/settings/theme';
- });
+ window.setTimeout(() => {
+ close();
+ }, 3000);
}
}