-
-
{{ plugin.name }}v{{ plugin.version }}
+
+
+ {{ plugin.name }}v{{ plugin.version }}
+ {{ i18n.ts.makeActive }}
+
-
{{ i18n.ts.makeActive }}
-
-
- {{ i18n.ts.author }}
- {{ plugin.author }}
-
-
- {{ i18n.ts.description }}
- {{ plugin.description }}
-
-
- {{ i18n.ts.permission }}
- {{ plugin.permission }}
-
+
+
+ {{ i18n.ts.author }}
+ {{ plugin.author }}
+
+
+ {{ i18n.ts.description }}
+ {{ plugin.description }}
+
+
+ {{ i18n.ts.permission }}
+
+
+ - {{ i18n.ts._permissions[permission] }}
+ - {{ i18n.ts.none }}
+
+
+
+
{{ i18n.ts.settings }}
{{ i18n.ts.uninstall }}
+
+
+
+ {{ i18n.ts._plugin.viewSource }}
+
+
+
+ {{ 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;
diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts
index 16483f0cf7..8a7ee62eff 100644
--- a/packages/frontend/src/store.ts
+++ b/packages/frontend/src/store.ts
@@ -381,6 +381,9 @@ export type Plugin = {
src: string | null;
version: string;
ast: any[];
+ author?: string;
+ description?: string;
+ permissions?: string[];
};
interface Watcher {