webconsole/src/components/app-home/app-home.tsx

40 lines
958 B
TypeScript
Raw Normal View History

2022-01-18 11:47:11 +00:00
import { Component, h} from '@stencil/core';
import { Api } from '../api';
2022-01-18 06:14:48 +00:00
@Component({
tag: 'app-home',
styleUrl: 'app-home.css',
shadow: true,
})
export class AppHome {
2022-01-18 11:47:11 +00:00
constructor() {
2022-01-21 00:55:16 +00:00
this.start();
2022-01-18 11:47:11 +00:00
}
async start() {
2022-01-21 09:16:03 +00:00
await Api.login('test', 'test');
2022-01-21 00:55:16 +00:00
let data = await Api.get("/users/me");
console.log(data);
2022-01-21 09:16:03 +00:00
data = await Api.post("/server/dummy/start");
console.log(data);
data = await Api.post("/server/dummy/stop");
console.log(data);
2022-01-18 11:47:11 +00:00
}
2022-01-21 00:55:16 +00:00
2022-01-18 06:14:48 +00:00
render() {
return (
<div class="app-home">
<p>
Welcome to the Stencil App Starter. You can use this starter to build entire apps all with web components using Stencil! Check out our docs on{' '}
<a href="https://stenciljs.com">stenciljs.com</a> to get started.
</p>
<stencil-route-link url="/profile/stencil">
<button>Profile page</button>
</stencil-route-link>
</div>
);
}
}