Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
].map(row => `<li>${row}</li>`).join('') + '' + this.infoText.map(row => `<p>${row}</p>`).join(''),
columns: 6
})
this.addChart({
columns: 6,
title: 'Articles',
subtitle: 'Summary for all articles',
config: {
type: 'bar',
data: {
datasets: [
{
label: 'Published',
fill: true,
backgroundColor: PageBuilder.COLOR.INFO,
data: [this.articlesCount.published]
}, {
label: 'Not Published',
fill: true,
backgroundColor: PageBuilder.COLOR.WARNING,
data: [this.articlesCount.unpublished]
},
],
},
}
})
this.addInfoList({
title: 'Recent comments',
subtitle: 'Latest comments from user all around the world',
columns: 4,
async build() {
await this.fetchData()
await this.addBlock({
title: 'Published Articles',
value: this.articlesCount.published,
icon: 'fas fa-newspaper fa-2x',
columns: 3,
})
this.addBlock({
title: 'Articles needing publication',
value: this.articlesCount.unpublished,
icon: 'fas fa-truck fa-2x',
columns: 3,
}, PageBuilder.COLOR.WARNING)
this.addBlock({
title: 'Comments',
value: await CommentModel.find({}).countDocuments(),
icon: 'fas fa-comments fa-2x',
columns: 3,
})
this.addBlock({
title: 'Users',
value: await UserModel.find({}).countDocuments(),
icon: 'fas fa-users fa-2x',
columns: 3,
})
this.addTextBox({