* Fix bug #42777.
This commit is contained in:
@@ -3,3 +3,37 @@ $(function()
|
||||
initBurnChar();
|
||||
});
|
||||
|
||||
function truncateCustomString(str, maxLength)
|
||||
{
|
||||
let count = 0;
|
||||
let strLength = 0;
|
||||
|
||||
for(let char of str)
|
||||
{
|
||||
if(char.match(/[A-Z]/))
|
||||
{
|
||||
count += 2;
|
||||
}
|
||||
else if(char.match(/[a-z]/))
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
else if(char.charCodeAt(0) > 255)
|
||||
{
|
||||
count += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
|
||||
if(count > maxLength)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
strLength++;
|
||||
}
|
||||
|
||||
return str.slice(0, strLength);
|
||||
}
|
||||
|
||||
@@ -35,10 +35,11 @@ function initBurnChar()
|
||||
Object.values(executions).forEach(function(execution)
|
||||
{
|
||||
var chartDom = document.getElementById('burn' + execution.id);
|
||||
var myChart = echarts.init(chartDom);
|
||||
var myChart = echarts.init(chartDom);
|
||||
var title = truncateCustomString(execution.name, 38);
|
||||
var option = {
|
||||
title: {
|
||||
text: execution.name,
|
||||
text: title,
|
||||
top: 10,
|
||||
textStyle: {
|
||||
color: '#a1c4e9',
|
||||
|
||||
Reference in New Issue
Block a user