Skip to content

Commit 1bea816

Browse files
committed
Have all logs possibilities instead of grouping them by 2
1 parent 40a878c commit 1bea816

1 file changed

Lines changed: 10 additions & 29 deletions

File tree

src/static/riot/competitions/detail/submission_modal.tag

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
self.columns = []
8282

8383
// Logs helpers
84+
self.nonEmpty = (v) => !self.isEmpty(v)
85+
self.showLog = (v) => self.nonEmpty(v) ? self.normalizeLog(v) : "No logs for this tab."
8486
self.normalizeLog = (v) => {
8587
if (v == null) return v
8688
if (Array.isArray(v)) return v.join('\n')
@@ -93,15 +95,6 @@
9395
v = self.normalizeLog(v)
9496
return v == null || (typeof v === "string" && v.trim().length === 0)
9597
}
96-
self.nonEmpty = (v) => !self.isEmpty(v)
97-
self.showLog = (v) => self.nonEmpty(v) ? self.normalizeLog(v) : "No logs for this tab."
98-
self.getLog = (...keys) => {
99-
for (const k of keys) {
100-
const v = self.normalizeLog(self.logs[k])
101-
if (!self.isEmpty(v)) return v
102-
}
103-
return null
104-
}
10598

10699
// Dynamic tabs state
107100
self.logTabs = []
@@ -110,26 +103,14 @@
110103
self.rebuildLogTabs = () => {
111104
const prefix = self.submission && self.submission.admin ? 'admin_' : ''
112105
const candidates = [
113-
{
114-
key: 'log_ing_out',
115-
label: 'Ingestion output',
116-
content: self.getLog('prediction_ingestion_stdout', 'prediction_stdout')
117-
},
118-
{
119-
key: 'log_ing_err',
120-
label: 'Ingestion errors',
121-
content: self.getLog('prediction_ingestion_stderr', 'prediction_stderr')
122-
},
123-
{
124-
key: 'log_score_out',
125-
label: 'Scoring output',
126-
content: self.getLog('scoring_stdout', 'scoring_ingestion_stdout')
127-
},
128-
{
129-
key: 'log_score_err',
130-
label: 'Scoring errors',
131-
content: self.getLog('scoring_stderr', 'scoring_ingestion_stderr')
132-
},
106+
{ key:'p_stdout', label:'Prediction output', content: self.logs.prediction_stdout },
107+
{ key:'p_stderr', label:'Prediction errors', content: self.logs.prediction_stderr },
108+
{ key:'p_ing_out', label:'Ingestion output', content: self.logs.prediction_ingestion_stdout },
109+
{ key:'p_ing_err', label:'Ingestion errors', content: self.logs.prediction_ingestion_stderr },
110+
{ key:'s_stdout', label:'Scoring output', content: self.logs.scoring_stdout },
111+
{ key:'s_stderr', label:'Scoring errors', content: self.logs.scoring_stderr },
112+
{ key:'s_ing_out', label:'Scoring ingestion output', content: self.logs.scoring_ingestion_stdout },
113+
{ key:'s_ing_err', label:'Scoring ingestion errors', content: self.logs.scoring_ingestion_stderr },
133114
]
134115

135116
// Keep only non empty tabs

0 commit comments

Comments
 (0)