mirror of
				https://github.com/louislam/uptime-kuma.git
				synced 2025-11-01 03:49:24 +08:00 
			
		
		
		
	add simple loading chart effect
This commit is contained in:
		| @@ -10,7 +10,7 @@ | |||||||
|                 </li> |                 </li> | ||||||
|             </ul> |             </ul> | ||||||
|         </div> |         </div> | ||||||
|         <div class="chart-wrapper"> |         <div class="chart-wrapper" :class="{ loading : loading}"> | ||||||
|             <LineChart :chart-data="chartData" :options="chartOptions" /> |             <LineChart :chart-data="chartData" :options="chartOptions" /> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| @@ -42,6 +42,9 @@ export default { | |||||||
|     }, |     }, | ||||||
|     data() { |     data() { | ||||||
|         return { |         return { | ||||||
|  |  | ||||||
|  |             loading: false, | ||||||
|  |  | ||||||
|             // Configurable filtering on top of the returned data |             // Configurable filtering on top of the returned data | ||||||
|             chartPeriodHrs: 0, |             chartPeriodHrs: 0, | ||||||
|  |  | ||||||
| @@ -218,12 +221,15 @@ export default { | |||||||
|                 newPeriod = null; |                 newPeriod = null; | ||||||
|                 this.heartbeatList = null; |                 this.heartbeatList = null; | ||||||
|             } else { |             } else { | ||||||
|  |                 this.loading = true; | ||||||
|  |  | ||||||
|                 this.$root.getMonitorBeats(this.monitorId, newPeriod, (res) => { |                 this.$root.getMonitorBeats(this.monitorId, newPeriod, (res) => { | ||||||
|                     if (!res.ok) { |                     if (!res.ok) { | ||||||
|                         toast.error(res.msg); |                         toast.error(res.msg); | ||||||
|                     } else { |                     } else { | ||||||
|                         this.heartbeatList = res.data; |                         this.heartbeatList = res.data; | ||||||
|                     } |                     } | ||||||
|  |                     this.loading = false; | ||||||
|                 }); |                 }); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -309,5 +315,9 @@ export default { | |||||||
|  |  | ||||||
| .chart-wrapper { | .chart-wrapper { | ||||||
|     margin-bottom: 0.5em; |     margin-bottom: 0.5em; | ||||||
|  |  | ||||||
|  |     &.loading { | ||||||
|  |         filter: blur(10px); | ||||||
|  |     } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user