2016-03-10 20:47:55 +01:00
|
|
|
function parseUrl(url) {
|
|
|
|
|
var parser = document.createElement('a');
|
|
|
|
|
parser.href = url;
|
|
|
|
|
return parser;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-10 04:47:17 +01:00
|
|
|
Template.serverInformationModal.helpers({
|
|
|
|
|
serverInformation: function() {
|
|
|
|
|
var defaultServiceType = Meteor.settings && Meteor.settings.defaultServiceType || 'dicomWeb';
|
|
|
|
|
var serviceInfo = Meteor.settings[defaultServiceType];
|
|
|
|
|
if (defaultServiceType === 'dicomWeb') {
|
2016-03-10 20:47:55 +01:00
|
|
|
var serverInformationDicom = [];
|
2016-06-07 19:09:47 +02:00
|
|
|
var endpoints = serviceInfo['endpoints'];
|
2016-03-10 20:47:55 +01:00
|
|
|
endpoints.forEach(function(endpoint) {
|
|
|
|
|
var parsedUrl = parseUrl(endpoint.qidoRoot);
|
2016-06-07 19:09:47 +02:00
|
|
|
serverInformationDicom.push({
|
|
|
|
|
host: parsedUrl.hostname,
|
|
|
|
|
port: parsedUrl.port,
|
|
|
|
|
aeTitle: endpoint.name
|
|
|
|
|
});
|
2016-03-10 20:47:55 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return serverInformationDicom;
|
2016-03-10 04:47:17 +01:00
|
|
|
}
|
2016-06-07 19:09:47 +02:00
|
|
|
|
2016-03-10 04:47:17 +01:00
|
|
|
return serviceInfo;
|
|
|
|
|
}
|
2016-06-07 19:09:47 +02:00
|
|
|
});
|