flecs-hub / flecs-systems-admin

A web dashboard for Flecs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flecs-systems-admin

A web dashboard for Flecs

Getting started

First, make sure you clone and build the required dependencies:

When you are using bake, you can run the following command to install and build all modules:

bake clone flecs-hub/flecs-systems-admin

Command line parameter

The easiest way to run the admin is by passing arguments to the commandline. This lets you run the admin for any project without explicitly adding it to the code. For this to work, initialize your Flecs application like this:

ecs_init_w_args(world, argc, argv);

When you start your application, add the following arguments:

my_app --admin 9090

Enable in code

If you always want to run the admin with your project, you can enable it in code. To do this you need to include the following modules in your project:

  • flecs.components.http
  • flecs.systems.civetweb
  • flecs.systems.admin

If you are using bake, you can simply add these modules to the "use" property, like this:

{
    "id": "my_project",
    "type": "application",
    "value": {
        "use": ["flecs", "flecs.components.http", "flecs.systems.civetweb", "flecs.systems.admin"]
    }
}

In your main function, now add the following lines of code:

ecs_world_t *world = ecs_init();

/* Import modules for admin */
ECS_IMPORT(world, FlecsComponentsHttp, 0);
ECS_IMPORT(world, FlecsSystemsCivetweb, 0);
ECS_IMPORT(world, FlecsSystemsAdmin, 0);

/* Create the admin entity */
ecs_set(world, 0, EcsAdmin, {.port = 9090});

When you run your project, you should be able to see the admin in localhost:9090.

What if I am not using bake

Currently the admin needs certain features from bake to run. This dependency will be removed in the future, but if you would like to use the admin today without bake, you will have to change the ut_locate call to something that tells the code where to find the HTML / JS / CSS files.

Screenshots

Overview

overview

Performance

performance

Memory

memory

Systems

systems

About

A web dashboard for Flecs

License:MIT License


Languages

Language:JavaScript 88.9%Language:C 9.1%Language:CSS 1.8%Language:HTML 0.3%