mirror of
https://gitee.com/BDWare/router-frontend
synced 2025-01-09 17:34:00 +00:00
fix(router-frontend): fix bugs in front-end
fix the bug in nodeslistman.js that causes long names of offline nodes are shown
This commit is contained in:
parent
2fb58a9c27
commit
d4c82f5724
@ -322,10 +322,12 @@ var onListNodes = function (obj) {
|
||||
"render": function (data, type, row, meta) {
|
||||
const firstBg = data.indexOf(">");
|
||||
const secondSl = data.substring(1).indexOf("<");
|
||||
const aTag = data.substring(0, firstBg + 1)
|
||||
const aTagTail = data.substring(secondSl + 1)
|
||||
const name = data.substring(firstBg + 1, secondSl + 1)
|
||||
let html = name.length > 15 ?
|
||||
const aTag = firstBg === -1 ? "" : data.substring(0, firstBg + 1);
|
||||
const aTagTail = secondSl === -1 ? "" : data.substring(secondSl + 1);
|
||||
const name = firstBg === -1 || secondSl === -1 ?
|
||||
data :
|
||||
data.substring(firstBg + 1, secondSl + 1);
|
||||
const html = name.length > 15 ?
|
||||
`<span title='${name}'>${name.substring(0, 15)} ...</span>` :
|
||||
name;
|
||||
return aTag + html + aTagTail;
|
||||
|
Loading…
Reference in New Issue
Block a user