Skip to content

Commit

Permalink
Merge pull request #328 from manics/webclient-id-url
Browse files Browse the repository at this point in the history
Link image ID back to webclient
  • Loading branch information
jburel authored Jun 24, 2020
2 parents 60a0452 + a323f3e commit ce8404f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/info/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
<table show.bind="image_info.ready" class="table table-condensed">
<tr>
<td class="col-sm-6 text-weight-bold">Image ID:</td>
<td class="col-sm-6">${image_info.image_id}</td>
<td class="col-sm-6">
<a href="${image_info.web_url}"
title="Show ${image_info.short_image_name} in webclient"
target="_blank">${image_info.image_id}
</a>
</td>
</tr>
<tr show.bind="parent_info !== null">
<td class="col-sm-6 text-weight-bold">${parent_info.title}:</td>
Expand Down
12 changes: 11 additions & 1 deletion src/model/image_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Misc from '../utils/misc';
import Ui from '../utils/ui';
import {
APP_TITLE, CHANNEL_SETTINGS_MODE, INITIAL_TYPES, IVIEWER,
PROJECTION, REQUEST_PARAMS, WEBGATEWAY
PROJECTION, REQUEST_PARAMS, WEBCLIENT, WEBGATEWAY
} from '../utils/constants';
import { IMAGE_SETTINGS_REFRESH } from '../events/events';

Expand Down Expand Up @@ -236,6 +236,13 @@ export default class ImageInfo {
*/
model = "color";

/**
* URL to open the image in the main client
* @memberof ImageInfo
* @type {string}
*/
web_url = null;

/**
* @constructor
* @param {Context} context the application context
Expand All @@ -255,6 +262,9 @@ export default class ImageInfo {
parent_type <= INITIAL_TYPES.WELL)
this.parent_type = parent_type;
}
this.web_url = this.context.server +
this.context.getPrefixedURI(WEBCLIENT) +
'/?show=image-' + this.image_id;
}

/**
Expand Down

0 comments on commit ce8404f

Please sign in to comment.