diff --git a/bbit_ai/Dockerfile_ai_lab.old b/bbit_ai/Dockerfile_ai_lab.old new file mode 100644 index 0000000..4dcf2ca --- /dev/null +++ b/bbit_ai/Dockerfile_ai_lab.old @@ -0,0 +1,50 @@ +# 使用官方 Python 镜像 +FROM python:3.10-slim + +WORKDIR /app + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libpq5 \ + unixodbc \ + curl \ + fonts-wqy-zenhei \ + libgl1 \ + gnupg \ + apt-transport-https \ + lsb-release && \ + # 导入微软 GPG key(使用 keyrings 方式) + curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft.gpg && \ + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" > /etc/apt/sources.list.d/mssql-release.list && \ + apt-get update && \ + ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \ + rm -rf /var/lib/apt/lists/* + +COPY app/requirements.txt . +# 安装 Python 依赖 +RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt +RUN python -m pip uninstall -y opencv-python +RUN python -m pip install opencv-python-headless + + + +# 复制并解压 JRE +COPY docker/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz /opt/ +RUN tar -xzf /opt/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz -C /opt/ && \ + rm /opt/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz + +# 配置 Java 环境 +ENV JAVA_HOME=/opt/jdk-17.0.16+8-jre +ENV PATH="$JAVA_HOME/bin:$PATH" + +# 复制项目代码 +COPY app/ . +# 复制 pyzxing 的 jar 文件到默认路径 +COPY docker/javase-3.4.1-SNAPSHOT-jar-with-dependencies.jar /root/.local/pyzxing/javase-3.4.1-SNAPSHOT-jar-with-dependencies.jar + +EXPOSE 13011 + +# 启动命令(使用 uvicorn 启动 FastAPI) +CMD ["python", "app.py"] + + diff --git a/sentinel/main/main.go b/sentinel/main/main.go index fb7f64e..ea60f7d 100644 --- a/sentinel/main/main.go +++ b/sentinel/main/main.go @@ -23,8 +23,8 @@ func main() { fmt.Println(banner) deviceID := device.GetDeviceID() - log.Init(config.Log_file_dic) // 初始化日志目录 - log.Info("Device id: " + deviceID) // 第一次启动记录 + log.Init(config.Log_file_dic) // 初始化日志目录 + log.Info("Device id: " + deviceID) // 第一次启动记录 log.Println("版本号: ", config.APP_VERSION) // 第一次启动记录 var mqttSvc *MQTTService @@ -55,7 +55,7 @@ func main() { continue } // 个人业务 - //test() + test() break } diff --git a/vue2/apps/web-antd/src/views/iot/device/data.ts b/vue2/apps/web-antd/src/views/iot/device/data.ts index 9a68795..230e4b9 100644 --- a/vue2/apps/web-antd/src/views/iot/device/data.ts +++ b/vue2/apps/web-antd/src/views/iot/device/data.ts @@ -170,13 +170,13 @@ export function useColumns( field: 'online', slots: { default: 'status' }, title: '当前状态', - width: 100, + width: 80, }, { field: 'device_type', slots: { default: 'deviceType' }, title: '设备类型', - width: 100, + width: 80, }, { field: 'dept_name', @@ -192,15 +192,6 @@ export function useColumns( title: '可用性', width: 100, }, - { - cellRender: { - attrs: { beforeChange: onIsSuperUserChange }, - name: onIsSuperUserChange ? 'CellSwitch' : 'CellTag', - }, - field: 'is_superuser', - title: '管理员', - width: 100, - }, { field: 'remark', title: '备注', @@ -256,6 +247,15 @@ export function useColumns( title: '创建时间', width: 150, }, + { + cellRender: { + attrs: { beforeChange: onIsSuperUserChange }, + name: onIsSuperUserChange ? 'CellSwitch' : 'CellTag', + }, + field: 'is_superuser', + title: '管理员', + width: 100, + }, { field: 'operation', title: '操作', diff --git a/vue2/apps/web-antd/src/views/iot/device/index.vue b/vue2/apps/web-antd/src/views/iot/device/index.vue index 3243751..926b47a 100644 --- a/vue2/apps/web-antd/src/views/iot/device/index.vue +++ b/vue2/apps/web-antd/src/views/iot/device/index.vue @@ -202,8 +202,8 @@ let ws: null | WebSocket = null; function createWs(token: string) { ws = new WebSocket( - // `wss://ai.ronsunny.cn:8090/ai/iot/ws/device-status?token=${token}`, - `ws://127.0.0.1:13011/iot/ws/device-status?token=${token}`, + `wss://ai.ronsunny.cn:8090/ai/iot/ws/device-status?token=${token}`, + // `ws://127.0.0.1:13011/iot/ws/device-status?token=${token}`, ); wsState.ws = ws; diff --git a/vue2/apps/web-antd/src/views/sentinel/record/index.vue b/vue2/apps/web-antd/src/views/sentinel/record/index.vue index d1ea927..1582d13 100644 --- a/vue2/apps/web-antd/src/views/sentinel/record/index.vue +++ b/vue2/apps/web-antd/src/views/sentinel/record/index.vue @@ -172,7 +172,8 @@ function createWs(token: string) { } ws = new WebSocket( - `ws://127.0.0.1:13011/iot/ws/sentinel_record?token=${token}`, + // `ws://127.0.0.1:13011/iot/ws/sentinel_record?token=${token}`, + `wss://ai.ronsunny.cn:8090/ai/iot/ws/sentinel_record?token=${token}`, ); ws.onmessage = (e) => {