Skip to content
Snippets Groups Projects
Select Git revision
  • 310bce2dcdb5a7015e26cb7d3655809792b0810e
  • master default protected
  • 551-init-broker-service-permissions
  • dev protected
  • release-1.10 protected
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • release-1.9 protected
  • 499-standalone-compute-service-2
  • 539-load-tests
  • hotfix/helm-chart
  • luca_ba_new_interface
  • 534-bug-when-adding-access-to-user-that-is-not-registered-at-dashboard-service
  • release-1.8 protected
  • 533-integrate-semantic-recommendation
  • feature/openshift
  • 518-spark-doesn-t-map-the-headers-correct
  • 485-fixity-checks
  • 530-various-schema-problems-with-subsets
  • release-1.7 protected
  • fix/auth-service
  • v1.10.1 protected
  • v1.10.0-rc13 protected
  • v1.10.0-rc12 protected
  • v1.10.0-rc11 protected
  • v1.10.0-rc10 protected
  • v1.10.0-rc9 protected
  • v1.10.0-rc8 protected
  • v1.10.0-rc7 protected
  • v1.10.0-rc6 protected
  • v1.10.0-rc5 protected
  • v1.10.0-rc4 protected
  • v1.10.0-rc3 protected
  • v1.10.0-rc2 protected
  • v1.10.0rc1 protected
  • v1.10.0rc0 protected
  • v1.10.0 protected
  • v1.9.3 protected
  • v1.9.2 protected
  • v1.9.2-rc0 protected
  • v1.9.1 protected
41 results

TimeTravel.vue

Blame
  • TimeTravel.vue 1.93 KiB
    <template>
      <div>
        <v-card>
          <v-progress-linear v-if="loading" :color="loadingColor" :indeterminate="!error" />
          <v-card-title>
            Time Travelling
          </v-card-title>
          <v-card-subtitle>
            View data for other version
          </v-card-subtitle>
          <v-card-text>
            <v-date-picker
              v-model="date"
              no-title />
            <v-time-picker
              v-model="time"
              format="24hr"
              no-title />
          </v-card-text>
          <v-card-actions>
            <v-spacer />
            <v-btn
              class="mb-2"
              @click="cancel">
              Cancel
            </v-btn>
            <v-btn
              class="mb-2"
              color="blue-grey white--text"
              @click="reset">
              Now
            </v-btn>
            <v-btn
              id="version"
              class="mb-2"
              :disabled="date === null || time === null"
              color="primary"
              @click="pick">
              Pick
            </v-btn>
          </v-card-actions>
        </v-card>
      </div>
    </template>
    
    <script>
    export default {
      data () {
        return {
          formValid: false,
          loading: false,
          error: false, // XXX: `error` is never changed
          date: null,
          time: null
        }
      },
      computed: {
        loadingColor () {
          return this.error ? 'red lighten-2' : 'primary'
        }
      },
      methods: {
        cancel () {
          this.$parent.$parent.$parent.$parent.pickVersionDialog = false
        },
        sleep (ms) {
          return new Promise((resolve) => {
            setTimeout(resolve, ms)
          })
        },
        reset () {
          this.$parent.$parent.$parent.$parent.version = null
          this.cancel()
        },
        pick () {
          this.$parent.$parent.$parent.$parent.version = this.formatDate()
          this.cancel()
        },
        formatDate () {
          if (this.date === null || this.time === null) {
            return null
          }
          console.debug('selected date', this.date, 'time', this.time)
          return Date.parse(this.date + ' ' + this.time)
        }
      }
    }
    </script>