Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
feat: add Kubernetes and Servers pages
Browse files Browse the repository at this point in the history
Add Kubernetes and Servers pages and it's components, fix several bugs including bug with search

Signed-off-by: evgeniybryzh<evgeniy@merge.rocks>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
evgeniybryzh authored and smira committed Feb 3, 2022
1 parent 4451a5b commit 2b7831f
Show file tree
Hide file tree
Showing 48 changed files with 2,135 additions and 277 deletions.
4 changes: 1 addition & 3 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<template>
<div :class="{ dark: dark }" v-if="connected">
<t-modal />
<!-- <t-modal /> -->
<t-header />
<t-shell>
<template v-slot:menu>
Expand Down Expand Up @@ -49,7 +49,6 @@ import { useRouter } from "vue-router";
// import Shell from "./components/Shell.vue";
// import SidebarChangeContext from "./views/SidebarChangeContext.vue";
// import Sidebar from "./views/Sidebar.vue";
import TModal from "./components/TModal.vue";
// import TButton from "./components/TButton.vue";
// import TSpinner from "./components/TSpinner.vue";
import { context, changeContext, detectCapabilities } from "./context";
Expand All @@ -65,7 +64,6 @@ export default {
// Shell,
// SidebarChangeContext,
// Sidebar,
TModal,
// TButton,
// TSpinner,
THeader,
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/api/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default class Watch {
context,
kubernetes,
talos,
theila,
compareFn,
} = toRefs(props);

Expand All @@ -118,6 +119,7 @@ export default class Watch {
context,
kubernetes,
talos,
theila,
compareFn,
ctx.current,
], (val, oldVal) => {
Expand All @@ -139,7 +141,10 @@ export default class Watch {
source = Runtime.Kubernetes;
} else if(talos.value) {
source = Runtime.Talos;
} else {
} else if(theila.value) {
source = Runtime.Theila;
}
else {
throw new Error("unknown source specified");
}

Expand Down
25 changes: 17 additions & 8 deletions frontend/src/components/TChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,33 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<template>
<div class="flex flex-col">
<div v-if="title" class="w-full text-center">{{ title }}</div>
<div v-if="title" class="w-full text-center text-naturals-N13">
{{ title }}
</div>
<div class="flex-1">
<div v-if="err || loading" class="flex flex-row justify-center items-center w-full h-full">
<div v-if="err" class="flex justify-center items-center w-1/2 gap-4 text-talos-gray-500 text-sm">
<div
v-if="err || loading"
class="flex flex-row justify-center items-center w-full h-full"
>
<div
v-if="err"
class="flex justify-center items-center w-1/2 gap-4 text-talos-gray-500 text-sm"
>
<div class="flex-0">
<exclamation-icon class="w-6 h-6"/>
<exclamation-icon class="w-6 h-6" />
</div>
<div>{{ err }}</div>
</div>
<t-spinner v-else/>
<t-spinner v-else />
</div>
<apexchart v-else
<apexchart
v-else
width="100%"
height="100%"
:type="type"
:options="options"
:series="series"
/>
/>
</div>
</div>
</template>
Expand Down Expand Up @@ -213,7 +222,7 @@ export default {
}
},
},
xaxis:{
xaxis:{
type: "datetime",
labels: {
datetimeFormatter: {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/THeader/THeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<t-icon class="theHeader__icon" icon="header-logo" />
</router-link>
</div>
<nav class="theHeader__nav">
<!-- Todo -->
<!-- <nav class="theHeader__nav">
<router-link class="theHeader__dashboard-wrapper" to="/dashboard">
<t-button
class="theHeader__nav-name"
Expand All @@ -16,7 +17,7 @@
>Dashboard</t-button
>
</router-link>
</nav>
</nav> -->
</div>
<t-dropdown-notifications title="Ongoing Tasks" hasLoader>
<t-header-task-item
Expand All @@ -31,13 +32,12 @@
</template>

<script lang="ts">
import TButton from "@/components/common/Button/TButton.vue";
import TIcon from "@/components/common/Icon/TIcon.vue";
import THeaderTaskItem from "./THeaderTaskItem/THeaderTaskItem.vue";
import TDropdownNotifications from "@/components/common/Dropdown/TDropdownNotifications.vue";
export default {
components: { TIcon, TButton, THeaderTaskItem, TDropdownNotifications },
components: { TIcon, THeaderTaskItem, TDropdownNotifications },
setup() {
const tasksList = [
{
Expand Down
46 changes: 27 additions & 19 deletions frontend/src/components/TModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<template>
<div class="container-modal" v-if="view" @click.self="close">
<component :is="view" v-bind="props"/>
<div class="container-modal" v-if="view">
<component :is="view" v-bind="props" />
</div>
</template>

<script lang="ts">
import { watch, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { modals } from '../router';
import { modal } from '../modal';
import { watch, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { modals } from "../router";
import { modal } from "../modal";
export default {
setup() {
Expand All @@ -23,23 +23,27 @@ export default {
const props = ref({});
const updateState = () => {
if(modal.value) {
if (modal.value) {
view.value = modal.value.component;
props.value = modal.value.props || {};
return;
}
props.value = {};
view.value = route.query.modal ? modals[route.query.modal as string] : null;
}
view.value = route.query.modal
? modals[route.query.modal as string]
: null;
};
watch(() => route.query.modal, () => {
if(route.query.modal)
modal.value = null;
watch(
() => route.query.modal,
() => {
if (route.query.modal) modal.value = null;
updateState();
});
updateState();
}
);
// modals which do not need to be tied to the URI
watch(modal, () => {
Expand All @@ -53,18 +57,22 @@ export default {
props,
close() {
router.go(-1);
}
}
}
},
};
},
};
</script>

<style scoped>
.container-modal {
@apply fixed bg-talos-gray-200 dark:bg-black bg-opacity-50 dark:bg-opacity-50 w-screen h-screen flex items-center justify-center transition-all transition z-50;
@apply z-20 flex justify-center items-center;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
.container-modal > * {
@apply align-middle bg-white dark:bg-talos-gray-800 rounded-lg text-left shadow-xl transform;
@apply align-middle rounded-lg text-left;
}
</style>
1 change: 0 additions & 1 deletion frontend/src/components/common/ActionsBox/TActionsBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default {
setup() {
const isActionsDropdownOpened = ref(false);
const settingsButton = ref(null);
return {
isActionsDropdownOpened,
settingsButton,
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/common/Animation/TAnimation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ export default {
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition: all 0.3s linear;
transition: all 0.25s linear;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
.slide-fade-enter-active {
transition: all 0.3s ease-out;
transition: all 0.25s ease-out;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
transition: all 0.25s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter-from,
Expand Down
19 changes: 18 additions & 1 deletion frontend/src/components/common/Button/TButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
class="TButton"
:class="[
type,
isLightHover && 'lightHover',
fluid && 'fluid',
{
_left: icon && iconPosition === 'left',
_right: icon && iconPosition === 'right',
_middle: icon && iconPosition === 'middle',
},
]"
@click.self="() => $emit('click')"
>
<span class="TButton__text"><slot></slot></span>
<t-icon
Expand Down Expand Up @@ -61,6 +61,10 @@ export default {
},
default: "right",
},
isLightHover: {
type: Boolean,
default: false,
},
},
};
</script>
Expand Down Expand Up @@ -139,6 +143,19 @@ export default {
disabled:text-naturals-N6
disabled:cursor-not-allowed;
}
.TButton.subtle.lightHover {
@apply bg-transparent
p-0
border-none
text-naturals-N9
hover:text-naturals-N12
focus:text-naturals-N13
focus:underline
active:text-naturals-N13
active:no-underline
disabled:text-naturals-N6
disabled:cursor-not-allowed;
}
.TButton__text {
order: 0;
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/common/Icon/TIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ export default {
[getName("question")]: defineAsyncComponent(() =>
import("../../icons/IconQuestion.vue")
),
[getName("upgrade-empty-state")]: defineAsyncComponent(() =>
import("../../icons/IconUpgradeEmptyState.vue")
),
},
computed: {
getIcon() {
Expand Down
Loading

0 comments on commit 2b7831f

Please sign in to comment.