功能:完善终端认证恢复、选择页及策略和指标采集
This commit is contained in:
1 parent
d87fa47e24
commit
eef485306f
22 files changed
+904
-151
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QTimer>
|
||||
#include "desktop_list_page.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
QApplication app(argc, argv);
|
||||
app.setOrganizationName("vdi-preview");
|
||||
app.setApplicationName("desktop-selection");
|
||||
const QStringList args = app.arguments();
|
||||
if (args.size() < 5) return 2;
|
||||
QSettings().setValue("appearance/light", args[4] == "light");
|
||||
vdi::DesktopListPage page;
|
||||
page.resize(args[2].toInt(), args[3].toInt());
|
||||
page.setCurrentUser(QStringLiteral("云终端"));
|
||||
if (!args.contains("empty")) {
|
||||
std::vector<vdi::DesktopInfo> desktops;
|
||||
for (const QString& os : {QStringLiteral("Windows"), QStringLiteral("Ubuntu"), QStringLiteral("麒麟")}) {
|
||||
vdi::DesktopInfo d;
|
||||
d.id = os; d.name = os + QStringLiteral(" 云桌面"); d.os = os;
|
||||
d.state = vdi::DesktopState::kAvailable;
|
||||
if (args.contains("states") && os == "Ubuntu") d.state = vdi::DesktopState::kPending;
|
||||
if (args.contains("states") && os == QStringLiteral("麒麟")) d.state = vdi::DesktopState::kUnassigned;
|
||||
desktops.push_back(d);
|
||||
}
|
||||
page.setDesktops(desktops);
|
||||
}
|
||||
if (args.contains("error")) page.setStatus(QStringLiteral("连接失败:管理平台暂不可用;正在自动重试,无需重启盒子"), true);
|
||||
if (args.contains("busy")) { page.setBusy(true); page.setStatus(QStringLiteral("正在连接,请稍候…")); }
|
||||
page.show();
|
||||
QTimer::singleShot(150, [&] { app.exit(page.grab().save(args[1]) ? 0 : 1); });
|
||||
return app.exec();
|
||||
}
|
||||
Reference in new issue
Block a user