add static link

peertube
Namekuji 2023-01-26 14:39:19 -05:00
rodzic 17e07d28a1
commit b21aa42aaa
7 zmienionych plików z 35 dodań i 27 usunięć

Wyświetl plik

@ -5,10 +5,14 @@ audon.localhost {
path /app/* /api/* /storage/* /u/* path /app/* /api/* /storage/* /u/*
} }
handle @backend { handle @backend {
reverse_proxy devcontainer:8100 reverse_proxy devcontainer:8100 {
flush_interval -1
}
} }
handle { handle {
reverse_proxy devcontainer:5173 reverse_proxy devcontainer:5173 {
flush_interval -1
}
} }
} }

1
.gitignore vendored
Wyświetl plik

@ -20,6 +20,7 @@
# Go workspace file # Go workspace file
go.work go.work
__debug_bin
### Node ### ### Node ###
# Logs # Logs

Wyświetl plik

@ -25,6 +25,9 @@ editRoom: "Room Edit"
comingFuture: "Coming with future update!" comingFuture: "Coming with future update!"
processing: "Processing now...<br />Keep this window open!" processing: "Processing now...<br />Keep this window open!"
lostWarning: "Unsaved data will be lost if you leave the page, are you sure?" lostWarning: "Unsaved data will be lost if you leave the page, are you sure?"
staticLink:
title: "Your Static Link"
hint: "Other can join to your room via this link while you're hosting."
form: form:
title: "Title" title: "Title"
titleRequired: "Room title required" titleRequired: "Room title required"
@ -46,7 +49,7 @@ roomReady:
header: "Your room is ready!" header: "Your room is ready!"
message: "Your room \"{title}\" is now ready. Share the following URL with other participants." message: "Your room \"{title}\" is now ready. Share the following URL with other participants."
errors: errors:
offline: "This user is offline now." offline: "This user is not hosting now."
invalidAddress: "Invalid address" invalidAddress: "Invalid address"
serverNotFound: "Instance not found" serverNotFound: "Instance not found"
notFound: "{value} not found" notFound: "{value} not found"

Wyświetl plik

@ -25,6 +25,9 @@ editRoom: "部屋の編集"
comingFuture: "今後のアップデートで追加予定" comingFuture: "今後のアップデートで追加予定"
processing: "処理中です。<br />画面を閉じないでください。" processing: "処理中です。<br />画面を閉じないでください。"
lostWarning: "この画面を閉じると保存前の内容が失われます。構いませんか?" lostWarning: "この画面を閉じると保存前の内容が失われます。構いませんか?"
staticLink:
title: "固定リンク"
hint: "プロフィール欄などに固定しておくと、あなたが部屋をホストしたとき他の人はこのリンクを使って参加できます。"
form: form:
title: "タイトル" title: "タイトル"
titleRequired: "部屋の名前を入力してください" titleRequired: "部屋の名前を入力してください"
@ -46,7 +49,7 @@ roomReady:
header: "お部屋の用意ができました!" header: "お部屋の用意ができました!"
message: "{title} を作りました。参加者に以下の URL を共有してください。" message: "{title} を作りました。参加者に以下の URL を共有してください。"
errors: errors:
offline: "このユーザーは現在オフラインです。" offline: "このユーザーは現在ホスト中ではありません。"
invalidAddress: "アドレスが有効ではありません" invalidAddress: "アドレスが有効ではありません"
serverNotFound: "サーバーが見つかりません" serverNotFound: "サーバーが見つかりません"
notFound: "{value} が見つかりません" notFound: "{value} が見つかりません"

Wyświetl plik

@ -2,7 +2,6 @@ import { createRouter, createWebHistory } from "vue-router";
import LoginView from "../views/LoginView.vue"; import LoginView from "../views/LoginView.vue";
import RoomView from "../views/RoomView.vue"; import RoomView from "../views/RoomView.vue";
import ErrorView from "../views/ErrorView.vue"; import ErrorView from "../views/ErrorView.vue";
import axios from "axios";
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
@ -49,27 +48,6 @@ const router = createRouter({
}, },
component: RoomView, component: RoomView,
}, },
{
path: "/u/:webfinger",
name: "currentHosting",
meta: {
noauth: true,
},
redirect: async (to) => {
try {
const resp = await axios.get(`/u/${to.params.webfinger}`);
if (resp.status === 302) {
return {
name: "room",
params: { id: resp.headers.location },
};
}
} catch (error) {
console.log(error);
}
return { name: "notfound" };
},
},
], ],
}); });

Wyświetl plik

@ -24,6 +24,13 @@ export const useMastodonStore = defineStore("mastodon", {
} }
return ""; return "";
}, },
myStaticLink() {
if (this.oauth.audon?.webfinger) {
const url = new URL(location.href);
return `${url.origin}/u/@${this.oauth.audon.webfinger}`;
}
return "";
}
}, },
actions: { actions: {
async fetchToken() { async fetchToken() {

Wyświetl plik

@ -2,10 +2,12 @@
import { useMastodonStore } from "../stores/mastodon"; import { useMastodonStore } from "../stores/mastodon";
import axios from "axios"; import axios from "axios";
import { some } from "lodash-es"; import { some } from "lodash-es";
import { mdiLinkVariant } from "@mdi/js";
export default { export default {
setup() { setup() {
return { return {
mdiLinkVariant,
donStore: useMastodonStore(), donStore: useMastodonStore(),
}; };
}, },
@ -49,7 +51,7 @@ export default {
{{ $t("logout") }} {{ $t("logout") }}
</v-btn> </v-btn>
</div> </div>
<div class="text-center my-10"> <div class="text-center my-8">
<v-avatar class="rounded" size="100"> <v-avatar class="rounded" size="100">
<v-img <v-img
:src="donStore.userinfo?.avatar" :src="donStore.userinfo?.avatar"
@ -80,5 +82,15 @@ export default {
> >
</v-col> </v-col>
</v-row> </v-row>
<div class="d-flex justify-center mt-6">
<v-alert :icon="mdiLinkVariant" :title="$t('staticLink.title')">
<div class="my-1">
<h4 style="word-break: break-all">
<a :href="donStore.myStaticLink" @click.prevent="">{{ donStore.myStaticLink }}</a>
</h4>
</div>
<p>{{ $t("staticLink.hint") }}</p>
</v-alert>
</div>
</main> </main>
</template> </template>