Commit cdc5e0d6 authored by vehnem's avatar vehnem
Browse files

front: display current step, fixed run:done:wait step

parent 1675e4de
......@@ -38,11 +38,23 @@ object ReleaseLogHandler {
lf.logName -> lf
}).toMap
Config.extractionLogs.names.map(logName => remote.getOrElse(logName, new LogFile("", logName, 0,
Config.extractionLogs.descriptionsBylogName.getOrElse(logName,"TODO"))))
var lastRunningFound = false
Config.extractionLogs.names.reverse.map({ logName =>
val currentLog = remote.getOrElse(logName, new LogFile("", logName, 0,
Config.extractionLogs.descriptionsBylogName.getOrElse(logName, "TODO")))
if (currentLog.state == 1 && lastRunningFound) {
currentLog.copy(state = 2)
} else if (currentLog.state == 1) {
lastRunningFound = true
currentLog
} else {
currentLog
}
})
})
} catch {
case _: Exception => None
case e: Exception => None
}
}
......
......@@ -198,19 +198,19 @@
<div class="card">
<div class="card-body">
<h4>Overall Extraction Progress</h4>
<h6>Mappings</h6>
<h6 id="mappings-progress-step">Mappings</h6>
<div class="progress">
<div id="mappings-progress" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
Step 0/7
</div>
</div>
<h6>Generic</h6>
<h6 id="generic-progress-step">Generic</h6>
<div class="progress">
<div id="generic-progress" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
Step 0/7
</div>
</div>
<h6>Wikidata</h6>
<h6 id="wikidata-progress-step">Wikidata</h6>
<div class="progress">
<div id="wikidata-progress" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
Step 0/7
......@@ -268,11 +268,11 @@
<div class="col-sm-6 p-3">
<div class="card">
<div class="card-body">
<h4>Log Files</h4>
<h4>Steps</h4>
<table id="mappings-logs-table" data-pagination="true"
data-page-size="4" class="table">
<thead>
<th data-field="state">State</th>
<th data-field="stateHtml">State</th>
<th data-field="filename">Log File</th>
<th data-field="description">Description</th>
</thead>
......@@ -350,11 +350,11 @@
<div class="col-sm-6 p-3">
<div class="card">
<div class="card-body">
<h4>Log Files</h4>
<h4>Steps</h4>
<table id="generic-logs-table" data-pagination="true"
data-page-size="4" class="table">
<thead>
<th data-field="state">State</th>
<th data-field="stateHtml">State</th>
<th data-field="filename">Log File</th>
<th data-field="description">Description</th>
</thead>
......@@ -432,11 +432,11 @@
<div class="col-sm-6 p-3">
<div class="card">
<div class="card-body">
<h4>Log Files</h4>
<h4>Steps</h4>
<table id="wikidata-logs-table" data-pagination="true"
data-page-size="4" class="table">
<thead>
<th data-field="state">State</th>
<th data-field="stateHtml">State</th>
<th data-field="filename">Log File</th>
<th data-field="description">Description</th>
</thead>
......
......@@ -98,6 +98,15 @@ $(function () {
/* log-files */
var stepByLog = {
"downloadMappings.log" : "mappings downlaod",
"downloadOntology.log" : "ontology downlaod",
"downloadWikidumps.log" : "wikidump download",
"extraction.log" : "knowledge extraction",
"postProcess.log" : "post processing",
"unRedirected/" : "copy un-redirected files"
}
function getLogs(group) {
// n/a - not loaded,
// unzipped - in progress,
......@@ -110,6 +119,7 @@ function getLogs(group) {
var processLogs = []
var doneSteps = 0
var isRunning = false
var step = ""
data.forEach(element => {
......@@ -117,8 +127,9 @@ function getLogs(group) {
if (state == 0) {
state = '<strong class="text-warning">WARN</strong>'
} else if (state == 1) {
doneSteps += 1
isRunning = true
step = stepByLog[element.logName] || step
doneSteps += 1
isRunning = true
state = '<strong class="text-success">RUN</strong>'
} else {
doneSteps += 1
......@@ -128,13 +139,22 @@ function getLogs(group) {
var url = element.url
var file = element.logName
var description = element.description
processLogs.push({ 'state': state, 'description': description, 'filename': `<a href="${url}">${file}</a>` })
processLogs.push({ 'state': element.state, 'stateHtml': state, 'description': description, 'filename': `<a href="${url}">${file}</a>` })
})
if ( isRunning ) doneSteps -= 1;
setProgress(group, doneSteps, 6)
logTable.bootstrapTable({ 'data': processLogs })
if (step != "" ) $(`#${group}-progress-step`).append(` at step: ${step}`)
processLogs.sort( function(a,b) {
if (a.state == 1) return -1
else if ( b.state == 1) return 1
else return b.state-a.state
})
logTable.bootstrapTable({ 'data': processLogs });
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment