Skip to content

Commit 2585a0b

Browse files
committed
Add links for tab item
1 parent 4e79ce9 commit 2585a0b

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

src/assets/css/general.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ select {
6161
.w-100 {
6262
width: 100%;
6363
}
64-
.w-80 {
65-
width: 80%;
66-
}
67-
.w-60 {
68-
width: 60%;
69-
}
7064
input[type='button'] {
7165
background: #428bff;
7266
color: #fff;

src/assets/icons/details-link.svg

Lines changed: 7 additions & 0 deletions
Loading

src/assets/icons/open-link.svg

Lines changed: 6 additions & 0 deletions
Loading

src/components/TabItem.vue

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
<template>
22
<div class="tab-item">
33
<Favicon :favicon="item.favicon" :type="typeOfUrl" />
4-
<div class="ml-10 flex-grow-2">
4+
<div
5+
class="ml-10 flex-grow-2"
6+
@mouseover="isShowCmdButtons = true"
7+
@mouseleave="isShowCmdButtons = false"
8+
>
59
<div class="first-block">
6-
<div :class="listType == TypeOfList.All ? 'w-60' : 'w-80'">
7-
<p class="url" @click="openUrl(item.url)">{{ url }}</p>
10+
<div>
11+
<p class="url">{{ url }}</p>
812
<BadgeIcons :url="url" :type="typeOfUrl" :listType="listType" />
13+
<p class="links" v-if="isShowCmdButtons" title="Statistics">
14+
<img class="link" src="../assets/icons/details-link.svg" height="18" />
15+
</p>
16+
17+
<p class="links" v-if="isShowCmdButtons" title="Open website">
18+
<img
19+
class="link"
20+
src="../assets/icons/open-link.svg"
21+
height="18"
22+
@click="openUrl(item.url)"
23+
/>
24+
</p>
925
</div>
1026
<p class="text-right time">{{ summaryTimeForTab }}</p>
1127
</div>
@@ -33,6 +49,7 @@ export default {
3349
import { computed, ref } from 'vue';
3450
import { useI18n } from 'vue-i18n';
3551
import Favicon from './Favicon.vue';
52+
import TabItemLink from './TabItemLink.vue';
3653
import BadgeIcons from './BadgeIcons.vue';
3754
import { convertSummaryTimeToString } from '../utils/converter';
3855
import { getPercentage } from '../utils/common';
@@ -47,6 +64,8 @@ const props = defineProps<{
4764
listType: TypeOfList;
4865
}>();
4966
67+
const isShowCmdButtons = ref<boolean>();
68+
5069
const typeOfUrl = computed(() =>
5170
props.item.url.startsWith('file:') ? TypeOfUrl.Document : TypeOfUrl.WebSite,
5271
);
@@ -91,12 +110,21 @@ const showWarningMessage = ref<boolean>();
91110
.tab-item:hover {
92111
border: 1px rgb(202, 202, 202) solid;
93112
}
113+
114+
.tab-item .links {
115+
display: inline-block;
116+
margin: 0;
117+
cursor: pointer;
118+
margin: 0 5px;
119+
}
120+
.tab-item .links .link {
121+
vertical-align: middle;
122+
}
94123
.tab-item .url {
95124
font-size: 15px;
96125
font-weight: 600;
97126
cursor: pointer;
98127
overflow-wrap: anywhere;
99-
max-width: 80%;
100128
display: inline-block;
101129
}
102130
.tab-item .url:hover {

0 commit comments

Comments
 (0)