mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-18 09:24:07 +00:00
fix: limit the shown text's length (close #80)
This commit is contained in:
6
web/src/helpers/render.js
Normal file
6
web/src/helpers/render.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export function renderText(text, limit) {
|
||||
if (text.length > limit) {
|
||||
return text.slice(0, limit - 3) + '...';
|
||||
}
|
||||
return text;
|
||||
}
|
Reference in New Issue
Block a user