-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show detailed build information on a separate page
- Loading branch information
1 parent
0b69365
commit 937b9c7
Showing
6 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Ember from 'ember'; | ||
|
||
const { computed } = Ember; | ||
|
||
function flattenBuildInfo(buildOrdering, builds) { | ||
if (!buildOrdering || !builds) { | ||
return []; | ||
} | ||
|
||
return buildOrdering.map(version => { | ||
const thisVersion = builds[version]; | ||
|
||
return { | ||
version, | ||
'x86_64-apple-darwin': thisVersion['x86_64-apple-darwin'], | ||
'x86_64-pc-windows-gnu': thisVersion['x86_64-pc-windows-gnu'], | ||
'x86_64-pc-windows-msvc': thisVersion['x86_64-pc-windows-msvc'], | ||
'x86_64-unknown-linux-gnu': thisVersion['x86_64-unknown-linux-gnu'], | ||
}; | ||
}); | ||
} | ||
|
||
export default Ember.Controller.extend({ | ||
id: computed.alias('model.crate.id'), | ||
name: computed.alias('model.crate.name'), | ||
version: computed.alias('model.num'), | ||
build_info: computed.alias('model.build_info'), | ||
stable_build: computed('build_info.ordering.stable', 'build_info.stable', function() { | ||
const ordering = this.get('build_info.ordering.stable'); | ||
const stable = this.get('build_info.stable'); | ||
|
||
return flattenBuildInfo(ordering, stable); | ||
}), | ||
beta_build: computed('build_info.ordering.beta', 'build_info.beta', function() { | ||
const ordering = this.get('build_info.ordering.beta'); | ||
const beta = this.get('build_info.beta'); | ||
|
||
return flattenBuildInfo(ordering, beta); | ||
}), | ||
nightly_build: computed('build_info.ordering.nightly', 'build_info.nightly', function() { | ||
const ordering = this.get('build_info.ordering.nightly'); | ||
const nightly = this.get('build_info.nightly'); | ||
|
||
return flattenBuildInfo(ordering, nightly); | ||
}), | ||
has_stable_builds: computed.gt('stable_build.length', 0), | ||
has_beta_builds: computed.gt('beta_build.length', 0), | ||
has_nightly_builds: computed.gt('nightly_build.length', 0), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Ember from 'ember'; | ||
|
||
export function buildInfoPassFail(status) { | ||
if (status === true) { | ||
return '✅ Pass'; | ||
} else if (status === false) { | ||
return '❌ Fail'; | ||
} else { | ||
return ''; | ||
} | ||
} | ||
|
||
export default Ember.Helper.helper(params => buildInfoPassFail(params[0])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
model(params) { | ||
const requestedVersion = params.version_num; | ||
const crate = this.modelFor('crate'); | ||
|
||
// Find version model | ||
return crate.get('versions') | ||
.then(versions => { | ||
const version = versions.find(version => version.get('num') === requestedVersion); | ||
if (!version) { | ||
this.controllerFor('application').set('nextFlashError', | ||
`Version '${requestedVersion}' of crate '${crate.get('name')}' does not exist`); | ||
} | ||
return version; | ||
}); | ||
}, | ||
|
||
serialize(model) { | ||
let version_num = model ? model.get('num') : ''; | ||
return { version_num }; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{{title name}} | ||
|
||
<div class='all-versions-back'> | ||
{{#link-to 'crate' id}}⬅ Back to {{ name }}{{/link-to}} | ||
</div> | ||
|
||
<div id='crates-heading'> | ||
<div class="wide"> | ||
<div class='info'> | ||
<img class='logo crate' src="/assets/crate.png"/> | ||
<h1>Build info for {{ name }}</h1> | ||
<h2>{{ version }}</h2> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div id='crate-build-info'> | ||
{{#if has_stable_builds}} | ||
<h3>Stable channel</h3> | ||
<table> | ||
<tr> | ||
<th>Rust Version</th> | ||
<th>Linux 64 bit</th> | ||
<th>macOS 64 bit</th> | ||
<th>Windows (GNU) 64 bit</th> | ||
<th>Windows (MSVC) 64 bit</th> | ||
</tr> | ||
{{#each stable_build as |build|}} | ||
<tr> | ||
<td>{{ build.version }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-unknown-linux-gnu }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-apple-darwin }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-pc-windows-gnu }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-pc-windows-msvc }}</td> | ||
</tr> | ||
{{/each}} | ||
</table> | ||
{{/if}} | ||
|
||
{{#if has_beta_builds}} | ||
<h3>Beta channel</h3> | ||
<table> | ||
<tr> | ||
<th>Rust Version</th> | ||
<th>Linux 64 bit</th> | ||
<th>macOS 64 bit</th> | ||
<th>Windows (GNU) 64 bit</th> | ||
<th>Windows (MSVC) 64 bit</th> | ||
</tr> | ||
{{#each beta_build as |build|}} | ||
<tr> | ||
<td>{{ format-day build.version }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-unknown-linux-gnu }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-apple-darwin }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-pc-windows-gnu }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-pc-windows-msvc }}</td> | ||
</tr> | ||
{{/each}} | ||
</table> | ||
{{/if}} | ||
|
||
{{#if has_nightly_builds}} | ||
<h3>Nightly channel</h3> | ||
<table> | ||
<tr> | ||
<th>Rust Version</th> | ||
<th>Linux 64 bit</th> | ||
<th>macOS 64 bit</th> | ||
<th>Windows (GNU) 64 bit</th> | ||
<th>Windows (MSVC) 64 bit</th> | ||
</tr> | ||
{{#each nightly_build as |build|}} | ||
<tr> | ||
<td>{{ format-day build.version }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-unknown-linux-gnu }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-apple-darwin }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-pc-windows-gnu }}</td> | ||
<td>{{ build-info-pass-fail build.x86_64-pc-windows-msvc }}</td> | ||
</tr> | ||
{{/each}} | ||
</table> | ||
{{/if}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters