File tree Expand file tree Collapse file tree 5 files changed +13
-12
lines changed
Expand file tree Collapse file tree 5 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,11 @@ public String getDisplayName() {
140140 * @return Jenkins relative URL.
141141 */
142142 public @ NonNull String getUrl () {
143- return "cloud/" + Util .rawEncode (name ) + "/" ;
143+ if (Jenkins .get ().getCloud (name ) != this ) { // this cloud is not the first occurrence with this name
144+ return "cloud/cloudByIndex/" + Jenkins .get ().clouds .indexOf (this ) + "/" ;
145+ } else {
146+ return "cloud/" + Util .rawEncode (name ) + "/" ;
147+ }
144148 }
145149
146150 @ Override
Original file line number Diff line number Diff line change @@ -113,11 +113,7 @@ public ManagementLink getManagementLink() {
113113 @ Restricted (DoNotUse .class ) // stapler
114114 public String getCloudUrl (StaplerRequest2 request , Jenkins jenkins , Cloud cloud ) {
115115 String context = Functions .getNearestAncestorUrl (request , jenkins );
116- if (Jenkins .get ().getCloud (cloud .name ) != cloud ) { // this cloud is not the first occurrence with this name
117- return context + "/cloud/cloudByIndex/" + getClouds ().indexOf (cloud ) + "/" ;
118- } else {
119- return context + "/" + cloud .getUrl ();
120- }
116+ return context + "/" + cloud .getUrl ();
121117 }
122118
123119 /**
Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ THE SOFTWARE.
2727 <l : header />
2828 <l : side-panel >
2929 <l : tasks >
30- <j : set var =" url" value =" ${h.getNearestAncestorUrl(request2,it) }" />
31- <l : task contextMenu =" false" href =" ${url}/ " icon =" symbol-computer" title =" ${%Status}" />
32- <l : task href =" ${url}/ configure" icon =" symbol-settings"
30+ <j : set var =" url" value =" ${rootURL}/${it.url }" />
31+ <l : task contextMenu =" false" href =" ${url}" icon =" symbol-computer" title =" ${%Status}" />
32+ <l : task href =" ${url}configure" icon =" symbol-settings"
3333 title =" ${app.hasPermission(app.ADMINISTER) ? '%Configure' : '%View Configuration'}" />
3434 <l : delete permission =" ${app.ADMINISTER}" title =" ${%Delete Cloud}" message =" ${%delete.cloud(it.displayName)}" urlPrefix =" ${url}" />
3535 <t : actions />
Original file line number Diff line number Diff line change @@ -64,11 +64,11 @@ THE SOFTWARE.
6464 </td >
6565 <td >
6666 <input type =" hidden" name =" name" value =" ${cloud.name}" />
67- <a href =" ${it.getCloudUrl(request2,app, cloud) }" class =" jenkins-table__link model-link inside" >${cloud.name}</a >
67+ <a href =" ../${ cloud.url }" class =" jenkins-table__link model-link inside" >${cloud.name}</a >
6868 </td >
6969 <td class =" jenkins-table__cell--tight" >
7070 <div class =" jenkins-table__cell__button-wrapper" >
71- <a href =" ${it.getCloudUrl(request2,app, cloud) }configure" class =" jenkins-button" >
71+ <a href =" ../${ cloud.url }configure" class =" jenkins-button" >
7272 <l : icon src =" symbol-settings" />
7373 </a >
7474 </div >
Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ THE SOFTWARE.
7575
7676 <j : set var =" url" value =" doDelete" />
7777 <j : if test =" ${attrs.urlPrefix != null}" >
78- <j : set var =" url" value =" ${urlPrefix}/doDelete" />
78+ <j : set var =" basePrefix" value =" ${urlPrefix.endsWith('/') ? urlPrefix.substring(0, urlPrefix.length() - 1) : urlPrefix}" />
79+ <j : set var =" url" value =" ${basePrefix}/doDelete" />
7980 </j : if >
8081
8182
You can’t perform that action at this time.
0 commit comments