diff --git a/frontend/src/components/ActiveSearchList.vue b/frontend/src/components/ActiveSearchList.vue index b26189e..33ed99e 100644 --- a/frontend/src/components/ActiveSearchList.vue +++ b/frontend/src/components/ActiveSearchList.vue @@ -1,9 +1,8 @@ + + \ No newline at end of file diff --git a/frontend/src/components/ActiveSearchSkeleton.vue b/frontend/src/components/ActiveSearchSkeleton.vue new file mode 100644 index 0000000..3a3842f --- /dev/null +++ b/frontend/src/components/ActiveSearchSkeleton.vue @@ -0,0 +1,47 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/CollectionItem.vue b/frontend/src/components/CollectionItem.vue index 14a0d7e..122d0a0 100644 --- a/frontend/src/components/CollectionItem.vue +++ b/frontend/src/components/CollectionItem.vue @@ -85,12 +85,20 @@ onBeforeUnmount(() => {
-
+
-
+
+ + \ No newline at end of file diff --git a/frontend/src/components/CollectionListItem.vue b/frontend/src/components/CollectionListItem.vue index b4eb833..dfb3f40 100644 --- a/frontend/src/components/CollectionListItem.vue +++ b/frontend/src/components/CollectionListItem.vue @@ -9,11 +9,11 @@ const props = defineProps<{ collection: CollectionPreview }>(); + + \ No newline at end of file diff --git a/frontend/src/views/MeView.vue b/frontend/src/views/MeView.vue index edbbc4a..094f900 100644 --- a/frontend/src/views/MeView.vue +++ b/frontend/src/views/MeView.vue @@ -15,10 +15,7 @@ const borderColor = ref(""); const loginStatus = ref("Login"); -function update() { - var input = document.getElementById("url-input") as HTMLInputElement; - userStore.cloudflareUrl.value = input.value; -} +const isHealthy = ref(null); function save(bg: string | null, main: string | null, info: string | null, border: string | null) { document.documentElement.style.setProperty("--background-color", bg ?? bgColor.value); @@ -47,8 +44,41 @@ async function getMe() { userStore.cloudflareUrl.value = data.endpoint; } +async function pasteFromClipboard() { + try { + const text = await navigator.clipboard.readText(); + userStore.cloudflareUrl.value = text; + await checkHealth(text); + } catch (e) { + console.error("Failed to read clipboard"); + } +} + +async function copyToClipboard() { + await navigator.clipboard.writeText(userStore.cloudflareUrl.value); +} + +async function checkHealth(url: string) { + if (!url) return; + try { + const response = await fetch(`${url}/ping`); + isHealthy.value = response.ok; + } catch (e) { + isHealthy.value = false; + } +} + +function update(e: Event) { + const val = (e.target as HTMLInputElement).value; + userStore.cloudflareUrl.value = val; + checkHealth(val); +} + onMounted(() => { reset(); + if (userStore.cloudflareUrl.value) { + checkHealth(userStore.cloudflareUrl.value); + } }); function reset() { @@ -68,8 +98,8 @@ function reset() {

@@ -77,31 +107,37 @@ function reset() {
- -
- -
- -
-

{{ userStore.user.value.name }}

-

- {{ userStore.user.value.endpoint == "" ? "Not Connected" : "Connected" }} -

-

- Sharing: - -

- +
+
+ + + +
+
+
+ + +

Background:

diff --git a/frontend/src/views/RecentView.vue b/frontend/src/views/RecentView.vue index ee93fb5..8b54323 100644 --- a/frontend/src/views/RecentView.vue +++ b/frontend/src/views/RecentView.vue @@ -64,7 +64,7 @@ onMounted(async () => {
+ + \ No newline at end of file diff --git a/frontend/src/views/SearchView.vue b/frontend/src/views/SearchView.vue index bb4a512..6672fb2 100644 --- a/frontend/src/views/SearchView.vue +++ b/frontend/src/views/SearchView.vue @@ -1,53 +1,72 @@ + + \ No newline at end of file diff --git a/grpc-backend/main.go b/grpc-backend/main.go index 9363df3..c5ca546 100644 --- a/grpc-backend/main.go +++ b/grpc-backend/main.go @@ -207,6 +207,10 @@ func runGrpcAndGateway(s *Server, port string) error { mux.HandleFunc("/callback/", s.callback) mux.HandleFunc("/api/v1/audio/{filepath}", s.songFile) mux.HandleFunc("/api/v1/image/{filepath}", s.imageFile) + mux.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Write([]byte("pong")) + }) fileServer := http.FileServer(http.Dir("gen/swagger")) mux.Handle("/swagger/", http.StripPrefix("/swagger/", fileServer))