Skip to content

Commit

Permalink
UBERF-9107: Add backup list support (#7662)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo authored Jan 15, 2025
1 parent 5fac867 commit 81dd4cd
Show file tree
Hide file tree
Showing 19 changed files with 570 additions and 20 deletions.
2 changes: 1 addition & 1 deletion common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
"name": "docker:build",
"phases": ["_phase:build", "_phase:bundle", "_phase:package", "_phase:docker-build"],
"enableParallelism": true,
"incremental": true
"incremental": true
},
{
"summary": "docker:rebuild",
Expand Down
15 changes: 12 additions & 3 deletions desktop/src/ui/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login, { loginId } from '@hcengineering/login'
import { getEmbeddedLabel, getMetadata, setMetadata } from '@hcengineering/platform'
import presentation, { closeClient, MessageBox, setDownloadProgress } from '@hcengineering/presentation'
import { settingId } from '@hcengineering/setting'
import settings, { settingId } from '@hcengineering/setting'
import {
closePanel,
closePopup,
Expand All @@ -24,7 +24,6 @@ import { isOwnerOrMaintainer } from '@hcengineering/core'
import { configurePlatform } from './platform'
import { defineScreenShare } from './screenShare'
import { IPCMainExposed } from './types'
import settings from '@hcengineering/setting'

defineScreenShare()

Expand Down Expand Up @@ -108,7 +107,17 @@ window.addEventListener('DOMContentLoaded', () => {
const workspace = getMetadata(presentation.metadata.WorkspaceId)
if (isOwnerOrMaintainer()) {
if (token != null && endpoint != null && workspace != null) {
ipcMain.startBackup(token, endpoint, workspace)
// ipcMain.startBackup(token, endpoint, workspace)
closePopup()
closePanel()
const loc = getCurrentResolvedLocation()
loc.fragment = undefined
loc.query = undefined
loc.path[2] = settingId
loc.path[3] = 'setting'
loc.path[4] = 'backup'
loc.path.length = 5
navigate(loc)
}
} else {
showPopup(MessageBox, {
Expand Down
3 changes: 2 additions & 1 deletion dev/prod/public/config-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"REKONI_URL": "https://rekoni.hc.engineering",
"COLLABORATOR_URL": "wss://collaborator.hc.engineering",
"STATS_URL": "https://stats.hc.engineering",
"PRESENCE_URL": "wss://presence.hc.engineering"
"PRESENCE_URL": "wss://presence.hc.engineering",
"BACKUP_URL": "https://front.hc.engineering/api/backup"
}
5 changes: 4 additions & 1 deletion dev/prod/src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { questionsId } from '@hcengineering/questions'
import { recruitId } from '@hcengineering/recruit'
import rekoni from '@hcengineering/rekoni'
import { requestId } from '@hcengineering/request'
import { settingId } from '@hcengineering/setting'
import setting, { settingId } from '@hcengineering/setting'
import sign from '@hcengineering/sign'
import { supportId } from '@hcengineering/support'
import { tagsId } from '@hcengineering/tags'
Expand Down Expand Up @@ -165,6 +165,7 @@ export interface Config {
PRESENCE_URL?: string
USE_BINARY_PROTOCOL?: boolean,
TRANSACTOR_OVERRIDE?: string
BACKUP_URL?: string
}

export interface Branding {
Expand Down Expand Up @@ -433,5 +434,7 @@ export async function configurePlatform() {
setMetadata(workbench.metadata.DefaultSpace, myBranding.defaultSpace ?? tracker.project.DefaultProject)
setMetadata(workbench.metadata.DefaultSpecial, myBranding.defaultSpecial ?? 'issues')

setMetadata(setting.metadata.BackupUrl, config.BACKUP_URL ?? '')

initThemeStore()
}
13 changes: 13 additions & 0 deletions models/setting/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ export function createModel (builder: Builder): void {
},
setting.ids.General
)
builder.createDoc(
setting.class.WorkspaceSettingCategory,
core.space.Model,
{
name: 'backup',
label: setting.string.Backup,
icon: setting.icon.Setting,
component: setting.component.Backup,
order: 950,
role: AccountRole.Owner
},
setting.ids.Backup
)
builder.createDoc(
setting.class.WorkspaceSettingCategory,
core.space.Model,
Expand Down
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
"DeleteSpaceTypeConfirm": "Opravdu chcete tento typ prostoru smazat?",
"WorkspaceName": "Název pracovního prostoru",
"Workspace": "Pracovní prostor",
"OwnerOrMaintainerRequired": "Musíte být vlastníkem nebo správcem pracovního prostoru"
"OwnerOrMaintainerRequired": "Musíte být vlastníkem nebo správcem pracovního prostoru",
"Backup": "Záloha",
"BackupLast": "Poslední záloha",
"BackupTotalSnapshots": "Celkem snímků",
"BackupTotalFiles": "Soubory",
"BackupSize": "Velikost zálohy",
"BackupLinkInfo": "Záložní adresář je dostupný na",
"BackupBearerTokenInfo": "Pro přístup k záloze je vyžadován přístupový token. Klikněte na tlačítko pro zkopírování tokenu do schránky.",
"BackupSnapshots": "Snímky",
"BackupFileDownload": "Stáhnout",
"BackupFiles": "Soubory",
"BackupNoBackup": "Žádná záloha není k dispozici"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
"DeleteSpaceTypeConfirm": "Sind Sie sicher, dass Sie diesen Bereichstyp löschen möchten?",
"WorkspaceName": "Arbeitsbereich-Name",
"Workspace": "Arbeitsbereich",
"OwnerOrMaintainerRequired": "Sie müssen Eigentümer oder Betreuer des Arbeitsbereichs sein"
"OwnerOrMaintainerRequired": "Sie müssen Eigentümer oder Betreuer des Arbeitsbereichs sein",
"Backup": "Sicherung",
"BackupLast": "Letzte Sicherung",
"BackupTotalSnapshots": "Gesamtanzahl Snapshots",
"BackupTotalFiles": "Dateien",
"BackupSize": "Sicherungsgröße",
"BackupLinkInfo": "Ein Sicherungsverzeichnis ist verfügbar unter",
"BackupBearerTokenInfo": "Für den Zugriff auf die Sicherung wird ein Bearer-Token benötigt. Bitte klicken Sie auf die Schaltfläche 'Kopieren', um den Token in die Zwischenablage zu kopieren.",
"BackupSnapshots": "Snapshots",
"BackupFileDownload": "Herunterladen",
"BackupFiles": "Dateien",
"BackupNoBackup": "Keine Sicherung verfügbar"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
"DeleteSpaceTypeConfirm": "Are you sure you want to delete this space type?",
"WorkspaceName": "Workspace name",
"Workspace": "Workspace",
"OwnerOrMaintainerRequired": "You need to be a workspace Owner or Maintainer"
"OwnerOrMaintainerRequired": "You need to be a workspace Owner or Maintainer",
"Backup": "Backup",
"BackupLast": "Last backup",
"BackupTotalSnapshots": "Total Snapshots",
"BackupTotalFiles": "Files",
"BackupSize": "Backup size",
"BackupLinkInfo": "A backup directory is available at",
"BackupBearerTokenInfo": "A bearer token is required to access the backup. Please click copy to clipboard button to copy the token." ,
"BackupSnapshots": "Snapshots",
"BackupFileDownload": "Download",
"BackupFiles": "Files",
"BackupNoBackup": "No backup available"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@
"DeleteSpaceTypeConfirm": "¿Estás seguro de que quieres eliminar este tipo de espacio?",
"WorkspaceName": "Nombre del espacio de trabajo",
"Workspace": "Espacio de trabajo",
"OwnerOrMaintainerRequired": "Necesitas ser Propietario o Mantenedor del espacio de trabajo"
"OwnerOrMaintainerRequired": "Necesitas ser Propietario o Mantenedor del espacio de trabajo",
"Backup": "Copia de seguridad",
"BackupLast": "Última copia de seguridad",
"BackupTotalSnapshots": "Total de instantáneas",
"BackupTotalFiles": "Archivos",
"BackupSize": "Tamaño de la copia",
"BackupLinkInfo": "El directorio de copias de seguridad está disponible en",
"BackupBearerTokenInfo": "Se requiere un token de acceso para acceder a la copia de seguridad. Por favor, haga clic en el botón para copiar el token al portapapeles.",
"BackupSnapshots": "Instantáneas",
"BackupFileDownload": "Descargar",
"BackupFiles": "Archivos",
"BackupNoBackup": "No hay copias de seguridad disponibles"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
"DeleteSpaceTypeConfirm": "Êtes-vous sûr de vouloir supprimer ce type d'espace ?",
"WorkspaceName": "Nom de l'espace de travail",
"Workspace": "Espace de travail",
"OwnerOrMaintainerRequired": "Vous devez être propriétaire ou responsable d'un espace de travail"
"OwnerOrMaintainerRequired": "Vous devez être propriétaire ou responsable d'un espace de travail",
"Backup": "Sauvegarde",
"BackupLast": "Dernière sauvegarde",
"BackupTotalSnapshots": "Total des instantanés",
"BackupTotalFiles": "Fichiers",
"BackupSize": "Taille de la sauvegarde",
"BackupLinkInfo": "Un répertoire de sauvegarde est disponible à",
"BackupBearerTokenInfo": "Un jeton d'authentification est nécessaire pour accéder à la sauvegarde. Veuillez cliquer sur le bouton pour copier le jeton dans le presse-papiers.",
"BackupSnapshots": "Instantanés",
"BackupFileDownload": "Télécharger",
"BackupFiles": "Fichiers",
"BackupNoBackup": "Aucune sauvegarde disponible"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
"DeleteSpaceTypeConfirm": "Sei sicuro di voler eliminare questo tipo di spazio?",
"WorkspaceName": "Nome spazio di lavoro",
"Workspace": "Spazio di lavoro",
"OwnerOrMaintainerRequired": "Devi essere un proprietario o un manutentore dello spazio di lavoro"
"OwnerOrMaintainerRequired": "Devi essere un proprietario o un manutentore dello spazio di lavoro",
"Backup": "Backup",
"BackupLast": "Ultimo backup",
"BackupTotalSnapshots": "Totale istantanee",
"BackupTotalFiles": "File",
"BackupSize": "Dimensione backup",
"BackupLinkInfo": "Una directory di backup è disponibile in",
"BackupBearerTokenInfo": "È richiesto un token di accesso per accedere al backup. Fare clic sul pulsante per copiare il token negli appunti.",
"BackupSnapshots": "Istantanee",
"BackupFileDownload": "Scarica",
"BackupFiles": "File",
"BackupNoBackup": "Nessun backup disponibile"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@
"DeleteSpaceTypeConfirm": "Tem certeza de que deseja excluir este tipo de espaço?",
"WorkspaceName": "Nome do espaço de trabalho",
"Workspace": "Espaço de trabalho",
"OwnerOrMaintainerRequired": "Precisa de ser proprietário ou mantenedor do espaço de trabalho"
"OwnerOrMaintainerRequired": "Precisa de ser proprietário ou mantenedor do espaço de trabalho",
"Backup": "Backup",
"BackupLast": "Último backup",
"BackupTotalSnapshots": "Total de instantâneos",
"BackupTotalFiles": "Arquivos",
"BackupSize": "Tamanho do backup",
"BackupLinkInfo": "Um diretório de backup está disponível em",
"BackupBearerTokenInfo": "É necessário um token de acesso para acessar o backup. Clique no botão para copiar o token para a área de transferência.",
"BackupSnapshots": "Instantâneos",
"BackupFileDownload": "Baixar",
"BackupFiles": "Arquivos",
"BackupNoBackup": "Nenhum backup disponível"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@
"DeleteSpaceTypeConfirm": "Вы действительно хотите удалить этот тип пространства?",
"WorkspaceName": "Название рабочего пространства",
"Workspace": "Рабочее пространство",
"OwnerOrMaintainerRequired": "Вы должны иметь роль Владельца/Сопровождаемого"
"OwnerOrMaintainerRequired": "Вы должны иметь роль Владельца/Сопровождаемого",
"Backup": "Резервная копия",
"BackupLast": "Последняя резервная копия",
"BackupTotalSnapshots": "Всего снимков",
"BackupTotalFiles": "Файлы",
"BackupSize": "Размер резервной копии",
"BackupLinkInfo": "Директория резервных копий доступна по адресу",
"BackupBearerTokenInfo": "Для доступа к резервной копии требуется токен авторизации. Пожалуйста, нажмите кнопку, чтобы скопировать токен в буфер обмена.",
"BackupSnapshots": "Снимки",
"BackupFileDownload": "Скачать",
"BackupFiles": "Файлы",
"BackupNoBackup": "Резервные копии отсутствуют"
}
}
13 changes: 12 additions & 1 deletion plugins/setting-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@
"DeleteSpaceTypeConfirm": "您确定要删除此空间类型吗?",
"WorkspaceName": "工作区名称",
"Workspace": "工作区",
"OwnerOrMaintainerRequired": "您需要成为工作空间所有者或维护者"
"OwnerOrMaintainerRequired": "您需要成为工作空间所有者或维护者",
"Backup": "备份",
"BackupLast": "最近备份",
"BackupTotalSnapshots": "快照总数",
"BackupTotalFiles": "文件",
"BackupSize": "备份大小",
"BackupLinkInfo": "备份目录位于",
"BackupBearerTokenInfo": "访问备份需要访问令牌。请点击复制按钮将令牌复制到剪贴板。",
"BackupSnapshots": "快照",
"BackupFileDownload": "下载",
"BackupFiles": "文件",
"BackupNoBackup": "暂无可用备份"
}
}
Loading

0 comments on commit 81dd4cd

Please sign in to comment.