mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-24 19:39:27 +08:00
ref: ini
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="dev-container">
|
||||
<div class="dev-detail" v-if="devPlugins.length">
|
||||
<div class="dev-detail" v-if="devPlugin.length">
|
||||
<a-menu v-model="currentSelect" style="width: 256px; height: 100%" mode="vertical">
|
||||
<a-menu-item @click="currentSelect = [index]" v-for="(plugin, index) in devPlugins" :key="index">
|
||||
<a-menu-item @click="currentSelect = [index]" v-for="(plugin, index) in devPlugin" :key="index">
|
||||
<div>{{ plugin.pluginName }}</div>
|
||||
<div>{{ plugin.description }}</div>
|
||||
</a-menu-item>
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a-switch />
|
||||
<a-switch :checked="pluginDetail.status" @change="devPluginStatusChange(pluginDetail)" />
|
||||
</div>
|
||||
</div>
|
||||
<a-tabs default-active-key="1">
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="desc-item">
|
||||
<div class="desc-title">
|
||||
<p>重新加载</p>
|
||||
<a-button type="link">重载</a-button>
|
||||
<a-button type="link" @click="reloadDevPlugin(pluginDetail)">重载</a-button>
|
||||
</div>
|
||||
<div class="desc-info">
|
||||
如果你修改了plugin.json文件需要重新加载以应用最近版本
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="desc-item">
|
||||
<div class="desc-title">
|
||||
<p>发布</p>
|
||||
<a-button type="link">发布</a-button>
|
||||
<a-button @click="release(pluginDetail)" type="link">发布</a-button>
|
||||
</div>
|
||||
<div class="desc-info">
|
||||
发布后用户可以通过插件中心下载,且享受最新的更新
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="desc-item">
|
||||
<div class="desc-title">
|
||||
<p>删除</p>
|
||||
<a-button type="link">删除</a-button>
|
||||
<a-button type="link" @click="deleteDevPlugin(pluginDetail)">删除</a-button>
|
||||
</div>
|
||||
<div class="desc-info">
|
||||
删除这个插件不可以恢复
|
||||
@@ -61,22 +61,50 @@
|
||||
</a-tabs>
|
||||
</div>
|
||||
</div>
|
||||
<div class="empty" v-else>
|
||||
<a-empty description="暂无开发中的插件" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex';
|
||||
import {mapState, mapMutations, mapActions} from 'vuex';
|
||||
import api from "../../../assets/api";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentSelect: [0]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations('main', ['deleteDevPlugin', 'devPluginStatusChange']),
|
||||
...mapActions('main', ['releasePlugin', 'reloadDevPlugin']),
|
||||
release(plugin) {
|
||||
if (!plugin.author) return this.$message.error('请填写作者!');
|
||||
if (!plugin.status) return this.$message.error('请开启插件!');
|
||||
api.plugin.add({
|
||||
pluginName: plugin.pluginName,
|
||||
author: plugin.author,
|
||||
logo: plugin.logo,
|
||||
gitUrl: plugin.gitUrl,
|
||||
title: plugin.title,
|
||||
description: plugin.description,
|
||||
version: plugin.version,
|
||||
name: plugin.name
|
||||
}).then(res => {
|
||||
this.$message.success('发布成功!')
|
||||
}).catch(e => {
|
||||
this.$message.error(e);
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('main', ['devPlugins']),
|
||||
pluginDetail() {
|
||||
console.log(this.$store)
|
||||
return this.devPlugins[this.currentSelect]
|
||||
return this.devPlugin[this.currentSelect]
|
||||
},
|
||||
devPlugin() {
|
||||
return this.devPlugins.filter(plugin => plugin.type === 'dev')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,5 +149,8 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty {
|
||||
padding-top: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user