Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HornCopper committed Sep 5, 2024
2 parents b3df79e + ea905a9 commit 4884b0a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
7 changes: 4 additions & 3 deletions src/plugins/jx3/calculator/dj.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ async def get_calculated_data(
json = params,
headers = {
"token": inkarsuki_offical_token
}
},
timeout=10000
)
return json.loads(data)

Expand Down Expand Up @@ -174,7 +175,7 @@ async def generate_calculator_img_dujing(server: Optional[str], name: str, group
"display": str(int(round(float(calculated_data["data"]["percent"][skill_sort][:-1])/float(calculated_data["data"]["percent"][0][:-1]), 2)*100)) + "%",
"percent": calculated_data["data"]["percent"][skill_sort],
"count": calculated_data["data"]["counts"][skill_sort],
"value": calculated_data["data"]["damages"]
"value": calculated_data["data"]["damages"][skill_sort]
})
)
html = Template(read(VIEWS + "/jx3/calculator/calculator.html")).render(**{
Expand All @@ -190,7 +191,7 @@ async def generate_calculator_img_dujing(server: Optional[str], name: str, group
})
final_html = CACHE + "/" + get_uuid() + ".html"
write(final_html, html)
final_path = await generate(final_html, False, "table", False)
final_path = await generate(final_html, False, ".total", False)
if not isinstance(final_path, str):
return
return Path(final_path).as_uri()
40 changes: 20 additions & 20 deletions src/views/jx3/calculator/calculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,27 @@
<div class="cell-title"><span>一键宏</span></div>
<div class="cell">{{ min }}</div>
</div>
<table style="background-color: #FFFFFF">
<thead>
<tr>
<th class="short-column" style="height:20px">技能</th>
<th class="short-column" style="height:20px">占比</th>
<th class="short-column" style="height:20px">次数</th>
<th class="short-column" style="height:20px">伤害</th>
</tr>
</thead>
<tbody>
{{ tables }}
</tbody>
<tfoot>
<tr>
<td colspan="7">&copy; Inkar Suki · {{ school }}DPS计算器 · {{ server }} · {{ name }} ·
06:41<br>计算器数据来源:{{ calculator }}
</td>
</tr>
</tfoot>
</table>
</div>
<table style="background-color: #FFFFFF">
<thead>
<tr>
<th class="short-column" style="height:20px">技能</th>
<th class="short-column" style="height:20px">占比</th>
<th class="short-column" style="height:20px">次数</th>
<th class="short-column" style="height:20px">伤害</th>
</tr>
</thead>
<tbody>
{{ tables }}
</tbody>
<tfoot>
<tr>
<td colspan="7">&copy; Inkar Suki · {{ school }}DPS计算器 · {{ server }} · {{ name }} ·
06:41<br>计算器数据来源:{{ calculator }}
</td>
</tr>
</tfoot>
</table>
</body>

</html>

0 comments on commit 4884b0a

Please sign in to comment.