]> source.dussan.org Git - archiva.git/blob
051073d01351ff683d7bb9996367db60493ef85b
[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>${$.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">
45       <ul id="proxy-connector-edit-order-div"
46          data-bind="sortable: { template: 'proxy-connector-edit-order-tmpl', data: proxyConnectors,afterMove: proxyConnectorMoved}">
47       </ul>
48     </div>
49   </div>
50
51 </script>
52
53 <script id='ko-proxy-connectors-grid' type='text/x-jquery-tmpl'>
54     <thead>
55       <tr>
56         <th title="${$.i18n.prop('proxy-connectors.grid.managedrepo.title')}">
57           ${$.i18n.prop('proxy-connectors.grid.managedrepo.grid.header')}
58         </th>
59         <th title="${$.i18n.prop('proxy-connectors.grid.remoterepo.title')}">
60           ${$.i18n.prop('proxy-connectors.grid.remoterepo.grid.header')}
61         </th>
62         <th>${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}</th>
63         <th>${$.i18n.prop('edit')}</th>
64         <th>${$.i18n.prop('delete')}</th>
65         <th>${$.i18n.prop('save')}</th>
66         <th>${$.i18n.prop('proxy-connectors.grid.header.order')}</th>
67       </tr>
68     </thead>
69     <tbody>
70     {{each(i, row) itemsOnCurrentPage()}}
71     <tr data-bind="css:{ 'modified': row.modified()}">
72       <td>${row.sourceRepoId()}</td>
73       <td>${row.targetRepoId()}</td>
74       <td><img src="images/utilities-system-monitor.png" id="proxy-connectors-grid-remoterepo-settings-edit-${row.sourceRepoId()}-${row.targetRepoId()}"
75                data-original-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
76                data-bind="event: { mouseover: function(){ showSettings(row)},}"></td>
77       <td>
78         <a data-bind="click: function(){ editProxyConnector(row)}" href="#">
79            ${$.i18n.prop('edit')}
80         </a>
81         <div id="proxy-connectors-grid-remoterepo-settings-content-${row.sourceRepoId()}-${row.targetRepoId()}"
82              style="display:none"></div>
83       </td>
84       <td>
85         <a href="#" data-bind="click: function(){ deleteProxyConnector(row)}">
86           <img src="images/edit-cut.png" title="${$.i18n.prop('delete')}"/>
87         </a>
88       </td>
89       <td>
90         {{if row.modified()}}
91           <a href="#" class="btn btn-warning" data-bind="click: function(){ updateProxyConnector(row)}">
92               ${$.i18n.prop('save')}
93           </a>
94         {{/if}}
95       </td>
96       <td>
97         {{if orderChangeAware(row)}}
98           <a href="#" class="btn btn-warning" data-bind="click: function(){ displayOrderEdit(row)}">
99               ${$.i18n.prop('proxy-connectors.order.edit')}
100           </a>
101         {{/if}}
102       </td>
103     </tr>
104     {{/each}}
105     </tbody>
106     <div id="proxy-connectors-grid-remoterepo-settings-content-${val}-${targetRepoId}" style="display:none"></div>
107 </script>
108
109 <script id='proxy-connectors-remote-settings-popover-tmpl' type='text/x-jquery-tmpl'>
110   <div>
111     {{if proxyId}}
112       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyConnector.proxyId}
113     {{else}}
114       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${$.i18n.prop('none')}
115     {{/if}}
116     <table class="table">
117       <thead>
118         <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
119       </thead>
120       <tbody>
121         {{each(i, entry) proxyConnector.policiesEntries}}
122         {{var name = proxyConnectorsViewModel.findPolicyInformationName(entry.key)}}
123         <tr>
124           <td>${name}</td>
125           <td>${entry.value}</td>
126         </tr>
127         {{/each}}
128       </tbody>
129     </table>
130   </div>
131 </script>
132
133 <script id="proxy-connector-edit-form-tmpl" type='text/x-jquery-tmpl'>
134
135     <form id="proxy-connector-edit-form" class="form-horizontal">
136       <fieldset id="remote-repository-edit-fieldset">
137         <div class="control-group">
138           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.network-proxy.id')}</label>
139           <div class="controls">
140             <select id="proxyId"
141                     data-bind="options: proxyConnectorsViewModel.networkProxies, optionsText: 'id',optionsValue:'id',
142                      value: proxyConnector.proxyId, optionsCaption: 'direct connection'"></select>
143           </div>
144         </div>
145         <div class="control-group">
146           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.managed.repository.id')}</label>
147           <div class="controls">
148               <select id="sourceRepoId"
149                       data-bind="options: proxyConnectorsViewModel.managedRepositories, optionsText: 'id',optionsValue:'id',
150                       value: proxyConnector.sourceRepoId,attr: {disabled: isUpdate() }"></select>
151           </div>
152         </div>
153         <div class="control-group">
154           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.remote.repository.id')}</label>
155           <div class="controls">
156             <select id="targetRepoId"
157                     data-bind="options: proxyConnectorsViewModel.remoteRepositories, optionsText: 'id',optionsValue:'id',
158                      value: proxyConnector.targetRepoId,attr: {disabled: isUpdate() }"></select>
159           </div>
160         </div>
161         <div class="control-group span6">
162             <table class="table">
163               <thead>
164                 <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
165               </thead>
166               <tbody data-bind="foreach: proxyConnectorsViewModel.policyInformations()">
167                   <tr>
168                     <td data-bind="text: name"></td>
169                     <td>
170                       <select
171                               data-bind="options: getPolicyOptions(id()),value:getSelectedPolicyOption(id()),
172                               attr: { id: 'policy-'+id() },event: { change: function(){ changePolicyOption(id())},}"
173                               ></select>
174                     </td>
175                   </tr>
176               </tbody>
177             </table>
178         </div>
179         <div class="control-group span6">
180           <h4>${$.i18n.prop('proxy-connector.properties')}</h4>
181
182             <table class="table">
183               <thead>
184                 <th><input type="text" id="property-key"/></th>
185                 <th><input type="text" id="property-value"/></th>
186                 <th><a href="#" data-bind="click: function(){ addProperty() }">${$.i18n.prop('add')}</a></th>
187               </thead>
188               <tbody data-bind="foreach: proxyConnector.propertiesEntries">
189                 <tr>
190                   <td data-bind="text: key"></td>
191                   <td data-bind="text: value"></td>
192                   <td><a href="#" data-bind="click: function(){ $parent.deleteProperty(key)}">${$.i18n.prop('delete')}</a></td>
193                 </tr>
194               </tbody>
195             </table>
196         </div>
197
198         <div class="control-group span6">
199             <h4>${$.i18n.prop('proxy-connector.blacklist')}</h4>
200             <table class="table">
201               <thead>
202                 <th><input type="text" id="blacklist-value"/></th>
203                 <th><a href="#" data-bind="click: function(){ addBlacklistPattern() }">${$.i18n.prop('add')}</a></th>
204               </thead>
205               <tbody data-bind="foreach: proxyConnector.blackListPatterns">
206                 <tr>
207                   <td data-bind="text: $data"></td>
208                   <td><a href="#" data-bind="click: function(){removeBlacklistPattern($data)}">${$.i18n.prop('delete')}</a></td>
209                 </tr>
210               </tbody>
211             </table>
212         </div>
213
214
215           <div class="control-group span6">
216             <h4>${$.i18n.prop('proxy-connector.whitelist')}</h4>
217             <table class="table">
218               <thead>
219                 <th><input type="text" id="whitelist-value"/></th>
220                 <th><a href="#" data-bind="click: function(){ addWhitelistPattern() }">${$.i18n.prop('add')}</a></th>
221               </thead>
222               <tbody data-bind="foreach: proxyConnector.whiteListPatterns">
223                 <tr>
224                   <td data-bind="text: $data"></td>
225                   <td><a href="#" data-bind="click: function(){removeWhitelistPattern($data)}">${$.i18n.prop('delete')}</a></td>
226                 </tr>
227               </tbody>
228             </table>
229         </div>
230
231       </fieldset>
232
233       <button id="proxy-connector-btn-save" data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
234       {{if modified()}}
235        ${("#network-proxy-btn-save").button('reset')}
236       {{/if}}
237       <button data-bind="click: displayGrid" class="btn">${$.i18n.prop('cancel')}</button>
238
239     </form>
240
241 </script>
242 <script id="proxy-connectors-bulk-save-tmpl" type='text/x-jquery-tmpl'>
243   {{if bulkSave()}}
244     <a data-bind="click: updateModifiedProxyConnectors" class="btn btn-danger" href="#">${$.i18n.prop('save.all')}</a>
245   {{/if}}
246 </script>
247
248 <script id="proxy-connector-edit-order-tmpl" type='text/html'>
249     <li>
250       <a href="#">
251         ${sourceRepoId}-${targetRepoId}-${order}
252       </a>
253     </li>
254 </script>