]> source.dussan.org Git - archiva.git/blob
09e19650b933eb12c8ffc7baf9efe2633cb0d00a
[archiva.git] /
1 <!--
2   ~ Licensed to the Apache Software Foundation (ASF) under one
3   ~ or more contributor license agreements.  See the NOTICE file
4   ~ distributed with this work for additional information
5   ~ regarding copyright ownership.  The ASF licenses this file
6   ~ to you under the Apache License, Version 2.0 (the
7   ~ "License"); you may not use this file except in compliance
8   ~ with the License.  You may obtain a copy of the License at
9   ~
10   ~   http://www.apache.org/licenses/LICENSE-2.0
11   ~
12   ~ Unless required by applicable law or agreed to in writing,
13   ~ software distributed under the License is distributed on an
14   ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   ~ KIND, either express or implied.  See the License for the
16   ~ specific language governing permissions and limitations
17   ~ under the License.
18 -->
19 <script id="proxyConnectorsMain" type="text/x-jquery-tmpl">
20   <div class="page-header">
21     <h2><img src="images/preferences-system-network-proxy-32-32.png"/>${$.i18n.prop('proxy-connectors.list')}</h2>
22   </div>
23
24   <ul id="proxy-connectors-view-tabs" class="nav nav-tabs">
25     <li id="proxy-connectors-view-tabs-li-grid" class="active">
26       <a data-toggle="tab" href="#proxy-connectors-view" id="proxy-connectors-view-tabs-a-network-proxies-grid">${$.i18n.prop('proxy-connectors.grid.tab.title')}</a>
27     </li>
28     <li id="proxy-connectors-view-tabs-li-edit">
29       <a data-toggle="tab" href="#proxy-connectors-edit" id="proxy-connectors-view-tabs-a-edit">${$.i18n.prop('add')}</a>
30     </li>
31     <li id="proxy-connectors-view-tabs-li-edit-order">
32       <a data-toggle="tab" href="#proxy-connectors-edit-order" id="proxy-connectors-view-tabs-a-edit-order">${$.i18n.prop('proxy-connectors.grid.tab.edit.order')}</a>
33     </li>
34   </ul>
35   <div id="proxy-connectors-view-tabs-content" class="tab-content">
36     <div id="proxy-connectors-view" class="tab-pane active">
37       <div id="proxy-connectors-bulk-save-btn" data-bind='template:{name:"proxy-connectors-bulk-save-tmpl"}'></div>
38       <table class="table table-striped table-bordered" id="proxyConnectorsTable"
39              data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko-proxy-connectors-grid',pageLinksId:'proxy-connectorsPagination'">
40       </table>
41       <div id="proxy-connectorsPagination"></div>
42     </div>
43     <div id="proxy-connectors-edit" class="tab-pane"></div>
44     <div id="proxy-connector-edit-order" class="tab-pane span8">
45       <div id="proxy-connector-edit-order-managed-repository-div" data-bind='template:{name:"proxy-connector-edit-order-managed-repository-tmpl"}'></div>
46       <div id="proxy-connector-edit-order-div"
47          data-bind="sortable: { template: 'proxy-connector-edit-order-tmpl', data: proxyConnectors,afterMove: proxyConnectorMoved}">
48       </div>
49     </div>
50   </div>
51
52 </script>
53
54 <script id='ko-proxy-connectors-grid' type='text/x-jquery-tmpl'>
55     <thead>
56       <tr>
57         <th title="${$.i18n.prop('proxy-connectors.grid.managedrepo.title')}">
58           ${$.i18n.prop('proxy-connectors.grid.managedrepo.grid.header')}
59         </th>
60         <th title="${$.i18n.prop('proxy-connectors.grid.remoterepo.title')}">
61           ${$.i18n.prop('proxy-connectors.grid.remoterepo.grid.header')}
62         </th>
63         <th>${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}</th>
64         <th>${$.i18n.prop('edit')}</th>
65         <th>${$.i18n.prop('delete')}</th>
66         <th>${$.i18n.prop('save')}</th>
67         <th>${$.i18n.prop('proxy-connectors.grid.header.order')}</th>
68       </tr>
69     </thead>
70     <tbody>
71     {{each(i, row) itemsOnCurrentPage()}}
72     <tr data-bind="css:{ 'modified': row.modified()}">
73       <td>${row.sourceRepoId()}</td>
74       <td>${row.targetRepoId()}</td>
75       <td><img src="images/utilities-system-monitor-22-22.png" id="proxy-connectors-grid-remoterepo-settings-edit-${row.sourceRepoId()}-${row.targetRepoId()}"
76                data-original-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
77                data-bind="event: { mouseover: function(){ showSettings(row)},}"></td>
78       <td>
79         <a data-bind="click: function(){ editProxyConnector(row)}" href="#">
80            ${$.i18n.prop('edit')}
81         </a>
82         <div id="proxy-connectors-grid-remoterepo-settings-content-${row.sourceRepoId()}-${row.targetRepoId()}"
83              style="display:none"></div>
84       </td>
85       <td>
86         <a href="#" data-bind="click: function(){ deleteProxyConnector(row)}">
87           <img src="images/edit-cut-22-22.png" title="${$.i18n.prop('delete')}"/>
88         </a>
89       </td>
90       <td>
91         {{if row.modified()}}
92           <a href="#" class="btn btn-warning" data-bind="click: function(){ updateProxyConnector(row)}">
93               ${$.i18n.prop('save')}
94           </a>
95         {{/if}}
96       </td>
97       <td>
98         {{if orderChangeAware(row)}}
99           <a href="#" class="btn btn-warning" data-bind="click: function(){ displayOrderEdit(row)}">
100               ${$.i18n.prop('proxy-connectors.order.edit')}
101           </a>
102         {{/if}}
103       </td>
104     </tr>
105     {{/each}}
106     </tbody>
107     <div id="proxy-connectors-grid-remoterepo-settings-content-${val}-${targetRepoId}" style="display:none"></div>
108 </script>
109
110 <script id='proxy-connectors-remote-settings-popover-tmpl' type='text/x-jquery-tmpl'>
111   <div>
112     {{if proxyId}}
113       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyConnector.proxyId}
114     {{else}}
115       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${$.i18n.prop('none')}
116     {{/if}}
117     <table class="table">
118       <thead>
119         <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
120       </thead>
121       <tbody>
122         {{each(i, entry) proxyConnector.policiesEntries}}
123         {{var name = proxyConnectorsViewModel.findPolicyInformationName(entry.key)}}
124         <tr>
125           <td>${name}</td>
126           <td>${entry.value}</td>
127         </tr>
128         {{/each}}
129       </tbody>
130     </table>
131   </div>
132 </script>
133
134 <script id="proxy-connector-edit-form-tmpl" type='text/x-jquery-tmpl'>
135
136     <form id="proxy-connector-edit-form" class="form-horizontal">
137       <fieldset id="remote-repository-edit-fieldset">
138         <div class="control-group">
139           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.network-proxy.id')}</label>
140           <div class="controls">
141             <select id="proxyId"
142                     data-bind="options: proxyConnectorsViewModel.networkProxies, optionsText: 'id',optionsValue:'id',
143                      value: proxyConnector.proxyId, optionsCaption: 'direct connection'"></select>
144           </div>
145         </div>
146         <div class="control-group">
147           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.managed.repository.id')}</label>
148           <div class="controls">
149               <select id="sourceRepoId"
150                       data-bind="options: proxyConnectorsViewModel.managedRepositories, optionsText: 'id',optionsValue:'id',
151                       value: proxyConnector.sourceRepoId,attr: {disabled: isUpdate() }"></select>
152           </div>
153         </div>
154         <div class="control-group">
155           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.remote.repository.id')}</label>
156           <div class="controls">
157             <select id="targetRepoId"
158                     data-bind="options: proxyConnectorsViewModel.remoteRepositories, optionsText: 'id',optionsValue:'id',
159                      value: proxyConnector.targetRepoId,attr: {disabled: isUpdate() }"></select>
160           </div>
161         </div>
162         <div class="control-group span6">
163             <table class="table">
164               <thead>
165                 <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
166               </thead>
167               <tbody data-bind="foreach: proxyConnectorsViewModel.policyInformations()">
168                   <tr>
169                     <td data-bind="text: name"></td>
170                     <td>
171                       <select
172                               data-bind="options: getPolicyOptions(id()),value:getSelectedPolicyOption(id()),
173                               attr: { id: 'policy-'+id() },event: { change: function(){ changePolicyOption(id())},}"
174                               ></select>
175                     </td>
176                   </tr>
177               </tbody>
178             </table>
179         </div>
180         <div class="control-group span6">
181           <h4>${$.i18n.prop('proxy-connector.properties')}</h4>
182
183             <table class="table">
184               <thead>
185                 <th><input type="text" id="property-key"/></th>
186                 <th><input type="text" id="property-value"/></th>
187                 <th><a href="#" data-bind="click: function(){ addProperty() }">${$.i18n.prop('add')}</a></th>
188               </thead>
189               <tbody data-bind="foreach: proxyConnector.propertiesEntries">
190                 <tr>
191                   <td data-bind="text: key"></td>
192                   <td data-bind="text: value"></td>
193                   <td><a href="#" data-bind="click: function(){ $parent.deleteProperty(key)}">${$.i18n.prop('delete')}</a></td>
194                 </tr>
195               </tbody>
196             </table>
197         </div>
198
199         <div class="control-group span6">
200             <h4>${$.i18n.prop('proxy-connector.blacklist')}</h4>
201             <table class="table">
202               <thead>
203                 <th><input type="text" id="blacklist-value"/></th>
204                 <th><a href="#" data-bind="click: function(){ addBlacklistPattern() }">${$.i18n.prop('add')}</a></th>
205               </thead>
206               <tbody data-bind="foreach: proxyConnector.blackListPatterns">
207                 <tr>
208                   <td data-bind="text: $data"></td>
209                   <td><a href="#" data-bind="click: function(){removeBlacklistPattern($data)}">${$.i18n.prop('delete')}</a></td>
210                 </tr>
211               </tbody>
212             </table>
213         </div>
214
215
216         <div class="control-group span6">
217           <h4>${$.i18n.prop('proxy-connector.whitelist')}</h4>
218           <table class="table">
219             <thead>
220               <th><input type="text" id="whitelist-value"/></th>
221               <th><a href="#" data-bind="click: function(){ addWhitelistPattern() }">${$.i18n.prop('add')}</a></th>
222             </thead>
223             <tbody data-bind="foreach: proxyConnector.whiteListPatterns">
224               <tr>
225                 <td data-bind="text: $data"></td>
226                 <td><a href="#" data-bind="click: function(){removeWhitelistPattern($data)}">${$.i18n.prop('delete')}</a></td>
227               </tr>
228             </tbody>
229           </table>
230         </div>
231
232       </fieldset>
233
234       <button id="proxy-connector-btn-save" data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
235       {{if modified()}}
236        ${("#network-proxy-btn-save").button('reset')}
237       {{/if}}
238       <button data-bind="click: displayGrid" class="btn">${$.i18n.prop('cancel')}</button>
239
240     </form>
241
242 </script>
243 <script id="proxy-connectors-bulk-save-tmpl" type='text/x-jquery-tmpl'>
244   {{if bulkSave()}}
245     <a data-bind="click: updateModifiedProxyConnectors" class="btn btn-danger" href="#">${$.i18n.prop('save.all')}</a>
246   {{/if}}
247 </script>
248
249 <script id="proxy-connector-edit-order-tmpl" type='text/html'>
250   <div class="well draggable-item network-proxy-remote-item">
251     {{var remoteRepository=$parent.findRemoteRepository(targetRepoId)}}
252     <div class="row-fluid">
253       <div class="span1">
254         <img src="images/system-software-update-32-32.png"/>
255       </div>
256       <div class="span6 pull-left">
257         <blockquote>
258             ${targetRepoId}
259             <br/>
260             ${remoteRepository.name()}&nbsp;(<a href="${remoteRepository.url()}" target="_blank">${remoteRepository.url()}</a>)
261         </blockquote>
262         <!--<p>${order}</p>-->
263       </div>
264     </div>
265   </div>
266 </script>
267
268 <script id="proxy-connector-edit-order-managed-repository-tmpl" type="text/html">
269   <div class="well row-fluid">
270     <div class="span1">
271       <img src="images/applications-internet-32-32.png"/>
272     </div>
273     <div class="span6">
274       <blockquote>
275           ${managedRepository.id}
276           <br/>
277           ${managedRepository.name}
278       </blockquote>
279     </div>
280     <div class="span2">
281       {{if proxyConnectorsViewModel.bulkSave()}}
282         <p>
283            <a data-bind="click: function(){updateModifiedProxyConnectors()}"
284               href="#" class="btn btn-warning">${$.i18n.prop('save.all')}</a></p>
285       {{/if}}
286     </div>
287   </div>
288 </script>
289