forked from jenkinsci/configuration-as-code-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jelly
More file actions
103 lines (95 loc) · 3.66 KB
/
index.jelly
File metadata and controls
103 lines (95 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt"
xmlns:t="/lib/hudson">
<l:settings-subpage permissions="${app.MANAGE_AND_SYSTEM_READ}" header="${null}">
<l:dialog title="${%Apply Configuration as Code file}" hash="new">
<l:isAdmin>
<f:form method="post" action="replace" name="replace">
<input type="hidden" name="${h.getCrumbRequestField()}" value="${h.getCrumb(request2)}"/>
<f:entry title="${%Path or URL}" field="newSource" class="jenkins-form-item--small">
<f:textbox checkUrl="checkNewSource" checkDependsOn="newSource"/>
</f:entry>
<f:submit name="replace" value="${%Apply configuration}"/>
</f:form>
</l:isAdmin>
</l:dialog>
<l:app-bar title="${it.displayName}">
<j:if test="${!empty it.sources}">
<button id="btn-open-apply-configuration" class="jenkins-button"
data-type="dialog-opener"
data-dialog-id="${dialogId}">
<l:icon src="symbol-add"/>
${%Apply configuration}
</button>
</j:if>
<f:form method="post" action="viewExport" name="viewExport">
<l:hasPermission permission="${app.SYSTEM_READ}">
<button name="viewExport" class="jenkins-button">
${%Export configuration}
</button>
</l:hasPermission>
</f:form>
<j:if test="${it.lastAppliedConfigurationAvailable}">
<f:form method="post" action="downloadLastAppliedConfiguration" name="downloadLastAppliedConfiguration">
<l:hasPermission permission="${app.SYSTEM_READ}">
<button name="downloadLastApplied" class="jenkins-button">
${%Download last applied config}
</button>
</l:hasPermission>
</f:form>
</j:if>
<j:if test="${!empty it.sources}">
<f:form method="post" action="reload" name="reload">
<l:hasAdministerOrManage>
<button name="reload" tooltip="${%Reload configuration}" class="jenkins-button">
<l:icon src="symbol-refresh"/>
</button>
</l:hasAdministerOrManage>
</f:form>
</j:if>
</l:app-bar>
<p class="jenkins-page-description">
${it.description}
</p>
<j:choose>
<j:when test="${empty it.sources}">
<l:notice icon="symbol-logo plugin-configuration-as-code"
title="${%Controller has no configuration as code file set}">
<l:isAdmin>
<button id="btn-open-apply-configuration" class="jenkins-button"
data-type="dialog-opener"
data-dialog-id="${dialogId}">
${%Setup configuration}
</button>
</l:isAdmin>
</l:notice>
</j:when>
<j:otherwise>
<f:section title="${%Configurations}">
<p class="jenkins-section__description">
${%Last time applied:}
<i:formatDate value="${it.lastTimeLoaded}" type="both" dateStyle="medium"
timeStyle="long"/>
</p>
<ul class="jenkins-instructions">
<j:forEach var="source" items="${it.sources}">
<li style="font-family: var(--font-family-mono)">${source}</li>
</j:forEach>
</ul>
</f:section>
</j:otherwise>
</j:choose>
<l:hasPermission permission="${app.SYSTEM_READ}">
<f:section title="${%Reference}">
<dt>
<dl>
<a href="reference">${%Documentation}</a>
</dl>
<dl>
<a href="schema">${%JSON schema}</a>
</dl>
</dt>
</f:section>
</l:hasPermission>
</l:settings-subpage>
</j:jelly>