Fix some mobile UI issues on mining dashboard

This commit is contained in:
nymkappa
2022-03-31 18:14:07 +09:00
parent 2374f98ca8
commit 2b79d6c935
14 changed files with 50 additions and 123 deletions

View File

@@ -44,12 +44,12 @@
</form>
</div>
<div [class]="!widget ? 'chart' : 'chart-widget'"
echarts [initOpts]="chartInitOptions" [options]="chartOptions"></div>
<div [class]="!widget ? 'chart' : 'chart-widget'" echarts [initOpts]="chartInitOptions" [options]="chartOptions">
</div>
<div class="text-center loadingGraphs" *ngIf="isLoading">
<div class="spinner-border text-light"></div>
</div>
</div>
<ng-template #loadingStats>

View File

@@ -20,12 +20,11 @@
.full-container {
padding: 0px 15px;
width: 100%;
height: calc(100% - 170px);
min-height: 500px;
height: calc(100% - 150px);
@media (max-width: 992px) {
height: calc(100% - 220px);
};
@media (max-width: 575px) {
height: calc(100% - 260px);
height: 100%;
padding-bottom: 100px;
};
}
@@ -93,17 +92,8 @@
}
.item {
width: 50%;
margin: 0px auto 10px;
display: inline-block;
@media (min-width: 485px) {
margin: 0px auto 10px;
}
@media (min-width: 785px) {
margin: 0px auto 0px;
}
&:last-child {
margin: 0px auto 0px;
}
margin: 0px auto 20px;
&:nth-child(2) {
order: 2;
@media (min-width: 485px) {

View File

@@ -155,10 +155,10 @@ export class HashrateChartComponent implements OnInit {
'#D81B60',
],
grid: {
top: 30,
top: 20,
bottom: this.widget ? 30 : 70,
right: this.right,
left: this.left,
bottom: this.widget ? 30 : this.isMobile() ? 90 : 60,
},
tooltip: {
show: !this.isMobile() || !this.widget,
@@ -174,7 +174,7 @@ export class HashrateChartComponent implements OnInit {
align: 'left',
},
borderColor: '#000',
formatter: function (ticks) {
formatter: (ticks) => {
let hashrateString = '';
let difficultyString = '';
let hashratePowerOfTen: any = selectPowerOfTen(1);
@@ -205,7 +205,7 @@ export class HashrateChartComponent implements OnInit {
<span>${hashrateString}</span><br>
<span>${difficultyString}</span>
`;
}.bind(this)
}
},
xAxis: data.hashrates.length === 0 ? undefined : {
type: 'time',
@@ -239,7 +239,7 @@ export class HashrateChartComponent implements OnInit {
},
yAxis: data.hashrates.length === 0 ? undefined : [
{
min: function (value) {
min: (value) => {
return value.min * 0.9;
},
type: 'value',
@@ -256,7 +256,7 @@ export class HashrateChartComponent implements OnInit {
}
},
{
min: function (value) {
min: (value) => {
return value.min * 0.9;
},
type: 'value',
@@ -266,7 +266,7 @@ export class HashrateChartComponent implements OnInit {
formatter: (val) => {
const selectedPowerOfTen: any = selectPowerOfTen(val);
const newVal = Math.round(val / selectedPowerOfTen.divider);
return `${newVal} ${selectedPowerOfTen.unit}`
return `${newVal} ${selectedPowerOfTen.unit}`;
}
},
splitLine: {
@@ -310,7 +310,6 @@ export class HashrateChartComponent implements OnInit {
type: 'slider',
brushSelect: false,
realtime: true,
bottom: this.isMobile() ? 30 : 0,
left: 20,
right: 15,
selectedDataBackground: {