mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-18 10:02:16 +00:00
Update notification service
This commit is contained in:
@@ -110,6 +110,17 @@ else
|
|||||||
echo "⚠️ ai_providers directory not found"
|
echo "⚠️ ai_providers directory not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy config files (verified AI models, etc.)
|
||||||
|
echo "📋 Copying config files..."
|
||||||
|
CONFIG_DIR="$APPIMAGE_ROOT/config"
|
||||||
|
if [ -d "$CONFIG_DIR" ]; then
|
||||||
|
mkdir -p "$APP_DIR/usr/bin/config"
|
||||||
|
cp "$CONFIG_DIR/"*.json "$APP_DIR/usr/bin/config/" 2>/dev/null || true
|
||||||
|
echo "✅ Config files copied"
|
||||||
|
else
|
||||||
|
echo "⚠️ config directory not found"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "📋 Adding translation support..."
|
echo "📋 Adding translation support..."
|
||||||
cat > "$APP_DIR/usr/bin/translate_cli.py" << 'PYEOF'
|
cat > "$APP_DIR/usr/bin/translate_cli.py" << 'PYEOF'
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|||||||
@@ -104,12 +104,26 @@ def test_notification():
|
|||||||
|
|
||||||
|
|
||||||
def load_verified_models():
|
def load_verified_models():
|
||||||
"""Load verified models from config file."""
|
"""Load verified models from config file.
|
||||||
|
|
||||||
|
Checks multiple paths:
|
||||||
|
1. Same directory as script (AppImage: /usr/bin/config/)
|
||||||
|
2. Parent directory config folder (dev: AppImage/config/)
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
config_path = Path(__file__).parent.parent / 'config' / 'verified_ai_models.json'
|
# Try AppImage path first (scripts and config both in /usr/bin/)
|
||||||
|
script_dir = Path(__file__).parent
|
||||||
|
config_path = script_dir / 'config' / 'verified_ai_models.json'
|
||||||
|
|
||||||
|
if not config_path.exists():
|
||||||
|
# Try development path (AppImage/scripts/ -> AppImage/config/)
|
||||||
|
config_path = script_dir.parent / 'config' / 'verified_ai_models.json'
|
||||||
|
|
||||||
if config_path.exists():
|
if config_path.exists():
|
||||||
with open(config_path, 'r') as f:
|
with open(config_path, 'r') as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
|
else:
|
||||||
|
print(f"[flask_notification_routes] Config not found at {config_path}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[flask_notification_routes] Failed to load verified models: {e}")
|
print(f"[flask_notification_routes] Failed to load verified models: {e}")
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@@ -1692,7 +1692,14 @@ class NotificationManager:
|
|||||||
verified_models = []
|
verified_models = []
|
||||||
recommended_model = ''
|
recommended_model = ''
|
||||||
try:
|
try:
|
||||||
config_path = Path(__file__).parent.parent / 'config' / 'verified_ai_models.json'
|
# Try AppImage path first (scripts and config both in /usr/bin/)
|
||||||
|
script_dir = Path(__file__).parent
|
||||||
|
config_path = script_dir / 'config' / 'verified_ai_models.json'
|
||||||
|
|
||||||
|
if not config_path.exists():
|
||||||
|
# Try development path (AppImage/scripts/ -> AppImage/config/)
|
||||||
|
config_path = script_dir.parent / 'config' / 'verified_ai_models.json'
|
||||||
|
|
||||||
if config_path.exists():
|
if config_path.exists():
|
||||||
with open(config_path, 'r') as f:
|
with open(config_path, 'r') as f:
|
||||||
verified_config = json.load(f)
|
verified_config = json.load(f)
|
||||||
|
|||||||
Reference in New Issue
Block a user