From 1924bd20bb294bf2fdec6df922b3ec663102ae7c Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 23 Sep 2023 09:08:14 +0900 Subject: enhance(frontend): プラグインのソースコードを確認・コピーできるように (#11873) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * (add) plugin: view and copy source code * (fix) plugin permission ui * Update Changelog --- packages/frontend/src/pages/settings/plugin.vue | 63 ++++++++++++++++++------- 1 file changed, 46 insertions(+), 17 deletions(-) (limited to 'packages/frontend/src/pages') diff --git a/packages/frontend/src/pages/settings/plugin.vue b/packages/frontend/src/pages/settings/plugin.vue index e9bc8573b3..4a2d8d600e 100644 --- a/packages/frontend/src/pages/settings/plugin.vue +++ b/packages/frontend/src/pages/settings/plugin.vue @@ -10,28 +10,49 @@ SPDX-License-Identifier: AGPL-3.0-only
-
- {{ plugin.name }}v{{ plugin.version }} - - {{ i18n.ts.makeActive }} - - - - - - - - - - - - - +
+
+ {{ plugin.name }}v{{ plugin.version }} + {{ i18n.ts.makeActive }} +
+ +
+ + + + + + + + + + + + +
{{ i18n.ts.settings }} {{ i18n.ts.uninstall }}
+ + + + + +
+
+ {{ i18n.ts.copy }} +
+ + +
+
@@ -44,8 +65,11 @@ import FormLink from '@/components/form/link.vue'; import MkSwitch from '@/components/MkSwitch.vue'; import FormSection from '@/components/form/section.vue'; import MkButton from '@/components/MkButton.vue'; +import MkCode from '@/components/MkCode.vue'; +import MkFolder from '@/components/MkFolder.vue'; import MkKeyValue from '@/components/MkKeyValue.vue'; import * as os from '@/os.js'; +import copyToClipboard from '@/scripts/copy-to-clipboard.js'; import { ColdDeviceStorage } from '@/store.js'; import { unisonReload } from '@/scripts/unison-reload.js'; import { i18n } from '@/i18n.js'; @@ -61,6 +85,11 @@ function uninstall(plugin) { }); } +function copy(plugin) { + copyToClipboard(plugin.src ?? ''); + os.success(); +} + // TODO: この処理をstore側にactionとして移動し、設定画面を開くAiScriptAPIを実装できるようにする async function config(plugin) { const config = plugin.config; -- cgit v1.2.3-freya