-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const config = { | ||
apiUrl: "https://dev-api.shocklink.net/", | ||
webUiUrl: "https://dev.shocklink.net/#/", | ||
shortUrl: "https://shockl.ink/s/" | ||
shortUrl: "https://shockl.ink/", | ||
} | ||
|
||
global.config = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const config = { | ||
apiUrl: "https://localhost/", | ||
webUiUrl: "https://localhost:8080/#/", | ||
shortUrl: "https://shockl.ink/s/" | ||
shortUrl: "https://shockl.ink/" | ||
} | ||
|
||
global.config = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const config = { | ||
apiUrl: "https://api.shocklink.net/", | ||
webUiUrl: "https://shocklink.net/#/", | ||
shortUrl: "https://shockl.ink/s/" | ||
shortUrl: "https://shockl.ink/" | ||
} | ||
|
||
global.config = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="proxy-container"> | ||
<transition mode="out-in" name="component-fade"> | ||
<checkmark v-if="!loading && error" error="true"></checkmark> | ||
<loading-with-text v-else-if="loading">Checking login status...</loading-with-text> | ||
<loading-with-text v-else>Redirecting...</loading-with-text> | ||
</transition> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Checkmark from '../../utils/Checkmark.vue'; | ||
import LoadingWithText from '../../utils/LoadingWithText.vue'; | ||
export default { | ||
components: { LoadingWithText, Checkmark }, | ||
props: ['id'], | ||
data() { | ||
return { | ||
loading: true, | ||
error: true | ||
} | ||
}, | ||
async beforeMount() { | ||
this.loading = true; | ||
var loggedIn = await utils.checkIfLoggedIn(); | ||
this.loading = false; | ||
if (!loggedIn) { | ||
this.login(); | ||
return; | ||
} | ||
try { | ||
const res = await apiCall.makeCall('POST', `1/shares/code/${this.id}`); | ||
if (res.status !== 200) { | ||
throw new Error(res.statusText); | ||
} | ||
toastr.success(`Failed to add share: ${utils.getError(err)}`); | ||
} catch (err) { | ||
this.error = true; | ||
toastr.error(`Failed to add share: ${utils.getError(err)}`); | ||
return; | ||
} | ||
this.redirectToShares(); | ||
}, | ||
methods: { | ||
redirectToShares() { | ||
this.$router.push("/dashboard/shockers/shared"); | ||
}, | ||
login() { | ||
this.$store.dispatch('setReturnUrl', "/proxy/shares/code/" + this.id); | ||
this.$router.push("/account/login"); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"></style> |