Compare commits
2 Commits
v3.9.1
...
86ad0b38dd
| Author | SHA1 | Date | |
|---|---|---|---|
| 86ad0b38dd | |||
| cb380a521d |
@@ -1,9 +1,11 @@
|
|||||||
/** @type {AppTypes.Config} */
|
/** @type {AppTypes.Config} */
|
||||||
|
function sas_get_token() {
|
||||||
|
//implement token here
|
||||||
|
return "kris-check-token-is-here";
|
||||||
|
}
|
||||||
window.config = {
|
window.config = {
|
||||||
|
sasGetToken: sas_get_token,
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
pacs_document_host: '152.42.173.210',
|
|
||||||
pacs_document_port: 8080,
|
|
||||||
// whiteLabeling: {},
|
// whiteLabeling: {},
|
||||||
extensions: [],
|
extensions: [],
|
||||||
modes: [],
|
modes: [],
|
||||||
@@ -26,10 +28,12 @@ window.config = {
|
|||||||
prefetch: 25,
|
prefetch: 25,
|
||||||
},
|
},
|
||||||
expertise: false, //* Tambahan untuk enable expertise (CustomizableViewportOverlay)
|
expertise: false, //* Tambahan untuk enable expertise (CustomizableViewportOverlay)
|
||||||
|
expertise_host: `http://152.42.173.210`, //* Tambahan untuk fetch data Expertise)
|
||||||
|
pacs_document_host: `${window.location.hostname}`,
|
||||||
|
pacs_document_port: 8080,
|
||||||
// filterQueryParam: false,
|
// filterQueryParam: false,
|
||||||
// defaultDataSourceName: 'dicomweb',
|
// defaultDataSourceName: 'dicomweb',
|
||||||
defaultDataSourceName: 'local-proxy',
|
defaultDataSourceName: 'local-proxy',
|
||||||
// defaultDataSourceName: 'GCP',
|
|
||||||
/* Dynamic config allows user to pass "configUrl" query string this allows to load config without recompiling application. The regex will ensure valid configuration source */
|
/* Dynamic config allows user to pass "configUrl" query string this allows to load config without recompiling application. The regex will ensure valid configuration source */
|
||||||
// dangerouslyUseDynamicConfig: {
|
// dangerouslyUseDynamicConfig: {
|
||||||
// enabled: true,
|
// enabled: true,
|
||||||
@@ -45,10 +49,10 @@ window.config = {
|
|||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
||||||
sourceName: 'local-proxy',
|
sourceName: 'local-proxy',
|
||||||
configuration: {
|
configuration: {
|
||||||
friendlyName: 'DCM4CHEE Server',
|
friendlyName: 'Static WADO Local Data',
|
||||||
name: 'DCM4CHEE',
|
name: 'DCM4CHEE',
|
||||||
qidoRoot: 'http://152.42.173.210:5000/rs',
|
qidoRoot: `http://152.42.173.210:5000/rs`,
|
||||||
wadoRoot: 'http://152.42.173.210:5000/rs',
|
wadoRoot: `http://152.42.173.210:5000/rs`,
|
||||||
qidoSupportsIncludeField: false,
|
qidoSupportsIncludeField: false,
|
||||||
supportsReject: true,
|
supportsReject: true,
|
||||||
supportsStow: true,
|
supportsStow: true,
|
||||||
@@ -58,100 +62,14 @@ window.config = {
|
|||||||
supportsFuzzyMatching: false,
|
supportsFuzzyMatching: false,
|
||||||
supportsWildcard: true,
|
supportsWildcard: true,
|
||||||
staticWado: true,
|
staticWado: true,
|
||||||
singlepart: 'bulkdata,video',
|
singlepart: 'video',
|
||||||
bulkDataURI: {
|
bulkDataURI: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
relativeResolution: 'studies',
|
relativeResolution: 'studies',
|
||||||
transform: url => url.replace('/pixeldata.mp4', '/rendered'),
|
|
||||||
},
|
},
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
|
||||||
sourceName: 'dicomweb',
|
|
||||||
configuration: {
|
|
||||||
friendlyName: 'AWS S3 Static wado server',
|
|
||||||
name: 'aws',
|
|
||||||
wadoUriRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
wadoRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoSupportsIncludeField: false,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
enableStudyLazyLoad: true,
|
|
||||||
supportsFuzzyMatching: false,
|
|
||||||
supportsWildcard: true,
|
|
||||||
staticWado: true,
|
|
||||||
singlepart: 'bulkdata,video',
|
|
||||||
// whether the data source should use retrieveBulkData to grab metadata,
|
|
||||||
// and in case of relative path, what would it be relative to, options
|
|
||||||
// are in the series level or study level (some servers like series some study)
|
|
||||||
bulkDataURI: {
|
|
||||||
enabled: true,
|
|
||||||
relativeResolution: 'studies',
|
|
||||||
transform: url => url.replace('/pixeldata.mp4', '/rendered'),
|
|
||||||
},
|
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
|
||||||
sourceName: 'ohif2',
|
|
||||||
configuration: {
|
|
||||||
friendlyName: 'AWS S3 Static wado secondary server',
|
|
||||||
name: 'aws',
|
|
||||||
wadoUriRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
wadoRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
|
|
||||||
qidoSupportsIncludeField: false,
|
|
||||||
supportsReject: false,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
enableStudyLazyLoad: true,
|
|
||||||
supportsFuzzyMatching: false,
|
|
||||||
supportsWildcard: true,
|
|
||||||
staticWado: true,
|
|
||||||
singlepart: 'bulkdata,video',
|
|
||||||
// whether the data source should use retrieveBulkData to grab metadata,
|
|
||||||
// and in case of relative path, what would it be relative to, options
|
|
||||||
// are in the series level or study level (some servers like series some study)
|
|
||||||
bulkDataURI: {
|
|
||||||
enabled: true,
|
|
||||||
relativeResolution: 'studies',
|
|
||||||
},
|
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
|
||||||
sourceName: 'ohif3',
|
|
||||||
configuration: {
|
|
||||||
friendlyName: 'AWS S3 Static wado secondary server',
|
|
||||||
name: 'aws',
|
|
||||||
wadoUriRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
|
|
||||||
qidoRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
|
|
||||||
wadoRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
|
|
||||||
qidoSupportsIncludeField: false,
|
|
||||||
supportsReject: false,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
enableStudyLazyLoad: true,
|
|
||||||
supportsFuzzyMatching: false,
|
|
||||||
supportsWildcard: true,
|
|
||||||
staticWado: true,
|
|
||||||
singlepart: 'bulkdata,video',
|
|
||||||
// whether the data source should use retrieveBulkData to grab metadata,
|
|
||||||
// and in case of relative path, what would it be relative to, options
|
|
||||||
// are in the series level or study level (some servers like series some study)
|
|
||||||
bulkDataURI: {
|
|
||||||
enabled: true,
|
|
||||||
relativeResolution: 'studies',
|
|
||||||
},
|
|
||||||
omitQuotationForMultipartRequest: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomwebproxy',
|
namespace: '@ohif/extension-default.dataSourcesModule.dicomwebproxy',
|
||||||
sourceName: 'dicomwebproxy',
|
sourceName: 'dicomwebproxy',
|
||||||
|
|||||||
@@ -37,6 +37,38 @@ import appInit from './appInit.js';
|
|||||||
import OpenIdConnectRoutes from './utils/OpenIdConnectRoutes';
|
import OpenIdConnectRoutes from './utils/OpenIdConnectRoutes';
|
||||||
import { ShepherdJourneyProvider } from 'react-shepherd';
|
import { ShepherdJourneyProvider } from 'react-shepherd';
|
||||||
|
|
||||||
|
function injectAuth() {
|
||||||
|
console.log("---> Inject Auth");
|
||||||
|
const originalXHROpen = XMLHttpRequest.prototype.open;
|
||||||
|
const originalXHRSend = XMLHttpRequest.prototype.send;
|
||||||
|
|
||||||
|
//take from local storage for the token
|
||||||
|
// let authToken = '--kris-auth-token-check--';
|
||||||
|
let authToken = window.config.sasGetToken();
|
||||||
|
|
||||||
|
XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
|
||||||
|
this._url = url; // Save URL if you want conditional logic
|
||||||
|
return originalXHROpen.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
XMLHttpRequest.prototype.send = function (body) {
|
||||||
|
this.setRequestHeader('Authorization', `Bearer ${authToken}`);
|
||||||
|
this.addEventListener('readystatechange', function () {
|
||||||
|
if (this.readyState === 4) { // DONE
|
||||||
|
try {
|
||||||
|
//check responseType ie json, and then check the auth response status
|
||||||
|
//redirect to custom login page if needed
|
||||||
|
console.log("response type :", this.responseType);
|
||||||
|
console.log("response :", this.response);
|
||||||
|
console.log("responseText :", this.responseText);
|
||||||
|
} catch (e) { }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return originalXHRSend.apply(this, arguments);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
injectAuth();
|
||||||
let commandsManager: CommandsManager,
|
let commandsManager: CommandsManager,
|
||||||
extensionManager: ExtensionManager,
|
extensionManager: ExtensionManager,
|
||||||
servicesManager: AppTypes.ServicesManager,
|
servicesManager: AppTypes.ServicesManager,
|
||||||
|
|||||||
Reference in New Issue
Block a user