[VERY_UNLIKELY] Open new browser tab after starting a manually triggered rule

Hi Sebastian!

Rules / “Manually triggered” + “Send webhook” is great to initiate a new build process for static sites in the background, but currently there’s no way to automatically show live progress information to the user about the current progress of the triggered action.

I host and build my static sites on my own VPS and I’m going to write a Node+Express app which handles the build hook requests eg. “example-dot-com/build” which in the browser first shows some please wait text with a spinner, then redirects to the site when the build finished (or shows some error when failed).

So what I would like to achieve is to somehow open a new browser tab right after the user pressed the trigger button, where I can show some progress/result to the user.

I know the real webhook request with the payload data is now sent by Squidex (some background job handler) - not by my browser - and that job can be queued, so I assume what I want is complicated.

Possible implementations (?):

  1. Maybe the “Send webhook” form could have a new field where we can choose between “Run by Squidex job handler” / “Open request in a new window immediately”.
  2. Introduce a new “then” action similar to “Webhook”, something like “Open http request” (with custom headers).
  3. Something more (most user friendly IMHO): A new button (module) in the main menu bar (left) named “Links” or something where the owner can add links (with icon, title, description, headers) which are related to the current App. Beside the above (Rebuild website) it could be also a place for other useful links like Developer’s website / Support page / Download backup / Anything…

I’m sure you understand… :slight_smile:
Thank you very much and a million thanks for Squidex :heart: !

It is not possible or a lot of effort due to the architecture how rules work. They run in the background which makes it complicated to connect it to the frontend.

But you can write content sidebar extension.

Ok, I was thinking only in manually triggered rules. I understand that “hacking” it into the rules system is not a good idea. I’m going to open another topic with another approach. Please close this.

But manually triggered rules are also executed in the background. They just push a new event to the system, when the button is pressed.

Yes, that’s why I wrote “I assume what I want is complicated” in the first post.

To be the simplest - and to achieve my goal -, I would be fine with a checkbox field at the bottom of the Webhook form:

“When triggered manually, just open the URL in a new window immediately (no headers and payload data will be sent)”

And if it’s checked, a simple window.open() js call woluld open the URL in response to click the run button (instead pushing a new event to the system)

Anyway, my simple goal is to somehow provide 2 external links to my content editors inside the Squidex UI, which would be opened in a new window when clicked:

  • Build production site
  • Build preview (staging) site

My other - simple to implement - idea would be something like App / Settings / UI Settings / External links, where I would be able to add my custom URLs (URL, title). Then they could be presented in the top menu bar in a dropdown beside “Quick Nav”. Or on the App’s dashboard with a new widget.

Have you seen thtat?

https://docs.squidex.io/02-documentation/developer-guides/custom-sidebars

Sure, as soon as you suggested it in your first reply. But as the docs say: custom sidebar plugins must be connected to “a single content item or a list of content items”. As I understand, for my needs I should have to connect my plugin to all my schemas because what I want is an easy to find solution. But that little puzzle icon is hard to notice and understand for non technical people and I also should remember to always attach the plugin after creating a new schema.

However, this technique (iframe based custom plugin) would be great for creating custom dashboard plugins. That would be a great place for presenting any external content (site health, custom charts, my build links, anything…) to the user, but that would require more time to implement I assume. But definitely that would be the perfect solution…

But for now I would only need some pure links in one easy to find place :slight_smile: That’s why I think a new dropdown icon in the top menu bar would be useful. That icon would be visible only when links are added in Settings \ External links (new). Then I could tell my content editors that “If you want to preview the whole site, just click the icon in the top and choose Build preview. If looks good, choose Build production site”.

It is actually possible.

If you go to the Expert Mode for the dashboard you can edit the config and then add something like this

[
    {
        "cols": 1,
        "rows": 1,
        "x": 0,
        "y": 0,
        "type": "schemas",
        "name": "i18n:dashboard.schemasCard"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 1,
        "y": 0,
        "type": "api",
        "name": "i18n:dashboard.apiDocumentationCard"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 2,
        "y": 0,
        "type": "support",
        "name": "i18n:dashboard.supportCard"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 3,
        "y": 0,
        "type": "github",
        "name": "i18n:dashboard.githubCard"
    },
    {
        "cols": 2,
        "rows": 1,
        "x": 0,
        "y": 1,
        "type": "api-calls",
        "name": "i18n:dashboard.apiCallsChart"
    },
    {
        "cols": 2,
        "rows": 1,
        "x": 2,
        "y": 1,
        "type": "api-performance",
        "name": "i18n:dashboard.apiPerformanceChart"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 0,
        "y": 2,
        "type": "api-calls-summary",
        "name": "i18n:dashboard.apiCallsSummaryCard"
    },
    {
        "cols": 2,
        "rows": 1,
        "x": 1,
        "y": 2,
        "type": "asset-uploads-count",
        "name": "i18n:dashboard.assetUpdloadsCountChart"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 3,
        "y": 2,
        "type": "asset-uploads-size-summary",
        "name": "i18n:dashboard.assetUploadsSizeChart"
    },
    {
        "cols": 2,
        "rows": 1,
        "x": 0,
        "y": 3,
        "type": "asset-uploads-size",
        "name": "i18n:dashboard.assetTotalSize"
    },
    {
        "cols": 2,
        "rows": 1,
        "x": 2,
        "y": 3,
        "type": "api-traffic",
        "name": "i18n:dashboard.trafficChart"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 0,
        "y": 4,
        "type": "api-traffic-summary",
        "name": "i18n:dashboard.trafficSummaryCard"
    },
    {
        "cols": 2,
        "rows": 1,
        "x": 1,
        "y": 4,
        "type": "history",
        "name": "i18n:dashboard.historyCard"
    },
    {
        "cols": 1,
        "rows": 1,
        "x": 1,
        "y": 5,
        "type": "iframe",
        "name": "Squidex",
        "options": {
            "src": "https://squidex.io"
        }
    }
]

See the last entry

Hmm, this looks promising, but unfortunately the inserted panel/widget shows the default 404 page of the internal system (no matter what URL I use for the src).

Looking at the iframe in Chrome DevTools, the src attribute of the iframe is:

https://cms.mydomain.tld/undefined

My Squidex instance is running on my VPS in Docker and I access it on cms.mydomain.tld trough my Nginx reverse proxy, but I don’t think it is related to the issue (bug?).

Edit: It’s the same 404 page on my free cloud.squidex.io with this minimal config:

[
    {
        "cols": 3,
        "rows": 2,
        "x": 0,
        "y": 0,
        "type": "iframe",
        "name": "Squidex",
        "options": {
            "src": "https://squidex.io"
        }
    }
]

Sorry,

It is just

[
    {
        "cols": 3,
        "rows": 2,
        "x": 0,
        "y": 0,
        "type": "iframe",
        "name": "Squidex",
        "src": "https://squidex.io"
    }
]
1 Like