Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-03-18 15:43:20 +0300
committerJoas Schilling <coding@schilljs.com>2020-03-18 15:43:20 +0300
commit84a8ea67d03683cc0a689c5531e6271f528823f1 (patch)
treebd6849744b0c489cebbdf0effb23ca54743aad36 /js
parent655e4bc168bd2bfef1882714404c958c18c1721d (diff)
Fix darkmode
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'js')
-rw-r--r--js/script.js32
1 files changed, 20 insertions, 12 deletions
diff --git a/js/script.js b/js/script.js
index 18bd3a7..8ab8e6b 100644
--- a/js/script.js
+++ b/js/script.js
@@ -67,6 +67,14 @@
resizeSystemCharts();
});
+ function getThemedPrimaryColor() {
+ return OCA.Theming ? OCA.Theming.color : 'rgb(54, 129, 195)';
+ }
+
+ function getThemedPassiveColor() {
+ return OCA.Theming && OCA.Theming.inverted ? 'rgb(55, 55, 55)' : 'rgb(200, 200, 200)';
+ }
+
/**
* Reset all canvas widths on window resize so canvas is responsive
*/
@@ -116,7 +124,7 @@
{
millisPerPixel: 100,
minValue: 0,
- grid: {fillStyle: 'rgba(249,249,249,1)', strokeStyle: 'transparent'},
+ grid: {fillStyle: 'rgba(0,0,0,0)', strokeStyle: 'transparent'},
labels: {fillStyle: 'rgba(0,0,0,0.4)', fontSize: 12},
responsive: true
});
@@ -124,8 +132,8 @@
cpuLoadLine = new TimeSeries();
cpuLoadChart.addTimeSeries(cpuLoadLine, {
lineWidth: 1,
- strokeStyle: 'rgb(180, 180, 180)',
- fillStyle: OCA.Theming ? OCA.Theming.color : 'rgb(54, 129, 195)'
+ strokeStyle: getThemedPassiveColor(),
+ fillStyle: getThemedPrimaryColor()
});
}
@@ -175,8 +183,8 @@
memoryUsageLine = new TimeSeries();
memoryUsageChart.addTimeSeries(memoryUsageLine, {
lineWidth: 1,
- strokeStyle: 'rgb(180, 180, 180)',
- fillStyle: OCA.Theming ? OCA.Theming.color : 'rgb(54, 129, 195)'
+ strokeStyle: getThemedPassiveColor(),
+ fillStyle: getThemedPrimaryColor()
});
swapUsageLine = new TimeSeries();
memoryUsageChart.addTimeSeries(swapUsageLine, {
@@ -292,16 +300,16 @@
label: " ",
data: activeUsersData,
fill: false,
- borderColor: ['rgba(0, 0, 255, 1)'],
+ borderColor: [getThemedPrimaryColor()],
borderWidth: 1,
borderDashOffset: 0.0,
borderJoinStyle: 'miter',
- pointBorderColor: 'rgba(0, 0, 255, 1)',
- pointBackgroundColor: "#ffffff",
+ pointBorderColor: getThemedPrimaryColor(),
+ pointBackgroundColor: getThemedPassiveColor(),
pointBorderWidth: 1,
pointHoverRadius: 5,
- pointHoverBackgroundColor: "rgba(0,0,255,0.6)",
- pointHoverBorderColor: "rgba(0, 0, 255, 1)",
+ pointHoverBackgroundColor: getThemedPrimaryColor(),
+ pointHoverBorderColor: getThemedPrimaryColor(),
pointHoverBorderWidth: 1,
pointRadius: 5,
pointHitRadius: 10,
@@ -389,8 +397,8 @@
datasets: [
{
backgroundColor: [
- OCA.Theming ? OCA.Theming.color : 'rgb(54, 129, 195)',
- 'rgb(200, 200, 200)',
+ getThemedPrimaryColor(),
+ getThemedPassiveColor(),
],
borderWidth: 0,
data: diskdata[i]