update readme

This commit is contained in:
dskvr
2022-11-25 12:58:29 +01:00
parent c6fbb1da51
commit 86dbee43a1
2 changed files with 9 additions and 31 deletions

View File

@@ -22,6 +22,7 @@
"node-emoji": "1.11.0", "node-emoji": "1.11.0",
"node-polyfill-webpack-plugin": "2.0.1", "node-polyfill-webpack-plugin": "2.0.1",
"nostr": "0.2.5", "nostr": "0.2.5",
"nostr-relay-inspector": "0.0.1",
"nostr-tools": "0.24.1", "nostr-tools": "0.24.1",
"onion-regex": "2.0.8", "onion-regex": "2.0.8",
"requests": "0.3.0", "requests": "0.3.0",

View File

@@ -135,7 +135,7 @@
<th class="table-column status-indicator"></th> <th class="table-column status-indicator"></th>
<th class="table-column relay"></th> <th class="table-column relay"></th>
<th class="table-column verified"></th> <th class="table-column verified"></th>
<th class="table-column location"></th> <!-- <th class="table-column location"></th> -->
<th></th> <th></th>
<th class="table-column connect" v-tooltip:top.tooltip="'Relay connection status'"> <th class="table-column connect" v-tooltip:top.tooltip="'Relay connection status'">
🔌 🔌
@@ -155,7 +155,7 @@
<tr v-for="relay in query('offline')" :key="{relay}" :class="getLoadingClass(relay)"> <tr v-for="relay in query('offline')" :key="{relay}" :class="getLoadingClass(relay)">
<td :key="generateKey(relay, 'aggregate')"><span :class="getAggregateResultClass(relay)"></span></td> <td :key="generateKey(relay, 'aggregate')"><span :class="getAggregateResultClass(relay)"></span></td>
<td class="left-align relay-url">{{ relay }}</td> <td class="left-align relay-url">{{ relay }}</td>
<td></td> <!-- <td></td> -->
<td></td> <td></td>
<td></td> <td></td>
<td :key="generateKey(relay, 'check.connect')"><span :class="getResultClass(relay, 'connect')"></span></td> <td :key="generateKey(relay, 'check.connect')"><span :class="getResultClass(relay, 'connect')"></span></td>
@@ -265,8 +265,6 @@ export default defineComponent({
methods: { methods: {
check(relay){ check(relay){
//console.log(relay, 'checking', this.count++)
let inspect = new Inspector(relay, { let inspect = new Inspector(relay, {
checkLatency: true, checkLatency: true,
run: true, run: true,
@@ -277,17 +275,11 @@ export default defineComponent({
this.result[relay] = result this.result[relay] = result
}) })
.on('complete', (instance) => { .on('complete', (instance) => {
this.result[relay] = instance.result this.result[relay] = instance.result
this.messages[relay] = instance.inbox this.messages[relay] = instance.inbox
// console.log('notices', this.messages[relay])
this.setFlag(relay) this.setFlag(relay)
this.setAggregateResult(relay) this.setAggregateResult(relay)
//console.log('result state', instance.result) this.adjustResult(relay)
//console.log('messages', this.messages[relay].notices.length ? this.messages[relay].notices : null)
// this.adjustResult(relay)
// //console.log(this.connections[relay])
}) })
.on('notice', (notice) => { .on('notice', (notice) => {
const hash = this.sha1(notice) const hash = this.sha1(notice)
@@ -299,13 +291,6 @@ export default defineComponent({
this.result[relay].observations.push( new Observation('notice', response_obj.code, response_obj.description, response_obj.relates_to) ) this.result[relay].observations.push( new Observation('notice', response_obj.code, response_obj.description, response_obj.relates_to) )
console.log(this.result[relay].observations) console.log(this.result[relay].observations)
// if (Array.isArray(this.alerts[relay]))
// this.alerts[relay] = new Array()
//
// console.log('alerts', this.alerts, Array.isArray(this.alerts[relay]), this.alerts[relay], response_obj)
//
// this.alerts[relay].push = response_obj
}) })
.on('close', () => { .on('close', () => {
// delete this.connections[relay] // delete this.connections[relay]
@@ -344,19 +329,11 @@ export default defineComponent({
return [] return []
}, },
adjustResult (url) { adjustResult (relay) {
Object.entries(this.messages[url].notices).forEach( ([key, value]) => { this.result[relay].observations.forEach( observation => {
if(!value.hasOwnProperty("hash")) return if (observation.code == "BLOCKS_WRITE_STATUS_CHECK") {
let code = RELAY_MESSAGES[value.hash].code, this.result[relay].check.write = false
type = RELAY_CODES[code].type this.result[relay].aggregate = 'public'
this.result[url][type] = code
if (type == "maybe_public") {
this.result[url].check.write = false
this.result[url].aggregate = 'public'
}
if (type == "write_restricted") {
this.result[url].check.write = false
} }
}) })
}, },