OHIF-172: Make default values for requestOptions object

This commit is contained in:
Aysel Afsar 2017-10-05 10:50:54 -04:00
parent 1ed39e0d78
commit 131d64854c
2 changed files with 26 additions and 25 deletions

View File

@ -26,6 +26,7 @@ export const DICOMWebRequestOptions = new SimpleSchema({
auth: {
type: String,
label: 'Authentication',
defaultValue: 'orthanc:orthanc',
optional: true
},
logRequests: {

View File

@ -4,6 +4,31 @@ import { OHIF } from 'meteor/ohif:core';
import { Servers } from 'meteor/ohif:servers/both/collections';
import { ServerConfiguration } from 'meteor/ohif:servers/both/schema/servers.js';
// Validate the servers configuration
Meteor.startup(() => {
// Save custom properties (if any)...
// "Meteor.settings" and "Meteor.settings.public" are set by default...
let custom = {
private: Meteor.settings.custom,
public: Meteor.settings.public.custom
};
// ... and remove them to prevent clean up
delete Meteor.settings.custom;
delete Meteor.settings.public.custom;
ServerConfiguration.clean(Meteor.settings);
// TODO: Make the error messages more clear
// Taking this out for now to prevent confusion.
// check(Meteor.settings, ServerConfiguration);
Meteor.settings.custom = custom.private;
Meteor.settings.public.custom = custom.public;
OHIF.log.info(JSON.stringify(Meteor.settings, null, 2));
});
// Check the servers on meteor startup
Meteor.startup(function() {
OHIF.log.info('Updating servers information from JSON configuration');
@ -34,28 +59,3 @@ Meteor.startup(function() {
OHIF.servers.control.resetCurrentServer();
});
// Validate the servers configuration
Meteor.startup(() => {
// Save custom properties (if any)...
// "Meteor.settings" and "Meteor.settings.public" are set by default...
let custom = {
private: Meteor.settings.custom,
public: Meteor.settings.public.custom
};
// ... and remove them to prevent clean up
delete Meteor.settings.custom;
delete Meteor.settings.public.custom;
ServerConfiguration.clean(Meteor.settings);
// TODO: Make the error messages more clear
// Taking this out for now to prevent confusion.
// check(Meteor.settings, ServerConfiguration);
Meteor.settings.custom = custom.private;
Meteor.settings.public.custom = custom.public;
OHIF.log.info(JSON.stringify(Meteor.settings, null, 2));
});