perf(profile):优化统计项大数值的显示 (#79)

This commit is contained in:
mjking 2024-01-02 18:30:02 +08:00 committed by GitHub
parent ab736ce1d7
commit 15aa09c862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -2790,6 +2790,7 @@ button.swiper-pagination-bullet {
&-item { &-item {
flex-grow: 1; flex-grow: 1;
flex-shrink: 1; flex-shrink: 1;
flex: 1;
margin: 0 !important; margin: 0 !important;
text-align: center !important; text-align: center !important;

File diff suppressed because one or more lines are too long

View File

@ -19,27 +19,27 @@
<div th:each="item,sindex :${theme.config.sidebar.custom_stats}" class="level-item" th:switch="${item.type}"> <div th:each="item,sindex :${theme.config.sidebar.custom_stats}" class="level-item" th:switch="${item.type}">
<div th:case="visit"> <div th:case="visit">
<p class="heading">访问</p> <p class="heading">访问</p>
<p class="value" th:text="${stats.visit}"></p> <p class="value" th:title="${stats.visit / 10000 > 0} ? ${stats.visit}" th:text="${stats.visit / 1000000 > 0} ? (${#numbers.formatDecimal(stats.visit / 1000000.0,1,1)} + 'bw') : (${stats.visit / 10000 > 0} ? (${#numbers.formatDecimal(stats.visit / 10000.0,1,2)} + 'w') : ${stats.visit})"></p>
</div> </div>
<div th:case="upvote"> <div th:case="upvote">
<p class="heading">点赞</p> <p class="heading">点赞</p>
<p class="value" th:text="${stats.upvote}"></p> <p class="value" th:title="${stats.upvote / 10000 > 0} ? ${stats.upvote}" th:text="${stats.upvote / 1000000 > 0} ? (${#numbers.formatDecimal(stats.upvote / 1000000.0,1,1)} + 'bw') : (${stats.upvote / 10000 > 0} ? (${#numbers.formatDecimal(stats.upvote / 10000.0,1,2)} + 'w') : ${stats.upvote})"></p>
</div> </div>
<div th:case="comment"> <div th:case="comment">
<p class="heading">评论</p> <p class="heading">评论</p>
<p class="value" th:text="${stats.comment}"></p> <p class="value" th:title="${stats.comment / 10000 > 0} ? ${stats.comment}" th:text="${stats.comment / 1000000 > 0} ? (${#numbers.formatDecimal(stats.comment / 1000000.0,1,1)} + 'bw') : (${stats.comment / 10000 > 0} ? (${#numbers.formatDecimal(stats.comment / 10000.0,1,2)} + 'w') : ${stats.comment})"></p>
</div> </div>
<div th:case="category"> <div th:case="category">
<p class="heading">分类</p> <p class="heading">分类</p>
<p class="value" th:text="${stats.category}"></p> <p class="value" th:title="${stats.category / 10000 > 0} ? ${stats.category}" th:text="${stats.category / 1000000 > 0} ? (${#numbers.formatDecimal(stats.category / 1000000.0,1,1)} + 'bw') : (${stats.category / 10000 > 0} ? (${#numbers.formatDecimal(stats.category / 10000.0,1,2)} + 'w') : ${stats.category})"></p>
</div> </div>
<div th:case="tag"> <div th:case="tag" th:with="tagsList = ${tagFinder.listAll()}, tags = ${#lists.size(tagsList)}">
<p class="heading">标签</p> <p class="heading">标签</p>
<p class="value" th:with="tags = ${tagFinder.listAll()}" th:text="${#lists.size(tags)}"></p> <p class="value" th:title="${tags / 10000 > 0} ? ${tags}" th:text="${tags / 1000000 > 0} ? (${#numbers.formatDecimal(tags / 1000000.0,1,1)} + 'bw') : (${tags / 10000 > 0} ? (${#numbers.formatDecimal(tags / 10000.0,1,2)} + 'w') : ${tags})"></p>
</div> </div>
<div th:case="*"> <div th:case="*">
<p class="heading">文章</p> <p class="heading">文章</p>
<p class="value" th:text="${stats.post}"></p> <p class="value" th:title="${stats.post / 10000 > 0} ? ${stats.post}" th:text="${stats.post / 1000000 > 0} ? (${#numbers.formatDecimal(stats.post / 1000000.0,1,1)} + 'bw') : (${stats.post / 10000 > 0} ? (${#numbers.formatDecimal(stats.post / 10000.0,1,2)} + 'w') : ${stats.post})"></p>
</div> </div>
</div> </div>
</nav> </nav>