You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.9 KiB
HTML
105 lines
2.9 KiB
HTML
<html window-icon="themepicsingle:sessions">
|
|
<head>
|
|
<include src="common.htm" />
|
|
<style src="sessionsmgr.css" />
|
|
<script>
|
|
view.isMaximizable = false;
|
|
view.minSize = [500, 200];
|
|
translateWindow("button");
|
|
|
|
var page = "my",
|
|
startup = $("#startup"),
|
|
sessionslist = $("#sessionslist");
|
|
|
|
startup.html = _("Sessions list is empty |
|
var sClient = _("Client");
|
|
var sOS = _("Operating system");
|
|
var sLocation = _("Location");
|
|
var sCreated = _("Created");
|
|
var sCloseSession = _("Close session");
|
|
var sCurrentSession = _("Current session");
|
|
|
|
function makeSession(session) {
|
|
return <option hash={session.hash} current={session.current}>
|
|
<div class="titles">
|
|
<span>{sClient}</span>
|
|
<span>{sOS}</span>
|
|
<span>{sLocation}</span>
|
|
<span>IP</span>
|
|
<span>{sCreated}</span>
|
|
</div>
|
|
<div>
|
|
<span>{session.client}</span>
|
|
<span>{session.os}</span>
|
|
<span>{session.location}</span>
|
|
<span>{session.ip}</span>
|
|
<span>{session.startedTime}</span>
|
|
</div>
|
|
<div class="actions">
|
|
<img class="terminate" src="themepic:hand" title={sCloseSession} />
|
|
<span class={session.current ? "current" : "hidden"}>{sCurrentSession}</span>
|
|
</div>
|
|
</option>;
|
|
}
|
|
|
|
function updateSessionsList() {
|
|
$("#listsessions").state.disabled = true;
|
|
sessionslist.clear();
|
|
var sessions = MainNative.GetSessionsList();
|
|
if (sessions && sessions.length > 0)
|
|
for (let session of sessions)
|
|
sessionslist.append(makeSession(session));
|
|
|
|
if (sessionslist.length == 0) {
|
|
startup.classList.remove("hidden");
|
|
sessionslist.classList.add("hidden");
|
|
} else {
|
|
startup.classList.add("hidden");
|
|
sessionslist.classList.remove("hidden");
|
|
}
|
|
|
|
$("#listsessions").state.disabled = false;
|
|
}
|
|
|
|
function removeCurrent() {
|
|
var current = sessionslist.$("option[current=\"true\"]");
|
|
if (current) current.remove();
|
|
}
|
|
|
|
if (CommonNative.IsOnline()) updateSessionsList();
|
|
|
|
$("#listsessions").on("click", () => {
|
|
if (CommonNative.CheckOnline()) updateSessionsList();
|
|
});
|
|
|
|
$("#closesessions").on("click", () => {
|
|
if (CommonNative.CheckOnline()) MainNative.CloseAllSessions();
|
|
});
|
|
|
|
$("#close").on("click", () => {
|
|
view.close();
|
|
});
|
|
|
|
document.on("click", ".terminate", (e, el) => {
|
|
if (!CommonNative.CheckOnline()) return;
|
|
var opt = el.$p("option");
|
|
var cur = opt.attr["current"] == "true";
|
|
MainNative.CloseSession(opt.attr["hash"], cur);
|
|
}).on("keydown", (e) => {
|
|
if (e.keyCode == Event.VK_ESCAPE || (e.ctrlKey && e.keyCode == Event.VK_W)) {
|
|
view.close();
|
|
return true;
|
|
}
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<select type="list" as="string" class="vlist hidden" id="sessionslist"></select>
|
|
<div id="startup"></div>
|
|
<div class="bottombtns">
|
|
<button uwp id="listsessions" tabindex="3">Refresh</button>
|
|
<button uwp id="closesessions" tabindex="2">Close all but current</button>
|
|
<button uwp right id="close" tabindex="1">Close</button>
|
|
</div>
|
|
</body>
|
|
</html> |