Browse Source

Manual fixes

pull/113/head
Adam Stachowicz 3 years ago
parent
commit
4c8fdd07d9
  1. 1
      server/model/heartbeat.js
  2. 3
      server/model/monitor.js
  3. 4
      src/App.vue
  4. 4
      src/components/Confirm.vue
  5. 8
      src/components/CountUp.vue
  6. 4
      src/components/Datetime.vue
  7. 2
      src/components/HeartbeatBar.vue
  8. 4
      src/components/NotificationDialog.vue
  9. 4
      src/components/Status.vue
  10. 6
      src/components/Uptime.vue
  11. 4
      src/layouts/EmptyLayout.vue
  12. 1
      src/main.js
  13. 3
      src/mixins/socket.js
  14. 4
      src/pages/DashboardHome.vue
  15. 4
      src/pages/Details.vue

1
server/model/heartbeat.js

@ -9,6 +9,7 @@ const { BeanModel } = require("redbean-node/dist/bean-model");
* status: * status:
* 0 = DOWN * 0 = DOWN
* 1 = UP * 1 = UP
* 2 = PENDING
*/ */
class Heartbeat extends BeanModel { class Heartbeat extends BeanModel {

3
server/model/monitor.js

@ -22,6 +22,7 @@ const customAgent = new https.Agent({
* status: * status:
* 0 = DOWN * 0 = DOWN
* 1 = UP * 1 = UP
* 2 = PENDING
*/ */
class Monitor extends BeanModel { class Monitor extends BeanModel {
async toJSON() { async toJSON() {
@ -197,7 +198,7 @@ class Monitor extends BeanModel {
if (bean.status === UP) { if (bean.status === UP) {
console.info(`Monitor #${this.id} '${this.name}': Successful Response: ${bean.ping} ms | Interval: ${this.interval} seconds | Type: ${this.type}`) console.info(`Monitor #${this.id} '${this.name}': Successful Response: ${bean.ping} ms | Interval: ${this.interval} seconds | Type: ${this.type}`)
} else if (bean.status === PENDING) { } else if (bean.status === PENDING) {
console.warn(`Monitor #${this.id} '${this.name}': Pending: ${bean.msg} | Type: ${this.type}`) console.warn(`Monitor #${this.id} '${this.name}': Pending: ${bean.msg} | Max retries: ${this.maxretries} | Type: ${this.type}`)
} else { } else {
console.warn(`Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Type: ${this.type}`) console.warn(`Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Type: ${this.type}`)
} }

4
src/App.vue

@ -5,7 +5,3 @@
<script> <script>
export default {} export default {}
</script> </script>
<style lang="scss">
</style>

4
src/components/Confirm.vue

@ -50,7 +50,3 @@ export default {
}, },
} }
</script> </script>
<style scoped>
</style>

8
src/components/CountUp.vue

@ -12,11 +12,11 @@ export default {
props: { props: {
value: [String, Number], value: [String, Number],
time: { time: {
Number, type: Number,
default: 0.3, default: 0.3,
}, },
unit: { unit: {
String, type: String,
default: "ms", default: "ms",
}, },
}, },
@ -61,7 +61,3 @@ export default {
} }
</script> </script>
<style scoped>
</style>

4
src/components/Datetime.vue

@ -35,7 +35,3 @@ export default {
}, },
} }
</script> </script>
<style scoped>
</style>

2
src/components/HeartbeatBar.vue

@ -69,7 +69,7 @@ export default {
let width let width
if (this.maxBeat > 0) { if (this.maxBeat > 0) {
width = (this.beatWidth + this.beatMargin * 2) * this.maxBeat + (leftRight * 2) + "px" width = (this.beatWidth + this.beatMargin * 2) * this.maxBeat + (leftRight * 2) + "px"
} { } else {
width = "100%" width = "100%"
} }

4
src/components/NotificationDialog.vue

@ -496,7 +496,3 @@ export default {
}, },
} }
</script> </script>
<style scoped>
</style>

4
src/components/Status.vue

@ -17,8 +17,8 @@ export default {
} if (this.status === 2) { } if (this.status === 2) {
return "warning" return "warning"
} }
return "secondary"
return "secondary"
}, },
text() { text() {
@ -29,8 +29,8 @@ export default {
} if (this.status === 2) { } if (this.status === 2) {
return "Pending" return "Pending"
} }
return "Unknown"
return "Unknown"
}, },
}, },
} }

6
src/components/Uptime.vue

@ -8,7 +8,7 @@ export default {
monitor: Object, monitor: Object,
type: String, type: String,
pill: { pill: {
Boolean, type: Boolean,
default: false, default: false,
}, },
}, },
@ -57,7 +57,3 @@ export default {
}, },
} }
</script> </script>
<style scoped>
</style>

4
src/layouts/EmptyLayout.vue

@ -5,7 +5,3 @@
<script> <script>
export default {} export default {}
</script> </script>
<style scoped>
</style>

1
src/main.js

@ -91,4 +91,3 @@ app.use(Toast, options);
app.component("FontAwesomeIcon", FontAwesomeIcon) app.component("FontAwesomeIcon", FontAwesomeIcon)
app.mount("#app") app.mount("#app")

3
src/mixins/socket.js

@ -254,8 +254,8 @@ export default {
if (this.userTimezone === "auto") { if (this.userTimezone === "auto") {
return dayjs.tz.guess() return dayjs.tz.guess()
} }
return this.userTimezone
return this.userTimezone
}, },
lastHeartbeatList() { lastHeartbeatList() {
@ -322,4 +322,3 @@ export default {
}, },
} }

4
src/pages/DashboardHome.vue

@ -146,7 +146,9 @@ export default {
result.sort((a, b) => { result.sort((a, b) => {
if (a.time > b.time) { if (a.time > b.time) {
return -1; return -1;
} if (a.time < b.time) { }
if (a.time < b.time) {
return 1; return 1;
} }

4
src/pages/Details.vue

@ -45,7 +45,7 @@
<span class="num"><CountUp :value="ping" /></span> <span class="num"><CountUp :value="ping" /></span>
</div> </div>
<div class="col"> <div class="col">
<h4>Avg.{{ pingTitle }}</h4> <h4>Avg. {{ pingTitle }}</h4>
<p>(24-hour)</p> <p>(24-hour)</p>
<span class="num"><CountUp :value="avgPing" /></span> <span class="num"><CountUp :value="avgPing" /></span>
</div> </div>
@ -61,7 +61,7 @@
</div> </div>
<div v-if="certInfo" class="col"> <div v-if="certInfo" class="col">
<h4>CertExp.</h4> <h4>Cert Exp.</h4>
<p>(<Datetime :value="certInfo.validTo" date-only />)</p> <p>(<Datetime :value="certInfo.validTo" date-only />)</p>
<span class="num"> <span class="num">
<a href="#" @click.prevent="toggleCertInfoBox = !toggleCertInfoBox">{{ certInfo.daysRemaining }} days</a> <a href="#" @click.prevent="toggleCertInfoBox = !toggleCertInfoBox">{{ certInfo.daysRemaining }} days</a>

Loading…
Cancel
Save