<html>
<head>
	<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
	<script src="https://uikit.miotp.ru/cdn/miotuikit/130124a/miotuikit_min.js?content_type=text/javascript"></script>
	<link rel="stylesheet" href="https://uikit.miotp.ru/cdn/miotuikit/130124a/miotuikit_min.css?content_type=text/css">
	<link rel="stylesheet" href="https://uikit.miotp.ru/cdn/miotuikit/130124a/colors_min.css?content_type=text/css">
	<link rel="stylesheet" href="styles.css">

	<title>Slinn</title>

</head>
<body>
	<script>
		header = new UiHeaderContainer('header', document.querySelector('body'))
		new UiLabel('slinn', header.elem, 'Slinn — Miot Project')
		new UiHorizontalFlexSpacer('spacer1', header.elem)
		new UiLinkLabel('pypi', header.elem, 'Slinn on PyPI', 'https://pypi.org/project/slinn/', 'violet')
		new UiLinkLabel('homepage', header.elem, 'Slinn`s homepage', 'https://slinn.miotp.ru/', 'violet')
		new UiLinkLabel('homepage', header.elem, 'Miot Project', 'https://miotp.ru/', 'violet')
		body = new UiCenterContainer('body', document.querySelector('body'))
		new UiLabel('title', body.elem, 'Your Slinn server started successfully!')
		new UiLabel('subtitle', body.elem, 'Congratulations! 🎉')
		text = new UiText('text', body.elem, '')
		new UiText('text1', text.elem, 'You are seeing this page because')
		new UiMonoText('debugtruechip', text.elem, '{"debug": true}', 'violet')
		new UiText('text2', text.elem, 'is in your')
		new UiMonoText('projectjson', text.elem, 'project.json', 'violet')
		new UiText('text3', text.elem, 'file and you no have configured any dispatchers or routes')
		footer = new UiCenterContainer('footer', document.querySelector('body'))

		new UiText('footertext1', footer.elem, 'Your version: {% version %}')
		fetch('https://slinn.miotp.ru/check')
			.then(response => response.text())
			.then((result) => {
				console.log(result)
				latest = result.split('\n')[0].split(': ')[1]
				nightly = result.split('\n')[1].split(': ')[1]
				new UiText('footertext2', footer.elem, 'Latest stable version: '+latest+', latest nightly version: '+nightly)
			})
	</script>
</body>
</html>