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