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
1 change: 1 addition & 0 deletions agent/app/dto/response/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type AppInstallDTO struct {
Favorite bool `json:"favorite"`
App AppDetail `json:"app"`
Container string `json:"container"`
IsEdit bool `json:"isEdit"`
}

type AppInstallInfo struct {
Expand Down
5 changes: 5 additions & 0 deletions agent/app/service/app_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,12 @@ func handleInstalled(appInstallList []model.AppInstall, updated bool, sync bool)
Container: installed.ContainerName,
}
if updated {
detail, _ := appDetailRepo.GetFirst(repo.WithByID(installed.AppDetailId))
installDTO.DockerCompose = installed.DockerCompose
rawCompose, _ := getUpgradeCompose(installed, detail)
if rawCompose != installed.DockerCompose {
installDTO.IsEdit = true
}
}
app, err := appRepo.GetFirst(repo.WithByID(installed.AppId))
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/api/interface/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ export namespace App {
appKey: string;
appType: string;
appStatus: string;
isEdit: boolean;
dockerCompose: string;
app: App.AppDetail;
}

export interface AppInstalledInfo {
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,8 @@ const message = {
uninstallDeleteBackup: 'Uninstall App - Delete Backup',
uninstallDeleteImage: 'Uninstall App - Delete Image',
upgradeBackup: 'Backup App Before Upgrade',
noAppHelper: 'No application detected, please go to the task center to view the app store sync log',
isEdirWarn: 'Detected modification to docker-compose.yml file, please check the comparison',
},
website: {
primaryDomain: 'Primary domain',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,9 @@ const message = {
uninstallDeleteBackup: 'Desinstalar - Eliminar respaldo',
uninstallDeleteImage: 'Desinstalar - Eliminar imagen',
upgradeBackup: 'Respaldar app antes de actualizar',
noAppHelper:
'No se detectó ninguna aplicación, por favor vaya al centro de tareas para ver el registro de sincronización de la tienda de aplicaciones',
isEdirWarn: 'Se detectó modificación en el archivo docker-compose.yml, por favor revise la comparación',
},
website: {
primaryDomain: 'Dominio principal',
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 @@ -2218,6 +2218,8 @@ const message = {
uninstallDeleteBackup: 'アプリをアンインストール - バックアップを削除',
uninstallDeleteImage: 'アプリをアンインストール - イメージを削除',
upgradeBackup: 'アプリのアップグレード前にアプリをバックアップ',
noAppHelper: 'アプリケーションが検出されませんでした。タスクセンターでアプリストアの同期ログを確認してください',
isEdirWarn: 'docker-compose.yml ファイルが変更されたことを検出しました。比較を確認してください',
},
website: {
primaryDomain: 'プライマリドメイン',
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 @@ -2181,6 +2181,8 @@ const message = {
uninstallDeleteBackup: '앱 제거 - 백업 삭제',
uninstallDeleteImage: '앱 제거 - 이미지 삭제',
upgradeBackup: '앱 업그레이드 전 앱 백업',
noAppHelper: '애플리케이션이 감지되지 않았습니다. 작업 센터에서 앱 스토어 동기화 로그를 확인해 주세요',
isEdirWarn: 'docker-compose.yml 파일이 수정된 것을 감지했습니다. 비교를 확인해 주세요',
},
website: {
primaryDomain: '기본 도메인',
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 @@ -2277,6 +2277,8 @@ const message = {
uninstallDeleteBackup: 'Cop Terhapus Semasa Nyahpasang Aplikasi',
uninstallDeleteImage: 'Imej Terhapus Semasa Nyahpasang Aplikasi',
upgradeBackup: 'Sandaran Aplikasi Sebelum Naik Taraf',
noAppHelper: 'Tiada aplikasi dikesan, sila pergi ke pusat tugas untuk melihat log penyegerakan kedai aplikasi',
isEdirWarn: 'Mengesan pengubahsuaian pada fail docker-compose.yml, sila semak perbandingan',
},
website: {
primaryDomain: 'Domain Utama',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,9 @@ const message = {
uninstallDeleteBackup: 'Desinstalar Aplicativo - Excluir Backup',
uninstallDeleteImage: 'Desinstalar Aplicativo - Excluir Imagem',
upgradeBackup: 'Fazer Backup do Aplicativo Antes de Atualizar',
noAppHelper:
'Nenhuma aplicação detectada, por favor vá ao centro de tarefas para visualizar o log de sincronização da loja de aplicativos',
isEdirWarn: 'Detectada modificação no arquivo docker-compose.yml, por favor verifique a comparação',
},
website: {
primaryDomain: 'Domínio principal',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,9 @@ const message = {
uninstallDeleteBackup: 'Деинсталляция приложения - Удаление резервной копии',
uninstallDeleteImage: 'Деинсталляция приложения - Удаление образа',
upgradeBackup: 'Резервное копирование приложения перед обновлением',
noAppHelper:
'Приложения не обнаружены, пожалуйста, перейдите в центр задач для просмотра журнала синхронизации магазина приложений',
isEdirWarn: 'Обнаружено изменение файла docker-compose.yml, пожалуйста, проверьте сравнение',
},
website: {
primaryDomain: 'Основной домен',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,9 @@ const message = {
uninstallDeleteBackup: 'Uygulamayı Kaldır - Yedeği Sil',
uninstallDeleteImage: 'Uygulamayı Kaldır - Görüntüyü Sil',
upgradeBackup: 'Yükseltmeden Önce Uygulamayı Yedekle',
noAppHelper:
'Uygulama tespit edilmedi, lütfen uygulama mağazası senkronizasyon günlüğünü görüntülemek için görev merkezine gidin',
isEdirWarn: 'docker-compose.yml dosyasında değişiklik tespit edildi, lütfen karşılaştırmayı kontrol edin',
},
website: {
primaryDomain: 'Birincil alan adı',
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 @@ -2137,6 +2137,8 @@ const message = {
uninstallDeleteBackup: '移除應用-刪除備份',
uninstallDeleteImage: '移除應用-刪除鏡像',
upgradeBackup: '應用升級前備份應用',
noAppHelper: '未檢測到應用程式,請前往任務中心查看應用商店同步日誌',
isEdirWarn: '檢測到 docker-compose.yml 檔案被修改,請查看對比',
},
website: {
primaryDomain: '主域名',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,7 @@ const message = {
uninstallDeleteImage: '卸载应用-删除镜像',
upgradeBackup: '应用升级前备份应用',
noAppHelper: '未检测到应用,请前往任务中心查看应用商店同步日志',
isEdirWarn: '检测到 docker-compose.yml 文件被修改,请查看对比',
},
website: {
primaryDomain: '主域名',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/app-store/installed/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ const openOperate = (row: any, op: string) => {
operateReq.installId = row.id;
operateReq.operate = op;
if (op == 'upgrade') {
upgradeRef.value.acceptParams(row.id, row.name, row.dockerCompose, op, row.app);
upgradeRef.value.acceptParams(row, op);
} else if (op == 'delete') {
appInstalledDeleteCheck(row.id).then(async (res) => {
const items = res.data;
Expand Down
33 changes: 17 additions & 16 deletions frontend/src/views/app-store/installed/upgrade/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,19 @@
<span class="input-help">{{ $t('app.pullImageHelper') }}</span>
</el-form-item>
</el-form>

<div v-if="operateReq.operate === 'upgrade'">
<el-text type="warning">{{ $t('app.upgradeWarn') }}</el-text>
<br />
<el-button @click="openDiff()" type="primary" class="mt-2">
{{ $t('app.showDiff') }}
</el-button>
<el-text type="danger" v-if="isEdit">{{ $t('app.isEdirWarn') }}</el-text>
<el-text type="warning" v-else>{{ $t('app.upgradeWarn') }}</el-text>
<div>
<el-checkbox v-model="useNewCompose" :label="$t('app.useCustom')" size="large" />
<el-button @click="openDiff()" :type="isEdit ? 'warning' : 'primary'">
{{ $t('app.showDiff') }}
</el-button>
</div>
<el-checkbox v-model="useNewCompose" :label="$t('app.useCustom')" size="large" />
<div v-if="useNewCompose">
<el-text type="danger">{{ $t('app.useCustomHelper') }}</el-text>
<el-text type="danger" v-if="!isEdit">{{ $t('app.useCustomHelper') }}</el-text>
<CodemirrorPro v-model="newCompose" mode="yaml"></CodemirrorPro>
</div>
<CodemirrorPro v-if="useNewCompose" v-model="newCompose" mode="yaml"></CodemirrorPro>
</div>
</div>
<template #footer>
Expand Down Expand Up @@ -131,6 +130,7 @@ const ignoreAppReq = reactive({
appDetailID: 0,
scope: 'app',
});
const isEdit = ref(false);

const toLink = (link: string) => {
window.open(link, '_blank');
Expand Down Expand Up @@ -162,16 +162,17 @@ const initData = async () => {
operateReq.dockerCompose = '';
};

const acceptParams = (id: number, name: string, dockerCompose: string, op: string, appDetail: App.AppDetail) => {
const acceptParams = (appInstall: App.AppInstallDto, op: string) => {
initData();
operateReq.installId = id;
isEdit.value = appInstall.isEdit;
operateReq.installId = appInstall.id;
operateReq.operate = op;
resourceName.value = name;
app.value = appDetail;
oldContent.value = dockerCompose;
appInstallID.value = id;
resourceName.value = appInstall.name;
app.value = appInstall.app;
oldContent.value = appInstall.dockerCompose;
appInstallID.value = appInstall.id;
getVersions('');
ignoreAppReq.appID = appDetail.appId;
ignoreAppReq.appID = appInstall.app.id;
if (op === 'ignore') {
operateReq.detailId = -1;
}
Expand Down
Loading