X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=4f4cc5cc94cec3a0034dbb92b4d2f77b7ad7bf06;hb=fbe408c72c6c4211e329ddab3b54a42034efc0f4;hp=07f0574d234401c2d94dee2008c8d53dae5ef4fb;hpb=bfc3e7ff15c47ecfedd558c612e9e6d453cad9f8;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 07f0574..4f4cc5c 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -229,11 +229,11 @@ function my_onstat(data) { if (stat == null) return; - stat.innerHTML = 'Status info' + + stat.innerHTML = '' + M('Status info') + '' + ' -- ' + - '' + data.activeclients + '/' + data.clients + '' + + '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' + ' -- ' + - '' + data.records + '/' + data.hits + ''; + '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + ''; } function my_onterm(data) { @@ -306,8 +306,13 @@ function my_onbytarget(data) { return; } - var table ='' - +''; + var table ='
Target IDHitsDiagsRecordsState
' + + '' + + '' + + '' + + '' + + '' + + ''; for (var i = 0; i < data.length; i++ ) { table += "'; + return ''; } @@ -650,7 +672,8 @@ function mkws_html_all() { mkws_html_switch(); if (mkws_config.use_service_proxy) - mkws_service_proxy_auth(mkws_config.service_proxy_auth); + mkws_service_proxy_auth(mkws_config.service_proxy_auth, + mkws_config.service_proxy_auth_domain); if (mkws_config.responsive_design_width) { // Responsive web design - change layout on the fly based on @@ -713,7 +736,7 @@ function mkws_html_sort() { if (key == mkws_config.sort_default) { sort_html += ' selected="selected"'; } - sort_html += '>' + val + ''; + sort_html += '>' + M(val) + ''; } sort_html += ''; @@ -743,13 +766,13 @@ function mkws_html_perpage() { * The username/password is configured in the apache config file * for the site. */ -function mkws_service_proxy_auth(auth_url) { +function mkws_service_proxy_auth(auth_url, auth_domain) { debug("Run service proxy auth URL: " + auth_url); var request = new pzHttpRequest(auth_url, function(err) { - alert("HTTP call for authentication failed: " + err) - return; - }); + alert("HTTP call for authentication failed: " + err) + return; + }, auth_domain); request.get(null, function(data) { if (!$.isXMLDoc(data)) {
' + M('Target ID') + '' + M('Hits') + '' + M('Diags') + '' + M('Records') + '' + M('State') + '
" + data[i].id + @@ -550,14 +555,23 @@ function replaceHtml(el, html) { function renderDetails(data, marker) { var details = '
'; - if (marker) details += ''; + if (marker) details += ''; + + var locations = []; + for (var i in data.location) { + locations.push(data.location[i]['@name']); + } details += renderField("Title", data["md-title"], data["md-title-remainder"], data["md-title-responsibility"]); details += renderField("Date", data["md-date"]); details += renderField("Author", data["md-author"]); details += renderField("URL", data["md-electronic-url"]); details += renderField("Subject", data["location"][0]["md-subject"]); - details += renderField("Location", data["location"][0]["@name"], data["location"][0]["@id"]); + if (locations.length == 0) { + details += ''; + } else { + details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations); + } details += '
'+ marker + '
'+ marker + '
No locations for record!
'; return details; @@ -568,19 +582,27 @@ function renderField(caption, data, data2, data3) { return ""; } - if (caption == "URL") { - data = '' + data + ''; + var res = ""; + for (var i = 0; i < data.length; i++) { + var s = data[i]; + if (i > 0) + res += ", "; + + if (caption == "URL") + s = '' + s + ''; + + res += s } if (data2 != undefined) { - data = data + " (" + data2 + ")"; + res = res + " (" + data2 + ")"; } if (data3 != undefined) { - data = data + " " + data3 + ""; + res = res + " " + data3 + ""; } - return '
' + M(caption) + '' + data + '
' + M(caption) + '' + res + '