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

CD/DVD Burner Options

@@ -125,6 +132,8 @@ export default class BurnerOptions extends Component{ + +
diff --git a/FrontEnd/src/components/Authentication.js b/FrontEnd/src/components/Authentication.js index 61eab3dea..9276655d7 100644 --- a/FrontEnd/src/components/Authentication.js +++ b/FrontEnd/src/components/Authentication.js @@ -42,20 +42,10 @@ export default class Authentication extends Component { await apis.authentication.logIn(postData).then((answer)=>{ - // get token from fetch request - const token = answer; - - //cookie's options - var d = new Date(); - d.setTime(d.getTime() + (7*24*60*60*1000)); // cookie expire in 7 days - var expires = d.toUTCString(); - - // set token in cookie - document.cookie = `tokenOrthancJs=${token}; expires=${expires}` - document.cookie = `tokenOrthancJs=${token}; expires=${expires};HttpOnly` + console.log(answer) newState = { - accessCheck : answer + accessCheck : true } }).catch( async (error) => { diff --git a/FrontEnd/src/components/CDBurner/CDBurner.js b/FrontEnd/src/components/CDBurner/CDBurner.js index 9ef126762..3d8a87cd8 100644 --- a/FrontEnd/src/components/CDBurner/CDBurner.js +++ b/FrontEnd/src/components/CDBurner/CDBurner.js @@ -169,7 +169,6 @@ export default class CDBurner extends Component { }; render(){ - console.log(this.state.burnerJobs) return (
diff --git a/FrontEnd/src/components/Main/Footer.js b/FrontEnd/src/components/Main/Footer.js index 75485928c..a435f251b 100644 --- a/FrontEnd/src/components/Main/Footer.js +++ b/FrontEnd/src/components/Main/Footer.js @@ -8,7 +8,7 @@ export default class Footer extends Component { render () { return ( -
Orthanc Tools JS: 0.4.4 +
Orthanc Tools JS: 0.4.5