Skip to content
Snippets Groups Projects
Select Git revision
  • 19f6bec07a996478efd408d2c08bf96126911a32
  • master default protected
  • release-1.10 protected
  • replication_test
  • dev protected
  • 556-usage-statistics
  • 553-semantic-recommendation-2
  • 553-semantic-recommendation
  • release-1.9 protected
  • 551-init-broker-service-permissions
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • 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
  • v1.10.4 protected
  • v1.10.3 protected
  • v1.10.2 protected
  • 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
41 results

.env.unix.example

Blame
  • signup.vue 3.60 KiB
    <template>
      <div>
        <v-toolbar flat>
          <v-toolbar-title>
            Signup
          </v-toolbar-title>
        </v-toolbar>
        <v-form ref="form" v-model="valid" @submit.prevent="submit">
          <v-card flat tile>
            <v-card-text>
              <v-row dense>
                <v-col sm="6">
                  <v-text-field
                    v-model="createAccount.email"
                    type="email"
                    autocomplete="off"
                    autofocus
                    required
                    name="email"
                    :rules="[v => !!v || $t('Required')]"
                    hint="e.g. max.mustermann@work.com"
                    label="Work E-Mail Address *" />
                </v-col>
              </v-row>
              <v-row dense>
                <v-col sm="6">
                  <v-text-field
                    v-model="createAccount.username"
                    autocomplete="off"
                    required
                    name="username"
                    :rules="[v => !!v || $t('Required'),
                             v => /^[a-z0-9]{3,}$/.test(v) || $t('Only lowercase letters, min. 3 length'),
                             v => !usernames.includes(v) || $t('This username is already taken')]"
                    hint="e.g. mmustermann"
                    label="Username *" />
                </v-col>
              </v-row>
              <v-row dense>
                <v-col sm="6">
                  <v-text-field
                    v-model="createAccount.password"
                    autocomplete="off"
                    required
                    name="password"
                    :rules="[v => !!v || $t('Required')]"
                    type="password"
                    label="Password *" />
                </v-col>
              </v-row>
              <v-row dense>
                <v-col sm="6">
                  <v-text-field
                    v-model="password2"
                    autocomplete="off"
                    required
                    name="password-confirm"
                    :rules="[v => !!v || $t('Required'), v => (!!v && v) === createAccount.password || $t('Not matching!')]"
                    type="password"
                    label="Repeat Password *" />
                </v-col>
              </v-row>
            </v-card-text>
            <v-card-text>
              <v-btn
                id="login"
                :disabled="!valid"
                color="primary"
                type="submit"
                name="submit"
                :loading="loading"
                @click="register">
                Submit
              </v-btn>
            </v-card-text>
          </v-card>
        </v-form>
      </div>
    </template>
    
    <script>
    import UserService from '@/api/user.service'
    export default {
      data () {
        return {
          loading: false,
          loadingUsers: false,
          usernames: [],
          error: false, // XXX: `error` is never changed
          valid: false,
          password2: null,
          privacy: false,
          consent: false,
          createAccount: {
            username: null,
            email: null,
            password: null
          }
        }
      },
      computed: {
        loadingColor () {
          return this.error ? 'red lighten-2' : 'primary'
        }
      },
      mounted () {
        this.loadUsers()
      },
      methods: {
        submit () {
          this.$refs.form.validate()
        },
        register () {
          this.loading = true
          UserService.create(this.createAccount)
            .then(() => {
              this.$toast.success('Success!')
              this.$router.push('/login')
              this.loading = false
            })
            .catch(() => {
              this.loading = false
            })
        },
        loadUsers () {
          this.loadingUsers = true
          UserService.findAll()
            .then((users) => {
              this.usernames = users.map(u => u.username)
            })
            .finally(() => {
              this.loadingUsers = false
            })
        }
      }
    }
    </script>