Skip to main content

完整示例

示例1:WebUI 内部打开 — 计时器应用

应用概览:

  • ID:tmrtimer
  • 类型:Deb 应用 / WebUI 内部打开(iframe)
  • 运行时:Python3 HTTP 服务(Unix Socket 模式)
  • 前端:静态 HTML 计时器页面

目录结构:

/usr/local/tmrtimer/
├── config.ini
├── tmrtimer.lang
├── webui.bz2
├── images/
│ └── icons/
│ └── tmrtimer.svg
└── init.d/
└── tmrtimer.service

config.ini:

{
"id": "tmrtimer",
"icon": "/images/icons/tmrtimer.svg",
"exec": true,
"version": "1.0.0",
"category": ["Utilities"],
"platform": "x86_64",
"system_id": "tmrtimer",
"package": "tmrtimer",
"application_type": "deb",
"path": "/tmrtimer/",
"type": "iframe",
"resize": true,
"maxmin": true
}

DEBIAN/control:

Package: tmrtimer
Version: 1.0.0
Architecture: amd64
Section: utils
Priority: optional
Maintainer: ljw <ljw@example.com>
Depends: python3 (>= 3.10), systemd
Description: 计时器应用
一个简单的定时器工具,支持启动、暂停和重置功能。

示例2:WebUI 外部打开 — 天气应用

应用概览:

  • ID:weather
  • 类型:Deb 应用 / WebUI 外部打开(新标签页)
  • 运行时:Go 后端服务,端口 16688
  • 前端:静态天气页面

目录结构:

/usr/local/weather/
├── config.ini
├── bin/
│ └── weather # Go 二进制
├── weather.lang
├── webui.bz2
├── images/
│ └── icons/
│ └── weather.svg
├── nginx/
│ └── weather.conf
└── init.d/
└── weather-system.service

config.ini:

{
"id": "weather",
"icon": "/images/icons/weather.svg",
"exec": true,
"version": "1.0.001",
"category": ["Utilities"],
"platform": "x86_64",
"system_id": "weather-system",
"package": "weather-package",
"application_type": "deb",
"path": "/weather/",
"open_path": true
}

nginx/weather.conf:

location /weather/ {
proxy_pass http://127.0.0.1:16688/;
proxy_http_version 1.1;
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;
}

示例3:无 UI 服务 — 数据同步服务

应用概览:

  • ID:datasync
  • 类型:Deb 应用 / 无 UI 服务
  • 运行时:Python3 后台服务

目录结构:

/usr/local/datasync/
├── config.ini
├── bin/
│ └── datasync # 可执行文件
├── datasync.lang
├── images/
│ └── icons/
│ └── datasync.svg
└── init.d/
└── datasync.service

config.ini:

{
"id": "datasync",
"icon": "/images/icons/datasync.svg",
"exec": true,
"version": "1.0.0",
"category": ["Utilities"],
"platform": "x86_64",
"system_id": "datasync",
"package": "datasync",
"application_type": "deb"
}