Commit b6183a95 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

446: Reimplement automatic online and offline crawl capabilities

(OPENED)

Task-Url: search#446
parent 86e86c58
......@@ -17,6 +17,7 @@ var CollectionsEditor = function() {
"~eu.dariah.de.minfba.search.view.collection.confirm_force_online"
]);
this.autoOnline = $("#autoOnline").val();
this.createTable();
//this.assignEvents();
this.getColregStatus();
......@@ -40,19 +41,19 @@ CollectionsEditor.prototype.createTable = function() {
"data": function (row, type, val, meta) { return editor.renderAccessColumn(row, type, val, meta); },
}, {
"targets": [3],
//"data": "entity.endpoint.accessType",
"data": function (row, type, val, meta) { return editor.renderDatamodelColumn(row, type, val, meta); },
"class": "no-break"
}, {
"targets": [4],
"data": "entity.dataset.lastCrawlCompleted",
//"data": function (row, type, val, meta) { return ""; },
"class": "no-break"
}, {
"targets": [5], "visible": false,
"targets": [5],
"data": "entity.dataset.nextCrawlPlanned",
}, {
"targets": [6], "visible": false,
"data": "entity.collection.name"
}, {
"targets": [0,1,2,3,4],
"targets": [0,1,2,3,4,5],
"render": function ( data, type, row, meta ) {
return '<a href="' + __util.composeRelativeUrl(row.entity.id) + '">' + data + '</a>';
}
......@@ -126,7 +127,7 @@ CollectionsEditor.prototype.getIcon = function(entity) {
return "fas fa-exclamation-circle";
} else if (entity.processing) {
return "fas fa-sync-alt";
} else if (entity.waiting) {
} else if (entity.waiting || entity.dataset.outdated) {
return "fas fa-clock";
} else if (entity.unknown || entity.dataset.docs==0) {
return "fas fa-question-circle";
......@@ -136,11 +137,12 @@ CollectionsEditor.prototype.getIcon = function(entity) {
};
CollectionsEditor.prototype.getState = function(entity) {
console.log(this.autoOnline);
if (entity.error) {
return "error"
} else if (entity.warning) {
return "warning";
} else if (entity.processing || entity.waiting || entity.unknown || entity.dataset.docs==0) {
} else if (entity.warning || (entity.dataset.outdated && !this.autoOnline) ) {
return "warning"
} else if (entity.processing || entity.waiting || entity.unknown || entity.dataset.outdated || entity.dataset.docs==0) {
return "info";
} else {
return "ok";
......
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