diff --git a/BackEnd/controllers/authentication.js b/BackEnd/controllers/authentication.js index 98e3dbe31..bccdb58c9 100644 --- a/BackEnd/controllers/authentication.js +++ b/BackEnd/controllers/authentication.js @@ -6,7 +6,7 @@ authentication = async function (req, res) { try { const userObject = new Users(body.username) await userObject.checkPassword(body.password, async function(reponse) { - console.log(reponse) + if (reponse) { let user = new Users(body.username) @@ -29,7 +29,8 @@ authentication = async function (req, res) { var TOKEN = jwt.sign(payload, process.env.TOKEN_SECRET, { expiresIn: '1h' }); - res.json(TOKEN); + res.cookie("tokenOrthancJs", TOKEN, {httpOnly: true}) + res.json(true) }) } else { res.status(401).send('Wrong Credential') diff --git a/BackEnd/controllers/options.js b/BackEnd/controllers/options.js index e9072f6f9..f420c4929 100644 --- a/BackEnd/controllers/options.js +++ b/BackEnd/controllers/options.js @@ -23,7 +23,8 @@ var updateRobotOptions = async function(req, res){ body.burner_monitoring_level, body.burner_support_type, body.burner_delete_study_after_sent, - body.burner_transfer_syntax + body.burner_transfer_syntax, + body.date_format ) res.json(true) } diff --git a/BackEnd/model/Options.js b/BackEnd/model/Options.js index 0737bb299..0486aa5cd 100644 --- a/BackEnd/model/Options.js +++ b/BackEnd/model/Options.js @@ -24,7 +24,7 @@ const Options = { }, setBurnerOptions : async (burner_monitored_path, burner_viewer_path, burner_label_path, burner_manifacturer, burner_monitoring_level, - burner_support_type, burner_delete_study_after_sent, burner_transfer_syntax ) => { + burner_support_type, burner_delete_study_after_sent, burner_transfer_syntax, date_format ) => { const option = await db.Option.findOne(({ where: { id: 1 } })) @@ -36,6 +36,7 @@ const Options = { option.burner_support_type = burner_support_type option.burner_delete_study_after_sent = burner_delete_study_after_sent option.burner_transfer_syntax = burner_transfer_syntax + option.date_format = date_format await option.save() diff --git a/BackEnd/model/monitoring/cdburner/CdBurner.js b/BackEnd/model/monitoring/cdburner/CdBurner.js index c51106904..fdd681a95 100644 --- a/BackEnd/model/monitoring/cdburner/CdBurner.js +++ b/BackEnd/model/monitoring/cdburner/CdBurner.js @@ -31,7 +31,7 @@ class CdBurner { this.dateOptions = { month: 'numeric', day: 'numeric', year : 'numeric' } //precision of the date const options = await Options.getCdBurnerOptions() - + //format of date (using contry convention) if (options.date_format === "fr") { this.format = "DD/MM/YYYY" diff --git a/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js b/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js index 06da3de91..25485b174 100644 --- a/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js +++ b/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js @@ -19,6 +19,7 @@ export default class BurnerOptions extends Component{ burner_manifacturer : '', burner_monitoring_level : '', burner_support_type : '', + date_format: '', burner_delete_study_after_sent : false, burner_transfer_syntax : null @@ -40,6 +41,11 @@ export default class BurnerOptions extends Component{ {value : 'DVD', label : 'DVD'} ] + dateFormatOptions = [ + {value: 'uk', label : 'MMDDYYYY'}, + {value: 'fr', label : "DDMMYYYY"} + ] + transferSyntaxOptions = [ {value: 'None', label: 'None (Original TS)'}, {value: '1.2.840.10008.1.2', label: 'Implicit VR Endian'}, @@ -111,6 +117,7 @@ export default class BurnerOptions extends Component{ render(){ return ( + //date_format