Skip to content

Commit

Permalink
feat(client): add title to text-overflow: ellipsis, fix #243
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 5, 2023
1 parent 477b7be commit a31d2bb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/client/client/components/layout/tab-item.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="k-tab-item k-tab-menu-item"
:title="label"
:class="{ active: label === modelValue }"
@click="$emit('update:modelValue', label)">
<slot>{{ label }}</slot>
Expand Down
4 changes: 2 additions & 2 deletions packages/market/client/components/package.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
<div class="main">
<h2 class="top">
<span class="title">{{ data.shortname }}</span>
<span class="title" :title="data.shortname">{{ data.shortname }}</span>
<el-tooltip v-if="badge" placement="right" :content="t(`badge.${badge.type}`)">
<span :class="['icon', badge.type]" @click.stop.prevent="$emit('query', badge.query)">
<market-icon :name="badge.type"></market-icon>
Expand All @@ -25,7 +25,7 @@
<slot name="action"></slot>
</div>
</div>
<k-markdown inline class="desc" :source="data.manifest ? tt(data.manifest.description) : data.package.description ?? ''"></k-markdown>
<k-markdown inline class="desc" :source="tt(data.manifest?.description) ?? ''"></k-markdown>
<div class="footer">
<el-tooltip :content="timeAgo(data.updatedAt)" placement="top">
<a class="shrink" target="_blank" :href="data.package.links.npm">
Expand Down
2 changes: 1 addition & 1 deletion packages/market/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@koishijs/market",
"description": "Market UI for Koishi",
"version": "4.1.6",
"version": "4.1.7",
"main": "client/index.ts",
"files": [
"client"
Expand Down
18 changes: 11 additions & 7 deletions plugins/config/client/components/tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
@node-collapse="handleCollapse"
#="{ node }">
<div class="item">
<div class="label">
<template v-if="node.data.name === 'group'">
{{ '分组:' + (node.label || node.data.alias) }}
</template>
<template v-else>
{{ node.label || node.data.name || '待添加' }}
</template>
<div class="label" :title="getLabel(node)">
{{ getLabel(node) }}
</div>
<div class="right"></div>
</div>
Expand Down Expand Up @@ -63,12 +58,21 @@ function filterNode(value: string, data: Tree) {
interface Node {
data: Tree
label?: string
parent: Node
expanded: boolean
isLeaf: boolean
childNodes: Node[]
}
function getLabel(node: Node) {
if (node.data.name === 'group') {
return '分组:' + (node.label || node.data.alias)
} else {
return node.label || node.data.name || '待添加'
}
}
function allowDrag(node: Node) {
return node.data.path !== ''
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/explorer/client/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@node-drop="handleDrop"
#="{ node }">
<div class="item">
<div class="label">
<div class="label" :title="node.data.name">
<input
v-focus
v-if="node.data.filename === renaming"
Expand Down
4 changes: 2 additions & 2 deletions plugins/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": "2.4.1",
"version": "2.4.2",
"main": "lib/node/index.js",
"types": "lib/index.d.ts",
"exports": {
Expand Down Expand Up @@ -69,7 +69,7 @@
},
"devDependencies": {
"@koishijs/client": "^5.18.3",
"@koishijs/market": "^4.1.6",
"@koishijs/market": "^4.1.7",
"@koishijs/plugin-config": "^2.4.5",
"@types/semver": "^7.5.4",
"@types/throttle-debounce": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions plugins/status/client/bots/preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</el-tooltip>
</div>
<div class="info">
<div><k-icon name="robot"/>{{ data.user.name }}</div>
<div><k-icon name="platform"/>{{ data.platform }}</div>
<div :title="data.user.name"><k-icon name="robot"/>{{ data.user.name }}</div>
<div :title="data.platform"><k-icon name="platform"/>{{ data.platform }}</div>
<div class="cur-frequency">
<span style="margin-right: 8px">
<k-icon name="arrow-up"/>
Expand Down

0 comments on commit a31d2bb

Please sign in to comment.