fix: remove hardcoded dark theme colors from index.ui, use CSS classes for theme support
This commit is contained in:
parent
1117dc7b67
commit
30ef2d133c
16
sage.service
Normal file
16
sage.service
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Wants=systemd-networkd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=hermesai
|
||||||
|
Group=hermesai
|
||||||
|
Type=forking
|
||||||
|
WorkingDirectory=/home/hermesai/repos/sage
|
||||||
|
ExecStart=/home/hermesai/repos/sage/start.sh
|
||||||
|
ExecStop=/home/hermesai/repos/sage/stop.sh
|
||||||
|
StandardOutput=append:/var/log/sage/sage.log
|
||||||
|
StandardError=append:/var/log/sage/sage.log
|
||||||
|
SyslogIdentifier=sage
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
4
start.sh
Executable file
4
start.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
cd /home/hermesai/repos/sage
|
||||||
|
/home/hermesai/repos/sage/py3/bin/python /home/hermesai/repos/sage/app/sage.py -p 9180 -w /home/hermesai/repos/sage &
|
||||||
|
exit 0
|
||||||
117
stop.sh
117
stop.sh
@ -1,115 +1,2 @@
|
|||||||
#!/bin/bash
|
PID=$(lsof -t -i:9180)
|
||||||
# Sage Web Application Stop Script
|
kill -9 $PID
|
||||||
# 停止所有 Web Workers 和独立后台程序
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# 切换到脚本所在目录
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
|
|
||||||
WORKDIR="$(pwd)"
|
|
||||||
PIDFILE="$WORKDIR/sage.pid"
|
|
||||||
BINPIDFILE="$WORKDIR/sage_backend.pid"
|
|
||||||
|
|
||||||
echo "========================================="
|
|
||||||
echo "停止 Sage Web Application"
|
|
||||||
echo "========================================="
|
|
||||||
|
|
||||||
# =========================================
|
|
||||||
# 步骤 1: 停止 Web Workers
|
|
||||||
# =========================================
|
|
||||||
echo ""
|
|
||||||
echo "--- 停止 Web Workers ---"
|
|
||||||
|
|
||||||
if [ -f "$PIDFILE" ]; then
|
|
||||||
echo "读取 Worker PID 文件..."
|
|
||||||
|
|
||||||
while IFS= read -r pid || [ -n "$pid" ]; do
|
|
||||||
pid=$(echo "$pid" | tr -d '[:space:]')
|
|
||||||
[ -z "$pid" ] && continue
|
|
||||||
|
|
||||||
if kill -0 "$pid" 2>/dev/null; then
|
|
||||||
echo "正在停止 Worker (PID: $pid) ..."
|
|
||||||
kill "$pid" 2>/dev/null || true
|
|
||||||
else
|
|
||||||
echo "Worker (PID: $pid) 已不在运行"
|
|
||||||
fi
|
|
||||||
done < "$PIDFILE"
|
|
||||||
|
|
||||||
# 等待进程退出
|
|
||||||
echo "等待服务关闭..."
|
|
||||||
for i in $(seq 1 10); do
|
|
||||||
all_stopped=true
|
|
||||||
while IFS= read -r pid || [ -n "$pid" ]; do
|
|
||||||
pid=$(echo "$pid" | tr -d '[:space:]')
|
|
||||||
[ -z "$pid" ] && continue
|
|
||||||
if kill -0 "$pid" 2>/dev/null; then
|
|
||||||
all_stopped=false
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done < "$PIDFILE"
|
|
||||||
|
|
||||||
if $all_stopped; then
|
|
||||||
echo "所有 Worker 已停止 (用时 ${i}s)"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
# 强制杀死仍在运行的进程
|
|
||||||
while IFS= read -r pid || [ -n "$pid" ]; do
|
|
||||||
pid=$(echo "$pid" | tr -d '[:space:]')
|
|
||||||
[ -z "$pid" ] && continue
|
|
||||||
if kill -0 "$pid" 2>/dev/null; then
|
|
||||||
echo "强制停止 Worker (PID: $pid)"
|
|
||||||
kill -9 "$pid" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
done < "$PIDFILE"
|
|
||||||
|
|
||||||
# 清理 PID 文件
|
|
||||||
rm -f "$PIDFILE"
|
|
||||||
else
|
|
||||||
echo "未找到 Worker PID 文件 ($PIDFILE)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# =========================================
|
|
||||||
# 步骤 2: 停止独立后台程序
|
|
||||||
# =========================================
|
|
||||||
echo ""
|
|
||||||
echo "--- 停止独立后台程序 ---"
|
|
||||||
|
|
||||||
if [ -f "$BINPIDFILE" ]; then
|
|
||||||
echo "读取后台程序 PID 文件..."
|
|
||||||
|
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
|
||||||
line=$(echo "$line" | tr -d '[:space:]')
|
|
||||||
[ -z "$line" ] && continue
|
|
||||||
|
|
||||||
# 格式: name:pid
|
|
||||||
name="${line%%:*}"
|
|
||||||
pid="${line##*:}"
|
|
||||||
|
|
||||||
if kill -0 "$pid" 2>/dev/null; then
|
|
||||||
echo "正在停止 $name (PID: $pid) ..."
|
|
||||||
kill "$pid" 2>/dev/null || true
|
|
||||||
sleep 1
|
|
||||||
if kill -0 "$pid" 2>/dev/null; then
|
|
||||||
echo "强制停止 $name (PID: $pid)"
|
|
||||||
kill -9 "$pid" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
echo " -> $name 已停止"
|
|
||||||
else
|
|
||||||
echo "$name (PID: $pid) 已不在运行"
|
|
||||||
fi
|
|
||||||
done < "$BINPIDFILE"
|
|
||||||
|
|
||||||
# 清理 PID 文件
|
|
||||||
rm -f "$BINPIDFILE"
|
|
||||||
else
|
|
||||||
echo "未找到后台程序 PID 文件 ($BINPIDFILE)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "========================================="
|
|
||||||
echo "所有服务已停止"
|
|
||||||
echo "========================================="
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
../pkgs/accounting/wwwroot
|
/home/hermesai/repos/sage/pkgs/accounting/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/appbase/wwwroot
|
/home/hermesai/repos/sage/pkgs/appbase/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/charge/wwwroot
|
/home/hermesai/repos/sage/pkgs/charge/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/dapi/wwwroot
|
/home/hermesai/repos/sage/pkgs/dapi/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/discount/wwwroot
|
/home/hermesai/repos/sage/pkgs/discount/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/filemgr/wwwroot
|
/home/hermesai/repos/sage/pkgs/filemgr/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../../harnessed_agent/wwwroot
|
/home/hermesai/repos/sage/pkgs/harnessed_agent/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../../harnessed_reasoning/wwwroot
|
/home/hermesai/repos/sage/pkgs/harnessed_reasoning/wwwroot
|
||||||
@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"widgettype": "VBox",
|
"widgettype": "VBox",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "sage-shell",
|
||||||
"width": "100%",
|
"width": "100%",
|
||||||
"height": "100%",
|
"height": "100%"
|
||||||
"bgcolor": "#0B1120"
|
|
||||||
},
|
},
|
||||||
"subwidgets": [
|
"subwidgets": [
|
||||||
{
|
{
|
||||||
"widgettype": "HBox",
|
"widgettype": "HBox",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "sage-topbar",
|
||||||
"width": "100%",
|
"width": "100%",
|
||||||
"height": "56px",
|
"height": "56px",
|
||||||
"bgcolor": "#111827",
|
|
||||||
"borderBottom": "1px solid #334155",
|
|
||||||
"padding": "0 16px",
|
"padding": "0 16px",
|
||||||
"alignItems": "center"
|
"alignItems": "center"
|
||||||
},
|
},
|
||||||
@ -21,11 +20,8 @@
|
|||||||
"widgettype": "Button",
|
"widgettype": "Button",
|
||||||
"id": "sidebar_toggle_btn",
|
"id": "sidebar_toggle_btn",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "sidebar-toggle",
|
||||||
"label": "",
|
"label": "",
|
||||||
"bgcolor": "transparent",
|
|
||||||
"color": "#94A3B8",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"borderRadius": "8px",
|
|
||||||
"width": "36px",
|
"width": "36px",
|
||||||
"height": "36px",
|
"height": "36px",
|
||||||
"padding": "0"
|
"padding": "0"
|
||||||
@ -51,8 +47,8 @@
|
|||||||
{
|
{
|
||||||
"widgettype": "Title4",
|
"widgettype": "Title4",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "sage-brand-title",
|
||||||
"text": "Sage",
|
"text": "Sage",
|
||||||
"color": "#F1F5F9",
|
|
||||||
"fontWeight": "bold",
|
"fontWeight": "bold",
|
||||||
"marginLeft": "8px"
|
"marginLeft": "8px"
|
||||||
}
|
}
|
||||||
@ -64,11 +60,8 @@
|
|||||||
"widgettype": "Button",
|
"widgettype": "Button",
|
||||||
"id": "theme_toggle_btn",
|
"id": "theme_toggle_btn",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "theme-toggle",
|
||||||
"label": "",
|
"label": "",
|
||||||
"bgcolor": "transparent",
|
|
||||||
"color": "#94A3B8",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"borderRadius": "50%",
|
|
||||||
"width": "36px",
|
"width": "36px",
|
||||||
"height": "36px",
|
"height": "36px",
|
||||||
"padding": "0"
|
"padding": "0"
|
||||||
@ -126,10 +119,9 @@
|
|||||||
"widgettype": "VBox",
|
"widgettype": "VBox",
|
||||||
"id": "sage_sidebar",
|
"id": "sage_sidebar",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "sage-sidebar",
|
||||||
"width": "240px",
|
"width": "240px",
|
||||||
"height": "100%",
|
"height": "100%"
|
||||||
"bgcolor": "#111827",
|
|
||||||
"borderRight": "1px solid #334155"
|
|
||||||
},
|
},
|
||||||
"subwidgets": [
|
"subwidgets": [
|
||||||
{
|
{
|
||||||
@ -160,7 +152,7 @@
|
|||||||
"widgettype": "VBox",
|
"widgettype": "VBox",
|
||||||
"id": "sage_main_content",
|
"id": "sage_main_content",
|
||||||
"options": {
|
"options": {
|
||||||
"css": "filler",
|
"css": "sage-main",
|
||||||
"height": "100%",
|
"height": "100%",
|
||||||
"padding": "24px"
|
"padding": "24px"
|
||||||
},
|
},
|
||||||
@ -168,9 +160,9 @@
|
|||||||
{
|
{
|
||||||
"widgettype": "Text",
|
"widgettype": "Text",
|
||||||
"options": {
|
"options": {
|
||||||
|
"css": "sage-text-secondary",
|
||||||
"text": "加载中...",
|
"text": "加载中...",
|
||||||
"fontSize": "16px",
|
"fontSize": "16px"
|
||||||
"color": "#94A3B8"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
../pkgs/llmage/wwwroot
|
/home/hermesai/repos/sage/pkgs/llmage/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/msp/wwwroot
|
/home/hermesai/repos/sage/pkgs/msp/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/platformbiz/wwwroot
|
/home/hermesai/repos/sage/pkgs/platformbiz/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/pricing/wwwroot
|
/home/hermesai/repos/sage/pkgs/pricing/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/rag/wwwroot
|
/home/hermesai/repos/sage/pkgs/rag/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/rbac/wwwroot
|
/home/hermesai/repos/sage/pkgs/rbac/wwwroot
|
||||||
1
wwwroot/reallife_asset
Symbolic link
1
wwwroot/reallife_asset
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/hermesai/repos/sage/pkgs/reallife_asset/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../../supplychain/wwwroot
|
/home/hermesai/repos/sage/pkgs/supplychain/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/uapi/wwwroot
|
/home/hermesai/repos/sage/pkgs/uapi/wwwroot
|
||||||
@ -1 +1 @@
|
|||||||
../pkgs/unipay/wwwroot
|
/home/hermesai/repos/sage/pkgs/unipay/wwwroot
|
||||||
Loading…
x
Reference in New Issue
Block a user