feat: add Node.js version warning, fix provider URL detection, and add v0.4.4 changelog (#146)
- Display persistent warning bar when Node.js version < 23 - Fix provider model fetching to support non-v1 API versions (e.g. /v4) - Add v0.4.4 changelog entries to frontend - Bump version to 0.4.4 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { onMounted, onUnmounted, computed, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { darkTheme, NConfigProvider, NMessageProvider, NDialogProvider, NNotificationProvider } from 'naive-ui'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { getThemeOverrides } from '@/styles/theme'
|
||||
import { useTheme } from '@/composables/useTheme'
|
||||
import AppSidebar from '@/components/layout/AppSidebar.vue'
|
||||
@@ -10,6 +11,7 @@ import { useAppStore } from '@/stores/hermes/app'
|
||||
import SessionSearchModal from '@/components/hermes/chat/SessionSearchModal.vue'
|
||||
|
||||
const { isDark } = useTheme()
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -20,6 +22,12 @@ const naiveTheme = computed(() => isDark.value ? darkTheme : null)
|
||||
|
||||
const isLoginPage = computed(() => route.name === 'login')
|
||||
|
||||
const nodeVersionLow = computed(() => {
|
||||
const v = appStore.nodeVersion
|
||||
const major = parseInt(v.split('.')[0], 10)
|
||||
return !isNaN(major) && major < 23
|
||||
})
|
||||
|
||||
// Close mobile sidebar on route change
|
||||
watch(() => route.path, () => {
|
||||
appStore.closeSidebar()
|
||||
@@ -49,6 +57,9 @@ useKeyboard()
|
||||
<NMessageProvider>
|
||||
<NDialogProvider>
|
||||
<NNotificationProvider>
|
||||
<div v-if="nodeVersionLow && ready" class="node-warning-bar">
|
||||
{{ t('sidebar.nodeVersionWarning', { version: appStore.nodeVersion }) }}
|
||||
</div>
|
||||
<div v-if="ready" class="app-layout" :class="{ 'no-sidebar': isLoginPage }">
|
||||
<button v-if="!isLoginPage" class="hamburger-btn" @click="appStore.toggleSidebar">
|
||||
<img src="/logo.png" alt="Menu" style="width: 24px; height: 24px;" />
|
||||
@@ -89,4 +100,20 @@ useKeyboard()
|
||||
height: calc(100 * var(--vh));
|
||||
}
|
||||
}
|
||||
|
||||
.node-warning-bar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
padding: 4px 16px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #b45309;
|
||||
background-color: #fef3c7;
|
||||
border-bottom: 1px solid #fde68a;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user