mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-10 17:49:17 +00:00
project page and build page improvements
This commit is contained in:
parent
f66f3b97d6
commit
66362b2a08
@ -1,3 +1,11 @@
|
||||
.build-view {
|
||||
&_info {
|
||||
}
|
||||
&_terminal {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.build {
|
||||
.clearfix;
|
||||
padding: 15px;
|
||||
|
@ -24,24 +24,39 @@
|
||||
&_items {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
padding: 15px 5px 5px;
|
||||
padding: 0;
|
||||
padding-top: 15px;
|
||||
left: 0;
|
||||
background: #2c3e50;
|
||||
background: @brand-primary;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&_item {
|
||||
padding: 5px 10px;
|
||||
.clearfix();
|
||||
|
||||
padding: 10px 10px;
|
||||
|
||||
&_link {
|
||||
float: left;
|
||||
display: block;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
&_run {
|
||||
float: right;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: lighten(@brand-primary, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
box-sizing: border-box;
|
||||
|
||||
&_code {
|
||||
height: 300px;
|
||||
height: 420px;
|
||||
padding: 8px 12px;
|
||||
box-sizing: border-box;
|
||||
overflow-y: scroll;
|
||||
|
@ -20,7 +20,7 @@ define([
|
||||
Route({handler: Components.App},
|
||||
Route({name: 'dashboard', path: '/', handler: Components.Dashboard}),
|
||||
Route({
|
||||
name: 'projects',
|
||||
name: 'project',
|
||||
path: 'projects/:name',
|
||||
handler: Components.Project.View
|
||||
}),
|
||||
@ -34,5 +34,4 @@ define([
|
||||
document.getElementById('content')
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
.builds
|
||||
if !this.state.items.length
|
||||
p Build list is empty
|
||||
p Build history is empty
|
||||
each build, index in this.state.items
|
||||
Item(build=build, key=build.id)
|
||||
|
@ -1,52 +1,101 @@
|
||||
if this.state.build
|
||||
h2
|
||||
span= this.state.build.project.name
|
||||
span build #
|
||||
span= this.state.build.number
|
||||
mixin statusBadge(build)
|
||||
if build.status === 'in-progress'
|
||||
span.label.label-info in progress
|
||||
|
||||
div
|
||||
| Initiated by
|
||||
- var initiator = this.state.build.initiator;
|
||||
if initiator.type === 'user'
|
||||
span user
|
||||
else if initiator.type === 'build'
|
||||
span= initiator.project.name
|
||||
span build #
|
||||
span= initiator.number
|
||||
else
|
||||
span= initiator.type
|
||||
if build.status === 'queued'
|
||||
span.label.label-default queued
|
||||
|
||||
if this.state.build.startDate
|
||||
div
|
||||
| Started at
|
||||
if this.state.build.startDate
|
||||
DateTime(date=new Date(this.state.build.startDate))
|
||||
else
|
||||
| -
|
||||
else
|
||||
div
|
||||
| Queued at
|
||||
if this.state.build.createDate
|
||||
DateTime(date=new Date(this.state.build.createDate))
|
||||
else
|
||||
| -
|
||||
if build.status === 'done'
|
||||
span.label.label.sm.label-success done
|
||||
|
||||
div
|
||||
| Built at
|
||||
if this.state.build.endDate
|
||||
DateTime(date=new Date(this.state.build.endDate))
|
||||
else
|
||||
| -
|
||||
if build.status === 'error'
|
||||
span.label.label-danger error
|
||||
|
||||
div
|
||||
if this.state.build.error
|
||||
| Error:
|
||||
span= this.state.build.error.message
|
||||
|
||||
if this.state.build.error.stderr
|
||||
div stderr:
|
||||
pre= this.state.build.error.stderr
|
||||
|
||||
.row
|
||||
div.row
|
||||
if this.state.build
|
||||
.col-md-8
|
||||
Terminal(build=this.state.build.id)
|
||||
h1
|
||||
.pull-right(style={fontSize: '22px'})
|
||||
mixin statusBadge(this.state.build)
|
||||
span Build #
|
||||
span= this.state.build.number
|
||||
|
||||
.text-muted(style={marginTop: '-10px'})
|
||||
| Initiated by
|
||||
- var initiator = this.state.build.initiator;
|
||||
if initiator.type === 'user'
|
||||
span user
|
||||
else if initiator.type === 'build'
|
||||
Link(to="project", params={name: initiator.project.name})
|
||||
span= initiator.project.name
|
||||
|
|
||||
| during the
|
||||
|
|
||||
Link(to="build", params={id: initiator.id})
|
||||
span build #
|
||||
span= initiator.number
|
||||
else
|
||||
span= initiator.type
|
||||
|
||||
hr
|
||||
|
||||
.build-view_info
|
||||
if this.state.build.error && this.state.build.error.message
|
||||
.text-center.alert.alert-danger
|
||||
| Error:
|
||||
span= this.state.build.error.message
|
||||
.row
|
||||
.col-md-6
|
||||
p
|
||||
Scm(scm=this.state.build.project.scm.type)
|
||||
|
|
||||
| Project
|
||||
Link(to="project", params={name: this.state.build.project.name})
|
||||
span= this.state.build.project.name
|
||||
|
||||
p
|
||||
i.fa.fa-fw.fa-clock-o
|
||||
span
|
||||
if this.state.build.startDate
|
||||
span Started at
|
||||
DateTime(date=new Date(this.state.build.startDate))
|
||||
else
|
||||
span Queued at
|
||||
DateTime(date=new Date(this.state.build.createDate))
|
||||
|
||||
if this.state.build.status !== 'in-progress'
|
||||
p
|
||||
i.fa.fa-fw.fa-circle
|
||||
|
|
||||
| Finished at
|
||||
if this.state.build.endDate
|
||||
DateTime(date=new Date(this.state.build.endDate))
|
||||
else
|
||||
| -
|
||||
.col-md-6
|
||||
p
|
||||
i.fa.fa-fw.fa-user
|
||||
|
|
||||
| Commit author
|
||||
|
|
||||
span= this.state.build.scm.rev.author
|
||||
p
|
||||
i.fa.fa-fw.fa-code-fork
|
||||
|
|
||||
| Revision
|
||||
|
|
||||
span= this.state.build.scm.rev.id
|
||||
|
||||
p
|
||||
i.fa.fa-fw.fa-comment-o
|
||||
|
|
||||
| Comment
|
||||
|
|
||||
span= this.state.build.scm.rev.comment
|
||||
|
||||
h2
|
||||
i.fa.fa-fw.fa-terminal
|
||||
|
|
||||
| Console output
|
||||
.build-view_terminal
|
||||
Terminal(build=this.state.build.id)
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
define([
|
||||
'react',
|
||||
'react-router',
|
||||
'reflux',
|
||||
'app/actions/build',
|
||||
'app/stores/build',
|
||||
@ -9,12 +10,14 @@ define([
|
||||
'templates/app/components/builds/view',
|
||||
'app/components/common/index'
|
||||
], function(
|
||||
React, Reflux, BuildActions, buildStore, TerminalComponent, template,
|
||||
React, Router, Reflux, BuildActions, buildStore, TerminalComponent, template,
|
||||
CommonComponents
|
||||
) {
|
||||
template = template.locals({
|
||||
DateTime: CommonComponents.DateTime,
|
||||
Terminal: TerminalComponent
|
||||
Scm: CommonComponents.Scm,
|
||||
Terminal: TerminalComponent,
|
||||
Link: Router.Link
|
||||
});
|
||||
|
||||
var Component = React.createClass({
|
||||
|
@ -1,9 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'./dateTime/index'
|
||||
], function(DateTime) {
|
||||
'./dateTime/index',
|
||||
'./scm/index'
|
||||
], function(DateTime, Scm) {
|
||||
return {
|
||||
DateTime: DateTime
|
||||
DateTime: DateTime,
|
||||
Scm: Scm
|
||||
};
|
||||
});
|
||||
|
5
static/js/app/components/common/scm/index.jade
Normal file
5
static/js/app/components/common/scm/index.jade
Normal file
@ -0,0 +1,5 @@
|
||||
if this.props.scm
|
||||
if this.props.scm === 'mercurial'
|
||||
i.fa.fa-fw.fa-bitbucket
|
||||
else
|
||||
i.fa.fa-fw.fa-git
|
10
static/js/app/components/common/scm/index.js
Normal file
10
static/js/app/components/common/scm/index.js
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'react', 'templates/app/components/common/scm/index'
|
||||
], function(React, template) {
|
||||
return React.createClass({
|
||||
render: template
|
||||
});
|
||||
});
|
||||
|
@ -13,12 +13,12 @@
|
||||
)
|
||||
ul.projects-selector_items
|
||||
each project in this.state.projects
|
||||
li.projects-selector_item.row(key=project.name)
|
||||
.col-md-8
|
||||
Link.projects-selector_item_link(to="projects", params={name: project.name}, onMouseDown=this.onSelectProject(project.name))
|
||||
span= project.name
|
||||
.col-md-4.text-small.text-right
|
||||
a.projects-selector_item_run(href="javascript:void(0);", onMouseDown=this.onRunProject(project.name))
|
||||
i.fa.fa-fw.fa-play
|
||||
li.projects-selector_item(key=project.name)
|
||||
Link.projects-selector_item_link(to="project", params={name: project.name}, onMouseDown=this.onSelectProject(project.name))
|
||||
Scm(scm=project.scm.type)
|
||||
span
|
||||
span= project.name
|
||||
a.projects-selector_item_run(href="javascript:void(0);", onMouseDown=this.onRunProject(project.name))
|
||||
i.fa.fa-fw.fa-play
|
||||
|
||||
|
||||
|
@ -3,10 +3,14 @@
|
||||
define([
|
||||
'react', 'react-router', 'reflux', 'app/actions/project',
|
||||
'app/stores/projects',
|
||||
'app/components/common/scm/index',
|
||||
'templates/app/components/projects/selector/index'
|
||||
], function(React, Router, Reflux, ProjectActions, projectsStore, template) {
|
||||
], function(React, Router, Reflux, ProjectActions, projectsStore, Scm,
|
||||
template
|
||||
) {
|
||||
template = template.locals({
|
||||
Link: Router.Link
|
||||
Link: Router.Link,
|
||||
Scm: Scm
|
||||
});
|
||||
|
||||
return React.createClass({
|
||||
@ -24,7 +28,7 @@ define([
|
||||
this.setState({showSearch: false});
|
||||
},
|
||||
onSelectProject: function(name) {
|
||||
this.transitionTo('projects', {name: name});
|
||||
this.transitionTo('project', {name: name});
|
||||
},
|
||||
updateItems: function(projects) {
|
||||
this.setState({projects: projects});
|
||||
|
@ -1,3 +1,21 @@
|
||||
div
|
||||
h1= this.state.project.name
|
||||
Builds()
|
||||
.row
|
||||
.col-md-8
|
||||
h1
|
||||
.pull-right
|
||||
span.badge.badge-default= this.state.project.scm ? this.state.project.scm.rev : ''
|
||||
|
||||
Scm(scm=this.state.project.scm ? this.state.project.scm.type : '')
|
||||
span= this.state.project.name
|
||||
|
||||
hr
|
||||
div.text-muted
|
||||
p Last successfully build: ...
|
||||
p Current successfully streak: ...
|
||||
p Last build time: ...
|
||||
p Average build time: ...
|
||||
|
||||
h2
|
||||
i.fa.fa-fw.fa-history
|
||||
span
|
||||
span Build history
|
||||
Builds()
|
||||
|
@ -6,12 +6,14 @@ define([
|
||||
'app/actions/build',
|
||||
'app/stores/project',
|
||||
'app/components/builds/list',
|
||||
'app/components/common/scm/index',
|
||||
'templates/app/components/projects/view/index'
|
||||
], function(React, Reflux, ProjectActions, BuildActions,
|
||||
projectStore, Builds, template
|
||||
projectStore, Builds, Scm, template
|
||||
) {
|
||||
template = template.locals({
|
||||
Builds: Builds
|
||||
Builds: Builds,
|
||||
Scm: Scm
|
||||
});
|
||||
|
||||
return React.createClass({
|
||||
|
@ -17,6 +17,7 @@ define([
|
||||
resource.sync('readAll', function(err, projects) {
|
||||
if (err) throw err;
|
||||
self.trigger(projects);
|
||||
console.log(projects);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user