npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

waigo-plugin-admin

v2.1.0

Published

Administration UI for Waigo apps (plugin)

Downloads

3

Readme

waigo-plugin-admin

The official waigo plugin which provides an Administration interface for your Waigo app:

  • See info on cron jobs and run them whenever you want
  • Test out all of your app's routes (incl. POST, PUT, etc)
  • Send an email to a selection of users (raw query filtering supported)
  • Browse, create and edit database data (raw query filtering supported)

All routes are placed under the /admin path and access is controlled via the Waigo ACL. By default only users with the admin role can access the routes.

Requirements

This plugin must be used in conjunction with Waigo 2+. It assumes you're using Waigo's built-in model layer, including the built-in User model.

Installation

$ npm install waigo-plugin-admin

Usage instructions

Set what links will show in the admin dashboard nav menu by entering the following in your config/base.js:

// admin menu
config.adminMenu = [
  {
    label: 'Dashboard',
    path: '/admin',
  },
  {
    label: 'Routes',
    path: '/admin/routes',
    canAccess: 'admin',
  },
  {
    label: 'Data',
    path: '/admin/models',
    canAccess: 'admin',
  },
  {
    label: 'Send email',
    path: '/admin/emails',
    canAccess: 'admin',
  },
  {
    label: 'Cron tasks',
    path: '/admin/cron',
    canAccess: 'admin',
  },
];

Note: the canAccess key specifies the the name of the resources which the user must be able to access (according to the ACL) in order to be access the given page. If not provided then anyone would be able to access the given page.

Ensure you have alteast one user with the admin role assigned and that the ACL contains an entry allowing admin role access to the admin resource.

Start Waigo and browse to /admin.

Login as the admin user and start using the interface.

Customization

The data admin page will by default show all table columns for each model. To modify this behaviour provide an adminViewOptions key within your model schemas. For example:

// File: src/models.activity.js


const UserSchema = {
  id: {    
    type: String,
    required: false,
  },
  displayName: {
    type: String,
    required: true,
  },
};

exports.schema = {
  verb: { 
    type: String, 
    required: true,
  },
  published: {
    type: Date,
    required: true,
  },
  actor: {
    type: [UserSchema],
    required: true,
    adminViewOptions: {
      viewSubKey: "displayName" /* when showing this column just show the value of the UserSchema.displayName key */
    }
  },
  details: {
    type: Object,
    adminViewOptions: {
      hide: true, /* don't show this column */
    },
  },
};

License

MIT - see LICENSE.md