Apps

API

class frontend.apps(frontend)

This portion of the API handles all pages relevant to apps.

frontend.apps.addComponent(c)

Add a component to display on each app’s page (/#/apps/myappid)

Arguments
  • c (object()) – Object containing component and display information

  • c.key (string()) – Key of the component, calling addComponent multiple times with the same key replaces the existing component with the new one. By default, heedy defines the “header” key, which contains the main card containing app icon and main options, and the “objects” key, which is the list of the app’s objects. The notifications plugin adds a “notifications” component, which is only rendered when there are notifications for the app.

  • c.weight (float()) – the component’s weight, with heavier components coming below lighter ones. The header has weight 0, and object list has weight 1. Notifications have weight 0.1.

  • c.component (vue.Component()) – The vue component object to display. Takes “app” object as a prop.

Examples:

frontend.apps.addComponent({
 key: "myComponentKey",
 weight: 2,
 component: MyComponent
});
frontend.apps.addMenu(mf)

A function that given an app object, returns a map where each key is menu item key, and each value is a menu item, and has icon, text, and action props.

Arguments
  • mf (function()) –

Examples:

frontend.objects.addMenu((o)=> ({
 my_menu_item: {
   text: "My Menu Item",
   icon: "fas fa-code",
   path: `myplugin/${o.id}`
 }
}));
frontend.apps.addRoute(r)

This function works in the same way as frontend.addRoute, but each path is relative to the app ID. The components are passed a valid app object as the app prop.

Arguments
  • r.path (string()) – The path, relative to /#/apps/:appid

  • r.component (vue.Component()) – Vue component object to show as the page at that route. The component should have an app prop of type Object that is given the specific app.

Examples:

frontend.apps.addRoute({
 path: "myplugin/path", // This means /#/apps/:appid/myplugin/path
 component: MyComponent
});