|
81 | 81 | self.columns = [] |
82 | 82 |
|
83 | 83 | // Logs helpers |
| 84 | + self.nonEmpty = (v) => !self.isEmpty(v) |
| 85 | + self.showLog = (v) => self.nonEmpty(v) ? self.normalizeLog(v) : "No logs for this tab." |
84 | 86 | self.normalizeLog = (v) => { |
85 | 87 | if (v == null) return v |
86 | 88 | if (Array.isArray(v)) return v.join('\n') |
|
93 | 95 | v = self.normalizeLog(v) |
94 | 96 | return v == null || (typeof v === "string" && v.trim().length === 0) |
95 | 97 | } |
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 | | - } |
105 | 98 |
|
106 | 99 | // Dynamic tabs state |
107 | 100 | self.logTabs = [] |
|
110 | 103 | self.rebuildLogTabs = () => { |
111 | 104 | const prefix = self.submission && self.submission.admin ? 'admin_' : '' |
112 | 105 | 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 }, |
133 | 114 | ] |
134 | 115 |
|
135 | 116 | // Keep only non empty tabs |
|
0 commit comments