kopia lustrzana https://github.com/manuelkasper/sotlas-frontend
Porównaj commity
6 Commity
c2c6ea1ae7
...
5309668c5e
Autor | SHA1 | Data |
---|---|---|
Manuel Kasper | 5309668c5e | |
Manuel Kasper | 64a6a57f03 | |
Manuel Kasper | 62af0822da | |
Manuel Kasper | 0b96d3c33e | |
Manuel Kasper | b19f9d5ecc | |
Manuel Kasper | 53bff389c3 |
|
@ -1,8 +1,9 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import ssoauth from './ssoauth.js'
|
import ssoauth from './ssoauth.js'
|
||||||
|
import utils from './utils.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [ssoauth],
|
mixins: [ssoauth, utils],
|
||||||
methods: {
|
methods: {
|
||||||
loadActivations (callsign) {
|
loadActivations (callsign) {
|
||||||
return axios.get(process.env.VUE_APP_API_URL + '/activations/' + callsign)
|
return axios.get(process.env.VUE_APP_API_URL + '/activations/' + callsign)
|
||||||
|
@ -11,13 +12,13 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadActivationDetails (activationId) {
|
loadActivationDetails (activationId) {
|
||||||
return this.axiosAuth.get('https://api-db.sota.org.uk/admin/secure/my_activator_log_detailed', { params: { id: this.activationId } })
|
return this.axiosAuth.get('https://api-db2.sota.org.uk/logs/activation/detailed/' + this.activationId)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
return response.data[0]
|
return response.data[0]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadS2SLog (userId, year) {
|
loadS2SLog (userId, year) {
|
||||||
return this.axiosAuth.get('https://api-db.sota.org.uk/admin/secure/s2s_log_by_id', { params: { id: userId, year } })
|
return this.axiosAuth.get('https://api-db2.sota.org.uk/logs/s2s/' + userId + '/' + year + '/1')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
return response.data
|
return response.data
|
||||||
})
|
})
|
||||||
|
@ -56,7 +57,7 @@ export default {
|
||||||
if (this.$store.state.myActivatedSummitsThisYear) {
|
if (this.$store.state.myActivatedSummitsThisYear) {
|
||||||
return Promise.resolve(this.$store.state.myActivatedSummitsThisYear)
|
return Promise.resolve(this.$store.state.myActivatedSummitsThisYear)
|
||||||
} else {
|
} else {
|
||||||
return this.axiosAuth.get('https://api-db.sota.org.uk/admin/secure/my_activator_log', { params: { year: new Date().getUTCFullYear() } })
|
return this.axiosAuth.get('https://api-db2.sota.org.uk/logs/activator/' + this.myUserId + '/' + new Date().getUTCFullYear() + '/1')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
let myActivatedSummitsThisYear = new Set()
|
let myActivatedSummitsThisYear = new Set()
|
||||||
response.data.forEach(ent => {
|
response.data.forEach(ent => {
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
<p class="subtitle is-size-7-mobile">
|
<p class="subtitle is-size-7-mobile">
|
||||||
<span class="summit-info"><strong>{{ summit.code }}</strong></span>
|
<span class="summit-info"><strong>{{ summit.code }}</strong></span>
|
||||||
<span class="summit-info"><AltitudeLabel :altitude="summit.altitude" /></span>
|
<span class="summit-info"><AltitudeLabel :altitude="summit.altitude" /></span>
|
||||||
<span class="summit-info"><SummitPointsLabel class="points" :points="summit.points" :bonus="summit.bonusPoints" /> {{ summit.points > 1 ? 'points' : 'point' }}</span>
|
<span v-if="bonusSeason" class="summit-info">
|
||||||
|
<b-tooltip class="season-tooltip" type="is-light" :position="$mq.mobile ? 'is-bottom' : 'is-right'" :label="bonusSeason">
|
||||||
|
<SummitPointsLabel class="points" :points="summit.points" :bonus="summit.bonusPoints" />
|
||||||
|
</b-tooltip> {{ summit.points > 1 ? 'points' : 'point' }}
|
||||||
|
</span>
|
||||||
|
<span v-else class="summit-info">
|
||||||
|
<SummitPointsLabel class="points" :points="summit.points" :bonus="summit.bonusPoints" /> {{ summit.points > 1 ? 'points' : 'point' }}
|
||||||
|
</span>
|
||||||
<span v-if="activations !== null" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-up']" class="faicon" /> {{ activations.length }} {{ activations.length === 1 ? 'activation' : 'activations' }}<span v-if="myActivations && myActivations.length > 0"> ({{ myActivations.length }} by me)</span></span>
|
<span v-if="activations !== null" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-up']" class="faicon" /> {{ activations.length }} {{ activations.length === 1 ? 'activation' : 'activations' }}<span v-if="myActivations && myActivations.length > 0"> ({{ myActivations.length }} by me)</span></span>
|
||||||
<span v-if="myChases !== null && myChases.length > 0" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-down']" class="faicon" /> {{ myChases.length }} {{ myChases.length === 1 ? 'chase' : 'chases' }} by me</span>
|
<span v-if="myChases !== null && myChases.length > 0" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-down']" class="faicon" /> {{ myChases.length }} {{ myChases.length === 1 ? 'chase' : 'chases' }} by me</span>
|
||||||
<span v-if="isComplete" class="summit-info"><font-awesome-icon :icon="['far', 'check-double']" class="faicon" /> Complete</span>
|
<span v-if="isComplete" class="summit-info"><font-awesome-icon :icon="['far', 'check-double']" class="faicon" /> Complete</span>
|
||||||
|
@ -384,6 +391,15 @@ export default {
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
loads.push(axios.get('https://api-db2.sota.org.uk/summits/history/' + this.summitCode)
|
||||||
|
.then(response => {
|
||||||
|
if (response.data.BonusPoints > 0) {
|
||||||
|
this.bonusSeason = '+ ' + response.data.BonusSeason
|
||||||
|
} else {
|
||||||
|
this.bonusSeason = null
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
if (this.myUserId) {
|
if (this.myUserId) {
|
||||||
loads.push(axios.get('https://api2.sota.org.uk/api/qsos/user-chases-by-summit/' + this.summitCode + '/' + this.myUserId)
|
loads.push(axios.get('https://api2.sota.org.uk/api/qsos/user-chases-by-summit/' + this.summitCode + '/' + this.myUserId)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
@ -460,7 +476,8 @@ export default {
|
||||||
isAddAlertActive: false,
|
isAddAlertActive: false,
|
||||||
isAddSpotActive: false,
|
isAddSpotActive: false,
|
||||||
enlargeMap: false,
|
enlargeMap: false,
|
||||||
alwaysLoadWikipedia: true
|
alwaysLoadWikipedia: true,
|
||||||
|
bonusSeason: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -597,4 +614,7 @@ export default {
|
||||||
color: #b5b5b5;
|
color: #b5b5b5;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
.season-tooltip {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Ładowanie…
Reference in New Issue