11<template >
22 <div class =" name-row" >
3- <div >
3+ <div class = " name-main " >
44 <el-form :model =" formData" :rules =" rules" ref =" formRef" v-if =" isEditing" @submit.prevent >
55 <el-form-item prop =" domainName" class =" inline-form-item" >
66 <el-input
1313 />
1414 </el-form-item >
1515 </el-form >
16- <el-text v-else type =" primary" class =" cursor-pointer" @click =" openConfig(row.id)" >
17- {{ row.primaryDomain }}
18- <span class =" text-gray-400" v-if =" isPunycoded(row.primaryDomain)" >
19- ({{ GetPunyCodeDomain(row.primaryDomain) }})
20- </span >
21- </el-text >
16+ <el-tooltip
17+ v-else
18+ effect =" dark"
19+ placement =" bottom-start"
20+ popper-class =" website-domain-tooltip"
21+ :show-after =" 300"
22+ :disabled =" !shouldShowDomainTooltip(row.primaryDomain)"
23+ >
24+ <template #content >
25+ <div class =" website-domain-tooltip__content" >
26+ {{ getDisplayDomain(row.primaryDomain) }}
27+ </div >
28+ </template >
29+ <el-text type =" primary" class =" cursor-pointer domain-text" @click =" openConfig(row.id)" >
30+ <span class =" domain-text__content" >
31+ {{ row.primaryDomain }}
32+ <span class =" text-gray-400" v-if =" isPunycoded(row.primaryDomain)" >
33+ ({{ GetPunyCodeDomain(row.primaryDomain) }})
34+ </span >
35+ </span >
36+ </el-text >
37+ </el-tooltip >
2238 <el-popover
2339 placement =" right"
2440 trigger =" hover"
@@ -181,15 +197,53 @@ const getUrl = (domain: Website.Domain, website: Website.Website): string => {
181197const favoriteWebsite = (row : Website .Website ) => {
182198 emit (' favoriteChange' , row );
183199};
200+
201+ const getDisplayDomain = (domain : string ) => {
202+ if (! isPunycoded (domain )) {
203+ return domain ;
204+ }
205+ return ` ${domain } (${GetPunyCodeDomain (domain )}) ` ;
206+ };
207+
208+ const shouldShowDomainTooltip = (domain : string ) => {
209+ return getDisplayDomain (domain ).length > 30 ;
210+ };
184211 </script >
185212
186213<style lang="css" scoped>
187214.name-row {
188215 display : flex ;
189216 align-items : center ;
190217 justify-content : space-between ;
218+ gap : 8px ;
191219 width : 100% ;
192220}
221+
222+ .name-main {
223+ display : flex ;
224+ align-items : center ;
225+ flex : 1 ;
226+ min-width : 0 ;
227+ }
228+
229+ .domain-text {
230+ display : inline-flex ;
231+ align-items : center ;
232+ flex : 1 ;
233+ width : 0 ;
234+ min-width : 0 ;
235+ max-width : 100% ;
236+ }
237+
238+ .domain-text__content {
239+ display : inline-block ;
240+ min-width : 0 ;
241+ max-width : 100% ;
242+ overflow : hidden ;
243+ text-overflow : ellipsis ;
244+ white-space : nowrap ;
245+ }
246+
193247:deep(.el-form ) {
194248 margin : 0 ;
195249 line-height : 1 ;
@@ -207,4 +261,14 @@ const favoriteWebsite = (row: Website.Website) => {
207261.domain-input {
208262 width : 200px ;
209263}
264+
265+ :deep(.website-domain-tooltip ) {
266+ max-width : min (720px , calc (100vw - 120px ));
267+ }
268+
269+ .website-domain-tooltip__content {
270+ white-space : normal ;
271+ word-break : break-all ;
272+ line-height : 1.5 ;
273+ }
210274 </style >
0 commit comments