6
0
Eric Tröbs 4 лет назад
Родитель
Сommit
925284cc21
1 измененных файлов с 29 добавлено и 4 удалено
  1. 29 4
      webui/src/components/window/top-navigation-bar.vue

+ 29 - 4
webui/src/components/window/top-navigation-bar.vue

@@ -10,13 +10,28 @@
     <div class="name">
       {{ currentProject ? currentProject.name : 'PyCS' }}
     </div>
+
+    <div class="jobs" v-if="activeJobCount > 0">
+      {{ activeJobCount }} {{ activeJobCount === 1 ? 'job' : 'jobs' }} running
+    </div>
   </div>
 </template>
 
 <script>
 export default {
   name: "top-navigation-bar",
-  props: ['window', 'currentProject']
+  props: ['window', 'currentProject'],
+  computed: {
+    activeJobCount: function() {
+      if (!this.currentProject)
+        return 0;
+
+      return Object.keys(this.currentProject.jobs)
+          .map(key => this.currentProject.jobs[key])
+          .filter(job => !job.finished)
+          .length;
+    }
+  }
 }
 </script>
 
@@ -31,19 +46,29 @@ export default {
   align-items: center;
 }
 
-.top-navigation .burger {
+.burger {
   transition: transform 0.6s;
   filter: invert(1);
   width: 2rem;
   margin-right: 0.75rem;
 }
 
-.top-navigation .burger.rotation {
+.burger.rotation {
   transform: rotate(90deg);
 }
 
-.top-navigation .name {
+.name {
   font-weight: bold;
   font-family: "Roboto Condensed";
+  flex-grow: 1;
+
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow-x: hidden;
+}
+
+.jobs {
+  font-family: "Roboto Condensed";
+  white-space: nowrap;
 }
 </style>