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/09 16:08:24 UTC

[GitHub] chrismattmann closed pull request #148: Feedbacks

chrismattmann closed pull request #148: Feedbacks
URL: https://github.com/apache/drat/pull/148
 
 
   

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/.gitignore b/.gitignore
index a956bfb4..c760526d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,11 @@
 .vagrant/
+venv/
 .project
 .classpath
 .settings
 .cache
+*.iml
+.idea
 target
 webapps/proteus-new/src/main/webapp/index.html
 webapps/proteus-new/src/main/webapp/js
@@ -15,3 +18,4 @@ webapps/proteus-new/src/main/webapp/resources/node_modules
 /.DS_Store
 /.pydevproject
 /*/.pydevproject
+**/overlays/
diff --git a/proteus/src/main/java/backend/AbstractDratWrapper.java b/proteus/src/main/java/backend/AbstractDratWrapper.java
index 229bab86..bc323490 100644
--- a/proteus/src/main/java/backend/AbstractDratWrapper.java
+++ b/proteus/src/main/java/backend/AbstractDratWrapper.java
@@ -38,4 +38,7 @@
 
   public String getIndexablePath();
   
+  public String getUrlLoc();
+
+  public void setUrlLoc(String urlLoc);
 }
diff --git a/proteus/src/main/java/backend/ProcessDratWrapper.java b/proteus/src/main/java/backend/ProcessDratWrapper.java
index 5d605711..c71cfde5 100644
--- a/proteus/src/main/java/backend/ProcessDratWrapper.java
+++ b/proteus/src/main/java/backend/ProcessDratWrapper.java
@@ -77,6 +77,7 @@
       "RatAggregateLog" };
 
   private String status;
+  public String urlLoc;
   private FileManagerUtils fm;
   private String path;
   private static ProcessDratWrapper singletonDratWrapper = new ProcessDratWrapper();
@@ -88,6 +89,7 @@ public static ProcessDratWrapper getInstance() {
   private ProcessDratWrapper() {
     super(DRAT);
     this.path = "";
+    this.urlLoc="";
     this.status = "IDLE";
     this.fm = new FileManagerUtils(
         PathUtils.replaceEnvVariables("[FILEMGR_URL]"));
@@ -101,6 +103,14 @@ public String getIndexablePath() {
     return this.path;
   }
 
+  public String getUrlLoc() {
+    return urlLoc;
+  }
+
+  public void setUrlLoc(String urlLoc) {
+    this.urlLoc = urlLoc;
+  }
+
   public String getStatus() {
     return this.status;
   }
@@ -112,6 +122,8 @@ public synchronized void setStatus(String status) {
   @Override
   public void crawl() throws Exception {
       DratLog crawlLog = new DratLog("CRAWLING");
+
+      versionControlCheck();
       try{
           setStatus(CRAWL_CMD);
 
@@ -141,6 +153,22 @@ public void crawl() throws Exception {
       }
   }
 
+  private void versionControlCheck() throws Exception {
+    File dirPathFile = new File(this.path);
+    boolean clone=false;
+    if(dirPathFile.exists() ){
+      if(dirPathFile.isDirectory()&& dirPathFile.list().length==0){
+        clone=true;
+      }
+    }else{
+      dirPathFile.createNewFile();
+      clone =true;
+    }
+    if(clone){
+      parseAsVersionControlledRepo();
+    }
+  }
+
   @Override
   public void index() throws IOException, DratWrapperException, InstantiationException, SolrServerException {
       solrIndex();
@@ -196,9 +224,10 @@ public void reduce() throws IOException {
   }
 
   @Override
-  public void reset() throws Exception {
-    LOG.info("DRAT: reset: wiping FM product catalog");
-
+  public void reset() {
+//    LOG.info("DRAT: reset: wiping FM product catalog");
+    DratLog resetLog = new DratLog("RESET");
+    resetLog.logInfo("Starting","");
     for (String type : WIPE_TYPES) {
       int numTries = 0;
       ProductType pType = fm.safeGetProductTypeByName(type);
@@ -212,48 +241,49 @@ public void reset() throws Exception {
 
       if (numTries == MAX_RESET_TRIES
           && this.fm.safeGetNumProducts(pType) > 0) {
-        LOG.warning("Unable to fully wipe type: [" + type + "]. Tried ["
+        resetLog.logWarning("Unable to fully wipe type: [" + type + "]. Tried ["
             + String.valueOf(numTries) + "] times. Max attempts: ["
             + String.valueOf(MAX_RESET_TRIES)
             + "]. Is your File Manager corrupt?");
       }
     }
 
-    LOG.info("DRAT: reset: wiping WM instance repository.");
+    resetLog.logInfo("DRAT: reset: wiping WM instance repository.");
     String wmUrl = PathUtils.replaceEnvVariables("[WORKFLOW_URL]");
     this.wipeInstanceRepo(wmUrl);
 
     String coreName = "drat";
-    LOG.info("DRAT: reset: wiping Solr core: [" + coreName + "]");
+    resetLog.logInfo("DRAT: reset: wiping Solr core: [" + coreName + "]");
     this.wipeSolrCore(coreName);
-
-    LOG.info("DRAT: reset: recursively removed: [" + Utils.getResetDirectories()
+  
+    resetLog.logInfo("DRAT: reset: recursively removed: [" + Utils.getResetDirectories()
         + "]");
     for (String dir : Utils.getResetDirectories()) {
       File file = new File(dir);
       if (file.exists()) {
         try {
-          LOG.info(
+          resetLog.logInfo(
               "DRAT: reset: removing dir: [" + file.getAbsolutePath() + "]");
           FileUtils.forceDelete(file);
         } catch (FileNotFoundException e) {
-          LOG.warning("Error removing: [" + file.getAbsolutePath()
+          resetLog.logInfo("Error removing: [" + file.getAbsolutePath()
               + "]: Message: " + e.getLocalizedMessage());
         } catch (IOException e) {
-          LOG.warning("Unable to remove file: [" + file.getAbsolutePath()
+          resetLog.logInfo("Unable to remove file: [" + file.getAbsolutePath()
               + "]: Message: " + e.getLocalizedMessage());
         }
       }
     }
-
+  
+    resetLog.logInfo("Finished","");
   }
 
   public void go() throws Exception {
     // before go, always reset
-    
+    versionControlCheck();
     this.reset();
     this.crawl();
-    this.index();
+    this.solrIndex();
     this.map();
 
     // don't run reduce until all maps are done
@@ -458,6 +488,38 @@ private synchronized void wipeProductType(String productTypeName) {
 
   }
 
+  private String parseAsVersionControlledRepo()
+          throws IOException {
+    String projectName = null;
+    boolean git = urlLoc.endsWith(".git");
+    String line = null;
+    if (git) {
+           line = "git clone --depth 1 --branch master " + urlLoc;
+    } else {
+      projectName = urlLoc.substring(urlLoc.lastIndexOf("/") + 1);
+      line = "svn export " + urlLoc;
+    }
+    String clonePath = this.path;
+    File cloneDir = new File(clonePath);
+    LOG.info("Cloning Git / SVN project: [" + projectName + "] remote repo: ["
+            + this.urlLoc + "] into " + this.path);
+
+    CommandLine cmdLine = CommandLine.parse(line);
+    DefaultExecutor executor = new DefaultExecutor();
+    executor.setWorkingDirectory(new File(this.path));
+    int exitValue = executor.execute(cmdLine);
+
+    if (git) {
+      String gitHiddenDirPath = clonePath + File.separator + ".git";
+      File gitHiddenDir = new File(gitHiddenDirPath);
+      LOG.info("Removing .git directory from " + gitHiddenDirPath);
+      org.apache.cxf.helpers.FileUtils.removeDir(gitHiddenDir);
+    }
+
+    return clonePath;
+
+  }
+
   private synchronized void wipeInstanceRepo(String wmUrl) {
     XmlRpcWorkflowManagerClient wm;
     try {
diff --git a/proteus/src/main/java/drat/proteus/rest/DratRestResource.java b/proteus/src/main/java/drat/proteus/rest/DratRestResource.java
index e7a07fd9..1dff94b8 100644
--- a/proteus/src/main/java/drat/proteus/rest/DratRestResource.java
+++ b/proteus/src/main/java/drat/proteus/rest/DratRestResource.java
@@ -50,18 +50,22 @@ public DratRestResource() {
   public void go(@RequestBody DratRequestWrapper body) throws Exception {
     dumpToFile(body);
     dratWrapper.setIndexablePath(body.repo);
+    dratWrapper.setUrlLoc(body.loc_url);
     dratWrapper.go();
   }
 
   @MethodMapping(value = "/index", httpMethod = HttpMethod.POST)
   public void index(@RequestBody DratRequestWrapper body) throws Exception {
+    dumpToFile(body);
     dratWrapper.setIndexablePath(body.repo);
     dratWrapper.index();
   }
 
   @MethodMapping(value = "/crawl", httpMethod = HttpMethod.POST)
   public void crawl(@RequestBody DratRequestWrapper body) throws Exception {
+    dumpToFile(body);
     dratWrapper.setIndexablePath(body.repo);
+    dratWrapper.setUrlLoc(body.loc_url);
     dratWrapper.crawl();
   }
 
diff --git a/webapps/proteus-new/src/main/webapp/resources/package.json b/webapps/proteus-new/src/main/webapp/resources/package.json
index 5712656a..e748a953 100644
--- a/webapps/proteus-new/src/main/webapp/resources/package.json
+++ b/webapps/proteus-new/src/main/webapp/resources/package.json
@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
-    "clean": "test -e ../index.html && rm -r ../css ../favicon.ico ../fonts ../index.html ../js ../logo.png || echo 'Already Clean'",
+    "clean": "test -e ../index.html && rm -r ../css ../favicon.ico ../fonts ../index.html ../js ../logo.png ../leaf-logo.png|| echo 'Already Clean'",
     "build": "vue-cli-service build && mv dist/* ./.. && rm -r dist",
     "lint": "vue-cli-service lint"
   },
diff --git a/webapps/proteus-new/src/main/webapp/resources/public/leaf-logo.png b/webapps/proteus-new/src/main/webapp/resources/public/leaf-logo.png
new file mode 100644
index 00000000..d9456e67
Binary files /dev/null and b/webapps/proteus-new/src/main/webapp/resources/public/leaf-logo.png differ
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 234d6350..0e902e4a 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/App.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/App.vue
@@ -30,7 +30,7 @@ the License.
         <v-list class="pa-0">
           <v-list-tile avatar>
             <v-list-tile-avatar>
-              <img src="./logo.png">
+              <img width=10px height=10px src="leaf-logo.png">
             </v-list-tile-avatar>
   
             <v-list-tile-content>
@@ -75,8 +75,8 @@ the License.
         </v-flex>
         
         <v-flex xs3>
-          <statisticscomp/>
           <progresscomp/>
+          <statisticscomp/>
         </v-flex>
         <v-flex xs6>
           <section >
@@ -97,7 +97,7 @@ the License.
       
       <v-layout row>
        
-          <licencepiecomp/>
+          <licensepiecomp/>
           <v-spacer/>
           <topmimepiecomp/>
         
@@ -148,8 +148,8 @@ the License.
     </div>
     
     <v-spacer/>
-    <v-card >
-      <img hieght="40px" width="150px" src="logo.png">
+    <v-card id="footercard">
+      <img height="60px"  src="logo.png">
     </v-card>
        
     </v-app>
@@ -166,7 +166,7 @@ import filelistcomp from './components/filelistcomp.vue'
 import statisticscomp from './components/statisticscomp.vue'
 import progresscomp from './components/progresscomp.vue'
 import bublechartcomp from './components/bublechartcomp.vue'
-import licencepiecomp from './components/licencepiecomp.vue'
+import licensepiecomp from './components/licensepiecomp.vue'
 import topmimepiecomp from './components/topmimepiecomp.vue'
 import auditsummarycomp from './components/auditsummarycomp.vue'
 import store from './store/store'
@@ -183,7 +183,7 @@ export default {
     piechart,
     progresscomp,
     bublechartcomp,
-    licencepiecomp,
+    licensepiecomp,
     topmimepiecomp,
     auditsummarycomp
   },
@@ -196,7 +196,8 @@ export default {
       drawer: true,
       items: [
         { title: 'Summary', icon: 'dashboard' },
-        { title: 'Audit', icon: 'question_answer' }
+        { title: 'Audit', icon: 'question_answer' },
+        
       ],
       mini: true,
       right: null
@@ -208,11 +209,42 @@ export default {
       store.commit("setOrigin",location.origin);
     },
     selectmenu(menu){
+      let options = {
+                html: false, // set to true if your message contains HTML tags. eg: "Delete <b>Foo</b> ?"
+                loader: false, // set to true if you want the dailog to show a loader after click on "proceed"
+                reverse: false, // switch the button positions (left to right, and vise versa)
+                okText: 'Yes',
+                cancelText: 'No',
+                animation: 'zoom', // Available: "zoom", "bounce", "fade"
+                type: 'basic', // coming soon: 'soft', 'hard'
+                verification: 'continue', // for hard confirm, user will be prompted to type this to enable the proceed button
+                verificationHelp: 'Type "[+:verification]" below to confirm', // Verification help text. [+:verification] will be matched with 'options.verification' (i.e 'Type "continue" below to confirm')
+                clicksCount: 3, // for soft confirm, user will be asked to click on "proceed" btn 3 times before actually proceeding
+                backdropClose: false // set to true to close the dialog when clicking outside of the dialog window, i.e. click landing on the mask 
+              };
       if(menu.title=="Summary"){
+        if(this.progress){
+          
+              this.$dialog.confirm({title:"Confirm",body:'Currently on progress, do you want to close ?'},options)
+              .then(function () {
+                  store.commit("setprogress",false);
+              })
+              .catch(function () {
+                  
+              });
+          }
         store.commit("setView","summary");
-        this.addsnackbarmessage("Summary View Loaded");
       }else if(menu.title=="Audit"){
-        this.addsnackbarmessage("Audit View Loaded");
+       if(this.progress){
+          
+          this.$dialog.confirm({title:"Confirm",body:'Currently on progress, do you want to close ?'},options)
+          .then(function () {
+              store.commit("setprogress",false);
+          })
+          .catch(function () {
+              
+          });
+        }
         store.commit("setView","audit");
       }
       this.showsnackbar();
@@ -240,7 +272,7 @@ export default {
     },
     stateView(){
       return store.state.view;
-    } 
+    },
   },
   mounted(){
    this.setHost();
@@ -261,10 +293,15 @@ export default {
 #contentpane{
   padding-left: 10%;
   padding-right: 10%;
+  margin-bottom: 50px;
 }
 #footercard{
   background-color: #2c3e50;
   width: 100%;
+  height: auto;
+  position: fixed;
+  bottom: 0%;
+  z-index: 1000;
 }
 
 #logospace{
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 3f1670ea..6c4a12d8 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
@@ -16,8 +16,11 @@ the License.
 
   <section class="barchartcomp">
     <v-card id = "barchart">
-    <h1>Liecense Breakdown</h1>
-     {{emptynote}}<br>
+    <v-toolbar height="50" color="primary" dark>
+      <v-toolbar-title>Liecense Breakdown</v-toolbar-title>
+      <v-spacer></v-spacer>
+    </v-toolbar>
+   
     <svg id="barsvg" width="400" height="270">
      
     </svg>
@@ -164,7 +167,6 @@ import store from './../store/store'
  #barchart {
     margin-top: 5%;
     margin-bottom :5%;
-    padding-top:5%;
     margin-left:5%
   }
 </style>
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 4ddf3dd8..94620d7f 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
@@ -23,8 +23,6 @@ the License.
           single-line
           v-model="url"
         />
-        
-        <v-btn v-on:click="search" color="info">Search</v-btn>
         <v-btn v-on:click="dialog=true" color="primary" medium> Run </v-btn>
         <v-dialog v-model="dialog" persistent max-width="500px">
           <v-card id="repodetailscard">
@@ -35,7 +33,7 @@ the License.
                 single-line
                 v-model="url"
               />
-
+              <hr>
               <v-text-field
               solo
                 name="name"
@@ -45,19 +43,33 @@ the License.
               />
               
               <v-spacer/>
+              <hr/>
               <v-text-field
               solo
                 name="location"
-                label="Location of the reoository"
+                label="Location of the repository"
                 single-line
                 v-model="repoloc"
-              /><v-text-field
+              />
+              <hr/><v-text-field
               solo
                 name="description"
-                label="Description about the reoository"
+                label="Description about the repository"
                 
                 v-model="repodesc"
               />
+              <hr/>
+            
+            <v-select xs1
+              v-model="selectedAction"
+              :items="dratoptions"
+              label="Action"
+              required
+              dense
+              nudge-width
+              @change="$v.select.$touch()"
+              @blur="$v.select.$touch()"
+            />
             <v-btn v-on:click="dialog=false">Close</v-btn>
             <v-btn v-on:click="go" color="primary">Run</v-btn>
           </v-card>  
@@ -78,6 +90,13 @@ the License.
     props: [],
     mounted() {
 
+    },
+    watch:{
+      progress:function(newVal){
+        if(newVal==false){
+          this.clearRepoDetails();
+        }
+      }
     },
     data() {
       return {
@@ -88,9 +107,18 @@ the License.
         repodesc:'',
         repoloc:'',
         reponame:'',
+        dratoptions:["Go","Crawl","Index","Map","Reduce","Reset"],
+        selectedAction:'Go'
       }
     },
     methods: {
+        clearRepoDetails:function(){
+          this.url="";
+          this.repo="";
+          this.repodesc="";
+          this.repoloc="";
+          this.reponame="";
+        },
         run: function(){
             console.log("test"+this.url);
             store.commit("invert");
@@ -113,6 +141,30 @@ the License.
               clicksCount: 3, // for soft confirm, user will be asked to click on "proceed" btn 3 times before actually proceeding
               backdropClose: false // set to true to close the dialog when clicking outside of the dialog window, i.e. click landing on the mask 
           };
+          var action = "go";
+          switch(this.selectedAction){
+            case "Go":
+              action = "go";
+              break;
+            case "Index":
+              action = "index";
+              break;
+            case "Crawl":
+              action= "crawl";
+              break;
+
+            case "Map":
+              action = "map";
+              break;
+
+            case "Reduce":
+              action = "reduce";
+              break;
+            case "Reset":
+              action = "reset";
+              break;
+
+          }
           
           if(this.url.length==0 || this.repoloc==0){
                     this.$dialog.alert({title:"Invalid input",body:'Please enter valid path and location, then continue'},options)
@@ -123,6 +175,13 @@ the License.
                 console.log('Clicked on cancel')
             });
           }else{
+            if(action==="reset"){
+              axios.post(this.origin+"/proteus/drat/reset","")
+              .then(response=>{
+                this.$log.info(response.data);              
+              })
+            }else{
+              store.commit("setCurrentActionRequest",action.toUpperCase()); 
               store.commit("setprogress",true);
               store.commit("setCurrentRepo",this.url);
               this.dialog = false;
@@ -133,13 +192,14 @@ the License.
                 loc_url:this.repoloc,
                 description:this.repodesc
               };
-            axios.post(this.origin+"/proteus/drat/go",body)
-            .then(response=>{
-              this.$log.info(response.data);              
-            })
-            .catch(error=>{
-              throw error;
-            })
+              axios.post(this.origin+"/proteus/drat/"+action,body)
+              .then(response=>{
+                this.$log.info(response.data);              
+              })
+              .catch(error=>{
+                throw error;
+              })
+            }
           }
           
         }
@@ -151,6 +211,9 @@ the License.
         },
         origin(){
           return store.state.origin;
+        },
+        progress(){
+          return store.state.progress;
         }
 
     }
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/licencepiecomp.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/licensepiecomp.vue
similarity index 95%
rename from webapps/proteus-new/src/main/webapp/resources/src/components/licencepiecomp.vue
rename to webapps/proteus-new/src/main/webapp/resources/src/components/licensepiecomp.vue
index 8591c135..78b4ba85 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/licencepiecomp.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/licensepiecomp.vue
@@ -15,13 +15,13 @@ the License.
 
 <template lang="html">
 
-  <section class="licencepiecomp">
+  <section class="licensepiecomp">
     <v-card id="licensecard">
       <v-toolbar dark color="primary">
          <v-toolbar-title class="white--text">License Types</v-toolbar-title>
       </v-toolbar>
       
-      <svg id="pielicencesvg" width="420" height="600"></svg>
+      <svg id="pielicensesvg" width="420" height="600"></svg>
     </v-card>
   </section>
 
@@ -32,7 +32,7 @@ the License.
   import axios from 'axios';
   import store from './../store/store'
   export default  {
-    name: 'licencepiecomp',
+    name: 'licensepiecomp',
     store,
     props: [],
     mounted() {
@@ -85,7 +85,7 @@ the License.
             result[i] = resultingData[i];
           }
 
-          var svg = d3.select("#pielicencesvg"),
+          var svg = d3.select("#pielicensesvg"),
             width = +svg.attr("width"),
             height = +svg.attr("height"),
             radius = Math.min(width, height) / 2,
@@ -118,7 +118,7 @@ the License.
               .attr("dy", "0.35em")
               .text(function(d) { return d.data.key; });
 
-         var legend = d3.select("#pielicencesvg").append("svg")
+         var legend = d3.select("#pielicensesvg").append("svg")
                   .attr("class", "legend")
                   .selectAll("g")
                   .data(pie(result))//setting the data as we know there are only two set of data[programmar/tester] as per the nest function you have written
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 716a5724..19d2dc47 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
@@ -18,8 +18,12 @@ the License.
 
   <section class="piechart">
     <v-card id="piecard">
-    <h1>Mime Type Breakdown</h1>
+    <v-toolbar height="50" color="primary" dark>
+      <v-toolbar-title>Mime Type Breakdown</v-toolbar-title>
+      <v-spacer></v-spacer>
+    </v-toolbar>
     <svg id="piesvg" width="400" height="300"></svg>
+    <svg id="pielegend"/>
     </v-card>
   </section>
 
@@ -47,9 +51,24 @@ import store from './../store/store';
       }
     },
     methods: {
+      translateLegend(d,i){
+          var x = 0;
+          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 = 0;
+              y+=25;
+            }
+          }
+          return "translate("+x+"," + y + ")";
+      },
       init(){
-        var svg = d3.select("#piesvg"),
-            width = +svg.attr("width"),
+        
+        var svg = d3.select("#piesvg");
+          svg.selectAll("*").remove();
+        var width = +svg.attr("width"),
             height = +svg.attr("height"),
             radius = Math.min(width, height) / 2,
             g = svg.append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
@@ -76,11 +95,26 @@ import store from './../store/store';
               .attr("d", path)
               .attr("style", function(d) { return "fill:"+color(d.data.type) });
 
-          arc.append("text")
-              .attr("transform", function(d) { return "translate(" + label.centroid(d) + ")"; })
-              .attr("dy", "0.35em")
-              .text(function(d) { return d.data.type; });
-     
+        var legend = d3.select("#pielegend")
+                  .attr("class", "legend")
+                  .selectAll("g")
+                  .data(pie(this.data))//setting the data as we know there are only two set of data[programmar/tester] as per the nest function you have written
+                  .enter().append("g")
+                  .attr("transform", this.translateLegend);
+
+              legend.append("rect")
+                  .attr("width", 18)
+                  .attr("height", 18)
+                  .style("fill", function(d, i) {
+                      return color(d.data.type);
+                    });
+
+              legend.append("text")
+                  .attr("x", 24)
+                  .attr("y", 9)
+                  .attr("dy", ".35em")
+                  .text(function(d) { return d.data.type; });
+        
       },
       loadData(){
         axios.get(this.origin+"/proteus/service/repo/breakdown/mime?limit=5")
@@ -120,7 +154,6 @@ import store from './../store/store';
 #piecard {
     margin-top: 5%;
     margin-bottom :5%;
-    padding-top:5%;
     margin-left:5%
   }
 </style>
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 bb778acf..28026555 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
@@ -47,7 +47,12 @@ the License.
     data() {
       return {
           value:0,
-          status:"IDLE"
+          status:"IDLE",
+          crawled:false,
+          indexed:false,
+          maped:false,
+          reduced:false,
+          completed:false
       }
     },
     methods: {
@@ -56,30 +61,76 @@ the License.
         .then(response=>{
             if(response.data=="CRAWL"){
               this.status="Crawling...";
+              this.crawled=true;
               this.value=0;
             }else if(response.data=="INDEX"){
               this.status="Indexing...";
+              this.indexed
               this.value=25;
             }else if(response.data=="MAP"){
               this.status="Mapping...";
+              this.mapped;
               this.value=50;
             }else if(response.data=="REDUCE"){
               this.status="Reducing...";
+              this.reduced = true;
               this.value=75;
             }else if(response.data=="IDLE"){
-              this.status="Finished"
-              this.value=100;
+              if(this.currentActionRequest=="GO" &&this.reduced){
+                this.completed=true;
+              }else if(this.currentActionRequest=="INDEX" && this.indexed){
+                this.completed = true;
+
+              }else if(this.currentActionRequest=="CRAWL" && this.crawled){
+                this.completed = true;
+                
+              }else if(this.currentActionRequest=="MAP" && this.mapped){
+                this.completed = true;
+                
+              }else if(this.currentActionRequest=="REDUCE" && this.reduced){
+                this.completed = true;
+              }
+              if(this.status!="Completed" && this.completed ){
+                  this.status="Completed"
+                  this.completed=true;
+                  this.value=100;
+                  let options = {
+                    html: false, // set to true if your message contains HTML tags. eg: "Delete <b>Foo</b> ?"
+                    loader: false, // set to true if you want the dailog to show a loader after click on "proceed"
+                    reverse: false, // switch the button positions (left to right, and vise versa)
+                    okText: 'Yes',
+                    cancelText: 'No',
+                    animation: 'zoom', // Available: "zoom", "bounce", "fade"
+                    type: 'basic', // coming soon: 'soft', 'hard'
+                    verification: 'continue', // for hard confirm, user will be prompted to type this to enable the proceed button
+                    verificationHelp: 'Type "[+:verification]" below to confirm', // Verification help text. [+:verification] will be matched with 'options.verification' (i.e 'Type "continue" below to confirm')
+                    clicksCount: 3, // for soft confirm, user will be asked to click on "proceed" btn 3 times before actually proceeding
+                    backdropClose: false // set to true to close the dialog when clicking outside of the dialog window, i.e. click landing on the mask 
+                  };
+                  this.$dialog.confirm({title:"Done",body:'Progress Completed.Click yes to close'},options)
+                  .then(function () {
+                      store.commit("setprogress",false);
+                  })
+                  .catch(function () {
+                      
+                  });
+              }
+
             }
         })
         .catch(error=>{
           throw error;
         })
         
-      }
+      },
+
     },
     computed: {
       origin(){
         return store.state.origin;
+      },
+      currentActionRequest(){
+        return store.state.currentActionRequest;
       }
     }
 }
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 3d42e693..c09eb930 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
@@ -131,41 +131,41 @@ the License.
           </v-layout>
           <v-layout row >
             <v-flex xs10  offset-xs1>
-              <v-card color="grey lighten-3" id="licencelist">
+              <v-card color="grey lighten-3" id="licenselist">
                
                  <br/>
-                <v-chip close v-model="licence.standard">
-                  <v-avatar class="teal">{{licence.docs.license_Standards}}</v-avatar>
+                <v-chip close v-model="license.standard">
+                  <v-avatar class="teal">{{license.docs.license_Standards}}</v-avatar>
                   Standard
                 </v-chip>
-                <v-chip close v-model="licence.unknown">
-                  <v-avatar class="teal">{{licence.docs.license_Unknown}}</v-avatar>
+                <v-chip close v-model="license.unknown">
+                  <v-avatar class="teal">{{license.docs.license_Unknown}}</v-avatar>
                   Unknown
                 </v-chip>
-                <v-chip close v-model="licence.apache">
-                  <v-avatar class="teal">{{licence.docs.license_Apache}}</v-avatar>
+                <v-chip close v-model="license.apache">
+                  <v-avatar class="teal">{{license.docs.license_Apache}}</v-avatar>
                   Apache
                 </v-chip>
-                 <v-chip close v-model="licence.binaries">
-                  <v-avatar class="teal">{{licence.docs.license_Binaries}}</v-avatar>
+                 <v-chip close v-model="license.binaries">
+                  <v-avatar class="teal">{{license.docs.license_Binaries}}</v-avatar>
                   Binaries
                 </v-chip>
-                 <v-chip close v-model="licence.generated">
-                  <v-avatar class="teal">{{licence.docs.license_Generated}}</v-avatar>
+                 <v-chip close v-model="license.generated">
+                  <v-avatar class="teal">{{license.docs.license_Generated}}</v-avatar>
                   Generated
                 </v-chip>
-                <v-chip close v-model="licence.notes">
-                  <v-avatar class="teal">{{licence.docs.license_Notes}}</v-avatar>
+                <v-chip close v-model="license.notes">
+                  <v-avatar class="teal">{{license.docs.license_Notes}}</v-avatar>
                   Notes
                 </v-chip>
-                 <v-chip close v-model="licence.archives">
-                  <v-avatar class="teal">{{licence.docs.license_Archives}}</v-avatar>
+                 <v-chip close v-model="license.archives">
+                  <v-avatar class="teal">{{license.docs.license_Archives}}</v-avatar>
                   Archives
                 </v-chip>
                 <br/>
                 <v-btn float color="primary"
-                    @click="licence.unknown =true,licence.standard=true,licence.apache=true
-                    ,licence.binaries=true,licence.generated=true,licence.notes=true,licence.archives=true"
+                    @click="license.unknown =true,license.standard=true,license.apache=true
+                    ,license.binaries=true,license.generated=true,license.notes=true,license.archives=true"
                   >Reset</v-btn>
                
               </v-card>
@@ -183,7 +183,7 @@ the License.
                 </v-text-field>
                
                 <v-data-table
-                  :headers="licence.headers"
+                  :headers="license.headers"
                   :items="sortedfiles"
                   :search="search"
                 >
@@ -225,7 +225,7 @@ import store from './../store/store';
     data() {
       return {
         search:'',
-        licence:{
+        license:{
           files:[],
           unknown:true,
           standard:true,
@@ -270,7 +270,7 @@ import store from './../store/store';
         this.$log.info("as");
         this.dialog =true;     
         this.selectedItem = this.docs[index];
-        this.loadLicenceData();
+        this.loadLicenseData();
         this.loadFileDetails();
       },
       loadData(){
@@ -287,11 +287,11 @@ import store from './../store/store';
               throw error;
             })
       },
-      loadLicenceData(){
+      loadLicenseData(){
         axios.get(this.origin+"/solr/statistics/select?q=id:\""+this.selectedItem.repo+"\"&fl=license_*&wt=json")
           .then(response=>{
             this.$log.info(response.data);
-            this.licence.docs=response.data.response.docs[0];
+            this.license.docs=response.data.response.docs[0];
           })
        },
       loadFileDetails(){
@@ -314,33 +314,33 @@ import store from './../store/store';
         get:function(){
             var listToReturn = [];
         
-            if(this.licence.files){
-              this.licence.files.forEach(file => {
+            if(this.license.files){
+              this.license.files.forEach(file => {
                 
                 switch(file.license){
                   case "Apache":
-                    if(this.licence.apache) listToReturn.push(file);
+                    if(this.license.apache) listToReturn.push(file);
                     break;
 
                   case "Unknown":
-                    if(this.licence.unknown) listToReturn.push(file);
+                    if(this.license.unknown) listToReturn.push(file);
                     break;
 
                   case "Standard":
-                      if(this.licence.standard) listToReturn.push(file);
+                      if(this.license.standard) listToReturn.push(file);
                       break;
                   case "Binaries":
-                      if(this.licence.binaries) listToReturn.push(file);
+                      if(this.license.binaries) listToReturn.push(file);
                       break;
 
                   case "Generated":
-                      if(this.licence.generated) listToReturn.push(file);
+                      if(this.license.generated) listToReturn.push(file);
                       break; 
                   case "Notes":
-                      if(this.licence.notes) listToReturn.push(file);
+                      if(this.license.notes) listToReturn.push(file);
                       break;   
                   case "Archives":
-                      if(this.licence.archives) listToReturn.push(file);
+                      if(this.license.archives) listToReturn.push(file);
                       break;
                 }
               });
@@ -351,7 +351,7 @@ import store from './../store/store';
         },
 
         set:function(docs){
-          this.licence.files = docs;
+          this.license.files = docs;
         }
         
       }
@@ -386,7 +386,7 @@ import store from './../store/store';
     padding-right:10%;
   }  
 
-  #licencelist{
+  #licenselist{
     padding: 2%;
     margin-top: 2%;
   }
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 96528ca0..47c09f80 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
@@ -29,7 +29,7 @@ the License.
           <div  slot="header"><b>Repository</b></div>
           <v-card>
             <v-card-text>
-            <p style="text-align:left;">In-Memory Size  : <span style="float:right;">    <strong> {{stat.size}} MB</strong> <br></span></p>
+            <p style="text-align:left;">In-Memory Size  : <span style="float:right;">    <strong> {{stat.size}}</strong> <br></span></p>
             <p style="text-align:left;">Number of files :<span style="float:right;">  <strong>{{stat.numOfFiles}} </strong><br></span></p>
             </v-card-text>
           </v-card>
@@ -81,12 +81,27 @@ the License.
       loadSizeData(){
         axios.get(this.origin+"/proteus/service/repo/size?dir="+this.currentRepo)
         .then(response=>{
-          this.stat.size = (response.data.memorySize / (1024*1024)).toFixed(2);
-          this.stat.numOfFiles = response.data.numberOfFiles;
+          if (!(isNaN(parseFloat(response.data.memorySize)) || !isFinite(response.data.memorySize))){
+          var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
+          number = Math.floor(Math.log(response.data.memorySize) / Math.log(1024)) | 0;
+            this.stat.size = (response.data.memorySize / Math.pow(1024, Math.floor(number))).toFixed(1) +  ' ' + units[number];
+            this.stat.numOfFiles = response.data.numberOfFiles;
+          }
         })
         .catch(error=>{
           throw error;
-        })
+        });
+        axios.get(this.origin+"/proteus/service/status/oodt/raw")
+        .then(response=> {
+            var temp = response.data.report.jobHealth;
+            for (var i = 0; i < temp.length; i++) {
+                if (temp[i].state == "PGE EXEC") {
+                    this.stat.runningRatInstances = temp[i].numJobs;
+                } else if (temp[i].state == "FINISHED") {
+                    this.stat.finishedRatInstances = temp[i].numJobs;
+                }
+            }
+        });
       }
     },
     computed: {
diff --git a/webapps/proteus-new/src/main/webapp/resources/src/leaf-logo.png b/webapps/proteus-new/src/main/webapp/resources/src/leaf-logo.png
new file mode 100644
index 00000000..d9456e67
Binary files /dev/null and b/webapps/proteus-new/src/main/webapp/resources/src/leaf-logo.png differ
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 b9a832ee..dfb57a4c 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
@@ -22,7 +22,8 @@ const store = new Vuex.Store({
         progress:false,
         view:"summary",
         currentRepo:'',
-        origin:''
+        origin:'',
+        currentActionRequest:''
     },
     mutations:{
         invert(state){
@@ -39,6 +40,9 @@ const store = new Vuex.Store({
         },
         setView(state,newVal){
             state.view = newVal;
+        },
+        setCurrentActionRequest(state,newVal){
+            state.currentActionRequest = newVal;
         }
     },
     getters:{


 

----------------------------------------------------------------
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