diff --git a/CHANGELOG.md b/CHANGELOG.md index 409fdee7..07f8fe84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [1.4.4 - 2023-12-2x] +## [1.4.4 - 2023-12-21] ### Added @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Processing of invalid default Nextcloud URL/incorrect url with slash at the end. #169 - `occ app_api:app:register` error message in case of missing deploy of ExApp. #172 - Default Docker Daemon(`not for AIO`) configuration should be better now. #173 +- UI fixes: `Update` button not working in some cases, missed `Uninstall` button. #177 ## [1.4.3 - 2023-12-18] diff --git a/appinfo/info.xml b/appinfo/info.xml index 86e05336..2eea24aa 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -42,7 +42,7 @@ to join us in shaping a more versatile, stable, and secure app landscape. *Your insights, suggestions, and contributions are invaluable to us.* ]]> - 1.4.3 + 1.4.4 agpl Andrey Borysenko Alexander Piskun diff --git a/lib/Controller/ExAppsPageController.php b/lib/Controller/ExAppsPageController.php index 80ee8fe7..8c42eaf9 100644 --- a/lib/Controller/ExAppsPageController.php +++ b/lib/Controller/ExAppsPageController.php @@ -380,14 +380,14 @@ private function buildLocalAppsList(array $apps, array $exApps): array { 'level' => 100, 'missingMaxOwnCloudVersion' => false, 'missingMinOwnCloudVersion' => false, - 'canInstall' => true, - 'canUnInstall' => false, + 'canInstall' => true, // to allow "remove" command for manual-install + 'canUnInstall' => !($exApp->getEnabled() === 1), 'isCompatible' => true, 'screenshot' => '', 'score' => 0, 'ratingNumOverall' => 0, 'ratingNumThresholdReached' => false, - 'removable' => false, + 'removable' => true, // to allow "remove" command for manual-install 'active' => $exApp->getEnabled() === 1, 'needsDownload' => false, 'groups' => [], @@ -468,15 +468,16 @@ public function enableApps(array $appIds, array $groups = []): JSONResponse { ], Http::STATUS_INTERNAL_SERVER_ERROR); } - //if (!$this->service->enableExApp($exApp)) { - // return new JSONResponse(['data' => ['message' => $this->l10n->t('Failed to enable ExApp')]], Http::STATUS_INTERNAL_SERVER_ERROR); - //} + $scopes = $this->exAppApiScopeService->mapScopeGroupsToNames(array_map(function (ExAppScope $exAppScope) { + return $exAppScope->getScopeGroup(); + }, $this->exAppScopeService->getExAppScopes($exApp))); return new JSONResponse([ 'data' => [ 'daemon_config' => $daemonConfig, 'systemApp' => $this->exAppUsersService->exAppUserExists($exApp->getAppid(), ''), 'exAppUrl' => AppAPIService::getExAppUrl($exApp->getProtocol(), $exApp->getHost(), $exApp->getPort()), 'status' => json_decode($exApp->getStatus(), true), + 'scopes' => $scopes, ] ]); } @@ -662,12 +663,16 @@ public function updateApp(string $appId): JSONResponse { } } + $scopes = $this->exAppApiScopeService->mapScopeGroupsToNames(array_map(function (ExAppScope $exAppScope) { + return $exAppScope->getScopeGroup(); + }, $this->exAppScopeService->getExAppScopes($exApp))); return new JSONResponse([ 'data' => [ 'appid' => $appId, 'status' => ['progress' => 0], 'systemApp' => filter_var($exAppInfo['system_app'], FILTER_VALIDATE_BOOLEAN), 'exAppUrl' => AppAPIService::getExAppUrl($exAppInfo['protocol'], $exAppInfo['host'], (int) $exAppInfo['port']), + 'scopes' => $scopes, ] ]); } diff --git a/lib/DeployActions/DockerActions.php b/lib/DeployActions/DockerActions.php index 7912c5c1..cc19c480 100644 --- a/lib/DeployActions/DockerActions.php +++ b/lib/DeployActions/DockerActions.php @@ -339,7 +339,7 @@ public function buildDeployParams(DaemonConfig $daemonConfig, SimpleXMLElement $ $secret = $oldEnvs['APP_SECRET']; $storage = $oldEnvs['APP_PERSISTENT_STORAGE']; // Preserve previous device requests (GPU) - $deviceRequests = $containerInfo['HostConfig']['DeviceRequests']; + $deviceRequests = $containerInfo['HostConfig']['DeviceRequests'] ?? []; } else { $port = $this->service->getExAppRandomPort(); if (isset($deployConfig['gpu']) && filter_var($deployConfig['gpu'], FILTER_VALIDATE_BOOLEAN)) { diff --git a/src/components/Apps/AppDetails.vue b/src/components/Apps/AppDetails.vue index 11449331..99264a22 100644 --- a/src/components/Apps/AppDetails.vue +++ b/src/components/Apps/AppDetails.vue @@ -17,7 +17,7 @@ - {{ t('settings','Disable') }} + {{ disableButtonText }} {{ !isDefault ? t('app_api', 'Set as default') : t('app_api', 'Default') }} - + {{ t('app_api', 'Delete') }} @@ -39,6 +68,11 @@ import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' import { showError } from '@nextcloud/dialogs' import NcListItem from '@nextcloud/vue/dist/Components/NcListItem.js' +import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js' +import NcDialogButton from '@nextcloud/vue/dist/Components/NcDialogButton.js' +import Cancel from 'vue-material-design-icons/Cancel.vue' +import Check from 'vue-material-design-icons/Check.vue' +import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' @@ -53,6 +87,11 @@ export default { NcActionButton, NcLoadingIcon, CheckBold, + NcDialog, + NcDialogButton, + Cancel, + Check, + NcNoteCard, DaemonConfigDetailsModal, }, props: { @@ -80,6 +119,7 @@ export default { showDetailsModal: false, settingDefault: false, deleting: false, + showDeleteDialog: false, } }, computed: { @@ -109,16 +149,7 @@ export default { }) }, deleteDaemonConfig(daemon) { - const self = this - OC.dialogs.confirm( - t('app_api', 'Are you sure you want delete Deploy Daemon?'), - t('app_api', 'Confirm Deploy daemon deletion'), - function(success) { - if (success) { - self._deleteDaemonConfig(daemon) - } - }, - ) + this.showDeleteDialog = true }, _deleteDaemonConfig(daemon) { this.deleting = true @@ -128,10 +159,12 @@ export default { this.getAllDaemons() } this.deleting = false + this.showDetailsModal = false }) .catch(err => { console.debug(err) this.deleting = false + this.showDetailsModal = false }) }, }, @@ -143,4 +176,8 @@ export default { background-color: var(--color-background-dark); border-radius: var(--border-radius-pill); } + +.confirm-delete-dialog { + padding: 20px; +} diff --git a/src/components/DaemonConfig/RegisterDaemonConfigModal.vue b/src/components/DaemonConfig/RegisterDaemonConfigModal.vue index f11c77be..842290fa 100644 --- a/src/components/DaemonConfig/RegisterDaemonConfigModal.vue +++ b/src/components/DaemonConfig/RegisterDaemonConfigModal.vue @@ -71,7 +71,7 @@ :placeholder="t('app_api', 'Set daemon as default')" :aria-label="t('app_api', 'Set daemon as default')" style="margin-top: 1rem;"> - {{ t('app_api', 'Default daemon') }} + {{ t('app_api', 'Set as default daemon') }}