-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
444 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<k-card class="page-awesome" title="依赖管理"> | ||
<table> | ||
<tr> | ||
<th>模块名称</th> | ||
<th>当前版本</th> | ||
<th>最新版本</th> | ||
<th>总体积</th> | ||
<th>综合评分</th> | ||
<th class="operation">操作</th> | ||
</tr> | ||
<package-view v-for="data in awesome" :data="data"/> | ||
</table> | ||
</k-card> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import PackageView from './package.vue' | ||
import { awesome } from '~/client' | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<template> | ||
<tr :class="{ workspace: data.local?.isWorkspace }"> | ||
<td class="package" :class="data.local ? data.local.isInstalled ? 'active' : 'local' : 'remote'"> | ||
<div> | ||
<a | ||
:href="'http://npmjs.com/package/' + data.name" | ||
target="blank" rel="noopener noreferrer" | ||
>{{ data.name.replace('koishi-plugin-', '') }}</a> | ||
<k-badge type="success" v-if="data.official">官方</k-badge> | ||
<k-badge type="warning" v-if="hasUpdate">可更新</k-badge> | ||
</div> | ||
<div class="description"> | ||
{{ data.description }} | ||
</div> | ||
</td> | ||
<td class="version">{{ data.local ? data.local.version : '-' }}</td> | ||
<td class="latest">{{ data.version }}</td> | ||
<td class="size">{{ formatSize(data.size) }}</td> | ||
<td class="score">{{ +data.score.final.toFixed(2) }}</td> | ||
<td class="operation"> | ||
<k-button frameless v-if="hasUpdate || !data.local" | ||
>{{ data.local ? '更新' : '下载' }}</k-button> | ||
</td> | ||
</tr> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import type { Awesome } from '~/server' | ||
import { defineProps, computed } from 'vue' | ||
const props = defineProps<{ data: Awesome.PackageData }>() | ||
const hasUpdate = computed(() => { | ||
const { local, version } = props.data | ||
return local && !local.isWorkspace && local.version !== version | ||
}) | ||
function formatSize(size: number) { | ||
if (size >= 1024000) { | ||
return Math.round(size / 1048576) + ' MB' | ||
} else { | ||
return Math.round(size / 1024) + ' KB' | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '~/variables'; | ||
.package { | ||
text-align: left; | ||
padding-left: 3rem; | ||
position: relative; | ||
a { | ||
font-weight: bold; | ||
transition: 0.3s ease; | ||
color: rgba(244, 244, 245, 0.75); | ||
} | ||
a:hover { | ||
color: rgba(244, 244, 245); | ||
} | ||
.description { | ||
margin-top: 0.15rem; | ||
font-size: 0.9rem; | ||
} | ||
&::before { | ||
content: ""; | ||
position: absolute; | ||
border-radius: 100%; | ||
width: 0.5rem; | ||
height: 0.5rem; | ||
top: 50%; | ||
left: 1.25rem; | ||
transform: translateY(-50%); | ||
box-shadow: 1px 1px 2px #3333; | ||
} | ||
&.active::before { | ||
background: $success; | ||
} | ||
&.local::before { | ||
background: $warning; | ||
} | ||
&.remote::before { | ||
background: #eeeeee5f; | ||
} | ||
} | ||
.page-awesome td:not(.package) { | ||
min-width: 4rem; | ||
} | ||
tr.workspace { | ||
.latest, .size { | ||
color: rgba(244, 244, 245, .25); | ||
} | ||
} | ||
</style> |
81 changes: 0 additions & 81 deletions
81
packages/plugin-webui/client/views/dependencies/dep-view.vue
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
80 changes: 0 additions & 80 deletions
80
packages/plugin-webui/client/views/dependencies/manager.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/plugin-webui/src/mongo.ts → packages/plugin-webui/src/database/mongo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.