]> source.dussan.org Git - archiva.git/blob
db7a441ac3ef93106457c20ce6c829d8c8879a0d
[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>
76           <img src="images/utilities-system-monitor-22-22.png" id="proxy-connectors-grid-remoterepo-settings-edit-${row.sourceRepoId()}-${row.targetRepoId()}"
77                data-original-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
78                data-bind="event: { mouseover: function(){ showSettings(row)},}">
79           <div id="proxy-connectors-grid-remoterepo-settings-content-${row.sourceRepoId()}-${row.targetRepoId()}"
80                style="display:none"></div>
81       </td>
82       <td>
83         <a data-bind="click: function(){ editProxyConnector(row)}" href="#">
84            ${$.i18n.prop('edit')}
85         </a>
86       </td>
87       <td>
88         <a href="#" data-bind="click: function(){ deleteProxyConnector(row)}">
89           <img src="images/edit-cut-22-22.png" title="${$.i18n.prop('delete')}"/>
90         </a>
91       </td>
92       <td>
93         {{if row.modified()}}
94           <a href="#" class="btn btn-warning" data-bind="click: function(){ updateProxyConnector(row)}">
95               ${$.i18n.prop('save')}
96           </a>
97         {{/if}}
98       </td>
99       <td>
100         {{if orderChangeAware(row)}}
101           <a href="#" class="btn btn-warning" data-bind="click: function(){ displayOrderEdit(row)}">
102               ${$.i18n.prop('proxy-connectors.order.edit')}
103           </a>
104         {{/if}}
105       </td>
106     </tr>
107     {{/each}}
108     </tbody>
109     <div id="proxy-connectors-grid-remoterepo-settings-content-${val}-${targetRepoId}" style="display:none"></div>
110 </script>
111
112 <script id='proxy-connectors-remote-settings-popover-tmpl' type='text/x-jquery-tmpl'>
113   <div>
114     {{if proxyId}}
115       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyConnector.proxyId}
116     {{else}}
117       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${$.i18n.prop('none')}
118     {{/if}}
119     <table class="table">
120       <thead>
121         <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
122       </thead>
123       <tbody>
124         {{each(i, entry) proxyConnector.policiesEntries}}
125         {{var name = proxyConnectorsViewModel.findPolicyInformationName(entry.key)}}
126         <tr>
127           <td>${name}</td>
128           <td>${entry.value}</td>
129         </tr>
130         {{/each}}
131       </tbody>
132     </table>
133   </div>
134 </script>
135
136 <script id="proxy-connector-edit-form-tmpl" type='text/x-jquery-tmpl'>
137
138     <form id="proxy-connector-edit-form" class="form-horizontal">
139       <fieldset id="remote-repository-edit-fieldset">
140         <div class="control-group">
141           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.network-proxy.id')}</label>
142           <div class="controls">
143             <select id="proxyId"
144                     data-bind="options: proxyConnectorsViewModel.networkProxies, optionsText: 'id',optionsValue:'id',
145                      value: proxyConnector.proxyId, optionsCaption: 'direct connection'"></select>
146           </div>
147         </div>
148         <div class="control-group">
149           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.managed.repository.id')}</label>
150           <div class="controls">
151               <select id="sourceRepoId"
152                       data-bind="options: proxyConnectorsViewModel.managedRepositories, optionsText: 'id',optionsValue:'id',
153                       value: proxyConnector.sourceRepoId,attr: {disabled: isUpdate() }"></select>
154           </div>
155         </div>
156         <div class="control-group">
157           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.remote.repository.id')}</label>
158           <div class="controls">
159             <select id="targetRepoId"
160                     data-bind="options: proxyConnectorsViewModel.remoteRepositories, optionsText: 'id',optionsValue:'id',
161                      value: proxyConnector.targetRepoId,attr: {disabled: isUpdate() }"></select>
162           </div>
163         </div>
164         <div class="control-group span6">
165             <table class="table">
166               <thead>
167                 <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
168               </thead>
169               <tbody data-bind="foreach: proxyConnectorsViewModel.policyInformations()">
170                   <tr>
171                     <td data-bind="text: name"></td>
172                     <td>
173                       <select
174                               data-bind="options: getPolicyOptions(id()),value:getSelectedPolicyOption(id()),
175                               attr: { id: 'policy-'+id() },event: { change: function(){ changePolicyOption(id())},}"
176                               ></select>
177                     </td>
178                   </tr>
179               </tbody>
180             </table>
181         </div>
182         <div class="control-group span6">
183           <h4>${$.i18n.prop('proxy-connector.properties')}</h4>
184
185             <table class="table">
186               <thead>
187                 <th><input type="text" id="property-key"/></th>
188                 <th><input type="text" id="property-value"/></th>
189                 <th><a href="#" data-bind="click: function(){ addProperty() }">${$.i18n.prop('add')}</a></th>
190               </thead>
191               <tbody data-bind="foreach: proxyConnector.propertiesEntries">
192                 <tr>
193                   <td data-bind="text: key"></td>
194                   <td data-bind="text: value"></td>
195                   <td><a href="#" data-bind="click: function(){ $parent.deleteProperty(key)}">${$.i18n.prop('delete')}</a></td>
196                 </tr>
197               </tbody>
198             </table>
199         </div>
200
201         <div class="control-group span6">
202             <h4>${$.i18n.prop('proxy-connector.blacklist')}</h4>
203             <table class="table">
204               <thead>
205                 <th><input type="text" id="blacklist-value"/></th>
206                 <th><a href="#" data-bind="click: function(){ addBlacklistPattern() }">${$.i18n.prop('add')}</a></th>
207               </thead>
208               <tbody data-bind="foreach: proxyConnector.blackListPatterns">
209                 <tr>
210                   <td data-bind="text: $data"></td>
211                   <td><a href="#" data-bind="click: function(){removeBlacklistPattern($data)}">${$.i18n.prop('delete')}</a></td>
212                 </tr>
213               </tbody>
214             </table>
215         </div>
216
217
218         <div class="control-group span6">
219           <h4>${$.i18n.prop('proxy-connector.whitelist')}</h4>
220           <table class="table">
221             <thead>
222               <th><input type="text" id="whitelist-value"/></th>
223               <th><a href="#" data-bind="click: function(){ addWhitelistPattern() }">${$.i18n.prop('add')}</a></th>
224             </thead>
225             <tbody data-bind="foreach: proxyConnector.whiteListPatterns">
226               <tr>
227                 <td data-bind="text: $data"></td>
228                 <td><a href="#" data-bind="click: function(){removeWhitelistPattern($data)}">${$.i18n.prop('delete')}</a></td>
229               </tr>
230             </tbody>
231           </table>
232         </div>
233
234       </fieldset>
235
236       <button id="proxy-connector-btn-save" data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
237       {{if modified()}}
238        ${("#network-proxy-btn-save").button('reset')}
239       {{/if}}
240       <button data-bind="click: displayGrid" class="btn">${$.i18n.prop('cancel')}</button>
241
242     </form>
243
244 </script>
245 <script id="proxy-connectors-bulk-save-tmpl" type='text/x-jquery-tmpl'>
246   {{if bulkSave()}}
247     <a data-bind="click: updateModifiedProxyConnectors" class="btn btn-danger" href="#">${$.i18n.prop('save.all')}</a>
248   {{/if}}
249 </script>
250
251 <script id="proxy-connector-edit-order-tmpl" type='text/html'>
252   <div class="well draggable-item network-proxy-remote-item">
253     {{var remoteRepository=$parent.findRemoteRepository(targetRepoId)}}
254     <div class="row-fluid">
255       <div class="span1">
256         <img src="images/system-software-update-32-32.png"/>
257       </div>
258       <div class="span6 pull-left">
259         <blockquote>
260             ${targetRepoId}
261             <br/>
262             ${remoteRepository.name()}&nbsp;(<a href="${remoteRepository.url()}" target="_blank">${remoteRepository.url()}</a>)
263         </blockquote>
264         <!--<p>${order}</p>-->
265       </div>
266     </div>
267   </div>
268 </script>
269
270 <script id="proxy-connector-edit-order-managed-repository-tmpl" type="text/html">
271   <div class="well row-fluid">
272     <div class="span1">
273       <img src="images/applications-internet-32-32.png"/>
274     </div>
275     <div class="span6">
276       <blockquote>
277           ${managedRepository.id}
278           <br/>
279           ${managedRepository.name}
280       </blockquote>
281     </div>
282     <div class="span2">
283       {{if proxyConnectorsViewModel.bulkSave()}}
284         <p>
285            <a data-bind="click: function(){updateModifiedProxyConnectors()}"
286               href="#" class="btn btn-warning">${$.i18n.prop('save.all')}</a></p>
287       {{/if}}
288     </div>
289   </div>
290 </script>
291