Skip to content
Snippets Groups Projects
Select Git revision
  • develop default protected
  • master
  • 1121-download
  • plugins-v3
  • 876-http-signature
  • plugins-v2
  • plugins
  • 0.21.2
  • 0.21.1
  • 0.21
  • 0.21-rc2
  • 0.21-rc1
  • 0.20.1
  • 0.20.0
  • 0.20.0-rc1
  • 0.19.1
  • 0.19.0
  • 0.19.0-rc2
  • 0.19.0-rc1
  • 0.18.3
  • 0.18.2
  • 0.18.1
  • 0.18
  • 0.17
  • 0.16.3
  • 0.16.2
  • 0.16.1
27 results

AlbumBase.vue

Blame
  • Forked from funkwhale / funkwhale
    Source project has a limited visibility.
    ScanForm.vue NaN GiB
    <template>
      <form class="ui form" @submit.prevent="scan">
        <div v-if="errors.length > 0" class="ui negative message">
          <div class="header"><translate :translate-context="'Content/Library/Error message.Title'">Could not fetch remote library</translate></div>
          <ul class="list">
            <li v-for="error in errors">{{ error }}</li>
          </ul>
        </div>
        <div class="ui field">
          <label><translate :translate-context="'Content/Library/Input.Label/Verb'">Search a remote library</translate></label>
          <div :class="['ui', 'action', {loading: isLoading}, 'input']">
            <input name="url" v-model="query" :placeholder="labels.placeholder" type="url">
            <button type="submit" class="ui icon button">
              <i class="search icon"></i>
            </button>
          </div>
        </div>
      </form>
    </template>
    <script>
    import axios from 'axios'
    
    export default {
      data () {
        return {
          query: '',
          isLoading: false,
          errors: []
        }
      },
      methods: {
        scan () {
          if (!this.query) {
            return
          }
          let self = this
          self.errors = []
          self.isLoading = true
          axios.post('federation/libraries/fetch/', {fid: this.query}).then((response) => {
            self.$emit('scanned', response.data)
            self.isLoading = false
          }, error => {
            self.isLoading = false
            self.errors = error.backendErrors
          })
        }
      },
      computed: {
        labels () {
          let placeholder = this.$pgettext('Content/Library/Input.Placeholder', 'Enter a library URL')
          return {
            placeholder
          }
        }
      }
    }
    </script>