aboutsummaryrefslogtreecommitdiff
path: root/kamon-status/src
diff options
context:
space:
mode:
Diffstat (limited to 'kamon-status/src')
-rw-r--r--kamon-status/src/App.vue29
-rw-r--r--kamon-status/src/api/StatusApi.ts41
-rw-r--r--kamon-status/src/assets/logo.pngbin0 -> 6849 bytes
-rw-r--r--kamon-status/src/components/HelloWorld.vue65
-rw-r--r--kamon-status/src/main.ts10
-rw-r--r--kamon-status/src/router.ts23
-rw-r--r--kamon-status/src/shims-tsx.d.ts13
-rw-r--r--kamon-status/src/shims-vue.d.ts4
-rw-r--r--kamon-status/src/views/About.vue5
-rw-r--r--kamon-status/src/views/Home.vue18
10 files changed, 208 insertions, 0 deletions
diff --git a/kamon-status/src/App.vue b/kamon-status/src/App.vue
new file mode 100644
index 00000000..f300d4b4
--- /dev/null
+++ b/kamon-status/src/App.vue
@@ -0,0 +1,29 @@
+<template>
+ <div id="app">
+ <div id="nav">
+ <router-link to="/">Home</router-link> |
+ <router-link to="/about">About</router-link>
+ </div>
+ <router-view/>
+ </div>
+</template>
+
+<style lang="scss">
+#app {
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-align: center;
+ color: #2c3e50;
+}
+#nav {
+ padding: 30px;
+ a {
+ font-weight: bold;
+ color: #2c3e50;
+ &.router-link-exact-active {
+ color: #42b983;
+ }
+ }
+}
+</style>
diff --git a/kamon-status/src/api/StatusApi.ts b/kamon-status/src/api/StatusApi.ts
new file mode 100644
index 00000000..540c1c53
--- /dev/null
+++ b/kamon-status/src/api/StatusApi.ts
@@ -0,0 +1,41 @@
+import axios, { AxiosResponse } from 'axios'
+
+export interface Environment {
+ service: string
+ host: string
+ instance: string
+ tags: { [key: string]: string }
+}
+
+export interface BaseInfo {
+ version: string
+ environment: Environment
+ config: any
+}
+
+export interface Module {
+ name: string
+ description: string
+ enabled: boolean
+ started: boolean
+}
+
+export interface ModuleRegistryStatus {
+ modules: Array<Module>
+}
+
+
+export class StatusApi {
+
+ public baseInfo(): Promise<BaseInfo> {
+ return axios.get("/status/base-info").then(response => {
+ return response.data as BaseInfo
+ })
+ }
+
+ public moduleRegistryStatus(): Promise<ModuleRegistryStatus> {
+ return axios.get("/status/modules").then(response => {
+ return response.data as ModuleRegistryStatus
+ })
+ }
+} \ No newline at end of file
diff --git a/kamon-status/src/assets/logo.png b/kamon-status/src/assets/logo.png
new file mode 100644
index 00000000..f3d2503f
--- /dev/null
+++ b/kamon-status/src/assets/logo.png
Binary files differ
diff --git a/kamon-status/src/components/HelloWorld.vue b/kamon-status/src/components/HelloWorld.vue
new file mode 100644
index 00000000..d9e77ef3
--- /dev/null
+++ b/kamon-status/src/components/HelloWorld.vue
@@ -0,0 +1,65 @@
+<template>
+ <div class="hello">
+ <h1>{{ msg }}</h1>
+ <p>
+ For a guide and recipes on how to configure / customize this project,<br>
+ check out the
+ <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
+ </p>
+ <h3>Installed CLI Plugins</h3>
+ <ul>
+ <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target="_blank" rel="noopener">typescript</a></li>
+ </ul>
+ <h3>Essential Links</h3>
+ <ul>
+ <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
+ <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
+ <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
+ <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
+ <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
+ </ul>
+ <h3>Ecosystem</h3>
+ <ul>
+ <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
+ <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
+ <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
+ <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
+ <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
+ </ul>
+ </div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue } from 'vue-property-decorator'
+import axios from 'axios'
+
+@Component
+export default class HelloWorld extends Vue {
+ @Prop() private msg!: string;
+
+ private mounted() {
+ console.log("I'm mounting the thing")
+ axios.get("/status/base-config").then(result => {
+ console.log("GOT A RESULT", result.data)
+ })
+ }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped lang="scss">
+h3 {
+ margin: 40px 0 0;
+}
+ul {
+ list-style-type: none;
+ padding: 0;
+}
+li {
+ display: inline-block;
+ margin: 0 10px;
+}
+a {
+ color: #42b983;
+}
+</style>
diff --git a/kamon-status/src/main.ts b/kamon-status/src/main.ts
new file mode 100644
index 00000000..afd50249
--- /dev/null
+++ b/kamon-status/src/main.ts
@@ -0,0 +1,10 @@
+import Vue from 'vue';
+import App from './App.vue';
+import router from './router';
+
+Vue.config.productionTip = false;
+
+new Vue({
+ router,
+ render: (h) => h(App),
+}).$mount('#app');
diff --git a/kamon-status/src/router.ts b/kamon-status/src/router.ts
new file mode 100644
index 00000000..e540d9a4
--- /dev/null
+++ b/kamon-status/src/router.ts
@@ -0,0 +1,23 @@
+import Vue from 'vue';
+import Router from 'vue-router';
+import Home from './views/Home.vue';
+
+Vue.use(Router);
+
+export default new Router({
+ routes: [
+ {
+ path: '/',
+ name: 'home',
+ component: Home,
+ },
+ {
+ path: '/about',
+ name: 'about',
+ // route level code-splitting
+ // this generates a separate chunk (about.[hash].js) for this route
+ // which is lazy-loaded when the route is visited.
+ component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
+ },
+ ],
+});
diff --git a/kamon-status/src/shims-tsx.d.ts b/kamon-status/src/shims-tsx.d.ts
new file mode 100644
index 00000000..3b88b582
--- /dev/null
+++ b/kamon-status/src/shims-tsx.d.ts
@@ -0,0 +1,13 @@
+import Vue, { VNode } from 'vue';
+
+declare global {
+ namespace JSX {
+ // tslint:disable no-empty-interface
+ interface Element extends VNode {}
+ // tslint:disable no-empty-interface
+ interface ElementClass extends Vue {}
+ interface IntrinsicElements {
+ [elem: string]: any;
+ }
+ }
+}
diff --git a/kamon-status/src/shims-vue.d.ts b/kamon-status/src/shims-vue.d.ts
new file mode 100644
index 00000000..8f6f4102
--- /dev/null
+++ b/kamon-status/src/shims-vue.d.ts
@@ -0,0 +1,4 @@
+declare module '*.vue' {
+ import Vue from 'vue';
+ export default Vue;
+}
diff --git a/kamon-status/src/views/About.vue b/kamon-status/src/views/About.vue
new file mode 100644
index 00000000..3fa28070
--- /dev/null
+++ b/kamon-status/src/views/About.vue
@@ -0,0 +1,5 @@
+<template>
+ <div class="about">
+ <h1>This is an about page</h1>
+ </div>
+</template>
diff --git a/kamon-status/src/views/Home.vue b/kamon-status/src/views/Home.vue
new file mode 100644
index 00000000..2187e5c9
--- /dev/null
+++ b/kamon-status/src/views/Home.vue
@@ -0,0 +1,18 @@
+<template>
+ <div class="home">
+ <img alt="Vue logo" src="../assets/logo.png">
+ <HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
+ </div>
+</template>
+
+<script lang="ts">
+import { Component, Vue } from 'vue-property-decorator';
+import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
+
+@Component({
+ components: {
+ HelloWorld,
+ },
+})
+export default class Home extends Vue {}
+</script>