]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1579] rewrite repositories scanning admin page
authorOlivier Lamy <olamy@apache.org>
Thu, 8 Mar 2012 09:31:09 +0000 (09:31 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 8 Mar 2012 09:31:09 +0000 (09:31 +0000)
templates for consumers.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1298320 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html

index 54897bfe47ac6f46f060e74e78e93f7549318960..453f3de03bf907d435714354feebb32d992e0adf 100644 (file)
@@ -351,6 +351,8 @@ $(function() {
   RepositoryScanningViewModel=function(){
     var self=this;
     this.fileTypes=ko.observableArray([]);
+    this.knownAdminRepositoryConsumers=ko.observableArray([]);
+    this.invalidAdminRepositoryConsumers=ko.observableArray([]);
 
     this.findFileType=function(id){
       var fileType=null;
@@ -404,6 +406,8 @@ $(function() {
 
     mainContent.html($("#repository-scanning-main").tmpl());
     mainContent.find("#file-types-content").html(mediumSpinnerImg());
+    mainContent.find("#consumers-known-content").html(mediumSpinnerImg());
+    mainContent.find("#consumers-invalid-content").html(mediumSpinnerImg());
 
     var repositoryScanningViewModel=new RepositoryScanningViewModel();
 
@@ -421,7 +425,9 @@ $(function() {
         type: "GET",
         dataType: 'json',
         success: function(data){
-          var adminRepositoryConsumers=mapAdminRepositoryConsumers(data);
+          var knownAdminRepositoryConsumers=mapAdminRepositoryConsumers(data);
+          repositoryScanningViewModel.knownAdminRepositoryConsumers(knownAdminRepositoryConsumers);
+          ko.applyBindings(repositoryScanningViewModel,mainContent.find("#consumers-known-content").get(0));
         }
     });
 
@@ -429,7 +435,9 @@ $(function() {
         type: "GET",
         dataType: 'json',
         success: function(data){
-          var adminRepositoryConsumers=mapAdminRepositoryConsumers(data);
+          var invalidAdminRepositoryConsumers=mapAdminRepositoryConsumers(data);
+          repositoryScanningViewModel.invalidAdminRepositoryConsumers(invalidAdminRepositoryConsumers);
+          ko.applyBindings(repositoryScanningViewModel,mainContent.find("#consumers-invalid-content").get(0));
         }
     });
 
index 2df39e00ea0719cd066e0037bcfc5906447171e4..8b26652cd451f18270822f25d59f490a35aecbe1 100644 (file)
 
   <div class="tab-content">
     <div id="file-types-content" class="tab-pane active" data-bind='template: {name:"file-types-tmpl"}'>
-      file types
     </div>
     <div id="consumers-content" class="tab-pane">
-      consumers
+      <div id="consumers-known-content" data-bind='template: {name:"consumers-known-content-tmpl"}'></div>
+      <div id="consumers-invalid-content" data-bind='template: {name:"consumers-invalid-content-tmpl"}'></div>
     </div>
   </div>
 
 </div>
 </script>
 
+<script id="consumers-known-content-tmpl" type="text/html">
+  <div class="page-header">
+    <h4>${$.i18n.prop('repository-scanning.consumers.know-content.head')}</h4>
+  </div>
+  <table class="table table-condensed">
+    <thead>
+      <tr>
+        <th>${$.i18n.prop('repository-scanning.consumers.grid.enabled')}</th>
+        <th>${$.i18n.prop('repository-scanning.consumers.grid.id')}</th>
+        <th>${$.i18n.prop('repository-scanning.consumers.grid.description')}</th>
+      </tr>
+    </thead>
+    <tbody>
+      {{each(i,knownAdminRepositoryConsumer) knownAdminRepositoryConsumers}}
+      <tr>
+        <td>${knownAdminRepositoryConsumer.enabled}</td>
+        <td>${knownAdminRepositoryConsumer.id}</td>
+        <td>${knownAdminRepositoryConsumer.description}</td>
+      </tr>
+      {{/each}}
+    </tbody>
+  </table>
+</script>
+
+<script id="consumers-invalid-content-tmpl" type="text/html">
+  <div class="page-header">
+    <h4>${$.i18n.prop('repository-scanning.consumers.invalid-content.head')}</h4>
+  </div>
+  <table class="table table-condensed">
+    <thead>
+      <tr>
+        <th>${$.i18n.prop('repository-scanning.consumers.grid.enabled')}</th>
+        <th>${$.i18n.prop('repository-scanning.consumers.grid.id')}</th>
+        <th>${$.i18n.prop('repository-scanning.consumers.grid.description')}</th>
+      </tr>
+    </thead>
+    <tbody>
+      {{each(i,invalidAdminRepositoryConsumer) invalidAdminRepositoryConsumers}}
+      <tr>
+        <td>${invalidAdminRepositoryConsumer.enabled}</td>
+        <td>${invalidAdminRepositoryConsumer.id}</td>
+        <td>${invalidAdminRepositoryConsumer.description}</td>
+      </tr>
+      {{/each}}
+    </tbody>
+  </table>
+</script>
+
+
+