refs #79 Remove search instance form
This commit is contained in:
parent
a82f45f23d
commit
004de980af
|
@ -5,19 +5,17 @@
|
|||
<i class="el-icon-close"></i>
|
||||
</el-button>
|
||||
</div>
|
||||
<instance-form v-if="page == 1"></instance-form>
|
||||
<login-form v-if="page == 2"></login-form>
|
||||
<login-form></login-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InstanceForm from './Login/InstanceForm'
|
||||
import LoginForm from './Login/LoginForm'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'login',
|
||||
components: { InstanceForm, LoginForm },
|
||||
components: { LoginForm },
|
||||
computed: {
|
||||
...mapState({
|
||||
page: state => state.Login.page
|
||||
|
@ -25,6 +23,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$store.dispatch('Login/pageBack')
|
||||
return this.$router.push({ path: '/' })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
<template>
|
||||
<div id="login_form">
|
||||
<el-form ref="loginForm" label-width="120px" label-position="top" v-on:submit.prevent="login" class="login-form">
|
||||
<el-form-item label="Select instance">
|
||||
<el-radio-group v-model="loginForm.selectInstance" @change="changeInstance" class="instance-group">
|
||||
<el-radio class="instance-list" v-for="instance in instances" v-bind:key="instance.id" :label="instance.name" border></el-radio>
|
||||
</el-radio-group>
|
||||
<el-form-item label="Please write host name">
|
||||
<el-input v-model="loginForm.domainName"></el-input>
|
||||
</el-form-item>
|
||||
<template v-if="instances.length === 0">
|
||||
<el-form-item label="Could not find instance, please write host name">
|
||||
<el-input v-model="loginForm.domainName"></el-input>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="confirm" v-if="selectedInstance === null">Search</el-button>
|
||||
</template>
|
||||
<el-button type="primary" @click="confirm" v-if="selectedInstance === null">Search</el-button>
|
||||
<el-form-item class="submit">
|
||||
<el-button type="text" class="back" @click="back"><icon name="chevron-left"></icon></el-button>
|
||||
<el-button type="primary" class="login" @click="login" native-type="submit" v-if="selectedInstance !== null">Login</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -28,14 +20,12 @@ export default {
|
|||
data () {
|
||||
return {
|
||||
loginForm: {
|
||||
selectInstance: '',
|
||||
domainName: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
instances: state => state.Login.instances,
|
||||
selectedInstance: state => state.Login.selectedInstance
|
||||
})
|
||||
},
|
||||
|
@ -61,12 +51,6 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
changeInstance (value) {
|
||||
this.$store.dispatch('Login/changeInstance', value)
|
||||
},
|
||||
back () {
|
||||
this.$store.dispatch('Login/pageBack')
|
||||
},
|
||||
confirm () {
|
||||
this.$store.dispatch('Login/confirmInstance', this.loginForm.domainName)
|
||||
.then(() => {
|
||||
|
|
|
@ -6,7 +6,7 @@ const Login = {
|
|||
state: {
|
||||
instances: [],
|
||||
selectedInstance: null,
|
||||
page: 1
|
||||
page: 2
|
||||
},
|
||||
mutations: {
|
||||
updateInstances (state, instances) {
|
||||
|
@ -16,12 +16,12 @@ const Login = {
|
|||
state.selectedInstance = instance
|
||||
},
|
||||
changePage (state, page) {
|
||||
state.page = page
|
||||
// Invalidate page changer until implement instance search form
|
||||
// state.page = page
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
searchInstance ({ commit }, domain) {
|
||||
console.log(domain)
|
||||
return new Promise((resolve, reject) => {
|
||||
ipcRenderer.send('get-social-token', 'get')
|
||||
ipcRenderer.once('error-get-social-token', (event, err) => {
|
||||
|
|
Loading…
Reference in New Issue