coravelpro icon indicating copy to clipboard operation
coravelpro copied to clipboard

Configurable Dashboard URL

Open jamesmh opened this issue 5 years ago • 6 comments

jamesmh avatar Aug 15 '19 18:08 jamesmh

Original at https://github.com/jamesmh/coravel/issues/104

jamesmh avatar Aug 15 '19 18:08 jamesmh

So there is really no chance to allow to change it?

XardasLord avatar Aug 23 '19 06:08 XardasLord

It's something I'll have to look into more, but ATM it's all autoconfigured using routing from a razor library (e.g. it depends on the directory paths of the files in the Coravel Pro package)

jamesmh avatar Aug 23 '19 11:08 jamesmh

I am also facing issues with the URL of the dashboard. When I configure my website as an application in some folder structure in IIS then the functionality won't work because it expects a different URL.

For example: http://mysite.com/dir1/sub1/app

When navigating to http://mysite.com/dir1/sub1/app/coravel/scheduling the page loads fine at first sight, but the action links (Schedule) are not working (as it expects a URL of http://mysite.com/coravel/scheduling).

ervea avatar Mar 05 '20 17:03 ervea

I had this issue once but works for me now.

mkojoa avatar Apr 12 '21 07:04 mkojoa

Note: Updated: After some research.

You should be able to override routes by using the following code.

builder.Services.Configure<RazorPagesOptions>(options =>
{
    options.Conventions.AddAreaPageRoute(
        "Coravel",
        "/Dashboard", 
        "/My-Custom-Dashboard"
    );
});

This will at least change route generation when using the ASP.NET Core tag helpers. For example.

<li class="nav-item">
    <a class="nav-link text-dark" asp-area="Coravel" asp-page="/Dashboard">
        Dashboard
    </a>
</li>
Google Chrome -2023-04-19 -15-34-53

The issue I'm seeing is when in the dashboard, the routes in the dashboard aren't changing. I can't see the code, but I'm guessing those routes are hard-coded using strings like /Coravel/Dashboard instead of the tag helpers or they are not including the asp-area attribute.

Google Chrome -2023-04-19 -15-35-14

Once the Razor Pages are updated, it's a matter of creating a helper method around IServicesCollection that allows folks to configure and register an instance of an Options class.

Cheers :)

khalidabuhakmeh avatar Apr 19 '23 17:04 khalidabuhakmeh