bull-admin-panel
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -23,2 +23,5 @@ const classNames = require('classnames'); | ||
}).isRequired, | ||
queues: PropTypes.arrayOf(PropTypes.shape({ | ||
name: PropTypes.string.isRequired | ||
}).isRequired).isRequired, | ||
jobs: PropTypes.shape({ | ||
@@ -79,2 +82,11 @@ index: PropTypes.number.isRequired, | ||
componentDidMount() { | ||
super.componentDidMount(); | ||
const {params, queues} = this.props; | ||
if (!params.queue) { | ||
getRouter().go({name: 'web.jobs', params: {queue: queues[0].name}}); | ||
} | ||
} | ||
notificationHandler = (eventType, queueName, jobId) => { | ||
@@ -81,0 +93,0 @@ const {params} = this.props; |
@@ -72,8 +72,4 @@ const classNames = require('classnames'); | ||
const {queues} = this.props; | ||
const {currentQueue} = this.state; | ||
queues.forEach(queue => this.countJobs(queue.name, 0)); | ||
if (!currentQueue) { | ||
getRouter().go({name: 'web.jobs', params: {queue: queues[0].name}}); | ||
} | ||
} | ||
@@ -118,3 +114,3 @@ | ||
event.preventDefault(); | ||
getRouter().go({name: 'web', params: {}}, {reload: true}); | ||
getRouter().go(window.config.basePath, {reload: true}); | ||
}; | ||
@@ -121,0 +117,0 @@ |
@@ -13,2 +13,3 @@ const {Router} = require('capybara-router'); | ||
{ | ||
isAbstract: true, | ||
name: 'web', | ||
@@ -25,9 +26,2 @@ uri: `${BASE_PATH}`, | ||
resolve: { | ||
jobCounts: ({queue}) => { | ||
if (!queue) { | ||
return null; | ||
} | ||
return api.job.countAllStateJobs(queue); | ||
}, | ||
jobs: ({queue, state}) => { | ||
@@ -41,11 +35,4 @@ if (!queue) { | ||
}, | ||
onEnter: props => { | ||
const table = { | ||
[jobStates.WAITING]: `Waiting - ${TITLE}`, | ||
[jobStates.ACTIVE]: `Active - ${TITLE}`, | ||
[jobStates.COMPLETED]: `Completed - ${TITLE}`, | ||
[jobStates.FAILED]: `Failed - ${TITLE}`, | ||
[jobStates.DELAYED]: `Delayed - ${TITLE}` | ||
}; | ||
document.title = table[props.params.state || jobStates.ACTIVE]; | ||
onEnter: ({params}) => { | ||
document.title = params.queue ? `${params.queue} - ${TITLE}` : TITLE; | ||
}, | ||
@@ -58,4 +45,4 @@ component: require('./pages/jobs') | ||
dismissalDelay: 300, | ||
onEnter: props => { | ||
document.title = `#${props.job.id} - ${TITLE}`; | ||
onEnter: ({params, job}) => { | ||
document.title = `#${job.id} - ${params.queue} - ${TITLE}`; | ||
}, | ||
@@ -62,0 +49,0 @@ resolve: { |
{ | ||
"name": "bull-admin-panel", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "An admin panel of Bull based on WebSocket.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2235105
3073