Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
feat(links): link to proper github repo and commits/versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ttshivers committed Aug 30, 2020
1 parent 1516eea commit c81348b
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 35 deletions.
34 changes: 17 additions & 17 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,6 @@ export default {
redirection,
],
data() {
return {
links: [
{
title: 'Github',
href: 'https://github.com/samcm/SyncLounge',
target: '_blank',
},
{
title: 'Discord',
target: '_blank',
href: 'https://discord.gg/fKQB3yt',
},
],
};
},
computed: {
...mapGetters([
'GET_UP_NEXT_POST_PLAY_DATA',
Expand All @@ -199,6 +182,8 @@ export default {
'GET_SNACKBAR_OPEN',
'GET_BACKGROUND',
'GET_NAVIGATE_TO_PLAYER',
'GET_REPOSITORY_URL',
'GET_DISCORD_URL',
]),
...mapGetters('plex', [
Expand All @@ -225,6 +210,21 @@ export default {
...mapState(['isRightSidebarOpen']),
links() {
return [
{
title: 'Github',
href: this.GET_REPOSITORY_URL,
target: '_blank',
},
{
title: 'Discord',
target: '_blank',
href: this.GET_DISCORD_URL,
},
];
},
showNowPlaying() {
return this.GET_ACTIVE_SERVER_ID && this.$route.name === 'browse';
},
Expand Down
32 changes: 17 additions & 15 deletions src/components/sidebars/leftsidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<v-subheader>About</v-subheader>

<v-list-item
href="https://synclounge.tv/"
:href="GET_RELEASE_URL"
target="_blank"
>
<v-list-item-icon>
Expand All @@ -84,12 +84,12 @@
</v-list-item-icon>

<v-list-item-content>
<v-list-item-title>SyncLounge v{{ version }}</v-list-item-title>
<v-list-item-title>SyncLounge v{{ GET_VERSION }}</v-list-item-title>
</v-list-item-content>
</v-list-item>

<v-list-item
href="https://discord.gg/fKQB3yt"
:href="GET_DISCORD_URL"
target="_blank"
>
<v-list-item-icon>
Expand All @@ -104,7 +104,7 @@
</v-list-item>

<v-list-item
href="https://github.com/samcm/synclounge"
:href="GET_REPOSITORY_URL"
target="_blank"
>
<v-list-item-icon>
Expand Down Expand Up @@ -144,7 +144,7 @@
class="text-center pa-2"
style="opacity: 0.7; font-size: 12px;"
>
<div>Build #{{ hash }}</div>
<div>Build #<a :href="GET_COMMIT_URL">{{ GET_GIT_HASH }}</a></div>
<div>Last updated {{ updatedAt }}</div>
</div>
</template>
Expand All @@ -161,7 +161,7 @@
</div>

<v-divider class="mt-2 mb-2" />
<ptsettings class="darken-4 pa-1" />
<settings class="darken-4 pa-1" />
</v-card>
</v-dialog>

Expand Down Expand Up @@ -191,7 +191,7 @@ import { formatDistanceToNow } from 'date-fns';
export default {
components: {
ptsettings: () => import('@/components/settings.vue'),
settings: () => import('@/components/settings.vue'),
plexsettings: () => import('@/components/plex/plexsettings.vue'),
donate: () => import('@/components/donate.vue'),
},
Expand All @@ -206,29 +206,31 @@ export default {
computed: {
...mapState(['isLeftSidebarOpen']),
...mapGetters([
'GET_REPOSITORY_URL',
'GET_VERSION',
'GET_GIT_HASH',
'GET_DISCORD_URL',
'GET_RELEASE_URL',
'GET_COMMIT_URL',
]),
...mapGetters('plex', [
'GET_PLEX_USER',
]),
hash() {
return process.env.VUE_APP_GIT_HASH;
},
date() {
return new Date(parseInt(process.env.VUE_APP_GIT_DATE, 10) * 1000);
},
updatedAt() {
return `${formatDistanceToNow(this.date)} ago`;
},
version() {
return process.env.VUE_APP_VERSION;
},
},
methods: {
...mapActions(['SET_LEFT_SIDEBAR_OPEN']),
getTimeFromMs(ms) {
const hours = ms / (1000 * 60 * 60);
const absoluteHours = Math.floor(hours);
Expand Down
8 changes: 8 additions & 0 deletions src/store/getters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export default {
GET_VERSION: (state) => state.version,
GET_GIT_HASH: (state) => state.gitHash,
GET_REPOSITORY_URL: (state) => state.repositoryUrl,
GET_DISCORD_URL: (state) => state.discordUrl,
GET_RELEASE_URL: (state, getters) => `${getters.GET_REPOSITORY_URL}/releases/tag/v${
getters.GET_VERSION}`,
GET_COMMIT_URL: (state, getters) => `${getters.GET_REPOSITORY_URL}/commit/${
getters.GET_GIT_HASH}`,
GET_BACKGROUND: (state) => state.background,
GET_UP_NEXT_POST_PLAY_DATA: (state) => state.upNextPostPlayData,
GET_CONFIG: (state) => state.configuration,
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/plex/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {

GET_PLEX_INITIAL_AUTH_PARAMS: (state, getters, rootState, rootGetters) => ({
'X-Plex-Product': getters.GET_PLEX_PRODUCT_HEADER,
'X-Plex-Version': process.env.VUE_APP_VERSION,
'X-Plex-Version': rootGetters.GET_VERSION,
'X-Plex-Client-Identifier': getters.GET_CLIENT_IDENTIFIER,
'X-Plex-Platform': getters.GET_PLEX_PLATFORM_HEADER,
'X-Plex-Platform-Version': rootGetters.GET_BROWSER.version,
Expand All @@ -54,7 +54,7 @@ export default {
GET_PLEX_AUTH_URL: (state, getters, rootState, rootGetters) => (code) => {
const urlParams = {
'context[device][product]': getters.GET_PLEX_PRODUCT_HEADER,
'context[device][version]': process.env.VUE_APP_VERSION,
'context[device][version]': rootGetters.GET_VERSION,
'context[device][platform]': getters.GET_PLEX_PLATFORM_HEADER,
'context[device][platformVersion]': rootGetters.GET_BROWSER.version,
'context[device][device]': getters.GET_PLEX_DEVICE_DEVICE_HEADER,
Expand Down
5 changes: 5 additions & 0 deletions src/store/state.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { detect } from 'detect-browser';

const state = () => ({
version: process.env.VUE_APP_VERSION,
gitHash: process.env.VUE_APP_GIT_HASH,
repositoryUrl: 'https://github.com/ttshivers/synclounge',
discordUrl: 'https://discord.gg/fKQB3yt',

background: null,
configuration: null,

Expand Down
3 changes: 2 additions & 1 deletion src/views/signin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
SyncLounge yourself have a look
<a
target="_blank"
href="https://github.com/samcm/SyncLounge"
:href="GET_REPOSITORY_URL"
>here</a>
for details.
</v-card-text>
Expand Down Expand Up @@ -73,6 +73,7 @@ export default {
computed: {
...mapGetters([
'GET_CONFIG',
'GET_REPOSITORY_URL',
]),
...mapGetters('plex', [
Expand Down

0 comments on commit c81348b

Please sign in to comment.