- {{ i18n.ts.copy }}
+ {{ i18n.ts.copy }}
@@ -74,6 +87,7 @@ import { ColdDeviceStorage } from '@/store.js';
import { unisonReload } from '@/scripts/unison-reload.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
+import { pluginLogs } from '@/plugin.js';
const plugins = ref(ColdDeviceStorage.get('plugins'));
@@ -87,8 +101,8 @@ async function uninstall(plugin) {
});
}
-function copy(plugin) {
- copyToClipboard(plugin.src ?? '');
+function copy(text) {
+ copyToClipboard(text ?? '');
os.success();
}
diff --git a/packages/frontend/src/plugin.ts b/packages/frontend/src/plugin.ts
index 743cadc36a..81233a5a5e 100644
--- a/packages/frontend/src/plugin.ts
+++ b/packages/frontend/src/plugin.ts
@@ -3,6 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+import { ref } from 'vue';
import { Interpreter, Parser, utils, values } from '@syuilo/aiscript';
import { aiScriptReadline, createAiScriptEnv } from '@/scripts/aiscript/api.js';
import { inputText } from '@/os.js';
@@ -10,6 +11,7 @@ import { Plugin, noteActions, notePostInterruptors, noteViewInterruptors, postFo
const parser = new Parser();
const pluginContexts = new Map
();
+export const pluginLogs = ref(new Map());
export async function install(plugin: Plugin): Promise {
// 後方互換性のため
@@ -22,21 +24,27 @@ export async function install(plugin: Plugin): Promise {
in: aiScriptReadline,
out: (value): void => {
console.log(value);
+ pluginLogs.value.get(plugin.id).push(utils.reprValue(value));
},
log: (): void => {
},
+ err: (err): void => {
+ pluginLogs.value.get(plugin.id).push(`${err}`);
+ throw err; // install時のtry-catchに反応させる
+ },
});
initPlugin({ plugin, aiscript });
- try {
- await aiscript.exec(parser.parse(plugin.src));
- } catch (err) {
- console.error('Plugin install failed:', plugin.name, 'v' + plugin.version);
- return;
- }
-
- console.info('Plugin installed:', plugin.name, 'v' + plugin.version);
+ aiscript.exec(parser.parse(plugin.src)).then(
+ () => {
+ console.info('Plugin installed:', plugin.name, 'v' + plugin.version);
+ },
+ (err) => {
+ console.error('Plugin install failed:', plugin.name, 'v' + plugin.version);
+ throw err;
+ },
+ );
}
function createPluginEnv(opts: { plugin: Plugin; storageKey: string }): Record {
@@ -92,6 +100,7 @@ function createPluginEnv(opts: { plugin: Plugin; storageKey: string }): Record
Date: Fri, 15 Mar 2024 22:02:57 +0900
Subject: fix(general):
`flash/create`でPlayの公開範囲を指定できない問題の修正と編集画面の調整
(#13574)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(backend): param `visibility` wasn't included in `flash/create`
* fix(frontend): tweak flash editor ui
* Update CHANGELOG.md
---
CHANGELOG.md | 2 +-
locales/index.d.ts | 4 ++++
locales/ja-JP.yml | 1 +
packages/backend/src/server/api/endpoints/flash/create.ts | 2 ++
packages/frontend/src/pages/flash/flash-edit.vue | 14 ++++++++------
packages/misskey-js/src/autogen/types.ts | 5 +++++
6 files changed, 21 insertions(+), 7 deletions(-)
(limited to 'packages/frontend/src')
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f1e863a8f2..fa56f1a268 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,7 @@
## Unreleased
### General
--
+- Fix: Play作成時に設定した公開範囲が機能していない問題を修正
### Client
- Enhance: 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるように
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 87065e1d37..7f4ec7ecb0 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -8635,6 +8635,10 @@ export interface Locale extends ILocale {
* 説明
*/
"summary": string;
+ /**
+ * 非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。
+ */
+ "visibilityDescription": string;
};
"_pages": {
/**
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index f42fd6587a..8b44ac2121 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -2280,6 +2280,7 @@ _play:
title: "タイトル"
script: "スクリプト"
summary: "説明"
+ visibilityDescription: "非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。"
_pages:
newPage: "ページの作成"
diff --git a/packages/backend/src/server/api/endpoints/flash/create.ts b/packages/backend/src/server/api/endpoints/flash/create.ts
index 584d167a29..361496e17e 100644
--- a/packages/backend/src/server/api/endpoints/flash/create.ts
+++ b/packages/backend/src/server/api/endpoints/flash/create.ts
@@ -44,6 +44,7 @@ export const paramDef = {
permissions: { type: 'array', items: {
type: 'string',
} },
+ visibility: { type: 'string', enum: ['public', 'private'], default: 'public' },
},
required: ['title', 'summary', 'script', 'permissions'],
} as const;
@@ -66,6 +67,7 @@ export default class extends Endpoint { // eslint-
summary: ps.summary,
script: ps.script,
permissions: ps.permissions,
+ visibility: ps.visibility,
}).then(x => this.flashsRepository.findOneByOrFail(x.identifiers[0]));
return await this.flashEntityService.pack(flash);
diff --git a/packages/frontend/src/pages/flash/flash-edit.vue b/packages/frontend/src/pages/flash/flash-edit.vue
index 4418172e62..3625bc1164 100644
--- a/packages/frontend/src/pages/flash/flash-edit.vue
+++ b/packages/frontend/src/pages/flash/flash-edit.vue
@@ -18,16 +18,17 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts._play.script }}
-
- {{ i18n.ts.save }}
- {{ i18n.ts.show }}
- {{ i18n.ts.delete }}
-
{{ i18n.ts.visibility }}
+ {{ i18n.ts._play.visibilityDescription }}
+
+ {{ i18n.ts.save }}
+ {{ i18n.ts.show }}
+ {{ i18n.ts.delete }}
+
@@ -367,7 +368,7 @@ const props = defineProps<{
}>();
const flash = ref