add result panel.

This commit is contained in:
2023-01-10 16:16:14 +08:00
parent a3456595a5
commit e3db109317
22 changed files with 714 additions and 172 deletions

View File

@@ -38,3 +38,15 @@ export function parseTime(utc: Date, format = "YYYY年M月D日") {
const time = useDateFormat(utc, format, { locales: "zh-CN" })
return time.value
}
export function submissionMemoryFormat(memory: string) {
if (memory === undefined) return "--"
// 1048576 = 1024 * 1024
let t = parseInt(memory) / 1048576
return String(t.toFixed(0)) + "MB"
}
export function submissionTimeFormat(time: number) {
if (time === undefined) return "--"
return time + "ms"
}