chore: type fixes on dashboard

This commit is contained in:
Ben Allfree 2023-10-18 00:39:19 -07:00
parent 3a3b13504d
commit 4d9463194c
2 changed files with 16 additions and 16 deletions

View File

@ -1,20 +1,20 @@
<script lang="ts"> <script lang="ts">
import { format, subMonths } from 'date-fns'
import { Line } from 'svelte-chartjs' import { Line } from 'svelte-chartjs'
import { subMonths, format } from 'date-fns'
import { instance } from './store' import { instance } from './store'
import Card from '$components/cards/Card.svelte'
import CardHeader from '$components/cards/CardHeader.svelte'
import { import {
CategoryScale,
Chart as ChartJS, Chart as ChartJS,
Title,
Tooltip,
Legend, Legend,
LineElement, LineElement,
LinearScale, LinearScale,
PointElement, PointElement,
CategoryScale, Title,
Tooltip,
} from 'chart.js' } from 'chart.js'
import Card from '$components/cards/Card.svelte'
import CardHeader from '$components/cards/CardHeader.svelte'
ChartJS.register( ChartJS.register(
Title, Title,
@ -41,7 +41,7 @@
} }
// Set the default data object for the chart // Set the default data object for the chart
let data = {} let data: any = {}
// This will watch for changes in the `secondsThisMonth` variable and update the chart data // This will watch for changes in the `secondsThisMonth` variable and update the chart data
$: { $: {
@ -73,7 +73,7 @@
} }
} }
let options = { const options: any = {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
scales: { scales: {

View File

@ -1,17 +1,17 @@
<script lang="ts"> <script lang="ts">
import { Line } from 'svelte-chartjs'
import { subMonths, format } from 'date-fns'
import { globalInstancesStore } from '$util/stores' import { globalInstancesStore } from '$util/stores'
import { format, subMonths } from 'date-fns'
import { Line } from 'svelte-chartjs'
import { import {
CategoryScale,
Chart as ChartJS, Chart as ChartJS,
Title,
Tooltip,
Legend, Legend,
LineElement, LineElement,
LinearScale, LinearScale,
PointElement, PointElement,
CategoryScale, Title,
Tooltip,
} from 'chart.js' } from 'chart.js'
ChartJS.register( ChartJS.register(
@ -109,7 +109,7 @@
) )
// Add up the individual instance usages and the total usage // Add up the individual instance usages and the total usage
const allChartData = [ const allChartData: any = [
...individualInstanceUsageData, ...individualInstanceUsageData,
{ {
label: 'All Instances', label: 'All Instances',
@ -142,12 +142,12 @@
] ]
// Set the default data object for the chart // Set the default data object for the chart
let data = { const data: any = {
labels: getLastSixMonths(), labels: getLastSixMonths(),
datasets: allChartData, datasets: allChartData,
} }
let options = { const options: any = {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
scales: { scales: {