Skip to content
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
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3245,6 +3245,8 @@ const message = {
baseDirHelper:
'When the installation directory is empty, it will be installed in the /opt directory by default',
nodePort: 'Node Port',
offline: 'Offline mode',
offlineHelper: 'Used when the node is in an offline environment',
},
customApp: {
name: 'Custom App Repository',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No significant issues were detected in the provided JavaScript code snippet you shared. However, there's one addition worth noting:

  1. New Keys:
  •        offline: 'Offline mode',
    
  •        offlineHelper: 'Used when the node is in an offline environment',
    
    These keys add new translations for "offline" modes and their respective helper text to support offline environments.
    
    
  1. Consistency Check:
    Ensure that all translations adhere to OpenAI's guidelines for consistency, such as using proper capitalization, accurate spellings, and consistent formatting.

Overall, the code remains clean and functional with no apparent errors. If further improvements or optimizations are needed beyond these additions, additional context or requirements would be necessary.

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3100,6 +3100,8 @@ const message = {
baseDir: 'インストールディレクトリ',
baseDirHelper: 'インストールディレクトリが空の場合、デフォルトで/optディレクトリにインストールされます',
nodePort: 'ノードポート',
offline: 'オフラインモード',
offlineHelper: 'ノードがオフライン環境にある場合に使用',
},
customApp: {
name: 'カスタムアプリリポジトリ',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The given code difference looks mostly correct but might benefit from some minor adjustments:

  • Line 3103: The comment "baseDirHelper" does not need an extra space after the colon.

Optimization Suggestion (optional):
Consider using a more concise naming convention for offline and offlineHelper to maintain consistency with other helper text entries.

Overall, the changes seem well-intentioned and aligns with typical locale-specific translations. If further customization is needed, feel free to share additional details!

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3048,6 +3048,8 @@ const message = {
baseDir: '설치 디렉토리',
baseDirHelper: '설치 디렉토리가 비어 있으면 기본적으로 /opt 디렉토리에 설치됩니다',
nodePort: '노드 포트',
offline: '오프라인 모드',
offlineHelper: '노드가 오프라인 환경일 때 사용',
},
customApp: {
name: '사용자 정의 앱 저장소',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3171,6 +3171,8 @@ const message = {
baseDir: 'Direktori Pemasangan',
baseDirHelper: 'Apabila direktori pemasangan kosong, secara lalai akan dipasang di direktori /opt',
nodePort: 'Port Nod',
offline: 'Mod luar talian',
offlineHelper: 'Digunakan apabila nod berada dalam persekitaran luar talian',
},
customApp: {
name: 'Repositori Aplikasi Khusus',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3173,6 +3173,8 @@ const message = {
baseDir: 'Diretório de Instalação',
baseDirHelper: 'Quando o diretório de instalação está vazio, será instalado por padrão no diretório /opt',
nodePort: 'Porta do Nó',
offline: 'Modo offline',
offlineHelper: 'Usado quando o nó está em ambiente offline',
},
customApp: {
name: 'Repositório de Aplicativos Personalizados',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3164,6 +3164,8 @@ const message = {
baseDir: 'Каталог установки',
baseDirHelper: 'Если каталог установки пуст, по умолчанию он будет установлен в каталоге /opt',
nodePort: 'Порт узла',
offline: 'Автономный режим',
offlineHelper: 'Используется, когда узел находится в автономной среде',
},
customApp: {
name: 'Пользовательское хранилище приложений',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,8 @@ const message = {
baseDir: '安裝目錄',
baseDirHelper: '安裝目錄為空時,預設安裝於 /opt 目錄下',
nodePort: '節點端口',
offline: '離線模式',
offlineHelper: '當節點處於離線環境時使用',
},
customApp: {
name: '自訂應用倉庫',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2988,6 +2988,8 @@ const message = {
baseDir: '安装目录',
baseDirHelper: '安装目录为空时,默认安装在 /opt 目录下',
nodePort: '节点端口',
offline: '离线模式',
offlineHelper: '节点为离线环境时使用',
},
customApp: {
name: '自定义应用仓库',
Expand Down
11 changes: 2 additions & 9 deletions frontend/src/layout/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<template>
<div :class="classObj" class="app-wrapper" v-loading="loading" :element-loading-text="loadingText" fullscreen>
<div v-if="classObj.mobile && classObj.openSidebar" class="drawer-bg" @click="handleClickOutside" />
<div
class="app-sidebar"
v-if="!globalStore.isFullScreen"
@mouseenter="collapseButtonShow = true"
@mouseleave="collapseButtonShow = false"
>
<el-affix v-if="collapseButtonShow" :offset="18" class="affix">
<div class="app-sidebar" v-if="!globalStore.isFullScreen">
<el-affix :offset="18" class="affix">
<el-tooltip
:content="menuStore.isCollapse ? $t('commons.button.expand') : $t('commons.button.collapse')"
>
Expand Down Expand Up @@ -48,7 +43,6 @@ import TaskList from '@/components/task-list/index.vue';
const { switchTheme } = useTheme();

useResize();
const collapseButtonShow = ref();

const taskListRef = ref();
const openTask = () => {
Expand Down Expand Up @@ -81,7 +75,6 @@ const handleClickOutside = () => {

const handleCollapse = () => {
menuStore.setCollapse();
collapseButtonShow.value = false;
};

watch(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some potential improvements and optimizations for the given code:

  1. Simplify if condition:

    <div v-if="((classObj.mobile && classObj.openSidebar) || !globalStore.isFullScreen)" class="...">
  2. Remove unused imports/variables.

    // Remove unused variable
    -const collapseButtonShow = ref();
  3. Optimize DOM rendering order:
    Consider whether this component should be a <component> instead of using inline style attributes directly on the divs.
    For example:

    <template>
        <component :is="'div' + (classObj.mobile && classObj.openSidebar ? '-mobile-mobile-sidebar': '')"
                   @click="handleClickOutside" />
    </template>
  4. Use computed properties or constants when possible**:
    You might want to define a more descriptive or reusable state like a sidebarVisible that simplifies your conditions.

  5. Consider removing unnecessary methods:
    If the handleCollapse method only collapses the menu, there is no need to store the value in a ref since you can just pass the updated collapsed status back into your logic.

Remember: these changes will depend heavily on the rest of your app's structure and requirements.

Expand Down
Loading