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

Commit

Permalink
feat: add Pods, Dashboard, Upgrade views, etc
Browse files Browse the repository at this point in the history
Add few views and components

Signed-off-by: evgeniybryzh<evgeniy@merge.rocks>
Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
  • Loading branch information
Unix4ever committed Dec 17, 2021
1 parent c549b8b commit 0b51727
Show file tree
Hide file tree
Showing 51 changed files with 2,496 additions and 284 deletions.
19 changes: 19 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"vue-class-component": "^8.0.0-0",
"vue-property-decorator": "^v10.0.0-rc.3",
"vue-router": "^4.0.6",
"vue3-apexcharts": "^1.4.0"
"vue3-apexcharts": "^1.4.0",
"vue3-popper": "^1.4.1"
},
"devDependencies": {
"@tailwindcss/postcss7-compat": "^2.0.2",
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
</template>
</t-shell>
<!-- Old Views Below -->
<shell class="h-screen">
<!-- <shell class="h-screen">
<template v-slot:menu>
<sidebar-change-context
v-if="selectContext"
Expand All @@ -39,19 +39,19 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
<template v-slot:content>
<router-view class="w-full h-full" />
</template>
</shell>
</shell> -->
</div>
</template>

<script lang="ts">
import { ref, onMounted, watch } from "vue";
import { useRouter } from "vue-router";
import Shell from "./components/Shell.vue";
import SidebarChangeContext from "./views/SidebarChangeContext.vue";
import Sidebar from "./views/Sidebar.vue";
// 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 TButton from "./components/TButton.vue";
// import TSpinner from "./components/TSpinner.vue";
import { context, changeContext, detectCapabilities } from "./context";
import { theme, systemTheme, isDark } from "./theme";
import { ContextService } from "./api/grpc";
Expand All @@ -62,12 +62,12 @@ import TShell from "./components/common/Shell/TShell.vue";
export default {
components: {
Shell,
SidebarChangeContext,
Sidebar,
// Shell,
// SidebarChangeContext,
// Sidebar,
TModal,
TButton,
TSpinner,
// TButton,
// TSpinner,
THeader,
TSideBar,
TShell,
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 @@ -18,26 +18,26 @@
</router-link>
</nav>
</div>
<t-dropdown title="Ongoing Tasks" hasLoader>
<t-dropdown-notifications title="Ongoing Tasks" hasLoader>
<t-header-task-item
v-for="(task, index) in tasksList"
:title="task.title"
:time="task.time"
:description="task.description"
:key="index"
/>
</t-dropdown>
</t-dropdown-notifications>
</header>
</template>

<script lang="ts">
import TButton from "@/components/common/Button/TButton.vue";
import TDropdown from "@/components/common/Dropdown/TDropdown.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, TDropdown, TButton, THeaderTaskItem },
components: { TIcon, TButton, THeaderTaskItem, TDropdownNotifications },
setup() {
const tasksList = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default {
.item {
@apply border-b border-naturals-N4 p-6;
width: 361px;
}
.item__heading {
@apply flex justify-between mb-2;
Expand Down
55 changes: 55 additions & 0 deletions frontend/src/components/common/ActionsBox/TActionsBox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div
v-click-outside="() => (isActionsDropdownOpened = false)"
class="box__actions"
ref="settingsButton"
>
<Popper offsetDistance="10" placement="left-start" zIndex="10">
<template #content>
<slot />
</template>
<button>
<t-icon
@click="() => (isActionsDropdownOpened = !isActionsDropdownOpened)"
class="box__actions-icon"
icon="action-horizontal"
:class="{ highlighted: isActionsDropdownOpened }"
/>
</button>
</Popper>
</div>
</template>

<script lang="ts">
import { ref } from "@vue/reactivity";
import TIcon from "@/components/common/Icon/TIcon.vue";
import vClickOutside from "click-outside-vue3";
import Popper from "vue3-popper";
export default {
components: { Popper, TIcon },
directives: {
clickOutside: vClickOutside.directive,
},
setup() {
const isActionsDropdownOpened = ref(false);
const settingsButton = ref(null);
return {
isActionsDropdownOpened,
settingsButton,
};
},
};
</script>

<style scoped>
.box__actions-icon {
@apply fill-current text-naturals-N11 hover:bg-naturals-N7 transition-all rounded duration-100 cursor-pointer;
width: 24px;
height: 24px;
}
.highlighted {
@apply bg-naturals-N7;
}
</style>
4 changes: 2 additions & 2 deletions frontend/src/components/common/Animation/TAnimation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<transition :name="name">
<slot class="slot"/>
<slot class="slot" />
</transition>
</template>

Expand All @@ -18,7 +18,7 @@ export default {
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition: all 0.2s linear;
transition: all 0.3s linear;
}
.fade-enter-from,
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/components/common/Animation/TGroupAnimation.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<transition-group>
<slot />
</transition-group>
</template>

<style>
.v-item {
opacity: 1;
}
.v-enter-active,
.v-leave-active {
transition: all 0.1s linear;
}
.v-enter-from,
.v-leave-to {
opacity: 0;
}
</style>
19 changes: 17 additions & 2 deletions frontend/src/components/common/Button/TButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
{
_left: icon && iconPosition === 'left',
_right: icon && iconPosition === 'right',
_middle: icon && iconPosition === 'middle',
},
]"
@click.self="() => $emit('click')"
Expand All @@ -23,7 +24,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
:icon="icon"
v-if="icon"
class="TButton__icon"
:class="{ _left: icon && iconPosition === 'left' }"
:class="{
_left: icon && iconPosition === 'left',
_right: icon && iconPosition === 'right',
_middle: icon && iconPosition === 'middle',
}"
/>
</button>
</template>
Expand Down Expand Up @@ -52,7 +57,7 @@ export default {
},
iconPosition: {
validator(value: string) {
return ["left", "right"].indexOf(value) !== -1;
return ["left", "middle", "right"].indexOf(value) !== -1;
},
default: "right",
},
Expand All @@ -78,6 +83,13 @@ export default {
.TButton._right {
padding-right: 14px;
}
.TButton._middle {
padding-right: 9px;
padding-left: 9px;
}
.TButton._middle:hover .TButton__icon._middle {
@apply text-naturals-N14;
}
.TButton.primary {
@apply text-naturals-N12
border-naturals-N5
Expand Down Expand Up @@ -143,6 +155,9 @@ export default {
margin-left: 0;
margin-right: 6px;
}
.TButton__icon._middle {
margin: 0;
}
.fluid {
@apply w-full max-w-full;
}
Expand Down
42 changes: 42 additions & 0 deletions frontend/src/components/common/Checkbox/TCheckbox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div class="checkbox" :class="{ checked: checked }">
<t-animation>
<t-icon class="checkbox__icon" icon="check" v-show="checked" />
</t-animation>
<input type="checkbox" hidden :value="checked" />
</div>
</template>

<script lang="ts">
import TIcon from "@/components/common/Icon/TIcon.vue";
import TAnimation from "@/components/common/Animation/TAnimation.vue";
export default {
components: {
TIcon,
TAnimation,
},
props: {
checked: {
type: Boolean,
default: false,
},
},
};
</script>

<style scoped>
.checkbox {
@apply border border-naturals-N7 flex items-center justify-center cursor-pointer;
width: 14px;
height: 14px;
border-radius: 2px;
}
.checked {
@apply border-primary-P6 bg-primary-P6;
}
.checkbox__icon {
@apply fill-current text-primary-P3;
width: 14px;
height: 14px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
icon="arrow-down"
/>
</div>
<the-animation>
<t-animation>
<div v-show="isDropdownOpen" class="dropdown__list">
<slot />
</div>
</the-animation>
</t-animation>
</div>
</template>

<script lang="ts">
import { ref } from "@vue/reactivity";
import TIcon from "../Icon/TIcon.vue";
import IconHeaderDropdownLoading from "../../icons/IconHeaderDropdownLoading.vue";
import TheAnimation from "../Animation/TAnimation.vue";
import TAnimation from "../Animation/TAnimation.vue";
import vClickOutside from "click-outside-vue3";
export default {
components: {
TIcon,
IconHeaderDropdownLoading,
TheAnimation,
TAnimation,
},
directives: {
clickOutside: vClickOutside.directive,
Expand Down Expand Up @@ -87,7 +87,7 @@ export default {
@apply text-naturals-N13 text-xs font-normal mr-2;
}
.dropdown__list {
@apply absolute -right-2 top-6 bg-naturals-N2 border border-naturals-N4 rounded z-10;
@apply absolute -right-2 top-6 bg-naturals-N2 border border-naturals-N4 rounded z-30;
}
@keyframes loadingDots {
Expand Down
Loading

0 comments on commit 0b51727

Please sign in to comment.