asynqmon icon indicating copy to clipboard operation
asynqmon copied to clipboard

Not working on Windows

Open crossworth opened this issue 3 years ago • 15 comments

Hi, great project. I'm trying using it on Windows, but can't get it to work.

When running and trying to access the browser, the following error is displayed: open ui\build\index.html: file does not exist

I have done some diging and have found the problem, but don't know the right "fix", so for this reason I'm opening this issue instead of PR.

Basically on this line, filepath.Abs returns C:\ https://github.com/hibiken/asynqmon/blob/0eb9d88c5365d7f34c1a9ff61518a5075170bb41/main.go#L59

This causes problems with the check if is / https://github.com/hibiken/asynqmon/blob/0eb9d88c5365d7f34c1a9ff61518a5075170bb41/main.go#L65 There is a problem with filepath.Join as well, since it will use \ and GO embed.FS will not find the file then. https://golang.org/pkg/embed/#hdr-Directives

The path separator is a forward slash, even on Windows systems.

The only way I could get it to work was making the following changes:

p := r.URL.Path
if filepath.IsAbs(p) {
	p = srv.indexFilePath()
} else {
	p = path.Join(srv.staticDirPath, p)
}

// ...
func (srv *staticFileServer) indexFilePath() string {
	return path.Join(srv.staticDirPath, srv.indexFileName)
}

crossworth avatar May 08 '21 04:05 crossworth

@crossworth Thank you for reporting this issue! Apologies for not testing fully on other OSs 🙏

Is this blocking you from using the tool completely? Or have you found a way to work around it until the fix is in? (I'm trying to gauge the priority of this bug).

hibiken avatar May 08 '21 17:05 hibiken

No worries, I'm able to use with the changes from my last message.

So maybe this can be low priority.

crossworth avatar May 08 '21 19:05 crossworth

Got it, thanks for letting me know! I'll get to this issue in a few weeks 👍

hibiken avatar May 09 '21 05:05 hibiken

What do you think about embeding templates ? https://pkg.go.dev/embed

SkYNewZ avatar Mar 05 '22 02:03 SkYNewZ

@SkYNewZ thank you for the comment. There were some changes made to use the embed package since this issue has been created, so this issue may be stale. I'll look into this issue once again soon when I have enough bandwidth.

hibiken avatar Mar 06 '22 04:03 hibiken

The problem is still not fixed

eaglebetter avatar Jun 06 '22 08:06 eaglebetter

Can't use it at all in Windows, only forking and fixing. Any news on this PR(https://github.com/hibiken/asynqmon/pull/251)?

localhosted avatar Aug 23 '22 19:08 localhosted

+1

navossoc avatar Jan 23 '23 04:01 navossoc

+1 template: pattern matches no files: ui\build\index.html

4GUO avatar Mar 09 '23 09:03 4GUO

+1 template: pattern matches no files: ui\build\index.html

lidaqi001 avatar Apr 25 '23 08:04 lidaqi001

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

4GUO avatar Apr 25 '23 08:04 4GUO

+1 template: pattern matches no files: ui\build\index.html

windowshopr avatar Oct 26 '23 05:10 windowshopr

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

4GUO avatar Oct 26 '23 05:10 4GUO

+1 It looks like a repository in disrepair, is there a better fork version? 看起来像是个年久失修的仓库,有没有比较好的fork版本呢?

Raindrifter avatar Feb 21 '24 08:02 Raindrifter

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

4GUO avatar Feb 21 '24 08:02 4GUO