Commit ec0461ec authored by Grégor JOUET's avatar Grégor JOUET 🔧
Browse files

show percent upload

parent de926547
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -259,12 +259,13 @@ export default {
    
    gcode_changed () {
      this.is_uploading_gcode = true
      this.gcode_upload_progress = 0
      let req_id = parseInt(this.id)
      var formData = new FormData();

      var progressHandler = function(progressEvent) {
        console.log(progressEvent)
        var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
        console.log(percentCompleted)
        this.gcode_upload_progress = percentCompleted
      }

+4 −5
Original line number Diff line number Diff line
<template>
  <div v-if="is_connected">
    <v-overlay :value="show_error_overlay" fullscreen>
      <v-alert type="error">MyFab Client had a problem. Please reload the page.<br/>
        If the problem continues, inform the DVIC or Fablab team by describing what you were doing and with the following message: <br/>
        <code>{{ error_message }}</code></v-alert>
    </v-overlay>
    <v-navigation-drawer v-model="nav" absolute>
      <v-list-item class="px-2">
        <v-list-item-avatar>
@@ -45,6 +40,10 @@
      <v-app-bar-nav-icon @click="nav=true"></v-app-bar-nav-icon>&nbsp;
      <v-icon>mdi-printer-3d</v-icon>&nbsp;&nbsp;MyFab2 Pre-α
      <v-spacer></v-spacer>
      <v-alert v-if="show_error_overlay" type="error">
        Problem Detected, attempting reconnection... <code>{{ error_message }}</code>
      </v-alert>
      <v-spacer></v-spacer>
      <v-img max-height="50px" max-width="60px" src="static/DVIC.png" />&nbsp;&nbsp;&nbsp;&nbsp;
      <v-img max-height="50px" max-width="45px" src="static/dvfl.png" />
    </v-toolbar>
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ const mutations = {
      show: true,
      msg: msg
    };
    setTimeout(() => {
      state.global_error.show = false
    }, 2000)
  },
  not_connected(state) {
    state.not_connected = true;