You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drat.apache.org by GitBox <gi...@apache.org> on 2018/08/11 18:51:17 UTC

[GitHub] chrismattmann closed pull request #149: Second update on feedbacks

chrismattmann closed pull request #149: Second update on feedbacks 
URL: https://github.com/apache/drat/pull/149
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/webapps/proteus-new/src/main/webapp/resources/public/index.html b/webapps/proteus-new/src/main/webapp/resources/public/index.html
index 3bd39e51..d2ea7e56 100644
--- a/webapps/proteus-new/src/main/webapp/resources/public/index.html
+++ b/webapps/proteus-new/src/main/webapp/resources/public/index.html
@@ -10,7 +10,7 @@
   <link rel="icon" href="favicon.ico">  
   <base href="./"/>
   <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico">   -->
-  <title>proteus</title>
+  <title>Proteus</title>
 </head>
 
 <body>
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/App.vue b/webapps/proteus-new/src/main/webapp/resources/src/App.vue
index 0e902e4a..d071508f 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/App.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/App.vue
@@ -301,7 +301,7 @@ export default {
   height: auto;
   position: fixed;
   bottom: 0%;
-  z-index: 1000;
+  z-index: 900;
 }
 
 #logospace{
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/auditsummarycomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/auditsummarycomp.vue
index 385b75c6..e8593734 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/auditsummarycomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/auditsummarycomp.vue
@@ -254,5 +254,6 @@ the License.
 <style scoped >
   .auditsummarycomp {
       margin-top: 5%;
+      margin-bottom: 10%;
   }
 </style>
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/barchartcomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/barchartcomp.vue
index 6c4a12d8..57a028d5 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/barchartcomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/barchartcomp.vue
@@ -41,15 +41,19 @@ import store from './../store/store'
     store,
     mounted() {
         this.loadData();
-        setInterval(function () {
-          this.loadData();
+        this.timerClearvar = setInterval(function () {
+          if(this.currentState=="MAP" || this.currentState=="REDUCE")this.loadData();
         }.bind(this), 1000);
         
     },
+    beforeDestroy(){
+      clearInterval(this.timerClearvar);
+    },
     data() {
       return {
         licenseTypes : [], 
         emptynote : '',
+        timerClearvar:''
        
       }
     },
@@ -61,7 +65,6 @@ import store from './../store/store'
           
           axios.get(this.origin+"/proteus/service/repo/breakdown/license")
             .then(response=>{
-              this.$log.info(response.data);
               this.licenseTypes=response.data;
               this.init();
             })
@@ -72,8 +75,6 @@ import store from './../store/store'
             
         },
         init(){
-          
-           this.$log.info("c0");
           var  svg = d3.select("#barsvg"),
               margin = {top: 20, right: 20, bottom: 50, left: 40},
               width = +svg.attr("width") - margin.left - margin.right,
@@ -135,7 +136,7 @@ import store from './../store/store'
           
         },
         
-
+        
         
     },
     computed: {
@@ -148,6 +149,9 @@ import store from './../store/store'
       },
       origin(){
         return store.state.origin;
+      },
+      currentState(){
+        return store.state.currentActionStep;
       }
     }
 }
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/bublechartcomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/bublechartcomp.vue
index d56340f1..752b91b0 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/bublechartcomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/bublechartcomp.vue
@@ -37,16 +37,19 @@ the License.
     props: [],
     mounted() {
       this.init();
-      setInterval(function(){
+      this.timerClearVar = setInterval(function(){
         this.init();
       }.bind(this),30000);
     },
     data() {
       return {
         data:[],
-        
+        timerClearVar:'',
       }
     },
+    beforeDestroy(){
+      clearInterval(this.timerClearVar)
+    },
     methods: {
       init(){
 
@@ -72,7 +75,6 @@ the License.
 
           var docs = response.data.response.docs;
           var resultingData = [];
-          var result = [];
           var mime = {};
 
           for(var i = 0; i < docs.length; i++) {
@@ -119,7 +121,6 @@ the License.
               return d.value;
               })
             
-          console.log(color);
 
           bubble(root);
 
@@ -137,8 +138,8 @@ the License.
 
           node.append("circle")
               .attr("r", function(d) { return d.r; })
-              .attr("style",function(d,i){
-                  console.log("color:" +d.data.className+" : " +color(d.data.className));
+              .attr("style",function(d){
+                  
                 return "fill:"+color(d.data.className);});
 
           node.append("text")
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/controll_bar.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/controll_bar.vue
index 94620d7f..5a538634 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/controll_bar.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/controll_bar.vue
@@ -120,7 +120,7 @@ the License.
           this.reponame="";
         },
         run: function(){
-            console.log("test"+this.url);
+           
             store.commit("invert");
             store.commit("setCurrentRepo",this.url);
         },
@@ -169,10 +169,10 @@ the License.
           if(this.url.length==0 || this.repoloc==0){
                     this.$dialog.alert({title:"Invalid input",body:'Please enter valid path and location, then continue'},options)
             .then(function () {
-                console.log('Clicked on proceed')
+                
             })
             .catch(function () {
-                console.log('Clicked on cancel')
+                
             });
           }else{
             if(action==="reset"){
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/filelistcomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/filelistcomp.vue
index e890f338..c30348ee 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/filelistcomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/filelistcomp.vue
@@ -23,7 +23,7 @@ the License.
     </v-toolbar>
     <strong v-if="fileslist.length==0">Empty List of files</strong>
     <v-list >
-    <template v-for="(file,index) in fileslist">
+    <template v-for="(file) in fileslist">
       <v-list-tile id="tile"
         :key="file.link"
         avatar
@@ -50,15 +50,19 @@ import store from './../store/store';
     props: [],
     mounted() {
         this.loadData();
-        setInterval(function () {
-          this.loadData();
+        this.timerClearVar = setInterval(function () {
+          if(this.currentState=="CRAWL")this.loadData();
         }.bind(this), 1000);
       
     },
+    beforeDestroy(){
+      clearInterval(this.timerClearVar);
+    },
     data() {
       return {
         data:[],
-        fileslist:[]
+        fileslist:[],
+        timerClearVar:'',
       }
     },
     methods: {
@@ -87,6 +91,9 @@ import store from './../store/store';
       },
       origin(){
         return store.state.origin;
+      },
+      currentState(){
+        return store.state.currentActionStep;
       }
 
     }
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/piechart.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/piechart.vue
index 19d2dc47..19d1fa89 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/piechart.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/piechart.vue
@@ -39,11 +39,12 @@ import store from './../store/store';
     props: [],
     mounted() {
         this.loadData();
-        setInterval(function () {
-          this.loadData();
+        this.timerClearVar = setInterval(function () {
+          if(this.currentState=="INDEX")this.loadData();
         }.bind(this), 10000);
-    },watch:{
-     
+    },
+    beforeDestroy(){
+      clearInterval(this.timerClearVar);
     },
     data() {
       return {
@@ -56,8 +57,8 @@ import store from './../store/store';
           var y = 0;
           var legend = d3.select("#piesvg");
           for(var j=0;j<i;j++){
-            x += ((this.data[j].type.length)*15)+20;
-            if((x + ((this.data[i].type.length)*15)+20)>(legend.attr("width"))){
+            x += (this.data[j].type.length) * 5 + 50;
+            if(x>250){
               x = 0;
               y+=25;
             }
@@ -83,9 +84,7 @@ import store from './../store/store';
             .outerRadius(radius - 10)
             .innerRadius(0);
 
-        var label = d3.arc()
-            .outerRadius(radius - 40)
-            .innerRadius(radius - 40);
+        
         var arc = g.selectAll(".arc")
             .data(pie(this.data))
             .enter().append("g")
@@ -105,7 +104,7 @@ import store from './../store/store';
               legend.append("rect")
                   .attr("width", 18)
                   .attr("height", 18)
-                  .style("fill", function(d, i) {
+                  .style("fill", function(d) {
                       return color(d.data.type);
                     });
 
@@ -132,6 +131,9 @@ import store from './../store/store';
     computed: {
       origin(){
         return store.state.origin;
+      },
+      currentState(){
+        return store.state.currentActionStep;
       }
     }
 }
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/progresscomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/progresscomp.vue
index 28026555..04cd578f 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/progresscomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/progresscomp.vue
@@ -40,10 +40,13 @@ the License.
     props: [],
     mounted() {
         this.loaddata();
-        setInterval(function () {
+        this.timerClearVar = setInterval(function () {
           this.loaddata();
         }.bind(this), 5000);
     },
+    beforeDestroy(){
+      clearInterval(this.timerClearVar);
+    },
     data() {
       return {
           value:0,
@@ -52,7 +55,8 @@ the License.
           indexed:false,
           maped:false,
           reduced:false,
-          completed:false
+          completed:false,
+          timerClearVar:''
       }
     },
     methods: {
@@ -62,21 +66,25 @@ the License.
             if(response.data=="CRAWL"){
               this.status="Crawling...";
               this.crawled=true;
+              store.commit("setCurrentActionStep","CRAWL");
               this.value=0;
             }else if(response.data=="INDEX"){
               this.status="Indexing...";
-              this.indexed
+              this.indexed=true
+              store.commit("setCurrentActionStep","INDEX");
               this.value=25;
             }else if(response.data=="MAP"){
               this.status="Mapping...";
-              this.mapped;
+              this.mapped=true;
+              store.commit("setCurrentActionStep","MAP");
               this.value=50;
-            }else if(response.data=="REDUCE"){
+            }else if(response.data=="REDUCE" ){
               this.status="Reducing...";
               this.reduced = true;
+              store.commit("setCurrentActionStep","REDUCE");
               this.value=75;
             }else if(response.data=="IDLE"){
-              if(this.currentActionRequest=="GO" &&this.reduced){
+              if(this.currentActionRequest=="GO" && this.reduced){
                 this.completed=true;
               }else if(this.currentActionRequest=="INDEX" && this.indexed){
                 this.completed = true;
@@ -92,6 +100,7 @@ the License.
               }
               if(this.status!="Completed" && this.completed ){
                   this.status="Completed"
+                  store.commit("setCurrentActionStep","DONE");
                   this.completed=true;
                   this.value=100;
                   let options = {
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue
index c09eb930..3b716a10 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue
@@ -171,7 +171,7 @@ the License.
               </v-card>
             </v-flex>
           </v-layout>
-          <v-card>
+          <v-card id="licensefiletable">
             <v-layout>
               <v-flex xs10 offset-xs1>
                 <v-text-field
@@ -218,13 +218,17 @@ import store from './../store/store';
     props: [],
     mounted() {
       this.loadData();
-        setInterval(function () {
+        this.timerClearVar= setInterval(function () {
           this.loadData();
         }.bind(this), 30000);
     },
+    beforeDestroy(){
+      clearInterval(this.timerClearVar);
+    },
     data() {
       return {
         search:'',
+        timerClearVar:'',
         license:{
           files:[],
           unknown:true,
@@ -401,4 +405,9 @@ import store from './../store/store';
     margin-top: 20px;
     padding : 10px;
   }
+
+  #licensefiletable{
+    margin-bottom: 50px;
+    z-index: 950;
+  }
 </style>
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/statisticscomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/statisticscomp.vue
index 47c09f80..98aa8d76 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/statisticscomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/statisticscomp.vue
@@ -61,12 +61,17 @@ the License.
     props: [],
     mounted() {
       this.loadSizeData();
-        setInterval(function () {
-          this.loadSizeData();
-        }.bind(this), 30000);
+        this.timerClearVar = setInterval(function () {
+          if(this.currentState!="IDLE") this.loadSizeData();
+          if(this.currentState=="MAP" || this.currentState=="REDUCE")this.loadInstanceCount()
+        }.bind(this), 1000);
+    },
+    beforeDestroy(){
+        clearInterval(this.timerClearVar);
     },
     data() {
       return {
+          timerClearVar:'',
           stat:{
             size:0,
             numOfFiles:0,
@@ -91,6 +96,9 @@ the License.
         .catch(error=>{
           throw error;
         });
+
+      },
+      loadInstanceCount(){
         axios.get(this.origin+"/proteus/service/status/oodt/raw")
         .then(response=> {
             var temp = response.data.report.jobHealth;
@@ -110,6 +118,9 @@ the License.
       },
       origin(){
         return store.state.origin;
+      },
+      currentState(){
+        return store.state.currentActionStep;
       }
     }
 }
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/store/store.js b/webapps/proteus-new/src/main/webapp/resources/src/store/store.js
index dfb57a4c..347193db 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/store/store.js
+++ b/webapps/proteus-new/src/main/webapp/resources/src/store/store.js
@@ -13,8 +13,8 @@ License for the specific language governing permissions and limitations under
 the License.
 */
 
-import Vuex from 'vuex'
-import Vue from 'vue'
+import Vuex from 'vuex';
+import Vue from 'vue';
 Vue.use(Vuex);
 
 const store = new Vuex.Store({
@@ -23,7 +23,8 @@ const store = new Vuex.Store({
         view:"summary",
         currentRepo:'',
         origin:'',
-        currentActionRequest:''
+        currentActionRequest:'',
+        currentActionStep:'IDLE'
     },
     mutations:{
         invert(state){
@@ -43,7 +44,11 @@ const store = new Vuex.Store({
         },
         setCurrentActionRequest(state,newVal){
             state.currentActionRequest = newVal;
+        },
+        setCurrentActionStep(state,newVal){
+            state.currentActionStep = newVal;
         }
+        
     },
     getters:{
         getprog(state){


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services