Skip to content

工程

创建静态应用

界面参数

json
{
    "theme": {
        "src": "/desktop/theme/sky.webp"
    },
    "date": {
        "timeFormat": "HH:mm:ss",
        "dayFormat": "MM月dd日",
        "lunarFormat": "MD",
        "weekday": [
            "星期日",
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六"
        ]
    },
    "useSearch": {
        "id": "1",
        "name": "百度",
        "sort": "1",
        "icon": "/desktop/search/baidu.svg",
        "url": "https://www.baidu.com/s?ie=utf-8&wd="
    },
    "search": [
        {
            "id": "1",
            "name": "百度",
            "sort": "1",
            "icon": "/desktop/search/baidu.svg",
            "url": "https://www.baidu.com/s?ie=utf-8&wd="
        },
        {
            "id": "2",
            "name": "Fine",
            "sort": "2",
            "icon": "/desktop/search/finemap.svg",
            "url": "https://www.baidu.com/s?ie=utf-8&wd="
        }
    ],
    "layout": [
        {
            "id": "1",
            "name": "第一页",
            "sort": "1",
            "icon": "图标1",
            "children": [
                {
                    "id": 1,
                    "name": "Fine",
                    "link": "http://www.finemap.cn/",
                    "size": "small",
                    "iconImg": "/desktop/icon/finemap.svg",
                    "sort": 1
                }
            ]
        }
    ]
}

部署

  1. 添加到webapps
  2. 安装并设置自启动apps.json
  3. 配置根路径
json
{
    "apps": [
        {
            "name": "desktop",
            "nickname": "desktop",
            "version": "1.0",
            "filename": "desktop-1.0",
            "type": "app",
            "source": "static",
            "system": "window",
            "author": "凡图科技",
            "description": "桌面",
            "logo": ""
        }
    ],
    "start": [
        {
            "name": "desktop",
            "version": "1.0"
        }
    ]
}
nginx
# 设置根界面反向代理
location / {
    # 代理转发
    proxy_pass http://127.0.0.1:80/desktop;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_connect_timeout 60s;
    proxy_read_timeout 180s;
}