功能:新增桌面连接配置持久化(desktops.json)
This commit is contained in:
parent
b9e5a3d416
commit
921f4c7798
37
terminal/kiosk-shell/src/desktop_store.h
Normal file
37
terminal/kiosk-shell/src/desktop_store.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// 桌面连接配置持久化(JSON)
|
||||||
|
//
|
||||||
|
// 每个客户部署环境的桌面地址不同,连接参数不能写死在代码里。
|
||||||
|
// 当前阶段由本地文件维护(现场通过"桌面连接设置"界面配置);
|
||||||
|
// 后续接入管理平台后,本类改为平台下发配置的本地缓存,接口不变。
|
||||||
|
//
|
||||||
|
// 文件:~/.config/vdi-terminal/desktops.json
|
||||||
|
// 兼容:文件不存在时生成默认骨架;老盒子从 client.conf 的 server 迁移 Windows 地址。
|
||||||
|
|
||||||
|
#ifndef KIOSK_SHELL_DESKTOP_STORE_H
|
||||||
|
#define KIOSK_SHELL_DESKTOP_STORE_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "desktop_session.h"
|
||||||
|
|
||||||
|
namespace vdi {
|
||||||
|
|
||||||
|
class DesktopStore {
|
||||||
|
public:
|
||||||
|
static QString storePath();
|
||||||
|
|
||||||
|
// 读取桌面列表;确保三张默认卡(Windows/Ubuntu/麒麟)始终存在。
|
||||||
|
// state 由 endpoint 是否为空推导:有地址=可连接,无地址=待分配。
|
||||||
|
static std::vector<DesktopInfo> load();
|
||||||
|
|
||||||
|
// 保存完整桌面列表
|
||||||
|
static bool save(const std::vector<DesktopInfo>& desktops);
|
||||||
|
|
||||||
|
// 更新单张桌面(按 id 匹配),保存成功返回 true
|
||||||
|
static bool update(const DesktopInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace vdi
|
||||||
|
|
||||||
|
#endif // KIOSK_SHELL_DESKTOP_STORE_H
|
||||||
Loading…
Reference in New Issue
Block a user