fix: URL过长时截断显示路径+省略号+hover完整
This commit is contained in:
@@ -77,7 +77,7 @@
|
|||||||
<span v-if="page.parsed?.matched" style="color:#67c23a">✓</span>
|
<span v-if="page.parsed?.matched" style="color:#67c23a">✓</span>
|
||||||
<span v-else-if="page.parsed" style="color:#e6a23c">⚠</span>
|
<span v-else-if="page.parsed" style="color:#e6a23c">⚠</span>
|
||||||
<span v-else style="color:#c0c4cc">○</span>
|
<span v-else style="color:#c0c4cc">○</span>
|
||||||
<strong style="font-size:13px;word-break:break-all">{{ page.url }}</strong>
|
<strong style="font-size:13px;max-width:400px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer" :title="page.url">{{ shortUrl(page.url) }}</strong>
|
||||||
<el-tag v-if="page.statusCode" size="small" :type="statusTag(page.statusCode)">{{ page.statusCode }}</el-tag>
|
<el-tag v-if="page.statusCode" size="small" :type="statusTag(page.statusCode)">{{ page.statusCode }}</el-tag>
|
||||||
<el-tag v-if="page.parsed?.matched" size="small" type="success">{{ page.parsed.pageName }}</el-tag>
|
<el-tag v-if="page.parsed?.matched" size="small" type="success">{{ page.parsed.pageName }}</el-tag>
|
||||||
|
|
||||||
@@ -316,6 +316,9 @@ const rejectConfig = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fmtTime = (t) => t ? t.substring(5,16).replace('T',' ') : '-'
|
const fmtTime = (t) => t ? t.substring(5,16).replace('T',' ') : '-'
|
||||||
|
const shortUrl = (u) => {
|
||||||
|
try { return new URL(u).pathname + new URL(u).search } catch { return u }
|
||||||
|
}
|
||||||
const statusTag = (c) => c>=200&&c<300?'success':c>=300&&c<400?'warning':'danger'
|
const statusTag = (c) => c>=200&&c<300?'success':c>=300&&c<400?'warning':'danger'
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user