见物于寻常处,见生活。
+ +diff --git a/.drone.yml b/.drone.yml index fe6630b..9d2c794 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,6 +28,11 @@ steps: commands: - npm --prefix apps/admin ci --no-audit --no-fund - npm --prefix apps/admin run build + - name: build-pc + image: node:24-alpine + commands: + - npm --prefix apps/pc ci --no-audit --no-fund + - npm --prefix apps/pc run build trigger: event: [push, pull_request, tag] diff --git a/apps/README.md b/apps/README.md index f03d8ca..f7a6dd8 100644 --- a/apps/README.md +++ b/apps/README.md @@ -3,7 +3,7 @@ | 路径 | 构建目标 | 制品名 | | --- | --- | --- | | `h5/` | uni-app 移动网页 | `item-atlas-h5` | -| `pc/` | 桌面浏览器网页 | `item-atlas-pc` | +| [pc/](pc/README.md) | 桌面浏览器网页 | `item-atlas-pc` | | [admin/](admin/README.md) | 管理后台 | `item-atlas-admin` | | [ios/](ios/README.md) | iOS 原生应用 | 见物 | | `android/` | Android 原生应用 | 见物 | diff --git a/apps/pc/.dockerignore b/apps/pc/.dockerignore new file mode 100644 index 0000000..79416de --- /dev/null +++ b/apps/pc/.dockerignore @@ -0,0 +1,4 @@ +node_modules +dist +.env* +.gitignore diff --git a/apps/pc/.gitignore b/apps/pc/.gitignore new file mode 100644 index 0000000..f4650bb --- /dev/null +++ b/apps/pc/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.env.local +.env.*.local diff --git a/apps/pc/Dockerfile b/apps/pc/Dockerfile new file mode 100644 index 0000000..de14394 --- /dev/null +++ b/apps/pc/Dockerfile @@ -0,0 +1,11 @@ +FROM node:24-alpine AS build +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --no-audit --no-fund +COPY . . +RUN npm run build + +FROM nginx:1.31-alpine +ENV ATLAS_GATEWAY_URL=http://item-atlas-gateway:8080 +COPY nginx.conf.template /etc/nginx/templates/default.conf.template +COPY --from=build /app/dist /usr/share/nginx/html diff --git a/apps/pc/README.md b/apps/pc/README.md new file mode 100644 index 0000000..4833450 --- /dev/null +++ b/apps/pc/README.md @@ -0,0 +1,25 @@ +# 见物桌面工作台 + +Vue 3、TypeScript、Vue Router 和 Vite。网页使用同源 `/api` 接现有网关,账号、物品和布局与 iOS 共享。 + +## 本地运行 + +使用 Node.js 24。在仓库根目录执行: + +```sh +npm --prefix apps/pc ci +npm --prefix apps/pc run dev -- --port 4173 +``` + +打开 `http://127.0.0.1:4173`。开发代理默认使用公网预览 API,可用 `ATLAS_GATEWAY_URL` 切换到其他网关。登录令牌只在当前页面内存中使用,刷新页面后重新登录。 + +## 构建与部署 + +```sh +npm --prefix apps/pc run build +docker build -t item-atlas-pc:0.1.0 apps/pc +``` + +镜像监听 8080。容器内 `ATLAS_GATEWAY_URL` 指向可达的网关;同一 Kubernetes 命名空间默认用 `http://item-atlas-gateway:8080`。就绪检查用 `/healthz`,Nginx 负责 SPA 路由和同源 API 转发。外部站点通过 HTTPS 接入。Drone 在现有流水线运行 `build-pc` 构建检查。 + +[产品交互](../../docs/ui/pc-workbench.md) · [域名与部署](../../docs/deployment/overview.md) diff --git a/apps/pc/index.html b/apps/pc/index.html new file mode 100644 index 0000000..1603561 --- /dev/null +++ b/apps/pc/index.html @@ -0,0 +1,13 @@ + + +
+ + + +
见物于寻常处,见生活。
+ +{{ error }}
+{{ listError }}
+| 物品 | 存放位置 | 数量 |
|---|---|---|
| + | + | {{ item.quantity }} | +
正在读取物品…
++ {{ error }} + + +
+「{{ conflict.name }}」与另一个房间重叠,请先调整位置。
+{{ status }}
+