change ab.js

This commit is contained in:
csf
2022-01-02 20:42:09 +08:00
committed by open-trade
parent 0409d8f761
commit 54b37862f1
3 changed files with 185 additions and 172 deletions

View File

@@ -4,7 +4,7 @@ stdout.println("current platform:", OS);
// html min-width, min-height not working on mac, below works for all
view.windowMinSize = (500, 300);
var app;
export var app;
var tmp = handler.get_connect_status();
var connect_status = tmp[0];
var service_stopped = false;
@@ -50,7 +50,28 @@ class ConnectStatus: Reactor.Component {
}
}
function createNewConnect(id, type) {
class RecentSessions: Reactor.Component {
function render() {
var sessions = handler.get_recent_sessions();
if (sessions.length == 0) return <span />;
return <div style="width: *">
<div .sessions-bar>
<div style="width:*">
{translate("Recent Sessions")}
</div>
<SearchBar parent={this} />
{!app.hidden && <SessionStyle />}
</div>
{!app.hidden && <SessionList @{this.sessionList} style={sessionsStyle} sessions={sessions} />}
</div>;
}
function filter(v) {
this.sessionList.filter(v);
}
}
export function createNewConnect(id, type) {
id = id.replace(/\s/g, "");
app.remote_id.value = formatId(id);
if (!id) return;
@@ -627,7 +648,7 @@ class ID: Reactor.Component {
}
var reg = /^\d+$/;
function formatId(id) {
export function formatId(id) {
id = id.replace(/\s/g, "");
if (reg.test(id) && id.length > 3) {
var n = id.length;