-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #552 from Gencaster/537-link-to-listening-from-the…
…-editor added menu buttons for play menu
- Loading branch information
Showing
10 changed files
with
91 additions
and
2 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
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,54 @@ | ||
<template> | ||
<div> | ||
<button | ||
class="unstyled" | ||
@click="directLink()" | ||
> | ||
Public | ||
</button> | ||
<button | ||
class="unstyled" | ||
@click="debug()" | ||
> | ||
Debug | ||
</button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { Graph } from "@/graphql"; | ||
import { ElMessage } from "element-plus"; | ||
const props = defineProps<{ | ||
graph: Pick<Graph, "uuid" | "slugName">; | ||
}>(); | ||
const gencasterFrontUrl = (): string | undefined => { | ||
// see https://github.com/Gencaster/gencaster/pull/552/files#r1315599653 | ||
let url: string | undefined = undefined; | ||
if (window.location.hostname === "127.0.0.1") { | ||
url = "http://127.0.0.1:3000"; | ||
} else if (import.meta.env.GENCASTER_FRONT_URL) { | ||
url = import.meta.env.GENCASTER_FRONT_URL; | ||
} | ||
return url; | ||
}; | ||
const directLink = () => { | ||
const frontUrl = gencasterFrontUrl(); | ||
if (frontUrl) { | ||
window.open(`${frontUrl}/listen/${props.graph.slugName}`, "_blank"); | ||
} else { | ||
ElMessage.error(`Could not find the URL for the Gencaster frontend`); | ||
} | ||
}; | ||
const debug = () => { | ||
const frontUrl = gencasterFrontUrl(); | ||
if (frontUrl) { | ||
window.open(`${frontUrl}/debug`, "_blank"); | ||
} else { | ||
ElMessage.error(`Could not find the URL for the Gencaster frontend`); | ||
} | ||
}; | ||
</script> |
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