Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening Webmin from Cloudmin should open in a new tab #182

Closed
h9k opened this issue May 31, 2015 · 56 comments
Closed

Opening Webmin from Cloudmin should open in a new tab #182

h9k opened this issue May 31, 2015 · 56 comments

Comments

@h9k
Copy link

h9k commented May 31, 2015

In the old Virtualmin Framed theme, when clicking on the "Open Webmin" link in the left pane in Cloudmin, the Webmin of the selected server would open in a new tab.
But with authentic-theme it opens in the same window, which looks a little bit odd with two sidebars, plus it results in layout problems.
Is it possible to make it open in a new tab?

@iliajie
Copy link
Collaborator

iliajie commented May 31, 2015

Be kind posting a screenshot! I am planning to release an update tonight, 13.04.

@iliajie
Copy link
Collaborator

iliajie commented May 31, 2015

Waiting for more details. Update 13.04 is about to be pushed.

@h9k
Copy link
Author

h9k commented Jun 1, 2015

Sorry for not making it on time.
Here is the screenshot
cm

@iliajie
Copy link
Collaborator

iliajie commented Jun 1, 2015

  1. Why do you need Webmin link inside of there?
  2. What is the URL that you set in Custom Links?

This is link is coming from Custom Links module, right?

@iliajie
Copy link
Collaborator

iliajie commented Jun 1, 2015

You can switch to Webmin using Alt+W hotkey

@iliajie
Copy link
Collaborator

iliajie commented Jun 2, 2015

How did you get Open Webmin? What is the URL there, on that link?

@iliajie
Copy link
Collaborator

iliajie commented Jun 2, 2015

Actually in order to open Webmin in the new tab, all you need to do is to set custom link with full URL, like https://localhost:10000. In case you set it like /, yes you will get what you get and it's obvious.

So just use full location.href and it will work. Not an issue! Closing.

@iliajie iliajie closed this as completed Jun 2, 2015
@h9k
Copy link
Author

h9k commented Jun 2, 2015

It is not a custom link, this is a built-in feature of Cloudmin.
The "Link to Webmin" opens Webmin in a new tab and works fine.
The "Open Webmin" also opens Webmin in a new tab, but in already logged in state. It works via javascript.
This is an example:

<li>
<a target="page" class="navigation_module_trigger" data-href="../servers/link.cgi/1577302730283920/"><i class="fa fa-fw fa-external-link"></i> <span>Open Webmin</span></a>
</li>

@iliajie
Copy link
Collaborator

iliajie commented Jun 2, 2015

I don't have this link?! How do you login?

@iliajie
Copy link
Collaborator

iliajie commented Jun 2, 2015

Can you go to Custom Links and see if it's defined there?

@h9k
Copy link
Author

h9k commented Jun 2, 2015

It's not in custom links. I go there this way: Cloudmin tab -> List managed systems -> then click on a managed system (or actually select one from the dropdown in the left pane) -> links should appear like in my screenshot, related to the selected managed system.

@h9k
Copy link
Author

h9k commented Jun 2, 2015

Oh, I forgot, the managed system must have Webmin installed and be registered with Cloudmin probably, so that the link displays there.

@h9k
Copy link
Author

h9k commented Jun 21, 2015

any news on this? :)

@iliajie
Copy link
Collaborator

iliajie commented Jun 21, 2015

:) OK. Can you control what link is set there or it's hardcoded? Are you sure it's not from custom links? Do you use custom links? I don't see this link and can not reproduce it. I need more detailed info on how did you make it appear!? I don't have it showing in Cloudmin?

What is the link's URL and what is the selector? Can you open dev tool and debug this link and attaching the screenshot.

1 similar comment
@iliajie
Copy link
Collaborator

iliajie commented Jun 21, 2015

:) OK. Can you control what link is set there or it's hardcoded? Are you sure it's not from custom links? Do you use custom links? I don't see this link and can not reproduce it. I need more detailed info on how did you make it appear!? I don't have it showing in Cloudmin?

What is the link's URL and what is the selector? Can you open dev tool and debug this link and attaching the screenshot.

@iliajie iliajie reopened this Jun 21, 2015
@h9k
Copy link
Author

h9k commented Jun 22, 2015

That link appears automatically if the managed system has Webmin installed and it is configured in Cloudmin. So basically, if a managed system (be it kvm, xen, openvz, or even physical, whatever) has Webmin installed on it, in Cloudmin you have to configure access to the Webmin.
When adding a managed system to Cloudmin, it will ask you if it has Webmin and you can provide details. On an existing system, I am not so sure where you can add the information. I guess under "Change password" or "Edit system", see my original screenshot at the top left.

In the Authentic theme, the link is like this:

<li>
<a target="page" class="navigation_module_trigger" data-href="../servers/link.cgi/1577312345683920/"><i class="fa fa-fw fa-external-link"></i> <span>Open Webmin</span></a>
</li>

In the Virtualmin Framed theme, the link is like this:

<div class="leftlink"><a href="../servers/link.cgi/1577312345683920/" target="_blank">Open Webmin</a></div>

As you can see, for some reason in the Authentic theme that links gets the target "page", whereas in the Virtualmin Framed theme it gets target _blank, which is correct behavior.

@iliajie
Copy link
Collaborator

iliajie commented Jun 22, 2015

Alright, now it's very clear. I am at vacation right now and don't have access to my debug server. I will try making a fix while I'm here if I can and provide you with the fix which I'll add to the next release in the end of the month, as I remember there were some other reported bugs for Cloudmin.

Thanks for clearing that up.

@iliajie
Copy link
Collaborator

iliajie commented Jun 22, 2015

Alright! I have fixed it before as I just found and commented this out as that was causing some issues in other parts of the theme. Now it seems alright and should add target blank attribute to the link! Please be kind testing with updated default.min.js.

@iliajie
Copy link
Collaborator

iliajie commented Jun 22, 2015

@h9k
Copy link
Author

h9k commented Jun 22, 2015

Hmmm somehow the theme is broken now, just see the loaders. But don't have time to test further, will try again in 12 hours.

@iliajie
Copy link
Collaborator

iliajie commented Jun 22, 2015

This is very unlikely. Clear cache please and try again.

@h9k
Copy link
Author

h9k commented Jun 22, 2015

I cleared cache and reloaded everything, unfortunately the link has still target="page"

@iliajie
Copy link
Collaborator

iliajie commented Jun 23, 2015

Ahh. Ok. I missed that Webmin devs provided a trigger for links that should be opened in new page. It should have been done using server-side. Added couple of strings to .lib file. Please upload and test:

https://rostovtsev.ru/pub/src/authentic/13.05-patches/issue182/authentic-lib.cgi

Working now, right??

@h9k
Copy link
Author

h9k commented Jun 24, 2015

Nope. Strangely, now target is _blank, but somehow the browser ignores it and still opens in the right frame. Tested with Chrome and Firefox

@iliajie
Copy link
Collaborator

iliajie commented Jun 27, 2015

Ahh..Ok, I got it. This one should work. Please test:

https://rostovtsev.ru/pub/src/authentic/13.05-patches/issue182/1/authentic-lib.cgi

@h9k
Copy link
Author

h9k commented Jun 28, 2015

Unfortunately, now when I click on the link nothing happens :(

@iliajie
Copy link
Collaborator

iliajie commented Jun 28, 2015

Can you please make a screenshot of it debugging in browser's console?

@h9k
Copy link
Author

h9k commented Jun 29, 2015

Uncaught Error: Syntax error, unrecognized expression: ../servers/link.cgi/1378123456781040/
ga.error @ jquery.min.js?1305:2
ga.tokenize @ jquery.min.js?1305:2
ga.select @ jquery.min.js?1305:2
ga @ jquery.min.js?1305:2
n.fn.extend.find @ jquery.min.js?1305:2
n.fn.init @ jquery.min.js?1305:2
n @ jquery.min.js?1305:2
(anonymous function) @ default.min.js?1305:6

@h9k
Copy link
Author

h9k commented Jun 30, 2015

Tried with Firebug this time, it just says this:
Error: Syntax error, unrecognized expression: ../servers/link.cgi/1371234567891012/
I also tried updating the default.min.js with the one you provided, but the same error happens.

@iliajie
Copy link
Collaborator

iliajie commented Jun 30, 2015

Funny. The link really doesn't work. But it shouldn't return any issue on javascript part.. ok. I will do my best to fix it by next release, 13.10 very soon. Please stay in touch after installing updated version. Clear browsers cache, test it and in case it still doesn't work, just let me know here again!

@iliajie iliajie closed this as completed Jun 30, 2015
@iliajie
Copy link
Collaborator

iliajie commented Jun 30, 2015

Can you please again send me the link of how it looks now, like you did, example:

<li>
<a target="page" class="navigation_module_trigger" data-href="../servers/link.cgi/1577312345683920/"><i class="fa fa-fw fa-external-link"></i> <span>Open Webmin</span></a>
</li>

@iliajie
Copy link
Collaborator

iliajie commented Jun 30, 2015

Ahh. Nevermind, I got it.

@h9k
Copy link
Author

h9k commented Jul 7, 2015

Installed 13.10. Unfortunatelly it is still not fixed. The good thing is, a new tab is actually opened, the bad thing is that the link changes to the hostname without the :10000 port, resulting in a 403 forbidden error.
The way this works in the Virtualmin Framed theme is that it opens the Webmin of the managed system in the new tab, already logged in, using the cloudmin system's hostname, not the managed one. Now I actually see that https://cloudmin.blabla.tld:10000/servers/link.cgi/1234561234567890/ is being opened, but then it redirects to the hostname. Maybe you need to pass something on in post or something? No idea...

@iliajie
Copy link
Collaborator

iliajie commented Jul 7, 2015

Only port is missing in opened URL? How the link looks now and how it should be?

@iliajie iliajie reopened this Jul 7, 2015
@iliajie
Copy link
Collaborator

iliajie commented Jul 7, 2015

..and what should be opened? URL you specified looks good!?

@h9k
Copy link
Author

h9k commented Jul 7, 2015

In Authentic the link looks like this

<li class="navigation_external">
<a href="../servers/link.cgi/1234567890123456/" target="_blank"><i class="fa fa-fw fa-external-link"></i> <span>Open Webmin</span></a>
</li>

In the Virtualmin Framed theme it looks like this

<div class="leftlink"><a target="_blank" href="../servers/link.cgi/1234567890123456/">Open Webmin</a></div>

So the link looks fine. If I click on it in the Virtualmin Framed theme, it opens fine. If I click on it in the Authentic theme it opens the new tab, but then the url gets a 302 redirection from https://cloudmin.myhost.tld:10000/servers/link.cgi/1234567890123456/ to https://blabla.myhost.tld. Could not say what the problem could be, as the links are identical...

@iliajie
Copy link
Collaborator

iliajie commented Jul 7, 2015

Can you hover on that link (in left menu), click right with your mouse and choose to Copy link address in both themes and then compare them. Are they the same?

@h9k
Copy link
Author

h9k commented Jul 9, 2015

Yes, they are identical

@iliajie
Copy link
Collaborator

iliajie commented Jul 9, 2015

Can you please also paste the way links look like after they are opened in tab, both in default theme and Authentic Theme?

@h9k
Copy link
Author

h9k commented Jul 9, 2015

After they open they look like that:
Virtualmin Framed: https://cloudmin.mydomain.tld:10000/servers/link.cgi/1234567890123456/
Authentic: https://virtualhost.mydomain.tld/

@iliajie
Copy link
Collaborator

iliajie commented Jul 19, 2015

Ok, I finally got it. I reproduced the bug completely and made it go away. It will be fixed in version 14 in couple of days. Let me know how it works for you after so many tries. ;) Clear cache if you face an issue (shouldn't be necessary really).

@iliajie iliajie closed this as completed Jul 19, 2015
@iliajie
Copy link
Collaborator

iliajie commented Jul 19, 2015

Here is the little preview that shows of how version 14 makes it work. It replaces ../servers/link.cgi/ with full URL and makes it open as you expect.

Tested in Chrome and Firefox.

Take a look:

https://rostovtsev.ru/pub/src/authentic/13.10/issue182/made_url_being_full_and_showing_how_it_works.webm

@h9k
Copy link
Author

h9k commented Jul 22, 2015

yaaaay, it works now! :)

@iliajie
Copy link
Collaborator

iliajie commented Jul 22, 2015

Ouhhh! Finally!! 😮

@h9k
Copy link
Author

h9k commented Jul 22, 2015

Actually, there is another problem now... it only shows the Webmin tab and only the Webmin Servers Index and System and Server status in the menu, that's it... but that system also has Virtualmin Pro on it, it should show all of that... :|

@iliajie
Copy link
Collaborator

iliajie commented Jul 22, 2015

You mean another problem like not opening ../servers/link.cgi/... links?

@iliajie
Copy link
Collaborator

iliajie commented Jul 22, 2015

No sure I understand? Clear cache and restart Webmin... I tested it on both Virtualmin+Cloudmin GPL/Pro. All was fine.

@h9k
Copy link
Author

h9k commented Jul 23, 2015

Did that, did not help.
image
That's all I see when opening Webmin from Cloudmin...

@iliajie
Copy link
Collaborator

iliajie commented Jul 23, 2015

Please create separate issue for that. When I tested it, I also saw Cloudmin there. Where is yours?

Why you never told me about this bug before? Cause link didn't open it? What is configuration on that user? Does it show in default theme?

@iliajie
Copy link
Collaborator

iliajie commented Jul 23, 2015

...and in case you have created Cloudmin User.. When I do the same, both themes reproduce the same result. Are you expecting Virtualmin to be shown? Is it in Virtualmin theme?

@h9k
Copy link
Author

h9k commented Aug 1, 2015

I will open a separate issue for this and provide details. Sorry for the delay.

@h9k
Copy link
Author

h9k commented Aug 1, 2015

Actually, I tested by changing to Virtualmin Framed theme, same issue there... must be some new issue with Cloudmin, nothing to do with your theme this time I guess... Will open an issue at the Webmin folks :)

@iliajie
Copy link
Collaborator

iliajie commented Aug 1, 2015

Alright, super! Thanks!

@goodelectrons
Copy link

I actually found the above 'nested frames' to be extremely useful. Having the cloudmin menu helped me quickly 'remember' which system I was looking at when I walked away or took a phone call. I also find it easier to be 'framed' than digging through multiple browser tabs that shrink to just say 'webmin'.

For anyone like me the solution to get the frames back is to

  1. edit /usr/libexec/webmin/server-manager/server-manager-lib-funcs.pl
  2. search for "edit_webmin2" (you can find this ref in /lang/en) and remove target from array code.

I know this is a virtulmin/cloudmin issue but this thread comes up high on the search rankings. Thanks to team Webmin and Team Authentic for making such sweet code!

@iliajie
Copy link
Collaborator

iliajie commented Oct 18, 2015

:) You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants