Skip to content

Commit

Permalink
feat(market): support preview flag for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 13, 2023
1 parent 6aa6761 commit ac19911
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/market/client/deps/install.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ const data = computed(() => {
})
const danger = computed(() => {
if (!workspace.value && store.market?.data[active.value]?.insecure) {
return '警告:从此插件的最新版本中检测出含有兼容性较差的依赖。安装或升级此插件可能导致后续升级时出现严重问题。'
}
if (workspace.value || !store.market?.data[active.value]?.insecure) return
return '警告:从此插件的最新版本中检测出安全性问题。安装或升级此插件可能导致严重问题。'
})
const warning = computed(() => {
Expand Down
2 changes: 2 additions & 0 deletions packages/market/client/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import CategoryTool from './category/tool.vue'
import Balance from './market/balance.vue'
import Download from './market/download.vue'
import Insecure from './market/insecure.vue'
import Preview from './market/preview.vue'
import Refresh from './market/refresh.vue'
import StarEmpty from './market/star-empty.vue'
import StarFull from './market/star-full.vue'
Expand Down Expand Up @@ -44,6 +45,7 @@ icons.register('category:tool', CategoryTool)
icons.register('balance', Balance)
icons.register('download', Download)
icons.register('insecure', Insecure)
icons.register('preview', Preview)
icons.register('refresh', Refresh)
icons.register('star-empty', StarEmpty)
icons.register('star-full', StarFull)
Expand Down
5 changes: 5 additions & 0 deletions packages/market/client/icons/market/preview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M507.6 122.8c-2.904-12.09-18.25-16.13-27.04-7.338l-76.55 76.56l-83.1-.0002l0-83.1l76.55-76.56c8.791-8.789 4.75-24.14-7.336-27.04c-23.69-5.693-49.34-6.111-75.92 .2484c-61.45 14.7-109.4 66.9-119.2 129.3C189.8 160.8 192.3 186.7 200.1 210.1l-178.1 178.1c-28.12 28.12-28.12 73.69 0 101.8C35.16 504.1 53.56 512 71.1 512s36.84-7.031 50.91-21.09l178.1-178.1c23.46 7.736 49.31 10.24 76.17 6.004c62.41-9.84 114.6-57.8 129.3-119.2C513.7 172.1 513.3 146.5 507.6 122.8zM80 456c-13.25 0-24-10.75-24-24c0-13.26 10.75-24 24-24s24 10.74 24 24C104 445.3 93.25 456 80 456z"/>
</svg>
</template>
11 changes: 10 additions & 1 deletion packages/market/client/market/package.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
<k-icon name="verified"></k-icon>
</span>
</el-tooltip>
<el-tooltip v-else-if="data.insecure" content="含有不安全的依赖" placement="right">
<el-tooltip v-else-if="data.insecure" content="不安全" placement="right">
<span class="icon insecure">
<k-icon name="insecure"></k-icon>
</span>
</el-tooltip>
<el-tooltip v-else-if="data.manifest.preview" content="开发中" placement="right">
<span class="icon preview">
<k-icon name="preview"></k-icon>
</span>
</el-tooltip>
</h2>
<el-tooltip :content="rating.toFixed(1)" placement="right">
<div class="rating">
Expand Down Expand Up @@ -203,6 +208,10 @@ function formatSize(value: number) {
color: var(--success);
}
.preview {
color: var(--warning);
}
.insecure {
color: var(--danger);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/market/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@koishijs/plugin-market",
"description": "Manage your bots and plugins with console",
"version": "1.8.6",
"version": "1.8.7",
"main": "lib/node/index.js",
"typings": "lib/index.d.ts",
"exports": {
Expand Down Expand Up @@ -66,7 +66,7 @@
"@types/which-pm-runs": "^1.0.0"
},
"dependencies": {
"@koishijs/registry": "^4.3.1",
"@koishijs/registry": "^4.3.2",
"execa": "^5.1.1",
"get-registry": "^1.1.0",
"ns-require": "^1.1.4",
Expand Down

0 comments on commit ac19911

Please sign in to comment.