refactor(frontend): Reactivityで型を明示するように (#12791)

* refactor(frontend): Reactivityで型を明示するように

* fix: プロパティの参照が誤っているのを修正

* fix: 初期化の値を空配列に書き換えていた部分をnullに置き換え
This commit is contained in:
zyoshoka 2023-12-26 14:19:35 +09:00 committed by Marie
parent f9c7b44ef8
commit 8daff4a998
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
109 changed files with 363 additions and 342 deletions

View file

@ -76,11 +76,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, onBeforeUnmount, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { v4 as uuid } from 'uuid';
const props = defineProps<{
connection: any,
meta: any
meta: Misskey.entities.ServerInfoResponse
}>();
const viewBoxX = ref<number>(50);
@ -94,10 +95,10 @@ const cpuPolylinePoints = ref<string>('');
const memPolylinePoints = ref<string>('');
const cpuPolygonPoints = ref<string>('');
const memPolygonPoints = ref<string>('');
const cpuHeadX = ref<any>(null);
const cpuHeadY = ref<any>(null);
const memHeadX = ref<any>(null);
const memHeadY = ref<any>(null);
const cpuHeadX = ref<number>();
const cpuHeadY = ref<number>();
const memHeadX = ref<number>();
const memHeadY = ref<number>();
const cpuP = ref<string>('');
const memP = ref<string>('');

View file

@ -16,11 +16,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, onBeforeUnmount, ref } from 'vue';
import * as Misskey from 'misskey-js';
import XPie from './pie.vue';
const props = defineProps<{
connection: any,
meta: any
meta: Misskey.entities.ServerInfoResponse
}>();
const usage = ref<number>(0);

View file

@ -17,11 +17,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed } from 'vue';
import * as Misskey from 'misskey-js';
import XPie from './pie.vue';
import bytes from '@/filters/bytes.js';
const props = defineProps<{
meta: any; // TODO
meta: Misskey.entities.ServerInfoResponse;
}>();
const usage = computed(() => props.meta.fs.used / props.meta.fs.total);

View file

@ -21,6 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onUnmounted, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { useWidgetPropsManager, Widget, WidgetComponentExpose } from '../widget.js';
import XCpuMemory from './cpu-mem.vue';
import XNet from './net.vue';
@ -65,7 +66,7 @@ const { widgetProps, configure, save } = useWidgetPropsManager(name,
emit,
);
const meta = ref(null);
const meta = ref<Misskey.entities.ServerInfoResponse | null>(null);
os.apiGet('server-info', {}).then(res => {
meta.value = res;

View file

@ -17,12 +17,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, onBeforeUnmount, ref } from 'vue';
import * as Misskey from 'misskey-js';
import XPie from './pie.vue';
import bytes from '@/filters/bytes.js';
const props = defineProps<{
connection: any,
meta: any
meta: Misskey.entities.ServerInfoResponse
}>();
const usage = ref<number>(0);

View file

@ -50,11 +50,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, onBeforeUnmount, ref } from 'vue';
import * as Misskey from 'misskey-js';
import bytes from '@/filters/bytes.js';
const props = defineProps<{
connection: any,
meta: any
meta: Misskey.entities.ServerInfoResponse
}>();
const viewBoxX = ref<number>(50);
@ -64,10 +65,10 @@ const inPolylinePoints = ref<string>('');
const outPolylinePoints = ref<string>('');
const inPolygonPoints = ref<string>('');
const outPolygonPoints = ref<string>('');
const inHeadX = ref<any>(null);
const inHeadY = ref<any>(null);
const outHeadX = ref<any>(null);
const outHeadY = ref<any>(null);
const inHeadX = ref<number>();
const inHeadY = ref<number>();
const outHeadX = ref<number>();
const outHeadY = ref<number>();
const inRecent = ref<number>(0);
const outRecent = ref<number>(0);