unify-external-plugin-platform 0.0.3-87 → 0.0.3-89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "unify-external-plugin-platform",
3
- "version": "0.0.3-87",
3
+ "version": "0.0.3-89",
4
4
  "description": "统一对外插件平台",
5
5
  "main": "./dist/external-plugin.umd.min.js",
6
- "author": "Young",
6
+ "author": "DaLaBengBa",
7
7
  "license": "ISC",
8
8
  "scripts": {
9
9
  "serve": "vue-cli-service serve",
@@ -0,0 +1,29 @@
1
+ @echo off
2
+ cd /d "%~dp0"
3
+
4
+ set "PORT=8399"
5
+ set "PAGE=camera-device-test.html"
6
+ set "URL=http://localhost:%PORT%/%PAGE%"
7
+
8
+ echo ������������ͷ����ҳ��...
9
+ echo ��ַ: %URL%
10
+ echo ������Ϻ�ֱ�ӹرձ����ڼ��ɡ�
11
+ echo.
12
+
13
+ where python >nul 2>nul && (
14
+ start "" "%URL%"
15
+ python -m http.server %PORT% || pause
16
+ goto :eof
17
+ )
18
+
19
+ where node >nul 2>nul && (
20
+ start "" "%URL%"
21
+ npx -y http-server -p %PORT% -s || pause
22
+ goto :eof
23
+ )
24
+
25
+ echo [����] δ��⵽ Python �� Node,�޷��������ط���
26
+ echo �밲װ��������һ��������:
27
+ echo Python: https://www.python.org/downloads/
28
+ echo Node.js: https://nodejs.org/
29
+ pause
@@ -0,0 +1,56 @@
1
+ #!/bin/bash
2
+ # 摄像头设备选择测试 - 一键启动(麒麟/UOS 等 Linux 环境)
3
+ # 用法: bash 启动摄像头测试.sh
4
+ # 兼容国产机的 python 命名怪象: python3 可能实际指向 2.x,真正的 3 可能叫 python3.4
5
+ cd "$(dirname "$0")"
6
+
7
+ PORT=8399
8
+ URL="http://localhost:$PORT/camera-device-test.html"
9
+
10
+ echo "正在检测可用的 Python..."
11
+ PY=""
12
+ PY2=""
13
+ for cand in python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python; do
14
+ if command -v "$cand" >/dev/null 2>&1; then
15
+ ver=$("$cand" --version 2>&1)
16
+ case "$ver" in
17
+ Python\ 3*)
18
+ PY="$cand"
19
+ echo " $cand -> $ver (可用)"
20
+ break
21
+ ;;
22
+ Python\ 2*)
23
+ [ -z "$PY2" ] && PY2="$cand"
24
+ echo " $cand -> $ver (版本过低,仅作兜底)"
25
+ ;;
26
+ esac
27
+ fi
28
+ done
29
+
30
+ if [ -n "$PY" ]; then
31
+ MODULE="http.server"
32
+ elif [ -n "$PY2" ]; then
33
+ PY="$PY2"
34
+ MODULE="SimpleHTTPServer"
35
+ echo "[提示] 未找到 Python3,改用 Python2 兼容方式启动。"
36
+ else
37
+ echo "[错误] 未找到任何可用的 Python,请安装: sudo apt install python3"
38
+ read -p "按回车键退出..."
39
+ exit 1
40
+ fi
41
+
42
+ echo "正在启动摄像头测试页面..."
43
+ echo "地址: $URL"
44
+ echo "测试完毕后按 Ctrl+C 停止服务。"
45
+ echo
46
+
47
+ # 起本地服务(摄像头 API 需要通过 localhost 访问,file:// 直接打开不可用)
48
+ "$PY" -m $MODULE $PORT &
49
+ SERVER_PID=$!
50
+ sleep 1
51
+
52
+ # 用系统默认浏览器打开;失败则提示手动打开
53
+ xdg-open "$URL" >/dev/null 2>&1 || echo "[提示] 请手动在浏览器打开: $URL"
54
+
55
+ # 等待服务进程,直到用户 Ctrl+C
56
+ wait $SERVER_PID