Skip to content

Commit

Permalink
Transition update,design fixes, /myteams finally works
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowing committed Jan 7, 2020
1 parent 683f145 commit df2be38
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
6 changes: 4 additions & 2 deletions web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span class="icon-bar"></span>
</button>
<transition name="fade">
<router-link to="/" class="navbar-brand" >Get5 Web Panel</router-link>
<router-link v-if="LogoTransition" to="/" class="navbar-brand" >Get5 Web Panel</router-link>
</transition>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
Expand Down Expand Up @@ -51,6 +51,7 @@ export default {
name: 'App',
data () {
return {
LogoTransition: false,
version: '',
activeIndex: '',
user: {
Expand All @@ -62,6 +63,7 @@ export default {
}
},
async mounted () {
this.LogoTransition = true
this.activeIndex = this.$route.name
let LoggedIn = await axios.get('/api/v1/CheckLoggedIn')
this.user = LoggedIn.data
Expand All @@ -85,7 +87,7 @@ export default {
}
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
transition: opacity 5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/MatchCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
<el-select v-model="form.server_id" filterable>
<el-option v-for="(server, index) in servers" :label="server.display_name" :key="index" :value="server.id"></el-option>
</el-select>
<router-link class="btn btn-primary" to="/server/create">Create a Server</router-link>
<el-button icon="el-icon-plus" @click="$router.push('/server/create')"></el-button>

</el-form-item>

<el-form-item label="Team 1" style="width: 653px;" prop="team1_id">
<el-select v-model="form.team1_id" filterable>
<el-option v-for="(team, index) in teams" :label="team.name" :key="index" :value="team.id"></el-option>
</el-select>
<el-button icon="el-icon-plus" @click="$router.push('/team/create')"></el-button>
</el-form-item>

<el-form-item v-if="match_text_option" label="Team 1 title text" style="width: 653px;" prop="team1_string">
Expand All @@ -23,6 +25,7 @@
<el-select v-model="form.team2_id" filterable>
<el-option v-for="(team, index) in teams" :label="team.name" :key="index" :value="team.id"></el-option>
</el-select>
<el-button icon="el-icon-plus" @click="$router.push('/team/create')"></el-button>
</el-form-item>

<el-form-item v-if="match_text_option" label="Team 2 title text" style="width: 653px;" prop="team2_string">
Expand Down
12 changes: 6 additions & 6 deletions web/src/components/Team.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<div class="container">
<h1 v-cloak>
<img :src="get_flag_link(team)" /> {{ team.name }} {{ team.logo }}
<div class="pull-right" v-if="Editable">
<router-link :to="'/team/'+team.id+'/edit'" class="btn btn-primary btn-xs">Edit</router-link>
</div>
<div class="pull-right" v-if="Deletable">
<button @click="DeleteTeam(team.id)" class="btn btn-primary btn-xs">Delete</button>
<el-button icon="el-icon-delete" @click="DeleteTeam(team.id)"></el-button>
</div>
<div class="pull-right" v-if="Editable">
<el-button icon="el-icon-edit" @click="$router.push('/team/'+team.id+'/edit')"></el-button>
</div>
</h1>

Expand Down Expand Up @@ -84,8 +84,8 @@ export default {
}
const loggedin = await this.axios.get('/api/v1/CheckLoggedIn')
this.user = loggedin.data
this.Editable = this.CheckTeamEditable(this.user.user_id)
this.Deletable = this.CheckTeamDeletable(this.user.user_id)
this.Editable = this.CheckTeamEditable(this.user.userid)
this.Deletable = this.CheckTeamDeletable(this.user.userid)
},
methods: {
async GetTeamData (teamid) {
Expand Down
20 changes: 10 additions & 10 deletions web/src/components/Teams.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<h1 v-else-if="owner">Teams for <a :href="'/user/'+owner.id"> {{ owner.name }}</a></h1>

<ul class="list-group">
<li class="list-group-item" v-if="teams.length == 0">
<li class="list-group-item" v-if="owner.teams.length == 0">
No teams found.
</li>

<li class="list-group-item" v-else v-for="(team,index) in teams" :key="index">
<li class="list-group-item" v-else v-for="(team,index) in owner.teams" :key="index">

<img :src="get_flag_link(team)" />
<router-link :to="'/team/'+team.id" class="col-sm-offset-1">{{team.name}}</router-link>
Expand All @@ -35,21 +35,21 @@ export default {
return {
user: {},
my_teams: false,
teams: [],
owner: {}
owner: {
teams: []
}
}
},
async created () {
this.user = await this.axios.get('/api/v1/CheckLoggedIn')
if (this.user.user_id === this.$route.params.userid || this.$route.path.userid === '/myteams') {
let res = await this.axios.get('/api/v1/CheckLoggedIn')
this.user = res.data
if (this.user.userid === this.$route.params.userid || this.$route.path === '/myteams') {
this.my_teams = true
}
if (this.my_teams) {
const userdata = await this.GetUserData(this.user.user_id)
this.teams = userdata.teams
this.owner = await this.GetUserData(this.user.userid)
} else {
const userdata = await this.GetUserData(this.$route.params.userid)
this.teams = userdata.teams
this.owner = await this.GetUserData(this.$route.params.userid)
}
},
methods: {
Expand Down

0 comments on commit df2be38

Please sign in to comment.