Skip to content

Sharing instances of apps and groups #348

@aldbr

Description

@aldbr

First approach

  • the state of the instances and groups is compressed and appended to the URL
  • problem:
    • we can potentially quickly reach the URL max length
    • we can't select the apps and groups we want to share
    • we can't add the instances and groups to an existing "workspace"

Second approach (from @TheauW)

  • the state of the instances is stored in the session storage (URL is not used anymore)
  • there are 2 new buttons:
    • one to export selected instances and groups as a JSON blob
    • the other to import a JSON blob that is then appended to the existing "workspace"

On May 15th 2025, the second approach was presented and we get interesting comments:

  • it's not intuitive (a URL would be appreciated)

  • one could potentially make a mistake in the produced JSON while copying/pasting it

  • other potential problems:

    • if you don't save the JSON blob somewhere and lose your session, then you have to build your dashboard from scratch again

Based on the comments, we could come up with a potential long-term plan to help mitigating the issues.

Ultimate approach?

The approach would include web-specific routes in diracx (new dbs and routes).

We would have 2 different objects:

  • workspaces: long-lived and editable dashboard composed of groups and sub-app instances, owned by a given user.
  • snippets: immutable snapshot corresponding to a subset of a workspace that can be shared (and expired at some point).

As a user, when you log in diracx-web, you can:

  • get your workspaces (GET /api/web/workspaces)
  • modify one of your workspace (PUT/PATCH /api/web/workspaces/{workspaceId})
  • create a new workspace (POST /api/web/workspaces)
  • delete one of your workspace (DELETE /api/web/workspaces/{workspaceId})

You can also:

  • export a snippet by selecting the instances and groups you want to include (POST /api/web/snippets body:JSON blob)
  • import a snippet in your current workspace (GET /api/web/snippets/{snippetId}) - you could potentially even choose which part of the snippet you want to import.

I think it would solve most of the problems:

  • users can save and easily retrieve their workspaces if they need
  • snippet can be shared with a simple id, avoiding the risk of potentially copying pasting a malformed JSON blob

But it also tightly binds diracx-web with diracx (which is likely fine as long as we don't spread web-specific elements throughout diracx)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions