upload build
This commit is contained in:
parent
3d1f3aac6c
commit
83c5c0853e
6 changed files with 462 additions and 450 deletions
408
-/node.js
408
-/node.js
|
|
@ -10442,204 +10442,6 @@ var $;
|
|||
$.$hyoo_crus_app_node_ref = $hyoo_crus_app_node_ref;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $mol_fetch_response extends $mol_object2 {
|
||||
native;
|
||||
constructor(native) {
|
||||
super();
|
||||
this.native = native;
|
||||
}
|
||||
status() {
|
||||
const types = ['unknown', 'inform', 'success', 'redirect', 'wrong', 'failed'];
|
||||
return types[Math.floor(this.native.status / 100)];
|
||||
}
|
||||
code() {
|
||||
return this.native.status;
|
||||
}
|
||||
message() {
|
||||
return this.native.statusText || `HTTP Error ${this.code()}`;
|
||||
}
|
||||
headers() {
|
||||
return this.native.headers;
|
||||
}
|
||||
mime() {
|
||||
return this.headers().get('content-type');
|
||||
}
|
||||
stream() {
|
||||
return this.native.body;
|
||||
}
|
||||
text() {
|
||||
const buffer = this.buffer();
|
||||
const native = this.native;
|
||||
const mime = native.headers.get('content-type') || '';
|
||||
const [, charset] = /charset=(.*)/.exec(mime) || [, 'utf-8'];
|
||||
const decoder = new TextDecoder(charset);
|
||||
return decoder.decode(buffer);
|
||||
}
|
||||
json() {
|
||||
return $mol_wire_sync(this.native).json();
|
||||
}
|
||||
blob() {
|
||||
return $mol_wire_sync(this.native).blob();
|
||||
}
|
||||
buffer() {
|
||||
return $mol_wire_sync(this.native).arrayBuffer();
|
||||
}
|
||||
xml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xml');
|
||||
}
|
||||
xhtml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xhtml+xml');
|
||||
}
|
||||
html() {
|
||||
return $mol_dom_parse(this.text(), 'text/html');
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "html", null);
|
||||
$.$mol_fetch_response = $mol_fetch_response;
|
||||
class $mol_fetch extends $mol_object2 {
|
||||
static request(input, init = {}) {
|
||||
const controller = new AbortController();
|
||||
let done = false;
|
||||
const promise = fetch(input, {
|
||||
...init,
|
||||
signal: controller.signal,
|
||||
}).finally(() => {
|
||||
done = true;
|
||||
});
|
||||
return Object.assign(promise, {
|
||||
destructor: () => {
|
||||
if (!done && !controller.signal.aborted)
|
||||
controller.abort();
|
||||
},
|
||||
});
|
||||
}
|
||||
static response(input, init) {
|
||||
return new $mol_fetch_response($mol_wire_sync(this).request(input, init));
|
||||
}
|
||||
static success(input, init) {
|
||||
const response = this.response(input, init);
|
||||
if (response.status() === 'success')
|
||||
return response;
|
||||
throw new Error(response.message(), { cause: response });
|
||||
}
|
||||
static stream(input, init) {
|
||||
return this.success(input, init).stream();
|
||||
}
|
||||
static text(input, init) {
|
||||
return this.success(input, init).text();
|
||||
}
|
||||
static json(input, init) {
|
||||
return this.success(input, init).json();
|
||||
}
|
||||
static blob(input, init) {
|
||||
return this.success(input, init).blob();
|
||||
}
|
||||
static buffer(input, init) {
|
||||
return this.success(input, init).buffer();
|
||||
}
|
||||
static xml(input, init) {
|
||||
return this.success(input, init).xml();
|
||||
}
|
||||
static xhtml(input, init) {
|
||||
return this.success(input, init).xhtml();
|
||||
}
|
||||
static html(input, init) {
|
||||
return this.success(input, init).html();
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "response", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "success", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "json", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "blob", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "buffer", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "html", null);
|
||||
$.$mol_fetch = $mol_fetch;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $hd_canary_app_home extends $hyoo_crus_home.with({
|
||||
Sites: $hyoo_crus_list_ref_to(() => $hd_canary_app_home_site),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_home = $hd_canary_app_home;
|
||||
class $hd_canary_app_home_site extends $hyoo_crus_dict.with({
|
||||
url: $hyoo_crus_atom_str,
|
||||
title: $hyoo_crus_atom_str,
|
||||
last_ping_time: $hyoo_crus_atom_time,
|
||||
last_ping_status: $hyoo_crus_atom_bool,
|
||||
}) {
|
||||
tick() {
|
||||
this.$.$mol_state_time.now(5000);
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
});
|
||||
if (this.can_change()) {
|
||||
const url = this.url().val();
|
||||
const title = this.title().val();
|
||||
console.log({ url, title });
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
...{ action: "tick", url, title }
|
||||
});
|
||||
const request = $mol_fetch.response(url);
|
||||
this.last_ping_status(null).val(request.code() == 200);
|
||||
this.last_ping_time(null).val(new $mol_time_moment);
|
||||
}
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_mem
|
||||
], $hd_canary_app_home_site.prototype, "tick", null);
|
||||
$.$hd_canary_app_home_site = $hd_canary_app_home_site;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
|
|
@ -15347,6 +15149,162 @@ var $;
|
|||
($mol_mem_key(($.$hd_canary_app_monitor.prototype), "target_result"));
|
||||
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $mol_fetch_response extends $mol_object2 {
|
||||
native;
|
||||
constructor(native) {
|
||||
super();
|
||||
this.native = native;
|
||||
}
|
||||
status() {
|
||||
const types = ['unknown', 'inform', 'success', 'redirect', 'wrong', 'failed'];
|
||||
return types[Math.floor(this.native.status / 100)];
|
||||
}
|
||||
code() {
|
||||
return this.native.status;
|
||||
}
|
||||
message() {
|
||||
return this.native.statusText || `HTTP Error ${this.code()}`;
|
||||
}
|
||||
headers() {
|
||||
return this.native.headers;
|
||||
}
|
||||
mime() {
|
||||
return this.headers().get('content-type');
|
||||
}
|
||||
stream() {
|
||||
return this.native.body;
|
||||
}
|
||||
text() {
|
||||
const buffer = this.buffer();
|
||||
const native = this.native;
|
||||
const mime = native.headers.get('content-type') || '';
|
||||
const [, charset] = /charset=(.*)/.exec(mime) || [, 'utf-8'];
|
||||
const decoder = new TextDecoder(charset);
|
||||
return decoder.decode(buffer);
|
||||
}
|
||||
json() {
|
||||
return $mol_wire_sync(this.native).json();
|
||||
}
|
||||
blob() {
|
||||
return $mol_wire_sync(this.native).blob();
|
||||
}
|
||||
buffer() {
|
||||
return $mol_wire_sync(this.native).arrayBuffer();
|
||||
}
|
||||
xml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xml');
|
||||
}
|
||||
xhtml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xhtml+xml');
|
||||
}
|
||||
html() {
|
||||
return $mol_dom_parse(this.text(), 'text/html');
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "html", null);
|
||||
$.$mol_fetch_response = $mol_fetch_response;
|
||||
class $mol_fetch extends $mol_object2 {
|
||||
static request(input, init = {}) {
|
||||
const controller = new AbortController();
|
||||
let done = false;
|
||||
const promise = fetch(input, {
|
||||
...init,
|
||||
signal: controller.signal,
|
||||
}).finally(() => {
|
||||
done = true;
|
||||
});
|
||||
return Object.assign(promise, {
|
||||
destructor: () => {
|
||||
if (!done && !controller.signal.aborted)
|
||||
controller.abort();
|
||||
},
|
||||
});
|
||||
}
|
||||
static response(input, init) {
|
||||
return new $mol_fetch_response($mol_wire_sync(this).request(input, init));
|
||||
}
|
||||
static success(input, init) {
|
||||
const response = this.response(input, init);
|
||||
if (response.status() === 'success')
|
||||
return response;
|
||||
throw new Error(response.message(), { cause: response });
|
||||
}
|
||||
static stream(input, init) {
|
||||
return this.success(input, init).stream();
|
||||
}
|
||||
static text(input, init) {
|
||||
return this.success(input, init).text();
|
||||
}
|
||||
static json(input, init) {
|
||||
return this.success(input, init).json();
|
||||
}
|
||||
static blob(input, init) {
|
||||
return this.success(input, init).blob();
|
||||
}
|
||||
static buffer(input, init) {
|
||||
return this.success(input, init).buffer();
|
||||
}
|
||||
static xml(input, init) {
|
||||
return this.success(input, init).xml();
|
||||
}
|
||||
static xhtml(input, init) {
|
||||
return this.success(input, init).xhtml();
|
||||
}
|
||||
static html(input, init) {
|
||||
return this.success(input, init).html();
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "response", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "success", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "json", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "blob", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "buffer", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "html", null);
|
||||
$.$mol_fetch = $mol_fetch;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
|
||||
|
|
@ -15415,7 +15373,7 @@ var $;
|
|||
}
|
||||
users() {
|
||||
const ref = $hyoo_crus_ref(this.$.$mol_fetch.text('/join'));
|
||||
return this.$.$hyoo_crus_glob.Node(ref, $hyoo_crus_list_vary);
|
||||
return this.$.$hyoo_crus_glob.Node(ref, $hd_canary_app_server).Users(null);
|
||||
}
|
||||
home() {
|
||||
const home = this.$.$hyoo_crus_glob.home($hd_canary_app_home);
|
||||
|
|
@ -18876,6 +18834,52 @@ var $;
|
|||
;
|
||||
"use strict";
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $hd_canary_app_server extends $hyoo_crus_dict.with({
|
||||
Users: $hyoo_crus_list_ref_to(() => $hyoo_crus_atom_ref),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_server = $hd_canary_app_server;
|
||||
class $hd_canary_app_home extends $hyoo_crus_home.with({
|
||||
Sites: $hyoo_crus_list_ref_to(() => $hd_canary_app_home_site),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_home = $hd_canary_app_home;
|
||||
class $hd_canary_app_home_site extends $hyoo_crus_dict.with({
|
||||
url: $hyoo_crus_atom_str,
|
||||
title: $hyoo_crus_atom_str,
|
||||
last_ping_time: $hyoo_crus_atom_time,
|
||||
last_ping_status: $hyoo_crus_atom_bool,
|
||||
}) {
|
||||
tick() {
|
||||
this.$.$mol_state_time.now(5000);
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
});
|
||||
if (this.can_change()) {
|
||||
const url = this.url().val();
|
||||
const title = this.title().val();
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
...{ action: "tick", url, title }
|
||||
});
|
||||
const request = $mol_fetch.response(url);
|
||||
this.last_ping_status(null).val(request.code() == 200);
|
||||
this.last_ping_time(null).val(new $mol_time_moment);
|
||||
}
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_mem
|
||||
], $hd_canary_app_home_site.prototype, "tick", null);
|
||||
$.$hd_canary_app_home_site = $hd_canary_app_home_site;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
|
|
@ -18891,8 +18895,8 @@ var $;
|
|||
...{ action: "tick", url: "_stat_update", title: "_stat_update" }
|
||||
});
|
||||
const home_land = this.$.$hyoo_crus_glob.home().land();
|
||||
const list = home_land.Node($hyoo_crus_list_vary).Item('');
|
||||
for (const ref of list.items_vary()) {
|
||||
const list = home_land.Node($hd_canary_app_server).Item('').Users(null);
|
||||
for (const ref of list.items()) {
|
||||
try {
|
||||
const user = this.$.$hyoo_crus_glob.Node(ref, $hd_canary_app_home);
|
||||
for (const site of user.Sites(null)?.remote_list() ?? []) {
|
||||
|
|
@ -18920,7 +18924,7 @@ var $;
|
|||
GET(msg) {
|
||||
const home_land = this.$.$hyoo_crus_glob.home().land();
|
||||
home_land.give(null, $hyoo_crus_rank_rule);
|
||||
const list = home_land.Node($hyoo_crus_list_vary).Item('');
|
||||
const list = home_land.Node($hd_canary_app_server).Item('');
|
||||
msg.reply(list.ref().description);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
408
-/node.test.js
408
-/node.test.js
|
|
@ -10433,204 +10433,6 @@ var $;
|
|||
$.$hyoo_crus_app_node_ref = $hyoo_crus_app_node_ref;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $mol_fetch_response extends $mol_object2 {
|
||||
native;
|
||||
constructor(native) {
|
||||
super();
|
||||
this.native = native;
|
||||
}
|
||||
status() {
|
||||
const types = ['unknown', 'inform', 'success', 'redirect', 'wrong', 'failed'];
|
||||
return types[Math.floor(this.native.status / 100)];
|
||||
}
|
||||
code() {
|
||||
return this.native.status;
|
||||
}
|
||||
message() {
|
||||
return this.native.statusText || `HTTP Error ${this.code()}`;
|
||||
}
|
||||
headers() {
|
||||
return this.native.headers;
|
||||
}
|
||||
mime() {
|
||||
return this.headers().get('content-type');
|
||||
}
|
||||
stream() {
|
||||
return this.native.body;
|
||||
}
|
||||
text() {
|
||||
const buffer = this.buffer();
|
||||
const native = this.native;
|
||||
const mime = native.headers.get('content-type') || '';
|
||||
const [, charset] = /charset=(.*)/.exec(mime) || [, 'utf-8'];
|
||||
const decoder = new TextDecoder(charset);
|
||||
return decoder.decode(buffer);
|
||||
}
|
||||
json() {
|
||||
return $mol_wire_sync(this.native).json();
|
||||
}
|
||||
blob() {
|
||||
return $mol_wire_sync(this.native).blob();
|
||||
}
|
||||
buffer() {
|
||||
return $mol_wire_sync(this.native).arrayBuffer();
|
||||
}
|
||||
xml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xml');
|
||||
}
|
||||
xhtml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xhtml+xml');
|
||||
}
|
||||
html() {
|
||||
return $mol_dom_parse(this.text(), 'text/html');
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "html", null);
|
||||
$.$mol_fetch_response = $mol_fetch_response;
|
||||
class $mol_fetch extends $mol_object2 {
|
||||
static request(input, init = {}) {
|
||||
const controller = new AbortController();
|
||||
let done = false;
|
||||
const promise = fetch(input, {
|
||||
...init,
|
||||
signal: controller.signal,
|
||||
}).finally(() => {
|
||||
done = true;
|
||||
});
|
||||
return Object.assign(promise, {
|
||||
destructor: () => {
|
||||
if (!done && !controller.signal.aborted)
|
||||
controller.abort();
|
||||
},
|
||||
});
|
||||
}
|
||||
static response(input, init) {
|
||||
return new $mol_fetch_response($mol_wire_sync(this).request(input, init));
|
||||
}
|
||||
static success(input, init) {
|
||||
const response = this.response(input, init);
|
||||
if (response.status() === 'success')
|
||||
return response;
|
||||
throw new Error(response.message(), { cause: response });
|
||||
}
|
||||
static stream(input, init) {
|
||||
return this.success(input, init).stream();
|
||||
}
|
||||
static text(input, init) {
|
||||
return this.success(input, init).text();
|
||||
}
|
||||
static json(input, init) {
|
||||
return this.success(input, init).json();
|
||||
}
|
||||
static blob(input, init) {
|
||||
return this.success(input, init).blob();
|
||||
}
|
||||
static buffer(input, init) {
|
||||
return this.success(input, init).buffer();
|
||||
}
|
||||
static xml(input, init) {
|
||||
return this.success(input, init).xml();
|
||||
}
|
||||
static xhtml(input, init) {
|
||||
return this.success(input, init).xhtml();
|
||||
}
|
||||
static html(input, init) {
|
||||
return this.success(input, init).html();
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "response", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "success", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "json", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "blob", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "buffer", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "html", null);
|
||||
$.$mol_fetch = $mol_fetch;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $hd_canary_app_home extends $hyoo_crus_home.with({
|
||||
Sites: $hyoo_crus_list_ref_to(() => $hd_canary_app_home_site),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_home = $hd_canary_app_home;
|
||||
class $hd_canary_app_home_site extends $hyoo_crus_dict.with({
|
||||
url: $hyoo_crus_atom_str,
|
||||
title: $hyoo_crus_atom_str,
|
||||
last_ping_time: $hyoo_crus_atom_time,
|
||||
last_ping_status: $hyoo_crus_atom_bool,
|
||||
}) {
|
||||
tick() {
|
||||
this.$.$mol_state_time.now(5000);
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
});
|
||||
if (this.can_change()) {
|
||||
const url = this.url().val();
|
||||
const title = this.title().val();
|
||||
console.log({ url, title });
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
...{ action: "tick", url, title }
|
||||
});
|
||||
const request = $mol_fetch.response(url);
|
||||
this.last_ping_status(null).val(request.code() == 200);
|
||||
this.last_ping_time(null).val(new $mol_time_moment);
|
||||
}
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_mem
|
||||
], $hd_canary_app_home_site.prototype, "tick", null);
|
||||
$.$hd_canary_app_home_site = $hd_canary_app_home_site;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
|
|
@ -15338,6 +15140,162 @@ var $;
|
|||
($mol_mem_key(($.$hd_canary_app_monitor.prototype), "target_result"));
|
||||
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $mol_fetch_response extends $mol_object2 {
|
||||
native;
|
||||
constructor(native) {
|
||||
super();
|
||||
this.native = native;
|
||||
}
|
||||
status() {
|
||||
const types = ['unknown', 'inform', 'success', 'redirect', 'wrong', 'failed'];
|
||||
return types[Math.floor(this.native.status / 100)];
|
||||
}
|
||||
code() {
|
||||
return this.native.status;
|
||||
}
|
||||
message() {
|
||||
return this.native.statusText || `HTTP Error ${this.code()}`;
|
||||
}
|
||||
headers() {
|
||||
return this.native.headers;
|
||||
}
|
||||
mime() {
|
||||
return this.headers().get('content-type');
|
||||
}
|
||||
stream() {
|
||||
return this.native.body;
|
||||
}
|
||||
text() {
|
||||
const buffer = this.buffer();
|
||||
const native = this.native;
|
||||
const mime = native.headers.get('content-type') || '';
|
||||
const [, charset] = /charset=(.*)/.exec(mime) || [, 'utf-8'];
|
||||
const decoder = new TextDecoder(charset);
|
||||
return decoder.decode(buffer);
|
||||
}
|
||||
json() {
|
||||
return $mol_wire_sync(this.native).json();
|
||||
}
|
||||
blob() {
|
||||
return $mol_wire_sync(this.native).blob();
|
||||
}
|
||||
buffer() {
|
||||
return $mol_wire_sync(this.native).arrayBuffer();
|
||||
}
|
||||
xml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xml');
|
||||
}
|
||||
xhtml() {
|
||||
return $mol_dom_parse(this.text(), 'application/xhtml+xml');
|
||||
}
|
||||
html() {
|
||||
return $mol_dom_parse(this.text(), 'text/html');
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch_response.prototype, "html", null);
|
||||
$.$mol_fetch_response = $mol_fetch_response;
|
||||
class $mol_fetch extends $mol_object2 {
|
||||
static request(input, init = {}) {
|
||||
const controller = new AbortController();
|
||||
let done = false;
|
||||
const promise = fetch(input, {
|
||||
...init,
|
||||
signal: controller.signal,
|
||||
}).finally(() => {
|
||||
done = true;
|
||||
});
|
||||
return Object.assign(promise, {
|
||||
destructor: () => {
|
||||
if (!done && !controller.signal.aborted)
|
||||
controller.abort();
|
||||
},
|
||||
});
|
||||
}
|
||||
static response(input, init) {
|
||||
return new $mol_fetch_response($mol_wire_sync(this).request(input, init));
|
||||
}
|
||||
static success(input, init) {
|
||||
const response = this.response(input, init);
|
||||
if (response.status() === 'success')
|
||||
return response;
|
||||
throw new Error(response.message(), { cause: response });
|
||||
}
|
||||
static stream(input, init) {
|
||||
return this.success(input, init).stream();
|
||||
}
|
||||
static text(input, init) {
|
||||
return this.success(input, init).text();
|
||||
}
|
||||
static json(input, init) {
|
||||
return this.success(input, init).json();
|
||||
}
|
||||
static blob(input, init) {
|
||||
return this.success(input, init).blob();
|
||||
}
|
||||
static buffer(input, init) {
|
||||
return this.success(input, init).buffer();
|
||||
}
|
||||
static xml(input, init) {
|
||||
return this.success(input, init).xml();
|
||||
}
|
||||
static xhtml(input, init) {
|
||||
return this.success(input, init).xhtml();
|
||||
}
|
||||
static html(input, init) {
|
||||
return this.success(input, init).html();
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "response", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "success", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "stream", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "text", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "json", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "blob", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "buffer", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "xhtml", null);
|
||||
__decorate([
|
||||
$mol_action
|
||||
], $mol_fetch, "html", null);
|
||||
$.$mol_fetch = $mol_fetch;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
|
||||
|
|
@ -15406,7 +15364,7 @@ var $;
|
|||
}
|
||||
users() {
|
||||
const ref = $hyoo_crus_ref(this.$.$mol_fetch.text('/join'));
|
||||
return this.$.$hyoo_crus_glob.Node(ref, $hyoo_crus_list_vary);
|
||||
return this.$.$hyoo_crus_glob.Node(ref, $hd_canary_app_server).Users(null);
|
||||
}
|
||||
home() {
|
||||
const home = this.$.$hyoo_crus_glob.home($hd_canary_app_home);
|
||||
|
|
@ -18867,6 +18825,52 @@ var $;
|
|||
;
|
||||
"use strict";
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $hd_canary_app_server extends $hyoo_crus_dict.with({
|
||||
Users: $hyoo_crus_list_ref_to(() => $hyoo_crus_atom_ref),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_server = $hd_canary_app_server;
|
||||
class $hd_canary_app_home extends $hyoo_crus_home.with({
|
||||
Sites: $hyoo_crus_list_ref_to(() => $hd_canary_app_home_site),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_home = $hd_canary_app_home;
|
||||
class $hd_canary_app_home_site extends $hyoo_crus_dict.with({
|
||||
url: $hyoo_crus_atom_str,
|
||||
title: $hyoo_crus_atom_str,
|
||||
last_ping_time: $hyoo_crus_atom_time,
|
||||
last_ping_status: $hyoo_crus_atom_bool,
|
||||
}) {
|
||||
tick() {
|
||||
this.$.$mol_state_time.now(5000);
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
});
|
||||
if (this.can_change()) {
|
||||
const url = this.url().val();
|
||||
const title = this.title().val();
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
...{ action: "tick", url, title }
|
||||
});
|
||||
const request = $mol_fetch.response(url);
|
||||
this.last_ping_status(null).val(request.code() == 200);
|
||||
this.last_ping_time(null).val(new $mol_time_moment);
|
||||
}
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_mem
|
||||
], $hd_canary_app_home_site.prototype, "tick", null);
|
||||
$.$hd_canary_app_home_site = $hd_canary_app_home_site;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
|
|
@ -18882,8 +18886,8 @@ var $;
|
|||
...{ action: "tick", url: "_stat_update", title: "_stat_update" }
|
||||
});
|
||||
const home_land = this.$.$hyoo_crus_glob.home().land();
|
||||
const list = home_land.Node($hyoo_crus_list_vary).Item('');
|
||||
for (const ref of list.items_vary()) {
|
||||
const list = home_land.Node($hd_canary_app_server).Item('').Users(null);
|
||||
for (const ref of list.items()) {
|
||||
try {
|
||||
const user = this.$.$hyoo_crus_glob.Node(ref, $hd_canary_app_home);
|
||||
for (const site of user.Sites(null)?.remote_list() ?? []) {
|
||||
|
|
@ -18911,7 +18915,7 @@ var $;
|
|||
GET(msg) {
|
||||
const home_land = this.$.$hyoo_crus_glob.home().land();
|
||||
home_land.give(null, $hyoo_crus_rank_rule);
|
||||
const list = home_land.Node($hyoo_crus_list_vary).Item('');
|
||||
const list = home_land.Node($hd_canary_app_server).Item('');
|
||||
msg.reply(list.ref().description);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
90
-/web.js
90
-/web.js
|
|
@ -14102,48 +14102,6 @@ var $;
|
|||
];
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $hd_canary_app_home extends $hyoo_crus_home.with({
|
||||
Sites: $hyoo_crus_list_ref_to(() => $hd_canary_app_home_site),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_home = $hd_canary_app_home;
|
||||
class $hd_canary_app_home_site extends $hyoo_crus_dict.with({
|
||||
url: $hyoo_crus_atom_str,
|
||||
title: $hyoo_crus_atom_str,
|
||||
last_ping_time: $hyoo_crus_atom_time,
|
||||
last_ping_status: $hyoo_crus_atom_bool,
|
||||
}) {
|
||||
tick() {
|
||||
this.$.$mol_state_time.now(5000);
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
});
|
||||
if (this.can_change()) {
|
||||
const url = this.url().val();
|
||||
const title = this.title().val();
|
||||
console.log({ url, title });
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
...{ action: "tick", url, title }
|
||||
});
|
||||
const request = $mol_fetch.response(url);
|
||||
this.last_ping_status(null).val(request.code() == 200);
|
||||
this.last_ping_time(null).val(new $mol_time_moment);
|
||||
}
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_mem
|
||||
], $hd_canary_app_home_site.prototype, "tick", null);
|
||||
$.$hd_canary_app_home_site = $hd_canary_app_home_site;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
"use strict";
|
||||
|
||||
|
|
@ -14212,7 +14170,7 @@ var $;
|
|||
}
|
||||
users() {
|
||||
const ref = $hyoo_crus_ref(this.$.$mol_fetch.text('/join'));
|
||||
return this.$.$hyoo_crus_glob.Node(ref, $hyoo_crus_list_vary);
|
||||
return this.$.$hyoo_crus_glob.Node(ref, $hd_canary_app_server).Users(null);
|
||||
}
|
||||
home() {
|
||||
const home = this.$.$hyoo_crus_glob.home($hd_canary_app_home);
|
||||
|
|
@ -17673,6 +17631,52 @@ var $;
|
|||
;
|
||||
"use strict";
|
||||
|
||||
;
|
||||
"use strict";
|
||||
var $;
|
||||
(function ($) {
|
||||
class $hd_canary_app_server extends $hyoo_crus_dict.with({
|
||||
Users: $hyoo_crus_list_ref_to(() => $hyoo_crus_atom_ref),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_server = $hd_canary_app_server;
|
||||
class $hd_canary_app_home extends $hyoo_crus_home.with({
|
||||
Sites: $hyoo_crus_list_ref_to(() => $hd_canary_app_home_site),
|
||||
}) {
|
||||
}
|
||||
$.$hd_canary_app_home = $hd_canary_app_home;
|
||||
class $hd_canary_app_home_site extends $hyoo_crus_dict.with({
|
||||
url: $hyoo_crus_atom_str,
|
||||
title: $hyoo_crus_atom_str,
|
||||
last_ping_time: $hyoo_crus_atom_time,
|
||||
last_ping_status: $hyoo_crus_atom_bool,
|
||||
}) {
|
||||
tick() {
|
||||
this.$.$mol_state_time.now(5000);
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
});
|
||||
if (this.can_change()) {
|
||||
const url = this.url().val();
|
||||
const title = this.title().val();
|
||||
this.$.$mol_log3_done({
|
||||
place: this,
|
||||
message: this.land().ref().description,
|
||||
...{ action: "tick", url, title }
|
||||
});
|
||||
const request = $mol_fetch.response(url);
|
||||
this.last_ping_status(null).val(request.code() == 200);
|
||||
this.last_ping_time(null).val(new $mol_time_moment);
|
||||
}
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
$mol_mem
|
||||
], $hd_canary_app_home_site.prototype, "tick", null);
|
||||
$.$hd_canary_app_home_site = $hd_canary_app_home_site;
|
||||
})($ || ($ = {}));
|
||||
|
||||
;
|
||||
|
||||
var $node = $node || {}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue