Submitted by maweber on Sat, 01/07/2017 - 13:36
Hi, I thought it would be useful to be able to copypaste GIT web-links from the module page, for usage in client apps (like "Tower" in my case). I never did perl, so I hacked it a bit together, but the "print formatting" part should give you a clear idea:
To have these links all together with $https, $user, $sslport, $nonsslport:
In webmin/virtualmin-git/index.cgi, around line 48:
# Build table of repositories
@table = ( );
foreach $r (@reps) {
$dom = $r->{'dom'}->{'dom'};
# MyDirt:
# Scroll down to the "push" for the idea:
$MYdom = $r->{'dom'};
@MYreps = @reps;
($MYrep) = grep { $_->{'rep'} eq $r->{'rep'} } @MYreps;
$MYrep || &error($text{'delete_erep'});
@MYusers = &list_rep_users($MYdom, $MYrep);
$MYuser = @MYusers ? $MYusers[0]->{'user'} : "\$username";
@actions = (
&ui_submit($text{'delete'},
$r->{'rep'}."\@".$r->{'dom'}->{'id'}),
&ui_submit($text{'index_browse'},
$r->{'rep'}."\@".$r->{'dom'}->{'id'}),
&ui_submit($text{'index_help'},
$r->{'rep'}."\@".$r->{'dom'}->{'id'}),
);
# I guess this makes it clear:
push(@table, [ $r->{'rep'}, $showd ? ( ) : ( $dom ),
$r->{'desc'}, $r->{'dir'}.
"</br></br><strong>Weblinks:</strong>".
"</br>http://$MYuser\@$r->{'dom'}->{'dom'}:$r->{'dom'}->{'web_port'}/git/$r->{'rep'}.git/".
"</br>https://$MYuser\@$r->{'dom'}->{'dom'}:$r->{'dom'}->{'web_sslport'}/git/$r->{'rep'}.git/",
join(" ", @actions) ]);
}
.
I'd be happy if that makes sense to you too, and would take something like this into your build.
Thanks, Best,
Manu
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Sat, 01/07/2017 - 15:41 Comment #1
Ok, are you suggesting that the link to gitweb be a proper link rather than a button?
Submitted by maweber on Sat, 01/07/2017 - 20:45 Comment #2
hm, maybe my specifics, but my situation was, that i needed a full url to paste.
especially I needed the written SSL port, because it's non-standard.
so for me a button would make me go to the new window and copy it from the browser's address-bar.
yet the browser would protest for fishing danger, because there is a user@ in the url.
so I'd rather prefer the overview/ or similar.
but for you this button may have another purpose...?
m
Submitted by maweber on Sat, 01/07/2017 - 20:49 Comment #3
btw, first I put the links into the helper CGI page, which was easier, but I thought that an overview would serve better... maybe...
Submitted by JamieCameron on Sun, 01/08/2017 - 01:03 Comment #4
Ok, the next release of the Git plugin for Virtualmin will use links instead of buttons.
Submitted by JamieCameron on Sun, 01/08/2017 - 01:03 Comment #5
I think maweber is looking for something like this:
Live demonstration (hosted on virtualmin) can be found here: https://git.topfreelancer.co.uk/gs/apache-error-pages
I was missing that feature in git plugin as well, and it would be great to have it included. Perhaps there are 3th party apps which could be used for this purpose as well. As webdev and devops I use git almost every day and all the times and this button or link would be great!
Submitted by maweber on Fri, 01/13/2017 - 05:24 Comment #7
I guess a dirty hack could also be to put both data into two very slimmed down, transparent
<input type="text" />
Then a double click into it will usually make it ready to copy. m
maweber sure, or I was thinking to add some js on page, like on click select etc.. like on this examle:
of course we could add another small js which will read current link location and pate this into text area, when user click on it, text become highlighted co just ctrl+c would work. I think that would be simplest solution?
Submitted by maweber on Sat, 01/14/2017 - 13:31 Comment #9
you mean like 1 copy-textarea which is fed by X buttons from the list?
i can just speak for myself, I'm a visually orientated person, and plain visible standardized-repetition of links is very easy to read. first I want to search the REPO name (first TD. should be STRONG), then take my http(s) link.
i think it's about 2 entries per TR here? http and https, right?
i think the this.select() is bullet-proof and sufficient. maybe add a cross-browser copy-button, but at first I think it should be easy to read (more intelligent js is not important to me personally at this point). also: the length of this string is not endless (https.DOMAIN./git/REPONAME.git), and even if it's truncated by the width of the TEXTAREA or INPUT (which looks clearer in repetition lists) the url-nature is clear to understand visually...
just my two cents, i think anyway, it's as far as I can wish just to get these strings...
Submitted by maweber on Sat, 01/14/2017 - 13:41 Comment #10
btw, I'm not sure, but the absolute SYSTEM-ROOT path to the *.git is no use for me... anyone?
edit:
sorry for the slight redundancy in my posts, I was not fully aware that you suggested all of this in #6.
there's a copy mechanism already in your example picture.
Submitted by Anonymous on Sat, 01/28/2017 - 13:46 Comment #11
Automatically closed - issue fixed for 2 weeks with no activity.