Blame view

src/pages/Login.vue 3.73 KB
93a68cfa1   Jatinder Singh   first commit
1
2
3
4
5
6
7
8
9
10
11
12
  <template>
   
   <v-app id="login">
      <v-toolbar color="grey lighten">
        <v-toolbar-items>
           <img src="/static/ana@2x.png" height="36" alt="ana">
      </v-toolbar-items>
    </v-toolbar>
    
      <v-content>
        <v-container fluid fill-height>
          <v-layout align-center justify-center>
04e3fbc56   Jatinder Singh   minor fix
13
            <v-flex xs12 sm8 md6 lg5>
07095d4d8   Jatinder Singh   regex
14
15
            <v-toolbar color="black" dark>
            <v-spacer></v-spacer>
93a68cfa1   Jatinder Singh   first commit
16
17
18
19
            <v-toolbar-title>Admin Login</v-toolbar-title>
            <v-spacer></v-spacer>
          </v-toolbar>
           
04e3fbc56   Jatinder Singh   minor fix
20
21
22
              <v-card class="elevation-1 pa-1">
                 <v-card-text>
                 <v-flex xs12 sm8 md8 lg8 offset-xs2>   
4413a8d93   Jatinder Singh   changes
23
                   <v-form ref="form" v-model="valid" lazy-validation>                           
93a68cfa1   Jatinder Singh   first commit
24
                   <v-text-field
c1fd43e24   Jatinder Singh   changes
25
                   v-model="userLogincredentials.userName"
04e3fbc56   Jatinder Singh   minor fix
26
27
28
29
                   :rules="nameRules"
                   label="Username"
                   required
                   ></v-text-field>
93a68cfa1   Jatinder Singh   first commit
30
                <v-text-field
07095d4d8   Jatinder Singh   regex
31
                  :rules="[rules.required, rules.min]"
c1fd43e24   Jatinder Singh   changes
32
                  v-model="userLogincredentials.password"
04e3fbc56   Jatinder Singh   minor fix
33
                  :append-icon="e1 ? 'visibility_off' : 'visibility'"
93a68cfa1   Jatinder Singh   first commit
34
35
                  :append-icon-cb="() => (e1 = !e1)"
                  :type="e1 ? 'password' : 'text'"
93a68cfa1   Jatinder Singh   first commit
36
37
                  name="input-10-1"
                  label="Password"
93a68cfa1   Jatinder Singh   first commit
38
                  counter
07095d4d8   Jatinder Singh   regex
39
                  
93a68cfa1   Jatinder Singh   first commit
40
                ></v-text-field>
07095d4d8   Jatinder Singh   regex
41
      
04e3fbc56   Jatinder Singh   minor fix
42
                </v-form></v-flex>
07095d4d8   Jatinder Singh   regex
43
              </v-card-text>
04e3fbc56   Jatinder Singh   minor fix
44
              <v-flex xs12 sm8 md8 lg8 offset-xs2>   
07095d4d8   Jatinder Singh   regex
45
               <v-checkbox :label="`Remember me`" 
93a68cfa1   Jatinder Singh   first commit
46
                  v-model="remember"></v-checkbox>
4413a8d93   Jatinder Singh   changes
47
                  <h5 id="fp"> <router-link to="/forgetpassword">Forget Password</router-link></h5>
04e3fbc56   Jatinder Singh   minor fix
48
49
50
              </v-flex>
              
               <v-flex class="mt-3 text-md-center">
93a68cfa1   Jatinder Singh   first commit
51
52
53
54
55
56
57
                  <v-btn round color="black" dark large @click="login" :loading="loading">Login</v-btn>
                  </v-flex>
              </v-card>
            </v-flex>
          </v-layout>
        </v-container>
      </v-content>
07095d4d8   Jatinder Singh   regex
58
59
60
    <v-footer class="pa-4" color="grey darken-2">
  </v-footer>
  </v-app>
93a68cfa1   Jatinder Singh   first commit
61
62
63
64
65
66
67
68
69
70
71
  </template>
  
  <script>
  import axios from 'axios';
  export default {
    data () {
      return {
        e1: true,
        loading: false,
        remember: false,
        valid: false,
b34ed827a   Jatinder Singh   changes
72
        userLogincredentials: {},
04e3fbc56   Jatinder Singh   minor fix
73
74
75
76
77
78
79
80
81
82
        username: '',
        nameRules: [
          v => !!v || 'Username is required',
        //  v => v.length >0 
        ],
        // email: '',
        // erules: {
        //   required: value => !!value || 'This email field is Required.', 
        //   em: v => (v.length > 0 && /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || 'Email must be valid') 
        // },
07095d4d8   Jatinder Singh   regex
83
84
        password: '',
        rules: {
c35a8dafd   Jatinder Singh   minor changes
85
          required: value => !!value || 'password is Required.',
07095d4d8   Jatinder Singh   regex
86
87
88
          min: v => (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters upper case lower case symbol required'
          
        } 
93a68cfa1   Jatinder Singh   first commit
89
90
91
92
      };
    },
    methods: {
      login () {
b34ed827a   Jatinder Singh   changes
93
        console.log('=clicked==', this.userLogincredentials);
93a68cfa1   Jatinder Singh   first commit
94
95
96
97
        this.loading = true;
        setTimeout(() => {
          this.$router.push('/dashboard');
        }, 1000);
4413a8d93   Jatinder Singh   changes
98
      }
a259e694f   Jatinder Singh   minor change
99
100
101
102
103
104
105
106
107
108
      // created () {
      //   axios.get(`http://jsonplaceholder.typicode.com/posts`)
      //     .then(response => {
            
      //       this.posts = response.data;
      //     })
      //     .catch(e => {
      //       this.errors.push(e);
      //     });
      // }
93a68cfa1   Jatinder Singh   first commit
109
110
    }
  };
93a68cfa1   Jatinder Singh   first commit
111
112
113
114
115
116
117
118
119
120
121
122
  </script>
  
  <style scoped lang="css">
    #login{
      width: 100%;
      position: absolute;
      top: 0;
      left: 0;
      content: "";
      z-index: 0;
    }
  </style>
04e3fbc56   Jatinder Singh   minor fix
123
  <style scoped>
93a68cfa1   Jatinder Singh   first commit
124
125
126
  img{
  position:absolute;
  top:13px;
04e3fbc56   Jatinder Singh   minor fix
127
128
129
130
  left:50px;
  }
  .v-btn--large {
      padding: 0px 84px;
93a68cfa1   Jatinder Singh   first commit
131
  }
04e3fbc56   Jatinder Singh   minor fix
132
133
134
135
  #fp{
    position: absolute;
    top: 193px;
    right: 128px;
4413a8d93   Jatinder Singh   changes
136
    color: black;
04e3fbc56   Jatinder Singh   minor fix
137
  }
4413a8d93   Jatinder Singh   changes
138
139
140
  a{
  color: #696969;
  }
04e3fbc56   Jatinder Singh   minor fix
141

93a68cfa1   Jatinder Singh   first commit
142
  </style>