Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add versions to the left sidebar bottom #11561

Merged
merged 7 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Add versions to the left sidebar bottom

We have added the versions to the left sidebar bottom to make it easier for users to find the versions of the server and web UI.

https://github.com/owncloud/web/pull/11561
https://github.com/owncloud/enterprise/issues/6814
24 changes: 22 additions & 2 deletions packages/web-runtime/src/components/SidebarNav/SidebarNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@
</oc-list>
</nav>
<!-- @slot bottom content of the sidebar -->
<slot name="bottom" />
<slot name="bottom">
<div v-if="!closed" class="versions oc-pb-s oc-pl-s oc-text-small oc-text-muted">
<span v-text="backendVersion" />
<span v-text="webVersion" />
</div>
</slot>
</div>
</template>

<script lang="ts">
import {
computed,
defineComponent,
nextTick,
onBeforeUnmount,
Expand All @@ -62,6 +68,8 @@ import {
import * as uuid from 'uuid'
import SidebarNavItem from './SidebarNavItem.vue'
import { NavItem } from '../../helpers/navItems'
import { getBackendVersion, getWebVersion } from '../../container/versions'
import { useCapabilityStore } from '@ownclouders/web-pkg'

type NavItemRef = InstanceType<typeof SidebarNavItem>

Expand All @@ -81,6 +89,10 @@ export default defineComponent({
let resizeObserver: ResizeObserver
const navItemRefs = ref<Record<string, NavItemRef>>({})
const highlighterAttrs = ref<Record<string, unknown>>({})
const capabilityStore = useCapabilityStore()

const webVersion = computed(() => getWebVersion())
const backendVersion = computed(() => getBackendVersion({ capabilityStore }))

onMounted(() => {
const navBar = document.getElementById('web-nav-sidebar')
Expand Down Expand Up @@ -128,7 +140,7 @@ export default defineComponent({
{ deep: true, immediate: true }
)

return { highlighterAttrs, navItemRefs }
return { highlighterAttrs, navItemRefs, backendVersion, webVersion }
},
computed: {
toggleSidebarButtonClass() {
Expand Down Expand Up @@ -187,6 +199,14 @@ export default defineComponent({
justify-content: flex-end !important;
}

.versions {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
flex-grow: 1;
}

.oc-sidebar-nav li a:not(.active),
.oc-sidebar-nav li button:not(.active) {
&:hover,
Expand Down