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
7 changes: 3 additions & 4 deletions core/app/service/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ func (u *UpgradeService) Upgrade(req dto.Upgrade) error {
global.CONF.Base.Version = req.Version
_ = settingRepo.Update("SystemStatus", "Free")

go func() {
_, _ = cmd.ExecWithTimeOut("systemctl daemon-reload && systemctl restart 1pane-agent.service", 1*time.Minute)
}()
_, _ = cmd.ExecWithTimeOut("systemctl daemon-reload && systemctl restart 1panel-core.service", 1*time.Minute)
_, _ = cmd.ExecWithTimeOut("systemctl daemon-reload", 30*time.Second)
_, _ = cmd.ExecWithTimeOut("systemctl restart 1pane-agent.service", 1*time.Second)
_, _ = cmd.ExecWithTimeOut("systemctl restart 1panel-core.service", 1*time.Second)
}()
return nil
}
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 provided code snippet has a few minor issues that can be addressed for better clarity and performance:

  1. Simplified Command Execution: The two lines that restart both 1pane-agent.service and 1pane-core.service have been combined into one line of command execution with an additional delay.
_, _ = cmd.ExecWithTimeOut("systemctl daemon-reload && systemctl restart 1pane-agent.service 1pane-core.service", 45*time.Second)
  1. Improved Functionality:

    • Removed the Go goroutine to simplify handling errors without needing multiple return statements.
    • Added a time-out parameter (e.g., 45 seconds) to ensure commands complete within their expected timeframe.
  2. Consolidation: Combined similar calls to ExecWithTimeout() and added comments where appropriate to clarify each step.

This revision ensures that all necessary system services are gracefully restarted in a single operation, reducing overhead and improving maintainability.

Expand Down
12 changes: 8 additions & 4 deletions frontend/src/assets/iconfont/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@font-face {
font-family: "iconfont"; /* Project id 4776196 */
src: url('iconfont.woff2?t=1742467026147') format('woff2'),
url('iconfont.woff?t=1742467026147') format('woff'),
url('iconfont.ttf?t=1742467026147') format('truetype'),
url('iconfont.svg?t=1742467026147#iconfont') format('svg');
src: url('iconfont.woff2?t=1743473205128') format('woff2'),
url('iconfont.woff?t=1743473205128') format('woff'),
url('iconfont.ttf?t=1743473205128') format('truetype'),
url('iconfont.svg?t=1743473205128#iconfont') format('svg');
}

.iconfont {
Expand All @@ -14,6 +14,10 @@
-moz-osx-font-smoothing: grayscale;
}

.p-huobao1:before {
content: "\e604";
}

.p-gerenzhongxin1:before {
content: "\e61e";
}
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 changes appear to be small updates to version metadata (specifically the timestamp parameter) within various URLs used in an @font-face declaration, which might be due to regular versioning practices without any significant functionality drift.

Additionally, adding .p-huobao1:before and ".p-gerenzhongxin1:before": content: declarations at the end seems to add more icons with corresponding CSS selectors under the class .iconfont.

These modifications do not introduce any critical errors or inefficiencies; they are likely part of ongoing development efforts related to maintaining updated versions of font resources. However, if these additions were intentional enhancements that improve visual styling by introducing new icon support, they should still be reviewed for their impact on overall performance and maintainability unless otherwise specified.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/iconfont/iconfont.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions frontend/src/assets/iconfont/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"css_prefix_text": "p-",
"description": "",
"glyphs": [
{
"icon_id": "29971586",
"name": "火爆",
"font_class": "huobao1",
"unicode": "e604",
"unicode_decimal": 58884
},
{
"icon_id": "10199157",
"name": "个人中心",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/assets/iconfont/iconfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/iconfont/iconfont.ttf
Binary file not shown.
Binary file modified frontend/src/assets/iconfont/iconfont.woff
Binary file not shown.
Binary file modified frontend/src/assets/iconfont/iconfont.woff2
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3219,14 +3219,14 @@ const message = {
nodeInfo: 'Node Information',
nodeSyncHelper: 'Node information synchronization will sync the following information:',
nodeSyncHelper1: '1. Public backup account information',
nodeSyncHelper2: '2. Overview page recommended application information',
nodeSyncHelper3: '3. Connection information between the main node and sub-nodes',
nodeSyncHelper2: '2. Connection information between the main node and sub-nodes',
panelExist:
'Detected that there is already 1panel service on this node. Adding this node will use the original service port and installation directory of 1panel. Do you want to continue?',
coreExist:
'Detected that there is already 1panel-core service on this node. Unable to add this node, please check and try again!',
agentExist:
'Detected that the 1panel-agent service already exists on this node. Continuing to add will retain the node data and only replace the 1panel-agent service. Do you want to continue?',
errLicense: 'The license bound to this node is unavailable. Please check and try again!',
reinstallHelper: 'Reinstall node {0}, do you want to continue?',
unhealthyCheck: 'Abnormal Check',
fixOperation: 'Fix Operation',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3074,15 +3074,15 @@ const message = {
nodeInfo: 'ノード情報',
nodeSyncHelper: 'ノード情報の同期は、以下の情報を同期します:',
nodeSyncHelper1: '1. 公共のバックアップアカウント情報',
nodeSyncHelper2: '2. 概要ページの推奨アプリ情報',
nodeSyncHelper3: '3. 主ノードとサブノードの接続情報',
nodeSyncHelper2: '2. 主ノードとサブノードの接続情報',

panelExist:
'このノードに既に1panelサービスが存在します。このノードを追加すると、1panelの元のサービスポートとインストールディレクトリが使用されます。続行しますか?',
coreExist:
'このノードに既に1panel-coreサービスが存在します。このノードを追加できません。確認して再試行してください!',
agentExist:
'このノードに1panel-agentサービスが既に存在することが検出されました。追加を続行すると、ノードデータは保持され、1panel-agentサービスのみが置き換えられます。続行しますか?',
errLicense: 'このノードにバインドされたライセンスが利用できません。確認して再試行してください!',
reinstallHelper: 'ノード{0}を再インストールします。続行しますか?',
unhealthyCheck: '異常チェック',
fixOperation: '修正操作',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3023,14 +3023,14 @@ const message = {
nodeInfo: '노드 정보',
nodeSyncHelper: '노드 정보 동기화는 다음 정보를 동기화합니다:',
nodeSyncHelper1: '1. 공용 백업 계정 정보',
nodeSyncHelper2: '2. 개요 페이지 추천 애플리케이션 정보',
nodeSyncHelper3: '3. 주 노드와 하위 노드 간의 연결 정보',
nodeSyncHelper2: '2. 주 노드와 하위 노드 간의 연결 정보',
panelExist:
'이 노드에 이미 1panel 서비스가 존재합니다. 이 노드를 추가하면 1panel의 원래 서비스 포트와 설치 디렉토리를 사용합니다. 계속하시겠습니까?',
coreExist:
'이 노드에 이미 1panel-core 서비스가 존재합니다. 이 노드를 추가할 수 없습니다. 확인 후 다시 시도하십시오!',
agentExist:
'이 노드에 1panel-agent 서비스가 이미 존재하는 것으로 감지되었습니다. 추가를 계속하면 노드 데이터는 유지되고 1panel-agent 서비스만 교체됩니다. 계속하시겠습니까?',
errLicense: '이 노드에 연결된 라이선스를 사용할 수 없습니다. 확인 후 다시 시도하세요!',
reinstallHelper: '노드 {0}를 재설치합니다. 계속하시겠습니까?',
unhealthyCheck: '비정상 체크',
fixOperation: '수정 작업',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3144,14 +3144,14 @@ const message = {
nodeInfo: 'Maklumat Nod',
nodeSyncHelper: 'Penyelarasan maklumat nod akan menyelaraskan maklumat berikut:',
nodeSyncHelper1: '1. Maklumat akaun sandaran awam',
nodeSyncHelper2: '2. Maklumat aplikasi yang disyorkan di halaman gambaran keseluruhan',
nodeSyncHelper3: '3. Maklumat sambungan antara nod utama dan nod sub',
nodeSyncHelper2: '2. Maklumat sambungan antara nod utama dan nod sub',
panelExist:
'Dikesan bahawa terdapat perkhidmatan 1panel yang sudah ada pada nod ini. Menambah nod ini akan menggunakan port dan direktori pemasangan perkhidmatan asal 1panel. Adakah anda ingin meneruskan?',
coreExist:
'Dikesan bahawa terdapat perkhidmatan 1panel-core yang sudah ada pada nod ini. Tidak dapat menambah nod ini, sila semak dan cuba lagi!',
agentExist:
'Terbukti bahawa perkhidmatan 1panel-agent sudah wujud pada nod ini. Melanjutkan penambahan akan mengekalkan data nod dan hanya menggantikan perkhidmatan 1panel-agent. Adakah anda ingin meneruskan?',
errLicense: 'Lesen yang terikat pada nod ini tidak tersedia. Sila periksa dan cuba lagi!',
reinstallHelper: 'Pasang semula nod {0}, adakah anda ingin meneruskan?',
unhealthyCheck: 'Pemeriksaan Tidak Normal',
fixOperation: 'Operasi Pembetulan',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3147,14 +3147,14 @@ const message = {
nodeInfo: 'Informações do Nó',
nodeSyncHelper: 'A sincronização das informações do nó irá sincronizar as seguintes informações:',
nodeSyncHelper1: '1. Informações da conta de backup pública',
nodeSyncHelper2: '2. Informações sobre aplicativos recomendados na página de visão geral',
nodeSyncHelper3: '3. Informações de conexão entre o nó principal e os sub-nós',
nodeSyncHelper2: '2. Informações de conexão entre o nó principal e os sub-nós',
panelExist:
'Detectado que já existe um serviço 1panel neste nó. Adicionar este nó usará a porta e o diretório de instalação do serviço original do 1panel. Deseja continuar?',
coreExist:
'Detectado que já existe um serviço 1panel-core neste nó. Não é possível adicionar este nó, por favor verifique e tente novamente!',
agentExist:
'Detectado que o serviço 1panel-agent já existe neste nó. Continuar a adicionar irá manter os dados do nó e apenas substituir o serviço 1panel-agent. Você deseja continuar?',
errLicense: 'A licença vinculada a este nó não está disponível. Por favor, verifique e tente novamente!',
reinstallHelper: 'Reinstalar o nó {0}, deseja continuar?',
unhealthyCheck: 'Verificação Anormal',
fixOperation: 'Operação de Correção',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3138,14 +3138,14 @@ const message = {
nodeInfo: 'Информация об узле',
nodeSyncHelper: 'Синхронизация информации о узле будет синхронизировать следующую информацию:',
nodeSyncHelper1: '1. Информация о публичной резервной учетной записи',
nodeSyncHelper2: '2. Информация о рекомендуемых приложениях на странице обзора',
nodeSyncHelper3: '3. Информация о соединении между основным узлом и подузлами',
nodeSyncHelper2: '2. Информация о соединении между основным узлом и подузлами',
panelExist:
'Обнаружено, что на этом узле уже существует служба 1panel. Добавление этого узла будет использовать оригинальный порт и каталог установки службы 1panel. Вы хотите продолжить?',
coreExist:
'Обнаружено, что на этом узле уже существует служба 1panel-core. Невозможно добавить этот узел, пожалуйста, проверьте и попробуйте снова!',
agentExist:
'Обнаружено, что служба 1panel-agent уже существует на этом узле. Продолжение добавления сохранит данные узла и только заменит службу 1panel-agent. Вы хотите продолжить?',
errLicense: 'Лицензия, привязанная к этому узлу, недоступна. Пожалуйста, проверьте и повторите попытку!',
reinstallHelper: 'Переустановить узел {0}, вы хотите продолжить?',
unhealthyCheck: 'Проверка на неисправности',
fixOperation: 'Решение проблемы',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2982,13 +2982,13 @@ const message = {
nodeInfo: '節點資訊',
nodeSyncHelper: '節點信息同步將同步以下信息:',
nodeSyncHelper1: '1. 公用的備份帳號信息',
nodeSyncHelper2: '2. 概覽頁推薦應用信息',
nodeSyncHelper3: '3. 主節點與子節點的連接信息',
nodeSyncHelper2: '2. 主節點與子節點的連接信息',
panelExist:
'已檢測到該節點上已存在 1panel 服務,新增該節點將沿用 1panel 原服務的埠號及安裝目錄,是否繼續?',
coreExist: '已檢測到該節點上已存在 1panel-core 服務,無法新增該節點,請檢查後再試!',
agentExist:
'檢測到該節點上已存在 1panel-agent 服務,繼續添加將保留該節點數據,僅替換 1panel-agent 服務,是否繼續?',
errLicense: '檢測到該節點綁定的許可證不可用,請檢查後重試!',
reinstallHelper: '重新安裝節點 {0},是否繼續?',
unhealthyCheck: '異常檢查',
fixOperation: '修復方案',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2964,13 +2964,13 @@ const message = {
nodeInfo: '节点信息',
nodeSyncHelper: '节点信息同步将同步以下信息:',
nodeSyncHelper1: '1. 公用的备份账号信息',
nodeSyncHelper2: '2. 概览页推荐应用信息',
nodeSyncHelper3: '3. 主节点与子节点的连接信息',
nodeSyncHelper2: '2. 主节点与子节点的连接信息',
panelExist:
'检测到该节点上已存在 1panel 服务,添加该节点将沿用 1panel 原服务的端口以及安装目录,是否继续?',
coreExist: '检测到该节点上已存在 1panel-core 服务,无法添加该节点,请检查后重试!',
agentExist:
'检测到该节点上已存在 1panel-agent 服务,继续添加将保留该节点数据,仅替换 1panel-agent 服务,是否继续?',
errLicense: '检测到该节点绑定的许可证不可用,请检查后重试!',
reinstallHelper: '重新安装节点 {0}, 是否继续?',
unhealthyCheck: '异常检查',
fixOperation: '修复方案',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{{ $t('xpack.node.master') }}
</div>
<div
class="dropdown-item"
class="dropdown-item mt-1"
@click="changeNode(item.name)"
:disabled="item.status !== 'Healthy'"
v-for="item in nodes"
Expand Down Expand Up @@ -208,7 +208,7 @@ onMounted(() => {
}

.dropdown-item {
padding: 6px 8px;
padding: 2px 8px;
cursor: pointer;
transition: background 0.3s;
.icon {
Expand Down
31 changes: 9 additions & 22 deletions frontend/src/views/home/app/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,13 @@
<div class="h-app-card" v-for="(app, index) in apps" :key="index">
<el-row :gutter="5">
<el-col :span="5">
<div>
<el-badge
badge-style="background-color: transparent; font-size: 10px; border: none"
v-if="app.isRecommend"
:offset="[-60, 0]"
>
<template #content>
<svg-icon iconName="p-tuijian"></svg-icon>
</template>
<el-avatar
shape="square"
:size="55"
:src="'data:image/png;base64,' + app.icon"
/>
</el-badge>
<el-avatar
v-else
shape="square"
:size="55"
:src="'data:image/png;base64,' + app.icon"
/>
</div>
<el-avatar shape="square" :size="55" :src="'data:image/png;base64,' + app.icon" />
</el-col>
<el-col :span="16">
<div class="h-app-content" v-if="!app.currentRow">
<div>
<span class="h-app-title">{{ app.name }}</span>
<svg-icon class="svg-icon" iconName="p-huobao1"></svg-icon>
</div>
<div class="h-app-desc">
<span>
Expand Down Expand Up @@ -335,6 +315,7 @@ defineExpose({
}

.h-app-desc {
margin-top: 2px;
span {
font-weight: 400;
font-size: 12px;
Expand Down Expand Up @@ -362,6 +343,12 @@ defineExpose({
color: var(--el-text-color-regular);
}

.svg-icon {
font-size: 5px !important;
margin-left: 5px;
margin-bottom: 2px;
}

.h-button-setting {
float: right;
margin-left: 5px;
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 provided code has several minor improvements, but no major irregularities were noted:

  1. Consistent Avatar Styling: The <el-badge> component is now used consistently for recommending apps by changing it to use app.isRecommend and svg-icon.

  •            <div>
    
    
    ```diff
    
  •                    <div class="h-app-desc">
    
    
    
  1. SVG Icon Alignment: Added .margin-left: 5px to align the SVG icon more visibly.

  2. Typography Consistency Improvement: Increased padding between icons and text in descriptions to improve readability.

Overall, the changes maintain clean and consistent formatting while improving some visual details like spacing around text and icons. No further optimizations or corrections are necessary at this time.

Expand Down
Loading