-
-
@@ -478,6 +526,8 @@
lxmfMessagesRequestSequence: 0,
chatItems: [],
+ nodePageContent: null,
+
nomadnetPageDownloadCallbacks: {},
nomadnetFileDownloadCallbacks: {},
@@ -780,7 +830,7 @@
"display_name": this.displayName,
});
},
- async downloadNomadNetFile(destinationHash, filePath, onSuccessCallback, onFailureCallback, onProgressCallback) {
+ downloadNomadNetFile(destinationHash, filePath, onSuccessCallback, onFailureCallback, onProgressCallback) {
// do nothing if not connected to websocket
if(!this.isWebsocketConnected){
@@ -811,7 +861,7 @@
}
},
- async downloadNomadNetPage(destinationHash, pagePath, onSuccessCallback, onFailureCallback, onProgressCallback) {
+ downloadNomadNetPage(destinationHash, pagePath, onSuccessCallback, onFailureCallback, onProgressCallback) {
// do nothing if not connected to websocket
if(!this.isWebsocketConnected){
@@ -948,6 +998,19 @@
// do nothing if failed to load messages
}
},
+ async loadNodeIndexPage(node) {
+ this.nodePageContent = "Requesting page: /page/index.mu";
+ this.downloadNomadNetPage(node.destination_hash, "/page/index.mu", (pageContent) => {
+ console.log("pageContent", pageContent);
+ this.nodePageContent = pageContent;
+ }, (failureReason) => {
+ console.log("failureReason", failureReason);
+ this.nodePageContent = `Failed loading page: ${failureReason}`;
+ }, (progress) => {
+ console.log("progress", progress);
+ this.nodePageContent = `Loading page: ${progress}`;
+ });
+ },
async deleteChatItem(chatItem) {
try {
@@ -1012,6 +1075,7 @@
onNodeClick: function(node) {
this.selectedPeer = null;
this.selectedNode = node;
+ this.loadNodeIndexPage(node);
},
parseSeconds: function(secondsToFormat) {
secondsToFormat = Number(secondsToFormat);