refactor: frontend TS migration + Tailwind4/daisyUI5 unify + BUILDPLATFORM docker build

- migrate frontend to TypeScript (vue-tsc strict in build), upgrade all deps to latest (Vite 8, Tailwind 4, daisyUI 5, Pinia 4, vue-router 5)
- restructure frontend dirs (api/components/common/layouts/styles/types/views)
- drop Element Plus, add daisyUI TagInput; main CSS 490KB->163KB, entry JS 618KB->1.3KB
- rewrite Dockerfile(.cn): frontend/backend stages pinned to $BUILDPLATFORM, CGO_ENABLED=0 cross-compile, no QEMU in multi-arch builds; add .dockerignore
- local dev: Vite /api proxy + make dev targets; go:embed all:dist with .gitkeep so backend runs without prior frontend build
- fix latent bugs: Keys.vue users ref, Settings.vue undefined userStore, Login.vue Ref-as-error display, res.error misuse
- add REFACTOR_PLAN.md (phased refactor log)
This commit is contained in:
Sakurasan
2026-08-29 23:27:31 +08:00
parent 4a68ff6162
commit ac0a6808ec
55 changed files with 2497 additions and 2318 deletions
+11 -10
View File
@@ -3,7 +3,7 @@
<div class="navbar fixed w-full top-0 z-50 backdrop-blur-sm bg-base-100/50">
<div class="container mx-auto flex justify-between items-center p-1 rounded-box">
<div class="flex items-center h-12 w-12 rounded-full text-l">
<img src="../assets/logo.svg" alt="Logo" class="select-none">
<img src="@/assets/logo.svg" alt="Logo" class="select-none">
<span class="hidden sm:flex text-xl font-bold">
<a href="/" class="text-base-content hover:no-underline">OpenTeam</a>
</span>
@@ -25,7 +25,7 @@
<main class="flex-grow flex flex-col justify-center items-center pt-16">
<div class="text-center">
<div class="flex items-center justify-center my-4 outline-none select-none">
<img src="../assets/openteam.png" alt="Project Logo" class="h-40">
<img src="@/assets/openteam.png" alt="Project Logo" class="h-40">
</div>
<h1 class="text-4xl font-bold mb-4">
<a class="text-gray-600" href="https://github.com/mirrors2/opencatd-open">OpenTeam</a>
@@ -65,7 +65,7 @@
<p class="mb-2">欢迎加入我们的Telegram频道,获取最新动态和帮助</p>
<div class="flex justify-center mb-4">
<a href="https://t.me/OpenTeamLLM" target="_blank" class="tooltip tooltip-bottom backdrop-blur-0" data-tip="Telegram Channel">
<img src="../assets/openteam_channel.jpg" alt="Telegram Group QR Code"
<img src="@/assets/openteam_channel.jpg" alt="Telegram Group QR Code"
class="w-40 fill-current backdrop-blur-0 select-none">
</a>
@@ -95,27 +95,28 @@
</div>
</template>
<script setup>
import { ref, onMounted, inject } from 'vue';
import LineSegmentFlow from '@/components/LineSegmentFlow.vue';
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import LineSegmentFlow from '@/components/common/LineSegmentFlow.vue';
import { Icon } from '@iconify/vue';
import { useToast } from '@/composables/toast';
const currentYear = ref('');
const url = ref('');
const { setToast } = inject('toast');
const { setToast } = useToast();
const copyUrl = async () => {
try {
await navigator.clipboard.writeText(url.value);
setToast('复制成功!', 'info');
} catch (err) {
} catch (err: any) {
setToast('复制失败,请手动复制。', 'error');
}
};
const star = ref(0);
const getGithubStars = async () => {
const res = await fetch('https://ungh.cc/repos/mirrors2/openteam', { next: { revalidate: 3600 } });
const getGithubStars = async (): Promise<number> => {
const res = await fetch('https://ungh.cc/repos/mirrors2/openteam', { next: { revalidate: 3600 } } as RequestInit);
const data = await res.json();
return data.repo.stars;
};