2016-03-10 14:47:55 -05:00
|
|
|
function parseUrl(url) {
|
|
|
|
|
var parser = document.createElement('a');
|
|
|
|
|
parser.href = url;
|
|
|
|
|
return parser;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-09 22:47:17 -05: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 14:47:55 -05:00
|
|
|
var serverInformationDicom = [];
|
2016-06-07 19:09:47 +02:00
|
|
|
var endpoints = serviceInfo['endpoints'];
|
2016-03-10 14:47:55 -05: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 14:47:55 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return serverInformationDicom;
|
2016-03-09 22:47:17 -05:00
|
|
|
}
|
2016-06-07 19:09:47 +02:00
|
|
|
|
2016-03-09 22:47:17 -05:00
|
|
|
return serviceInfo;
|
|
|
|
|
}
|
2016-06-07 19:09:47 +02:00
|
|
|
});
|