mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-18 15:25:36 +02:00
enhance(frontend): improve plugin management
This commit is contained in:
@@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</MkCodeEditor>
|
||||
|
||||
<div>
|
||||
<MkButton :disabled="code == null" primary inline @click="install"><i class="ti ti-check"></i> {{ i18n.ts.install }}</MkButton>
|
||||
<MkButton :disabled="code == null || code.trim() === ''" primary inline @click="install"><i class="ti ti-check"></i> {{ i18n.ts.install }}</MkButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -23,11 +23,12 @@ import MkCodeEditor from '@/components/MkCodeEditor.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import FormInfo from '@/components/MkInfo.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { unisonReload } from '@/utility/unison-reload.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/utility/page-metadata.js';
|
||||
import { installPlugin } from '@/plugin.js';
|
||||
import { useRouter } from '@/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
const code = ref<string | null>(null);
|
||||
|
||||
async function install() {
|
||||
@@ -36,6 +37,9 @@ async function install() {
|
||||
try {
|
||||
await installPlugin(code.value);
|
||||
os.success();
|
||||
code.value = null;
|
||||
|
||||
router.push('/settings/plugin');
|
||||
} catch (err) {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
|
||||
Reference in New Issue
Block a user