diff --git a/Dockerfile b/Dockerfile index fd1ac58..7019a6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM oven/bun:latest AS builder # 使用淘宝镜像加速 @@ -6,7 +8,7 @@ ENV BUN_INSTALL_REGISTRY=https://registry.npmmirror.com WORKDIR /build COPY web/package.json . COPY web/bun.lock . -RUN bun install +RUN --mount=type=cache,target=/root/.bun/install/cache bun install COPY ./web . COPY ./VERSION . RUN DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat VERSION) bun run build @@ -22,11 +24,11 @@ ENV GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} WORKDIR /build ADD go.mod go.sum ./ -RUN go mod download +RUN --mount=type=cache,target=/go/pkg/mod go mod download COPY . . COPY --from=builder /build/dist ./web/dist -RUN go build -ldflags "-s -w -X 'github.com/QuantumNous/new-api/common.Version=$(cat VERSION)'" -o new-api +RUN --mount=type=cache,target=/root/.cache/go-build go build -ldflags "-s -w -X 'github.com/QuantumNous/new-api/common.Version=$(cat VERSION)'" -o new-api FROM debian:bookworm-slim diff --git a/web/src/components/table/users/modals/UserModelRateLimitSection.jsx b/web/src/components/table/users/modals/UserModelRateLimitSection.jsx index fe81b33..727c49b 100644 --- a/web/src/components/table/users/modals/UserModelRateLimitSection.jsx +++ b/web/src/components/table/users/modals/UserModelRateLimitSection.jsx @@ -46,10 +46,10 @@ const UserModelRateLimitSection = ({ userId }) => { useEffect(() => { const loadModels = async () => { try { - const res = await API.get('/api/channel/models'); + const res = await API.get('/api/channel/models_enabled'); const { success, data } = res.data; if (success && Array.isArray(data)) { - setModelOptions(data.map((m) => ({ label: m.id, value: m.id }))); + setModelOptions(data.map((m) => ({ label: m, value: m }))); } } catch (e) { // ignore