Skip to content

Commit

Permalink
Merge pull request #4 from maxpromer/master
Browse files Browse the repository at this point in the history
แก้ปัญหาตาม issues #1 #2 และแก้ไขให้ลบปลั๊กอินได้
  • Loading branch information
Nat Weerawan committed Jul 4, 2019
2 parents 1164346 + 6e6bdf7 commit d9d84ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
9 changes: 1 addition & 8 deletions src/engine/PluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,8 @@ var installOnlinePlugin = function(info, cb) {
};

var removePlugin = function(pluginInfo, isBackupRemove = false) {
if (pluginInfo.board) {
var targetDir = util.boardDir + "/" + pluginInfo.board + "/plugin";
} else if (pluginInfo.platform) {
var targetDir = util.platformDir + "/" + pluginInfo.platform + "/plugin";
} else {
throw "no target defined";
}
return new Promise((resolve, reject) => {
let target = `${targetDir}/${pluginInfo.name}`;
let target = pluginInfo.directory;
if (isBackupRemove) {
target += "-backup-plugin";
}
Expand Down
21 changes: 7 additions & 14 deletions src/engine/components/plugin/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,21 @@
</template>
<v-img contain v-else src="/static/images/noimage.jpg"/>
</v-list-tile-avatar>
<template v-if='data.category.name && typeof(data.category.name) === "string"'>
<template>
<v-list-tile-content class="ml-2">
<v-list-tile-title>
<strong>{{data.category.title}}</strong>
<strong v-if="data.category.title || data.category.name">{{data.category.title ? data.category.title : typeof(data.category.name) === "string" ? data.category.name : typeof(data.category.name.en) === "string" ? data.category.name.en : data.dirName}}</strong>
<strong v-else>{{data.dirName}}</strong>
<span class="body-1">
[ v{{data.category.version}} by {{data.category.author}} ]
[ <a v-if="data.category.git"
@click="openLink(data.category.git)"> git </a> ]
<span v-if='data.category.version || data.category.author'> [ {{data.category.version ? 'v' + data.category.version + ' ' : ''}}{{data.category.author ? 'by ' + data.category.author : ''}} ] </span>
<span v-if='data.category.git'>[ <a @click="openLink(data.category.git)"> git </a> ]</span>
</span>
</v-list-tile-title>
<v-list-tile-sub-title
v-html="data.category.description"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
<template v-else>
<v-list-tile-content class="ml-2">
<strong>Please migrate your json file to use this feature</strong>
<span class="body-1">Plugin : {{data.category.name.en}} <br/>Tutorial : https://kbide.org/tutorials/plugin </span>
</v-list-tile-content>
</template>
<v-list-tile-action
v-if='data.category.name && typeof(data.category.name) === "string"'>
<v-list-tile-action>
<v-btn v-if="data.status != 'UPDATABLE'"
icon fab small dark
class="red"
Expand Down Expand Up @@ -316,7 +309,7 @@
if (res === true) {
console.log("removing plugin : " + name);
let b = this.getPluginByName(name);
pm.removePlugin(b.category).then(() => {
pm.removePlugin(b).then(() => {
this.$global.blockCode = "";
this.$dialog.notify.info("Remove plugin success");
this.listAllPlugins();
Expand Down

0 comments on commit d9d84ab

Please sign in to comment.