Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Lissy93/dashy into FIX/ticket-fix…
Browse files Browse the repository at this point in the history
…es-1419
  • Loading branch information
Lissy93 committed Dec 31, 2023
2 parents d8c0919 + 3e75854 commit 8e3c54f
Show file tree
Hide file tree
Showing 12 changed files with 511 additions and 117 deletions.
6 changes: 3 additions & 3 deletions .github/AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ Marcell Fülöp <marekful@protonmail.com> - 27 commits
Alicia Sykes <alicia@futr.ai> - 28 commits
Lissy93 <gh@d0h.co> - 78 commits
snyk-bot <snyk-bot@snyk.io> - 83 commits
repo-visualizer <repo-visualizer@users.noreply.github.com> - 117 commits
repo-visualizer <repo-visualizer@users.noreply.github.com> - 118 commits
Lissy93 <Lissy93@users.noreply.github.com> - 210 commits
liss-bot <liss-bot@d0h.co> - 212 commits
Alicia Bot <87835202+liss-bot@users.noreply.github.com> - 215 commits
liss-bot <liss-bot@d0h.co> - 214 commits
Alicia Bot <87835202+liss-bot@users.noreply.github.com> - 216 commits
Alicia Sykes <alicia@omg.lol> - 352 commits
Alicia Sykes <gh@d0h.co> - 440 commits
Alicia Sykes <sykes.alicia@gmail.com> - 1488 commits
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ Huge thanks to the sponsors helping to support Dashy's development!
<sub><b>Vincent Koc</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/peng1can">
<img src="https://avatars.githubusercontent.com/u/225854?v=4" width="80;" alt="peng1can"/>
<br />
<sub><b>peng1can</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tbjers">
<img src="https://avatars.githubusercontent.com/u/1117052?u=539d96d5e581b3139c75713ce35b89a36626404c&v=4" width="80;" alt="tbjers"/>
Expand All @@ -554,7 +561,7 @@ Huge thanks to the sponsors helping to support Dashy's development!
</td>
<td align="center">
<a href="https://github.com/AnandChowdhary">
<img src="https://avatars.githubusercontent.com/u/2841780?u=2d606fd66dbb1e7a102d54b4c90f078760de6674&v=4" width="80;" alt="AnandChowdhary"/>
<img src="https://avatars.githubusercontent.com/u/2841780?u=747e554b3a7f12eb20b7910e1c87d817844f714f&v=4" width="80;" alt="AnandChowdhary"/>
<br />
<sub><b>Anand Chowdhary</b></sub>
</a>
Expand All @@ -565,15 +572,15 @@ Huge thanks to the sponsors helping to support Dashy's development!
<br />
<sub><b>Shrippen</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/davidpaulyoung">
<img src="https://avatars.githubusercontent.com/u/3418369?v=4" width="80;" alt="davidpaulyoung"/>
<br />
<sub><b>David Young</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/bile0026">
<img src="https://avatars.githubusercontent.com/u/5022496?u=aec96ad173c0ea9baaba93807efa8a848af6595c&v=4" width="80;" alt="bile0026"/>
Expand Down Expand Up @@ -608,15 +615,22 @@ Huge thanks to the sponsors helping to support Dashy's development!
<br />
<sub><b>Vlad Timofeev</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/helixzz">
<img src="https://avatars.githubusercontent.com/u/12218889?v=4" width="80;" alt="helixzz"/>
<br />
<sub><b>HeliXZz</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Bastii717">
<img src="https://avatars.githubusercontent.com/u/53431819?u=604977bed6ad6875ada890d0d3765a4cacc2fa14&v=4" width="80;" alt="Bastii717"/>
<br />
<sub><b>Bastii717</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/ratty222">
<img src="https://avatars.githubusercontent.com/u/92832598?u=137b65530cbd5f5af9c24cde51baa6cc77cc934b&v=4" width="80;" alt="ratty222"/>
Expand Down
149 changes: 82 additions & 67 deletions docs/assets/CONTRIBUTORS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/assets/repo-visualization.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 20 additions & 6 deletions docs/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
<sub><b>Vincent Koc</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/peng1can">
<img src="https://avatars.githubusercontent.com/u/225854?v=4" width="80;" alt="peng1can"/>
<br />
<sub><b>Null</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tbjers">
<img src="https://avatars.githubusercontent.com/u/1117052?u=539d96d5e581b3139c75713ce35b89a36626404c&v=4" width="80;" alt="tbjers"/>
Expand All @@ -27,7 +34,7 @@
</td>
<td align="center">
<a href="https://github.com/AnandChowdhary">
<img src="https://avatars.githubusercontent.com/u/2841780?u=2d606fd66dbb1e7a102d54b4c90f078760de6674&v=4" width="80;" alt="AnandChowdhary"/>
<img src="https://avatars.githubusercontent.com/u/2841780?u=747e554b3a7f12eb20b7910e1c87d817844f714f&v=4" width="80;" alt="AnandChowdhary"/>
<br />
<sub><b>Anand Chowdhary</b></sub>
</a>
Expand All @@ -38,15 +45,15 @@
<br />
<sub><b>Null</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/davidpaulyoung">
<img src="https://avatars.githubusercontent.com/u/3418369?v=4" width="80;" alt="davidpaulyoung"/>
<br />
<sub><b>David Young</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/bile0026">
<img src="https://avatars.githubusercontent.com/u/5022496?u=aec96ad173c0ea9baaba93807efa8a848af6595c&v=4" width="80;" alt="bile0026"/>
Expand Down Expand Up @@ -81,15 +88,22 @@
<br />
<sub><b>Vlad Timofeev</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/helixzz">
<img src="https://avatars.githubusercontent.com/u/12218889?v=4" width="80;" alt="helixzz"/>
<br />
<sub><b>HeliXZz</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Bastii717">
<img src="https://avatars.githubusercontent.com/u/53431819?u=604977bed6ad6875ada890d0d3765a4cacc2fa14&v=4" width="80;" alt="Bastii717"/>
<br />
<sub><b>Null</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/ratty222">
<img src="https://avatars.githubusercontent.com/u/92832598?u=137b65530cbd5f5af9c24cde51baa6cc77cc934b&v=4" width="80;" alt="ratty222"/>
Expand Down
32 changes: 32 additions & 0 deletions docs/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,22 @@ Live-updating current CPU usage, as a combined average across all cores

---

### Current CPU Usage Speedometer

Speedometer styled version of the Current CPU Usage widget

<p align="center"><img width="400" src="https://i.ibb.co/7RHTRNq/gl-cpu-speedometer.png" /></p>

#### Example

```yaml
- type: gl-cpu-speedometer
options:
hostname: http://192.168.130.2:61208
```

---

### CPU Usage Per Core

Live-updating CPU usage breakdown per core
Expand Down Expand Up @@ -2388,6 +2404,22 @@ Real-time memory usage gauge, with more info visible on click

---

### Current Memory Usage Speedometer

Speedometer styled version of the Current Memory Usage widget

<p align="center"><img width="400" src="https://i.ibb.co/wsNW7Xr/gl-mem-speedometer.png" /></p>

#### Example

```yaml
- type: gl-mem-speedometer
options:
hostname: http://192.168.130.2:61208
```

---

### Memory Usage History

Recent memory usage chart
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
"@sentry/tracing": "^6.17.5",
"@sentry/vue": "^6.17.4",
"ajv": "^8.10.0",
"axios": "^0.27.2",
"axios": "^1.6.0",
"connect-history-api-fallback": "^1.6.0",
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"express": "^4.17.2",
"frappe-charts": "^1.6.2",
"js-yaml": "^4.1.0",
"keycloak-js": "^20.0.3",
"register-service-worker": "^1.7.2",
"remedial": "^1.0.8",
"rsup-progress": "^3.0.0",
"rsup-progress": "^3.2.0",
"simple-icons": "^7.19.0",
"v-jsoneditor": "^1.4.5",
"v-tooltip": "^2.1.3",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@
"general": {
"loading": "Loading...",
"show-more": "Expand Details",
"cpu-details": "CPU Details",
"mem-details": "Memory Details",
"show-less": "Show Less",
"open-link": "Continue Reading"
},
Expand Down
150 changes: 150 additions & 0 deletions src/components/Widgets/GlCpuSpeedometer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<template>
<div class="glances-cpu-gauge-wrapper">
<GaugeChart class="gl-speedometer" :value="gaugeValue"
:baseColor="baseColor" :shadowColor="shadowColor" :gaugeColor="gaugeColor"
:startAngle="startAngle" :endAngle="endAngle" :innerRadius="innerRadius"
:separatorThickness="separatorThickness">
<p class="percentage">{{ gaugeValue }}%</p>
</GaugeChart>
<p class="show-more-btn" @click="toggleMoreInfo">
{{ showMoreInfo ? $t('widgets.general.show-less') : $t('widgets.general.cpu-details') }}
</p>
<div class="more-info" v-if="moreInfo && showMoreInfo">
<div class="more-info-row" v-for="(info, key) in moreInfo" :key="key">
<p class="label">{{ info.label }}</p>
<p class="value">{{ info.value }}</p>
</div>
</div>
</div>
</template>

<script>
import WidgetMixin from '@/mixins/WidgetMixin';
import GlancesMixin from '@/mixins/GlancesMixin';
import GaugeChart from '@/components/Charts/Gauge';
import { capitalize } from '@/utils/MiscHelpers';
export default {
mixins: [WidgetMixin, GlancesMixin],
components: {
GaugeChart,
},
data() {
return {
gaugeValue: 0,
baseColor: '#101010ED',
shadowColor: '#00000000',
gaugeColor: [
{ offset: 0, color: '#20e253' },
{ offset: 35, color: '#f6f000' },
{ offset: 65, color: '#fca016' },
{ offset: 90, color: '#f80363' },
],
showMoreInfo: false,
moreInfo: null,
startAngle: -135,
endAngle: 135,
innerRadius: 80,
separatorThickness: 0,
};
},
computed: {
endpoint() {
return this.makeGlancesUrl('cpu');
},
},
methods: {
processData(cpuData) {
this.gaugeValue = cpuData.total;
const moreInfo = [];
const ignore = ['total', 'cpucore', 'time_since_update',
'interrupts', 'soft_interrupts', 'ctx_switches', 'syscalls'];
Object.keys(cpuData).forEach((key) => {
if (!ignore.includes(key) && cpuData[key]) {
moreInfo.push({ label: capitalize(key), value: `${cpuData[key].toFixed(1)}%` });
}
});
this.moreInfo = moreInfo;
},
toggleMoreInfo() {
this.showMoreInfo = !this.showMoreInfo;
},
},
created() {
this.overrideUpdateInterval = 2;
},
};
</script>

<style scoped lang="scss">
.glances-cpu-gauge-wrapper {
max-width: 15rem;
margin: 0rem auto;
p.percentage {
color: var(--widget-text-color);
text-align: center;
position: absolute;
font-size: 1.3rem;
margin: 3.5rem 0;
width: 100%;
bottom: 0;
}
.more-info {
background: var(--widget-accent-color);
border-radius: var(--curve-factor);
padding: 0.25rem 0.5rem;
margin: 0.5rem auto;
.more-info-row {
display: flex;
justify-content: space-between;
align-items: center;
p.label, p.value {
color: var(--widget-text-color);
margin: 0.25rem 0;
}
p.value {
font-family: var(--font-monospace);
}
&:not(:last-child) {
border-bottom: 1px dashed var(--widget-text-color);
}
}
}
p.show-more-btn {
cursor: pointer;
font-size: 0.9rem;
text-align: center;
width: fit-content;
margin: -1.1rem auto 0 auto;
padding: 0.1rem 0.25rem;
border: 1px solid transparent;
color: var(--widget-text-color);
opacity: var(--dimming-factor);
border-radius: var(--curve-factor);
&:hover {
border: 1px solid var(--widget-text-color);
}
&:focus,
&:active {
background: var(--widget-text-color);
color: var(--widget-background-color);
}
}
}
</style>
<style>
/* global override for the Guage tick lines */
.gl-speedometer svg line {
stroke: var(--widget-text-color);
opacity: .3;
}
</style>
Loading

0 comments on commit 8e3c54f

Please sign in to comment.