提交 3af3a271 编写于 作者: D Daniel Beck 提交者: GitHub

[FIX JENKINS-30565] Ask for confirmation before canceling/aborting (#1835)

上级 55e23a3d
confirm=Are you sure you want to cancel the queued run of {0}?
......@@ -62,7 +62,7 @@ THE SOFTWARE.
<div class="build-stop">
<!-- Check ABORT permission for Project, Admin permission otherwise -->
<j:if test="${empty(it.widget.owner.ABORT) ? h.hasPermission(app.ADMINISTER) : it.widget.owner.hasPermission(it.widget.owner.ABORT)}">
<l:stopButton href="${link}stop" alt="[cancel]"/>
<l:stopButton href="${link}stop" alt="[cancel]" confirm="${%confirm(build.fullDisplayName)}" />
</j:if>
</div>
</j:if>
......
......@@ -37,7 +37,7 @@ THE SOFTWARE.
<t:buildProgressBar build="${it}"/>
</td><td>
<j:if test="${it.parent.hasAbortPermission()}">
<l:stopButton href="stop" alt="[${%cancel}]"/>
<l:stopButton href="stop" confirm="${%confirm(it.fullDisplayName)}" alt="[${%cancel}]"/>
</j:if>
</td>
</tr></table>
......
confirm=Are you sure you want to abort {0}?
......@@ -110,7 +110,7 @@ THE SOFTWARE.
</st:include>
<td class="pane" align="center" valign="middle">
<j:if test="${e.hasStopPermission()}">
<l:stopButton href="${rootURL}/${c.url}${url}/stop" alt="${%terminate this build}"/>
<l:stopButton href="${rootURL}/${c.url}${url}/stop" confirm="${%confirm(exe.fullDisplayName)}" alt="${%terminate this build}" />
</j:if>
</td>
</j:otherwise>
......
Computers=master{0,choice,0#|1# + {0,number} computer ({1} of {2} executors)|1< + {0,number} computers ({1} of {2} executors)}
confirm=Are you sure you want to abort {0}?
......@@ -91,7 +91,7 @@ THE SOFTWARE.
</td>
<td class="pane" width="16" align="center" valign="middle">
<j:if test="${item.hasCancelPermission()}">
<l:stopButton href="${rootURL}/queue/cancelItem?id=${item.id}" alt="cancel this build"/>
<l:stopButton href="${rootURL}/queue/cancelItem?id=${item.id}" confirm="${%confirm(item.task.fullDisplayName)}" alt="cancel this build"/>
</j:if>
</td>
</tr>
......
Build\ Queue=Build Queue{0,choice,0#|0< ({0,number})}
Filtered\ Build\ Queue=Filtered Build Queue{0,choice,0#|0< ({0,number})}
WaitingFor=Waiting for {0}
confirm=Are you sure you want to cancel the queued run of {0}?
......@@ -33,8 +33,20 @@ THE SOFTWARE.
<st:attribute name="alt" use="required">
Alt text for image.
</st:attribute>
<st:attribute name="confirm" use="optional">
If defined, the user will be asked for confirmation first, and the value will be used as question.
</st:attribute>
</st:documentation>
<a class="stop-button-link" href="${href}" onclick="new Ajax.Request(this.href); return false">
<j:choose>
<j:when test="${confirm == null}">
<a class="stop-button-link" href="${href}" onclick='new Ajax.Request("${href}"); return false;'>
<l:icon class="icon-stop icon-sm"/>
</a>
</j:when>
<j:otherwise>
<a class="stop-button-link" href="${href}" onclick='if(confirm("${confirm}"))new Ajax.Request("${href}"); return false;'>
<l:icon class="icon-stop icon-sm"/>
</a>
</j:otherwise>
</j:choose>
</j:jelly>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册