mirror of
https://github.com/aljazceru/nostr-watch.git
synced 2025-12-17 05:24:19 +01:00
meh
This commit is contained in:
5
build.js
5
build.js
@@ -3,6 +3,7 @@
|
||||
const esbuild = require('esbuild')
|
||||
const alias = require('esbuild-plugin-alias')
|
||||
const nodeGlobals = require('@esbuild-plugins/node-globals-polyfill').default
|
||||
const vuePlugin = require("esbuild-vue");
|
||||
|
||||
const prod = process.argv.indexOf('prod') !== -1
|
||||
|
||||
@@ -15,8 +16,10 @@ esbuild
|
||||
alias({
|
||||
stream: require.resolve('readable-stream')
|
||||
}),
|
||||
nodeGlobals({buffer: true})
|
||||
nodeGlobals({buffer: true}),
|
||||
vuePlugin(),
|
||||
],
|
||||
minify: true,
|
||||
sourcemap: prod ? false : 'inline',
|
||||
define: {
|
||||
window: 'self',
|
||||
|
||||
137
main.js
137
main.js
@@ -1,37 +1,12 @@
|
||||
import {createApp, h} from 'vue'
|
||||
import {relayConnect} from 'nostr-tools/relay'
|
||||
import yaml from 'js-yaml'
|
||||
import fs from 'fs'
|
||||
|
||||
const App = {
|
||||
data() {
|
||||
return {
|
||||
relays: [
|
||||
'wss://nostr-pub.wellorder.net',
|
||||
'wss://relayer.fiatjaf.com',
|
||||
'wss://nostr.rocks',
|
||||
'wss://rsslay.fiatjaf.com',
|
||||
'wss://freedom-relay.herokuapp.com/ws',
|
||||
'wss://nostr-relay.freeberty.net',
|
||||
'wss://nostr.bitcoiner.social',
|
||||
'wss://nostr-relay.wlvs.space',
|
||||
'wss://nostr.onsats.org',
|
||||
'wss://nostr-relay.untethr.me',
|
||||
'wss://nostr.semisol.dev',
|
||||
'wss://nostr-pub.semisol.dev',
|
||||
'ws://jgqaglhautb4k6e6i2g34jakxiemqp6z4wynlirltuukgkft2xuglmqd.onion',
|
||||
'wss://nostr-verified.wellorder.net',
|
||||
'wss://nostr.drss.io',
|
||||
'wss://nostr.unknown.place',
|
||||
'wss://relay.damus.io',
|
||||
'wss://nostr.openchain.fr',
|
||||
'wss://nostr.delo.software',
|
||||
'wss://relay.nostr.info',
|
||||
'wss://relay.minds.com/nostr/v1/ws',
|
||||
'wss://nostr.zaprite.io',
|
||||
'wss://nostr.oxtr.dev',
|
||||
'wss://nostr.ono.re',
|
||||
'wss://relay.grunch.dev',
|
||||
'wss://relay.cynsar.foundation'
|
||||
],
|
||||
relays: yaml.load(fs.readFileSync('relays.yml', 'utf8')).relays,
|
||||
status: {}
|
||||
}
|
||||
},
|
||||
@@ -92,59 +67,59 @@ const App = {
|
||||
})
|
||||
},
|
||||
|
||||
render() {
|
||||
return h('table', {style: {fontSize: '28px'}}, [
|
||||
h('tr', [h('th'), h('th', 'connect'), h('th', 'read'), h('th', 'write')]),
|
||||
...this.relays.map(url =>
|
||||
h('tr', [
|
||||
h(
|
||||
'th',
|
||||
{
|
||||
style: {
|
||||
textAlign: 'right',
|
||||
whiteSpace: 'pre-wrap',
|
||||
wordWrap: 'break-word',
|
||||
wordBreak: 'break-all'
|
||||
}
|
||||
},
|
||||
url
|
||||
),
|
||||
...['didConnect', 'didQuery', 'didPublish'].map(attr =>
|
||||
h(
|
||||
'td',
|
||||
{
|
||||
style: {
|
||||
fontSize: '50px',
|
||||
textAlign: 'center',
|
||||
padding: '5px 35px',
|
||||
color:
|
||||
this.status?.[url]?.[attr] === true
|
||||
? 'green'
|
||||
: this.status?.[url]?.[attr] === false
|
||||
? 'red'
|
||||
: 'silver'
|
||||
}
|
||||
},
|
||||
'•'
|
||||
)
|
||||
)
|
||||
])
|
||||
),
|
||||
h('tr', [
|
||||
h('th', {style: {textAlign: 'right'}}, 'Your relay here:'),
|
||||
h('th', {colSpan: 3}, [
|
||||
h(
|
||||
'a',
|
||||
{
|
||||
href: 'https://github.com/fiatjaf/nostr-relay-registry',
|
||||
style: {color: 'black'}
|
||||
},
|
||||
'________________'
|
||||
)
|
||||
])
|
||||
])
|
||||
])
|
||||
}
|
||||
// render() {
|
||||
// return h('table', {style: {fontSize: '28px'}}, [
|
||||
// h('tr', [h('th'), h('th', 'connect'), h('th', 'read'), h('th', 'write')]),
|
||||
// ...this.relays.map(url =>
|
||||
// h('tr', [
|
||||
// h(
|
||||
// 'th',
|
||||
// {
|
||||
// style: {
|
||||
// textAlign: 'right',
|
||||
// whiteSpace: 'pre-wrap',
|
||||
// wordWrap: 'break-word',
|
||||
// wordBreak: 'break-all'
|
||||
// }
|
||||
// },
|
||||
// url
|
||||
// ),
|
||||
// ...['didConnect', 'didQuery', 'didPublish'].map(attr =>
|
||||
// h(
|
||||
// 'td',
|
||||
// {
|
||||
// style: {
|
||||
// fontSize: '50px',
|
||||
// textAlign: 'center',
|
||||
// padding: '5px 35px',
|
||||
// color:
|
||||
// this.status?.[url]?.[attr] === true
|
||||
// ? 'green'
|
||||
// : this.status?.[url]?.[attr] === false
|
||||
// ? 'red'
|
||||
// : 'silver'
|
||||
// }
|
||||
// },
|
||||
// '•'
|
||||
// )
|
||||
// )
|
||||
// ])
|
||||
// ),
|
||||
// h('tr', [
|
||||
// h('th', {style: {textAlign: 'right'}}, 'Your relay here:'),
|
||||
// h('th', {colSpan: 3}, [
|
||||
// h(
|
||||
// 'a',
|
||||
// {
|
||||
// href: 'https://github.com/fiatjaf/nostr-relay-registry',
|
||||
// style: {color: 'black'}
|
||||
// },
|
||||
// '________________'
|
||||
// )
|
||||
// ])
|
||||
// ])
|
||||
// ])
|
||||
// }
|
||||
}
|
||||
|
||||
createApp(App).mount('#app')
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
"readable-stream": "^3.6.0",
|
||||
"vue": "3"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"devDependencies": {
|
||||
"esbuild-vue": "1.2.2",
|
||||
"json-server": "0.17.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "./build.js prod",
|
||||
"watch": "ag -l --js | entr ./build.js"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Relay Registry</title>
|
||||
|
||||
<div id="app" style="font-family: monospace"></div>
|
||||
|
||||
<script src="main.js"></script>
|
||||
27
relays.yml
Normal file
27
relays.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
relays:
|
||||
- 'wss://nostr-pub.wellorder.net'
|
||||
- 'wss://relayer.fiatjaf.com'
|
||||
- 'wss://nostr.rocks'
|
||||
- 'wss://rsslay.fiatjaf.com'
|
||||
- 'wss://freedom-relay.herokuapp.com/ws'
|
||||
- 'wss://nostr-relay.freeberty.net'
|
||||
- 'wss://nostr.bitcoiner.social'
|
||||
- 'wss://nostr-relay.wlvs.space'
|
||||
- 'wss://nostr.onsats.org'
|
||||
- 'wss://nostr-relay.untethr.me'
|
||||
- 'wss://nostr.semisol.dev'
|
||||
- 'wss://nostr-pub.semisol.dev'
|
||||
- 'ws://jgqaglhautb4k6e6i2g34jakxiemqp6z4wynlirltuukgkft2xuglmqd.onion'
|
||||
- 'wss://nostr-verified.wellorder.net'
|
||||
- 'wss://nostr.drss.io'
|
||||
- 'wss://nostr.unknown.place'
|
||||
- 'wss://relay.damus.io'
|
||||
- 'wss://nostr.openchain.fr'
|
||||
- 'wss://nostr.delo.software'
|
||||
- 'wss://relay.nostr.info'
|
||||
- 'wss://relay.minds.com/nostr/v1/ws'
|
||||
- 'wss://nostr.zaprite.io'
|
||||
- 'wss://nostr.oxtr.dev'
|
||||
- 'wss://nostr.ono.re'
|
||||
- 'wss://relay.grunch.dev'
|
||||
- 'wss://relay.cynsar.foundation'
|
||||
11
src/App.vue
Normal file
11
src/App.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'App'
|
||||
})
|
||||
</script>
|
||||
0
src/components/BaseRelays.vue
Normal file
0
src/components/BaseRelays.vue
Normal file
0
src/pages/IndexPage.vue
Normal file
0
src/pages/IndexPage.vue
Normal file
23
src/router/index.js
Normal file
23
src/router/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { route } from 'quasar/wrappers'
|
||||
import {
|
||||
createRouter,
|
||||
createWebHistory,
|
||||
createWebHashHistory,
|
||||
} from 'vue-router'
|
||||
import routes from './routes'
|
||||
|
||||
export default route(() => {
|
||||
const createHistory =
|
||||
process.env.VUE_ROUTER_MODE === 'history'
|
||||
? createWebHistory
|
||||
: createWebHashHistory
|
||||
|
||||
const Router = createRouter({
|
||||
routes,
|
||||
history: createHistory(
|
||||
process.env.MODE === 'ssr' ? void 0 : process.env.VUE_ROUTER_BASE
|
||||
),
|
||||
})
|
||||
|
||||
return Router
|
||||
})
|
||||
9
src/router/routes.js
Normal file
9
src/router/routes.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('layouts/MainLayout.vue'),
|
||||
children: [
|
||||
{ path: '', component: () => import('pages/IndexPage.vue') }
|
||||
]
|
||||
|
||||
export default routes
|
||||
Reference in New Issue
Block a user