diff --git a/config/dev.env.js b/config/dev.env.js index 09c3a6b..8adf251 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -7,7 +7,7 @@ module.exports = merge(prodEnv, { NODE_ENV: '"development"', SESSION: '"http://fortress.sh/v1/sessions"', API_URL: '"http://fortress.sh/"', - API_TIMEOUT: '"4000"', + API_TIMEOUT: '"10000"', GITHUB_OAUTH: '"https://github.com/login/oauth/authorize?client_id=aa942c520baf3f84f67f&scope=admin:org_hook%20admin:repo_hook%20admin:public_key%20repo%20user"', SOCKET_URL: '"ws://fortress.sh"', SOCKET_PATH: '"/notifications"', diff --git a/config/prod.env.js b/config/prod.env.js index e10529e..54984eb 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -5,7 +5,7 @@ module.exports = { NODE_ENV: '"production"', SESSION: '"http://fortress.sh/v1/sessions"', API_URL: '"http://fortress.sh/"', - API_TIMEOUT: '"4000"', + API_TIMEOUT: '"10000"', GITHUB_OAUTH: '"https://github.com/login/oauth/authorize?client_id=aa942c520baf3f84f67f&scope=admin:org_hook%20admin:repo_hook%20admin:public_key%20repo%20user"', SOCKET_URL: '"wss://fortress.sh"', SOCKET_PATH: '"/notifications"', diff --git a/config/test.env.js b/config/test.env.js index 3e10b39..b39a265 100644 --- a/config/test.env.js +++ b/config/test.env.js @@ -6,7 +6,7 @@ module.exports = merge(devEnv, { NODE_ENV: '"testing"', SESSION: '"http://api.fortress.sh/v1/sessions"', API_URL: '"http://api.fortress.sh/"', - API_TIMEOUT: '"4000"', + API_TIMEOUT: '"10000"', GITHUB_OAUTH: '"https://github.com/login/oauth/authorize?client_id=aa942c520baf3f84f67f&scope=admin:org_hook%20admin:repo_hook%20admin:public_key%20repo%20user"', SOCKET_URL: '"ws://websockets.fortress.sh"', SOCKET_PATH: '"/notifications"', diff --git a/src/components/builds/build-item.vue b/src/components/builds/build-item.vue index 01b48f8..17d53a9 100644 --- a/src/components/builds/build-item.vue +++ b/src/components/builds/build-item.vue @@ -5,17 +5,19 @@
- - - + @@ -24,9 +26,9 @@

- {{ branch }} + {{ branch }} # {{ commit }} # {{ id }}
- 1 hour ago + {{ createdAtFromNow }}

@@ -35,6 +37,7 @@ diff --git a/src/components/builds/build-page.vue b/src/components/builds/build-page.vue index 980a7cf..65b1b33 100644 --- a/src/components/builds/build-page.vue +++ b/src/components/builds/build-page.vue @@ -1,8 +1,8 @@ @@ -12,13 +12,17 @@ import { mapState, mapActions, mapGetters } from 'vuex'; export default { created() { const projectId = this.$route.params.project_id; - const buildId = this.$route.params.id; - this.prefetch({ + const id = this.$route.params.id; + this.prefetchLogs({ projectId, - buildId, + id, }); - this.updateBuildEvent = `builds:${buildId}:update`; - this.newLogEvent = `logs:${buildId}:new`; + this.prefetchBuild({ + projectId, + id, + }); + this.updateBuildEvent = `builds:${id}:update`; + this.newLogEvent = `logs:${id}:new`; this.connection.on(this.newLogEvent, this.log.bind(this)); this.connection.on(this.updateBuildEvent, this.update.bind(this)); }, @@ -30,27 +34,36 @@ export default { ...mapGetters('socket', [ 'connection', ]), - ...mapState('build', [ - 'status', - ]), - ...mapGetters('build', [ - 'logs', - ]), + ...mapState('build', { + build: 'build', + isBuildLoading: 'isLoading', + }), + ...mapState('log', { + isLogsLoading: 'isLoading', + }), + ...mapGetters('log', { + logs: 'logs', + }), buildStatusClassName() { + const { status } = this.build; return { - 'fsh-build-success': this.status === 'success', - 'fsh-build-failure': ['failure', 'maintenance'].includes(this.status), - 'fsh-build-primary': ['created', 'scheduled'].includes(this.status), - 'fsh-build-running': this.status === 'running', + 'fsh-build-success': status === 'successful', + 'fsh-build-failure': ['failed', 'maintenance'].includes(status), + 'fsh-build-primary': ['created', 'scheduled', 'timeouted'] + .includes(status), + 'fsh-build-running': status === 'running', }; }, }, methods: { - ...mapActions('build', [ - 'log', - 'prefetch', - 'update', - ]), + ...mapActions('log', { + prefetchLogs: 'prefetch', + log: 'log', + }), + ...mapActions('build', { + prefetchBuild: 'prefetch', + update: 'update', + }), }, }; @@ -67,4 +80,11 @@ export default { .fsh-build-running { border-top: 5px solid #8080f2; } + pre { + white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */ + white-space: -pre-wrap; /* Opera */ + white-space: -o-pre-wrap; /* Opera */ + white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */ + word-wrap: break-word; /* IE 5.5+ */ + } diff --git a/src/components/builds/builds-page.vue b/src/components/builds/builds-page.vue index c7d2cb2..91bc792 100644 --- a/src/components/builds/builds-page.vue +++ b/src/components/builds/builds-page.vue @@ -1,5 +1,5 @@