chore: 官网拆分 homepage + 验收残留清理(当前可用状态基线)

This commit is contained in:
logan committed 2026-10-14 20:31:38 +08:00
1 parent 8c850690b0
commit 6452026fd6
9 files changed
+5219

No files matched your search

+107
View File
@@ -0,0 +1,107 @@
# sourced by run.sh — temp OpsxAPI.app for Dock icon (icons/icon.icns)
# shellcheck shell=bash
# .noindex:避免 Spotlight 把临时 Dock 壳当成可打开的历史 App
GUI_APP_DIR="$SCRIPT_DIR/src-tauri/target/gui-app.noindex"
GUI_APP="$GUI_APP_DIR/OpsxAPI.app"
# 源码在 apps/desktop/src-tauri;编译产物可能在根 src-tauri/target(历史路径)
ICONS_DIR="$SCRIPT_DIR/apps/desktop/src-tauri/icons"
[ -f "$ICONS_DIR/icon.icns" ] || ICONS_DIR="$SCRIPT_DIR/src-tauri/icons"
REL_APP="$SCRIPT_DIR/apps/desktop/src-tauri/target/release/bundle/macos/OpsxAPI.app"
[ -d "$REL_APP" ] || REL_APP="$SCRIPT_DIR/src-tauri/target/release/bundle/macos/OpsxAPI.app"
DBG_APP="$SCRIPT_DIR/apps/desktop/src-tauri/target/debug/bundle/macos/OpsxAPI.app"
[ -d "$DBG_APP" ] || DBG_APP="$SCRIPT_DIR/src-tauri/target/debug/bundle/macos/OpsxAPI.app"
REL_BIN="$SCRIPT_DIR/apps/desktop/src-tauri/target/release/OpsxAPI"
[ -x "$REL_BIN" ] || REL_BIN="$SCRIPT_DIR/src-tauri/target/release/OpsxAPI"
DBG_BIN_A="$SCRIPT_DIR/apps/desktop/src-tauri/target/debug/OpsxAPI"
[ -x "$DBG_BIN_A" ] || DBG_BIN_A="$SCRIPT_DIR/src-tauri/target/debug/OpsxAPI"
DBG_BIN_B="$SCRIPT_DIR/apps/desktop/src-tauri/target/debug/opsxapi"
[ -x "$DBG_BIN_B" ] || DBG_BIN_B="$SCRIPT_DIR/src-tauri/target/debug/opsxapi"
GUI_DEV_NEEDS_VITE=0
_gui_write_plist() {
cat >"$GUI_APP/Contents/Info.plist" <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key><string>OpsxAPI</string>
<key>CFBundleExecutable</key><string>OpsxAPI</string>
<key>CFBundleIconFile</key><string>icon.icns</string>
<key>CFBundleIdentifier</key><string>com.opsx.api.dev</string>
<key>CFBundleName</key><string>OpsxAPI</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleShortVersionString</key><string>0.1.0-dev</string>
<key>CFBundleVersion</key><string>0</string>
<key>LSHighResolutionCapable</key><true/>
</dict>
</plist>
PLIST
}
_gui_wrap_bin() {
local src="$1"
mkdir -p "$GUI_APP/Contents/MacOS" "$GUI_APP/Contents/Resources"
cp "$src" "$GUI_APP/Contents/MacOS/OpsxAPI"
chmod +x "$GUI_APP/Contents/MacOS/OpsxAPI"
_gui_write_plist
}
ensure_gui_dev_app() {
local icon="$ICONS_DIR/icon.icns"
GUI_DEV_NEEDS_VITE=0
if [ ! -f "$icon" ]; then
error "缺少 ${icon}"
return 1
fi
mkdir -p "$GUI_APP_DIR"
if [ -d "$DBG_APP" ]; then
rm -rf "$GUI_APP"
cp -R "$DBG_APP" "$GUI_APP"
GUI_DEV_NEEDS_VITE=1
elif [ -x "$DBG_BIN_A" ]; then
rm -rf "$GUI_APP"
_gui_wrap_bin "$DBG_BIN_A"
GUI_DEV_NEEDS_VITE=1
elif [ -x "$DBG_BIN_B" ]; then
rm -rf "$GUI_APP"
_gui_wrap_bin "$DBG_BIN_B"
GUI_DEV_NEEDS_VITE=1
elif [ -d "$REL_APP" ]; then
rm -rf "$GUI_APP"
cp -R "$REL_APP" "$GUI_APP"
elif [ -x "$REL_BIN" ]; then
rm -rf "$GUI_APP"
_gui_wrap_bin "$REL_BIN"
else
error "没有可包装的桌面二进制。请先 ./run.sh gui 走一次 tauri 编译,或 npm run tauri -- build --no-bundle。"
return 1
fi
mkdir -p "$GUI_APP/Contents/Resources"
cp "$icon" "$GUI_APP/Contents/Resources/icon.icns"
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName OpsxAPI" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Set :CFBundleName OpsxAPI" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Set :CFBundleExecutable OpsxAPI" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Set :CFBundleIconFile icon.icns" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier com.opsx.api.dev" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
local stamp
stamp="$(date +%Y%m%d%H%M%S)"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${stamp}" "$GUI_APP/Contents/Info.plist" 2>/dev/null || true
touch "$GUI_APP"
success "临时 .app 已刷 icons/icon.icns → ${GUI_APP}"
}
kill_opsxapi_gui() {
stop_detached "$DESKTOP_LABEL"
pkill -f "$SCRIPT_DIR/src-tauri/target/debug/OpsxAPI" 2>/dev/null || true
pkill -f "$SCRIPT_DIR/apps/desktop/src-tauri/target/debug/OpsxAPI" 2>/dev/null || true
pkill -f "$SCRIPT_DIR/node_modules/.bin/tauri" 2>/dev/null || true
pkill -f "$SCRIPT_DIR/src-tauri/target/gui-app/OpsxAPI.app" 2>/dev/null || true
pkill -f "$GUI_APP" 2>/dev/null || true
pkill -x OpsxAPI 2>/dev/null || true
}
gui_is_running() {
pgrep -f "$GUI_APP/Contents/MacOS/" >/dev/null 2>&1 \
|| pgrep -x OpsxAPI >/dev/null 2>&1
}
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
{"__app-acl__":{"default_permission":null,"permissions":{"transport":{"identifier":"transport","description":"Allow HTTP/WebSocket native transport","commands":{"allow":["http_send","ws_connect","ws_send","ws_close"],"deny":[]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"iLine truncated
+1
View File
@@ -0,0 +1 @@
{"default":{"identifier":"default","description":"Default capabilities for the OpsxAPI main window","local":true,"windows":["main"],"permissions":["core:default","core:event:default","transport","opener:default"]}}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff