summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/debug.vue
blob: 9c0761f0b1c4f27048ac3fa7d081f22c7a62b2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<PageWithHeader>
	<div class="_spacer" style="--MI_SPACER-w: 600px;">
		<div class="_gaps_m">
			<MkResult v-if="resultType === 'empty'" type="empty"/>
			<MkResult v-if="resultType === 'notFound'" type="notFound"/>
			<MkResult v-if="resultType === 'error'" type="error"/>
			<MkSelect
				v-model="resultType" :items="resultTypeDef"
			></MkSelect>

			<MkSystemIcon v-if="iconType === 'info'" type="info" style="width: 150px;"/>
			<MkSystemIcon v-if="iconType === 'question'" type="question" style="width: 150px;"/>
			<MkSystemIcon v-if="iconType === 'success'" type="success" style="width: 150px;"/>
			<MkSystemIcon v-if="iconType === 'warn'" type="warn" style="width: 150px;"/>
			<MkSystemIcon v-if="iconType === 'error'" type="error" style="width: 150px;"/>
			<MkSystemIcon v-if="iconType === 'waiting'" type="waiting" style="width: 150px;"/>
			<MkSelect
				v-model="iconType" :items="iconTypeDef"
			></MkSelect>

			<div class="_buttons">
				<MkButton @click="os.alert({ type: 'error', title: 'Error', text: 'error' })">Error</MkButton>
				<MkButton @click="os.alert({ type: 'warning', title: 'Warning', text: 'warning' })">Warning</MkButton>
				<MkButton @click="os.alert({ type: 'info', title: 'Info', text: 'info' })">Info</MkButton>
				<MkButton @click="os.alert({ type: 'success', title: 'Success', text: 'success' })">Success</MkButton>
				<MkButton @click="os.alert({ type: 'question', title: 'Question', text: 'question' })">Question</MkButton>
			</div>
		</div>
	</div>
</PageWithHeader>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js';
import { definePage } from '@/page.js';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkLink from '@/components/MkLink.vue';
import MkSelect from '@/components/MkSelect.vue';
import MkButton from '@/components/MkButton.vue';
import { useMkSelect } from '@/composables/use-mkselect.js';
import * as os from '@/os.js';

const {
	model: resultType,
	def: resultTypeDef,
} = useMkSelect({
	items: [
		{ label: 'empty', value: 'empty' },
		{ label: 'notFound', value: 'notFound' },
		{ label: 'error', value: 'error' },
	],
	initialValue: 'empty',
});
const {
	model: iconType,
	def: iconTypeDef,
} = useMkSelect({
	items: [
		{ label: 'info', value: 'info' },
		{ label: 'question', value: 'question' },
		{ label: 'success', value: 'success' },
		{ label: 'warn', value: 'warn' },
		{ label: 'error', value: 'error' },
		{ label: 'waiting', value: 'waiting' },
	],
	initialValue: 'info',
});

definePage(() => ({
	title: 'DEBUG ROOM',
	icon: 'ti ti-help-circle',
}));
</script>