{{ t('app_api', 'Are you sure you want delete Deploy Daemon?') }}
+{{ t('app_api', 'All GPU devices will be requested to be enabled in ExApp containers') }} @@ -173,7 +183,7 @@ export default { deployConfigSettingsOpened: false, deployConfig: { net: 'host', - host: '', + host: 'localhost', ssl_key: '', ssl_key_password: '', ssl_cert: '', @@ -205,6 +215,13 @@ export default { this.displayName = 'Docker Local' } }, + 'deployConfig.net'(newNet) { + if (newNet === 'host') { + this.deployConfig.host = 'localhost' + } else { + this.deployConfig.host = '' + } + }, }, methods: { registerDaemon() { @@ -269,7 +286,7 @@ export default { this.deployConfigSettingsOpened = false this.deployConfig = { net: 'host', - host: '', + host: 'localhost', ssl_key: '', ssl_key_password: '', ssl_cert: '', diff --git a/src/constants/AppsConstants.js b/src/constants/AppsConstants.js index 2c065306..5441e987 100644 --- a/src/constants/AppsConstants.js +++ b/src/constants/AppsConstants.js @@ -2,9 +2,9 @@ import { translate as t } from '@nextcloud/l10n' /** Enum of verification constants, according to Apps */ export const APPS_SECTION_ENUM = Object.freeze({ - enabled: t('settings', 'Active apps'), - disabled: t('settings', 'Disabled apps'), - updates: t('settings', 'Updates'), - featured: t('settings', 'Featured apps'), - supported: t('settings', 'Supported apps'), // From subscription + enabled: t('app_api', 'Active apps'), + disabled: t('app_api', 'Disabled apps'), + updates: t('app_api', 'Updates'), + featured: t('app_api', 'Featured apps'), + supported: t('app_api', 'Supported apps'), // From subscription }) diff --git a/src/mixins/AppManagement.js b/src/mixins/AppManagement.js index 521dc33d..087a5a5a 100644 --- a/src/mixins/AppManagement.js +++ b/src/mixins/AppManagement.js @@ -21,6 +21,12 @@ export default { } return t('app_api', 'Enable') }, + disableButtonText() { + if (this.app && Object.hasOwn(this.app?.status, 'progress')) { + return t('app_api', '{progress}% Initializing', { progress: this.app.status?.progress }) + } + return t('app_api', 'Disable') + }, forceEnableButtonText() { if (this.app.needsDownload) { return t('app_api', 'Allow untested app') @@ -44,7 +50,13 @@ export default { return base }, defaultDeployDaemonAccessible() { - return this.$store.getters.getDaemonAccessible || false + if (this.app?.daemon && this.app?.daemon?.accepts_deploy_id === 'manual-install') { + return true + } + if (this.app?.daemon?.accepts_deploy_id === 'docker-install') { + return this.$store.getters.getDaemonAccessible === true + } + return this.$store.getters.getDaemonAccessible }, }, diff --git a/src/store/apps.js b/src/store/apps.js index 2c237d47..9d930b4f 100644 --- a/src/store/apps.js +++ b/src/store/apps.js @@ -62,7 +62,7 @@ const mutations = { app.error = null }, - enableApp(state, { appId, groups, daemon, systemApp, exAppUrl, status }) { + enableApp(state, { appId, groups, daemon, systemApp, exAppUrl, status, scopes }) { const app = state.apps.find(app => app.id === appId) if (daemon) { app.installed = true @@ -76,11 +76,18 @@ const mutations = { app.exAppUrl = exAppUrl } if (status) { - app.status = status + app.status = { + progress: 0, + } + } + if (scopes) { + app.scopes = scopes } app.active = true app.groups = groups app.canUnInstall = false + app.removable = true + app.error = null }, disableApp(state, appId) { @@ -100,13 +107,15 @@ const mutations = { state.apps.find(app => app.id === appId).canUnInstall = false state.apps.find(app => app.id === appId).canInstall = true state.apps.find(app => app.id === appId).daemon = null + state.apps.find(app => app.id === appId).status = {} + state.apps.find(app => app.id === appId).scopes = null if (state.apps.find(app => app.id === appId).update !== null) { state.updateCount-- } state.apps.find(app => app.id === appId).update = null }, - updateApp(state, { appId, systemApp, exAppUrl, status }) { + updateApp(state, { appId, systemApp, exAppUrl, status, scopes }) { const app = state.apps.find(app => app.id === appId) const version = app.update app.update = null @@ -114,6 +123,8 @@ const mutations = { app.systemApp = systemApp app.exAppUrl = exAppUrl app.status = status + app.scopes = scopes + app.error = null state.updateCount-- }, @@ -220,6 +231,7 @@ const actions = { systemApp: response.data.data?.systemApp, exAppUrl: response.data.data?.exAppUrl, status: response.data.data?.status, + scopes: response.data.data?.scopes, }) }) @@ -341,6 +353,7 @@ const actions = { systemApp: response.data.data?.systemApp, exAppUrl: response.data.data?.exAppUrl, status: response.data.data?.status, + scopes: response.data.data?.scopes, }) context.dispatch('updateAppsStatus') return true