web: link to index.html if index_links is set
If the deployer has indicated that they would prefer the dashboard to link to index.html files rather than bare directories, do so. This is in aid of object storage systems where index.html is not automatically returned for directories. Change-Id: Iacbc016396f9e6681dd6c945224c5f63af24c5df
This commit is contained in:
parent
00578d721c
commit
f330fc67fd
|
@ -235,7 +235,8 @@ const receiveBuildManifest = (buildId, manifest) => {
|
|||
return {
|
||||
type: BUILD_MANIFEST_SUCCESS,
|
||||
buildId: buildId,
|
||||
manifest: {tree: manifest.tree, index: index},
|
||||
manifest: {tree: manifest.tree, index: index,
|
||||
index_links: manifest.index_links},
|
||||
receivedAt: Date.now()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,11 @@ class Manifest extends React.Component {
|
|||
render() {
|
||||
const { tenant, build } = this.props
|
||||
|
||||
const raw_suffix = (obj) => {
|
||||
return (obj.mimetype === 'application/directory' &&
|
||||
build.manifest.index_links) ? 'index.html' : ''
|
||||
}
|
||||
|
||||
const nodes = build.manifest.tree.map(
|
||||
n => renderTree(
|
||||
tenant, build, '/', n,
|
||||
|
@ -40,13 +45,13 @@ class Manifest extends React.Component {
|
|||
to={tenant.linkPrefix + '/build/' + build.uuid + '/log' + path + name}>
|
||||
{obj.name}
|
||||
</Link>
|
||||
(<a href={log_url + path + name}>raw</a>
|
||||
(<a href={log_url + path + name + raw_suffix(obj)}>raw</a>
|
||||
<span className="fa fa-external-link"/>)
|
||||
</span>),
|
||||
(log_url, path, name, obj) => (
|
||||
<span>
|
||||
{obj.name}
|
||||
(<a href={log_url + path + name}>raw</a>
|
||||
(<a href={log_url + path + name + raw_suffix(obj)}>raw</a>
|
||||
<span className="fa fa-external-link"/>)
|
||||
</span>
|
||||
)))
|
||||
|
|
|
@ -84,9 +84,15 @@ class Summary extends React.Component {
|
|||
}
|
||||
if (column === 'log_url') {
|
||||
label = 'log url'
|
||||
if (build.manifest && build.manifest.index_links) {
|
||||
value = <a href={value + 'index.html'}>{value}</a>
|
||||
} else {
|
||||
value = <a href={value}>{value}</a>
|
||||
}
|
||||
}
|
||||
if (column === 'ref_url') {
|
||||
label = 'ref url'
|
||||
value = <a href={value}>{value}</a>
|
||||
}
|
||||
if (column === 'event_id') {
|
||||
label = 'event id'
|
||||
|
|
Loading…
Reference in New Issue