diff --git a/src/ui/ab.tis b/src/ui/ab.tis
new file mode 100644
index 000000000..5aaa9b881
--- /dev/null
+++ b/src/ui/ab.tis
@@ -0,0 +1,171 @@
+var svg_tile = ;
+var svg_list = ;
+
+function getSessionsStyleOption(type) {
+ return (type || "recent") + "-sessions-style";
+}
+
+function getSessionsStyle(type) {
+ var v = handler.get_option(getSessionsStyleOption(type));
+ if (!v) v = type == "ab" ? "list" : "tile";
+ return v;
+}
+
+function stupidUpdate(me) {
+ /* hidden is workaround of stupid sciter bug */
+ me.hidden = true;
+ me.update();
+ self.timer(60ms, function() {
+ me.hidden = false;
+ me.update();
+ });
+}
+
+class SessionStyle: Reactor.Component {
+ this var type = "";
+
+ function this(params) {
+ this.type = (params || {}).type;
+ }
+
+ function render() {
+ var sessionsStyle = getSessionsStyle(this.type);
+ return
-
{translate("Recent Sessions")}
-
- {sessions}
+
+
+ {translate("Recent Sessions")}
+ {!app.hidden &&
}
+
+ {!app.hidden &&
}
;
}
-
- function getSession(s) {
- var id = s[0];
- var username = s[1];
- var hostname = s[2];
- var platform = s[3];
- var alias = s[4];
- return
-
- {platformSvg(platform, "white")}
-
{username}@{hostname}
-
-
-
{alias ? alias : formatId(id)}
- {svg_menu}
-
-
;
- }
-
- event dblclick $(div.remote-session) (evt, me) {
- createNewConnect(me.id, "connect");
- }
-
- event click $(#menu) (_, me) {
- var id = me.parent.parent.id;
- var platform = me.parent.parent.attributes["platform"];
- $(#rdp).style.set{
- display: (platform == "Windows" && is_win) ? "block" : "none",
- };
- // https://sciter.com/forums/topic/replacecustomize-context-menu/
- var menu = $(menu#remote-context);
- menu.attributes["remote-id"] = id;
- me.popup(menu);
- }
-}
-
-event click $(menu#remote-context li) (evt, me) {
- var action = me.id;
- var id = me.parent.attributes["remote-id"];
- if (action == "connect") {
- createNewConnect(id, "connect");
- } else if (action == "transfer") {
- createNewConnect(id, "file-transfer");
- } else if (action == "remove") {
- handler.remove_peer(id);
- app.recent_sessions.update();
- } else if (action == "shortcut") {
- handler.create_shortcut(id);
- } else if (action == "rdp") {
- createNewConnect(id, "rdp");
- } else if (action == "tunnel") {
- createNewConnect(id, "port-forward");
- } else if (action == "rename") {
- var old_name = handler.get_peer_option(id, "alias");
- handler.msgbox("custom-rename", "Rename", "
\
- ", function(res=null) {
- if (!res) return;
- var name = (res.name || "").trim();
- if (name != old_name) handler.set_peer_option(id, "alias", name);
- self.select('#' + id).select('#alias').text = name || id;
- });
- }
}
function createNewConnect(id, type) {
@@ -320,17 +258,6 @@ class App: Reactor.Component
var is_can_screen_recording = handler.is_can_screen_recording(false);
return
-
-
- {translate('Connect')}
- {translate('Transfer File')}
- {translate('TCP Tunneling')}
- RDP
- {translate('Rename')}
- {translate('Remove')}
- {is_win && {translate('Create Desktop Shortcut')}}
-
-
Refresh random password