diff --git a/histomicsui/web_client/views/itemList.js b/histomicsui/web_client/views/itemList.js index e4c2ac7d..36ab741d 100644 --- a/histomicsui/web_client/views/itemList.js +++ b/histomicsui/web_client/views/itemList.js @@ -63,6 +63,32 @@ wrap(ItemListWidget, 'render', function (render) { } HuiSettings.getSettings().then((settings) => { + const brandName = (settings['histomicsui.brand_name'] || 'HistomicsUI'); + const webrootPath = (settings['histomicsui.webroot_path'] || 'histomics'); + + ItemListWidget.registeredApplications.histomicsui = { + name: brandName, + // icon: + check: (modelType, model) => { + if (modelType !== 'item' || !model.get('largeImage')) { + return false; + } + const li = model.get('largeImage'); + if (!li.fileId || li.expected === true) { + return false; + } + let priority = 0; + try { + if (model.get('meta') && model.get('meta').dicom && model.get('meta').dicom.Modality && model.get('meta').dicom.Modality !== 'SM') { + priority = 1; + } + } catch (e) {} + return { + url: `${webrootPath}#?image=${model.id}`, + priority: priority + }; + } + }; if (this.accessLevel >= AccessType.WRITE) { adjustView.call(this, settings); } diff --git a/histomicsui/webroot.mako b/histomicsui/webroot.mako index b2b6a434..e58b2b13 100644 --- a/histomicsui/webroot.mako +++ b/histomicsui/webroot.mako @@ -8,6 +8,231 @@ % for plugin in pluginCss: % endfor + + + + + + + + +
${apiRoot}