Merge pull request #38 from dskvr/feature/alternating-rows

add alternative rows
This commit is contained in:
Sandwich
2022-12-18 17:22:05 +01:00
committed by GitHub
5 changed files with 25 additions and 16 deletions

View File

@@ -43,7 +43,7 @@
<span>NIP-11</span> <span>NIP-11</span>
</th> --> </th> -->
</tr> </tr>
<tr v-for="relay in query(section)" :key="{relay}" :class="getResultClass(relay)" class="relay"> <tr v-for="(relay, index) in query(section)" :key="{relay}" :class="getResultClass(relay, index)" class="relay">
<RelaySingleComponent <RelaySingleComponent
:relay="relay" :relay="relay"
:result="result[relay]" :result="result[relay]"
@@ -149,12 +149,13 @@ export default defineComponent({
restricted: this.section == "restricted" restricted: this.section == "restricted"
} }
}, },
getResultClass (relay) { getResultClass (relay, index) {
return { return {
loaded: this.result?.[relay]?.state == 'complete', loaded: this.result?.[relay]?.state == 'complete',
online: this.section != "offline", online: this.section != "offline",
offline: this.section == "offline", offline: this.section == "offline",
public: this.section == "public" public: this.section == "public",
even: index % 2,
} }
}, },
query (aggregate) { query (aggregate) {
@@ -255,11 +256,8 @@ export default defineComponent({
} }
.nip-11 a { cursor: pointer } .nip-11 a { cursor: pointer }
</style>
<style scoped> tr.even {
.dark-mode div ::v-deep(.modal-content) { background:#f9f9f9
border-color: #2d3748;
background-color: #1a202c;
} }
</style> </style>

View File

@@ -43,7 +43,7 @@
<span>NIP-11</span> <span>NIP-11</span>
</th> --> </th> -->
</tr> </tr>
<tr v-for="relay in sortByLatency()" :key="{relay}" class="relay" :class="getResultClass(relay)"> <tr v-for="(relay, index) in sortByLatency()" :key="{relay}" class="relay" :class="getResultClass(relay, index)">
<RelaySingleComponent <RelaySingleComponent
:relay="relay" :relay="relay"
:result="result[relay]" :result="result[relay]"
@@ -126,9 +126,10 @@ export default defineComponent({
// restricted: this.section == "restricted" // restricted: this.section == "restricted"
// } // }
// }, // },
getResultClass (relay) { getResultClass (relay, index) {
return { return {
loaded: this.result?.[relay]?.state == 'complete' loaded: this.result?.[relay]?.state == 'complete',
even: index % 2
} }
}, },
sort_by_latency(ascending) { sort_by_latency(ascending) {
@@ -252,11 +253,8 @@ export default defineComponent({
} }
.nip-11 a { cursor: pointer } .nip-11 a { cursor: pointer }
</style>
<style scoped> tr.even {
.dark-mode div ::v-deep(.modal-content) { background:#f9f9f9
border-color: #2d3748;
background-color: #1a202c;
} }
</style> </style>

View File

@@ -276,4 +276,9 @@ td.verified span {
position:relative; position:relative;
left:-7px; left:-7px;
} }
td {
padding-top:2px;
padding-bottom:2px;
}
</style> </style>

View File

@@ -301,3 +301,8 @@ export default defineComponent({
}) })
</script> </script>
<style scoped>
table {
border-collapse: collapse !important;
}
</style>

View File

@@ -134,4 +134,7 @@ export default defineComponent({
position:relative; position:relative;
z-index:1; z-index:1;
} }
table {
border-collapse: collapse !important;
}
</style> </style>