Skip to content

Commit e91ebb0

Browse files
feat: optimize prompt for syncing WAF IP groups
1 parent 4ed872c commit e91ebb0

File tree

11 files changed

+14
-0
lines changed

11 files changed

+14
-0
lines changed

agent/app/service/cronjob_helper.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ func (u *CronjobService) handleSyncIpGroup(cronjob model.Cronjob, taskItem *task
275275
}
276276
ipGroupDir := pathUtils.Join(appInstall.GetPath(), "1pwaf", "data", "rules", "ip_group")
277277
urlDir := pathUtils.Join(ipGroupDir, "ip_group_url")
278+
_, err = os.Stat(urlDir)
279+
if err != nil && os.IsNotExist(err) {
280+
return buserr.New("WafIpGroupNotFound")
281+
}
278282

279283
urlsFiles, err := os.ReadDir(urlDir)
280284
if err != nil {

agent/i18n/lang/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ InExecuting: "The current task is being executed, please do not repeat the execu
256256
NoSuchResource: "No backup content found in the database, skipping..."
257257
CleanLog: "Clean Log"
258258
CleanLogByName: "Clean {{.name}} Log"
259+
WafIpGroupNotFound: "WAF IP group not found, please add it first!"
259260

260261
#toolbox
261262
ErrNotExistUser: 'The current user does not exist, please modify and try again!'

agent/i18n/lang/es-ES.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ InExecuting: "La tarea actual se está ejecutando, por favor no la repita"
255255
NoSuchResource: "No se encontraron contenidos de respaldo en la base de datos, omitiendo..."
256256
CleanLog: "Limpiar registro"
257257
CleanLogByName: "Limpiar registro de {{.name}}"
258+
WafIpGroupNotFound: "¡Grupo de IP de WAF no encontrado, por favor añádalo primero!"
258259

259260
#toolbox
260261
ErrNotExistUser: 'El usuario actual no existe, modifíquelo e intente de nuevo'

agent/i18n/lang/ja.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ InExecuting: "現在のタスクは実行中です。重複して実行しない
255255
NoSuchResource: "データベースにバックアップ内容が見つかりませんでした。スキップします..."
256256
CleanLog: "ログをクリーン"
257257
CleanLogByName: "{{.name}} のログをクリーン"
258+
WafIpGroupNotFound: "WAF IPグループが見つかりません。先に追加してください!"
258259

259260
#toolbox
260261
ErrNotExistUser: '現在のユーザーは存在しません。変更してもう一度お試しください。'

agent/i18n/lang/ko.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ InExecuting: "현재 작업이 실행 중입니다. 중복 실행하지 마세
256256
NoSuchResource: "데이터베이스에서 백업 내용을 찾을 수 없어 건너뜁니다..."
257257
CleanLog: "로그 정리"
258258
CleanLogByName: "{{.name}} 로그 정리"
259+
WafIpGroupNotFound: "WAF IP 그룹을 찾을 수 없습니다. 먼저 추가해 주세요!"
259260

260261
#도구상자
261262
ErrNotExistUser: '현재 사용자가 존재하지 않습니다. 수정한 후 다시 시도하세요!'

agent/i18n/lang/ms.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ InExecuting: "Tugas semasa sedang dilaksanakan, jangan ulangi pelaksanaan!"
256256
NoSuchResource: "Tiada kandungan sandaran ditemui dalam pangkalan data, dilangkau..."
257257
CleanLog: "Bersihkan log"
258258
CleanLogByName: "Bersihkan log {{.name}}"
259+
WafIpGroupNotFound: "Kumpulan IP WAF tidak dijumpai, sila tambahkannya dahulu!"
259260

260261
#kotak alat
261262
ErrNotExistUser: 'Pengguna semasa tidak wujud, sila ubah suai dan cuba lagi!'

agent/i18n/lang/pt-BR.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ InExecuting: "A tarefa atual está sendo executada, não repita a execução!"
256256
NoSuchResource: "Nenhum conteúdo de backup encontrado no banco de dados, ignorando..."
257257
CleanLog: "Limpar log"
258258
CleanLogByName: "Limpar log de {{.name}}"
259+
WafIpGroupNotFound: "Grupo de IP do WAF não encontrado, por favor, adicione-o primeiro!"
259260

260261
#caixa de ferramentas
261262
ErrNotExistUser: 'O usuário atual não existe, modifique e tente novamente!'

agent/i18n/lang/ru.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ InExecuting: "Текущая задача выполняется, не повт
256256
NoSuchResource: "В базе данных не найдено содержимое резервной копии, пропускаем..."
257257
CleanLog: "Очистить журнал"
258258
CleanLogByName: "Очистить журнал {{.name}}"
259+
WafIpGroupNotFound: "Группа IP WAF не найдена, пожалуйста, сначала добавьте её!"
259260

260261
#ящик для инструментов
261262
ErrNotExistUser: 'Текущий пользователь не существует, измените его и повторите попытку!'

agent/i18n/lang/tr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ InExecuting: "Mevcut görev yürütülüyor, lütfen tekrar yürütmeyin!"
257257
NoSuchResource: "Veritabanında yedek içeriği bulunamadı, atlanıyor..."
258258
CleanLog: "Günlüğü temizle"
259259
CleanLogByName: "{{.name}} günlüğünü temizle"
260+
WafIpGroupNotFound: "WAF IP grubu bulunamadı, lütfen önce ekleyin!"
260261

261262
#toolbox
262263
ErrNotExistUser: 'Mevcut kullanıcı mevcut değil, lütfen değiştirin ve tekrar deneyin!'

agent/i18n/lang/zh-Hant.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ InExecuting: "目前任務正在執行中,請勿重複執行!"
255255
NoSuchResource: "資料庫中未能查詢到備份內容,跳過..."
256256
CleanLog: "清理日誌"
257257
CleanLogByName: "清理 {{.name}} 日誌"
258+
WafIpGroupNotFound: "WAF IP 群組未找到,請先新增!"
258259

259260
#toolbox
260261
ErrNotExistUser: '目前使用者不存在,請修改後重試!'

0 commit comments

Comments
 (0)