Skip to content

Commit 18e8476

Browse files
committed
fix
1 parent 4956302 commit 18e8476

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

scripts/ufs_statistic.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ async function onDocumentEnd() {
206206
data: createLogCountPerHour(allLogs),
207207
series: [
208208
{
209-
type: "line",
209+
type: "bar",
210210
xKey: "x",
211211
yKey: "y",
212212
title: "Count",
@@ -271,21 +271,29 @@ async function onDocumentEnd() {
271271
{
272272
field: "fbName",
273273
cellRenderer: (params) => {
274-
if (params.data.fbName)
275-
return `<a
276-
href="https://fb.com/${params.data.uid}"
277-
target="_blank"
278-
style="display:flex">
279-
<img
280-
class="avatar"
281-
src="${getUserAvatarFromUid(params.data.uid, 40)}"
282-
style="margin-right: 5px;" />
283-
${params.data.fbName}
284-
</a>`;
274+
if (params.data.fbName) {
275+
const a = document.createElement("a");
276+
a.href = `https://fb.com/${params.data.uid}`;
277+
a.target = "_blank";
278+
a.style.display = "flex";
279+
280+
const img = document.createElement("img");
281+
img.src = params.data.fbAvatar;
282+
img.className = "avatar";
283+
img.style = "margin-right: 5px;";
284+
img.onerror = () => {
285+
img.src = getUserAvatarFromUid(params.data.uid, 40);
286+
};
287+
a.appendChild(img);
288+
289+
a.appendChild(document.createTextNode(params.data.fbName));
290+
291+
return a;
292+
}
285293
},
286294
},
287295
{ field: "isScript", width: 80 },
288-
{ field: "eventName", width: 500 },
296+
{ field: "eventName", width: 500, filter: "agTextColumnFilter" },
289297
{
290298
field: "totalCount",
291299
filter: "agNumberColumnFilter",
@@ -309,7 +317,6 @@ async function onDocumentEnd() {
309317
data.push(node.data);
310318
});
311319
chartOptions.data = createLogCountPerHour(data);
312-
debugger;
313320
AgCharts.update(chart, chartOptions);
314321
},
315322
});
@@ -497,7 +504,6 @@ async function getFbProfile(uid, force = false) {
497504
}).toString(),
498505
},
499506
]);
500-
501507
let text = await res.body;
502508
const info = {
503509
uid: uid,

0 commit comments

Comments
 (0)