Commits (1)
......@@ -2,6 +2,7 @@ var editor;
$(document).ready(function() {
editor = new CollectionsEditor();
$("#btn-resync-colreg").click(function() { editor.triggerColRegSync(); });
$("#btn-force-online").click(function() { editor.triggerOnline(); });
//$("#btn-add-collection").click(function() { editor.triggerAddCollection(); });
});
......@@ -12,7 +13,8 @@ var CollectionsEditor = function() {
"~eu.dariah.de.minfba.search.view.crawl.confirm_delete",
"~eu.dariah.de.minfba.search.view.collection.info_resync.head",
"~eu.dariah.de.minfba.search.view.collection.info_resync.body",
"~eu.dariah.de.minfba.search.view.collection.confirm_resync_colreg"
"~eu.dariah.de.minfba.search.view.collection.confirm_resync_colreg",
"~eu.dariah.de.minfba.search.view.collection.confirm_force_online"
]);
this.createTable();
......@@ -210,4 +212,22 @@ CollectionsEditor.prototype.triggerColRegSync = function () {
});
}
});
};
CollectionsEditor.prototype.triggerOnline = function () {
bootbox.confirm(__translator.translate("~eu.dariah.de.minfba.search.view.collection.confirm_force_online"), function(result) {
if(result) {
$.ajax({
url: __util.composeRelativeUrl("async/triggerOnline"),
type: "GET",
dataType: "json",
success: function(data) {
__notifications.showTranslatedMessage(NOTIFICATION_TYPES.INFO,
"~eu.dariah.de.minfba.search.view.collection.info_resync.head",
"~eu.dariah.de.minfba.search.view.collection.info_resync.body");
},
error: __util.processServerError
});
}
});
};
\ No newline at end of file
......@@ -2,6 +2,8 @@ var editor;
$(document).ready(function() {
editor = new DatamodelEditor();
$("#btn-sync").click(function() { editor.triggerSync(); });
$("#btn-force-offline").click(function() { editor.triggerOffline(); });
//$("#btn-add-collection").click(function() { editor.triggerAddCollection(); });
});
......@@ -18,7 +20,8 @@ var DatamodelEditor = function() {
"~eu.dariah.de.minfba.common.status.outdated",
"~eu.dariah.de.minfba.search.view.api.status_code",
"~eu.dariah.de.minfba.search.view.models.show_in_DME",
"~eu.dariah.de.minfba.common.actions.delete"
"~eu.dariah.de.minfba.common.actions.delete",
"~eu.dariah.de.minfba.search.view.collection.confirm_force_offline"
]);
this.createTable();
......@@ -260,4 +263,23 @@ DatamodelEditor.prototype.triggerSync = function () {
}
}
});
};
DatamodelEditor.prototype.triggerOffline = function () {
bootbox.confirm(__translator.translate("~eu.dariah.de.minfba.search.view.collection.confirm_force_offline"), function(result) {
if(result) {
$.ajax({
url: __util.composeRelativeUrl("async/triggerOffline"),
type: "GET",
dataType: "json",
success: function(data) {
__notifications.showTranslatedMessage(NOTIFICATION_TYPES.INFO,
"~eu.dariah.de.minfba.search.view.datamodels.info_resync.head",
"~eu.dariah.de.minfba.search.view.datamodels.info_resync.body");
},
error: __util.processServerError
});
}
}
);
};
\ No newline at end of file