How to use the admin-bro.PageBuilder.COLOR function in admin-bro

To help you get started, we’ve selected a few admin-bro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SoftwareBrothers / admin-bro-example-app / admin / pages / dashboard-page.js View on Github external
].map(row =&gt; `<li>${row}</li>`).join('') + '' + this.infoText.map(row =&gt; `<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,
github SoftwareBrothers / admin-bro-example-app / admin / pages / dashboard-page.js View on Github external
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({