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">
import { format, subMonths } from 'date-fns'
import { Line } from 'svelte-chartjs'
import { subMonths, format } from 'date-fns'
import { instance } from './store'
import Card from '$components/cards/Card.svelte'
import CardHeader from '$components/cards/CardHeader.svelte'
import {
CategoryScale,
Chart as ChartJS,
Title,
Tooltip,
Legend,
LineElement,
LinearScale,
PointElement,
CategoryScale,
Title,
Tooltip,
} from 'chart.js'
import Card from '$components/cards/Card.svelte'
import CardHeader from '$components/cards/CardHeader.svelte'
ChartJS.register(
Title,
@ -41,7 +41,7 @@
}
// 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
$: {
@ -73,7 +73,7 @@
}
}
let options = {
const options: any = {
responsive: true,
maintainAspectRatio: false,
scales: {

View File

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