Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force upgrade in web UI #456

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions app/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"app_info_default_desc": "Redirect domain root to this application ({domain}).",
"app_info_changeurl_desc": "Change the access URL of this application (domain and/or path).",
"app_info_change_url_disabled_tooltip": "This feature hasn't been implemented in this app yet",
"app_info_force_upgrade_desc": "Force upgrade this application.",
"app_info_uninstall_desc": "Remove this application.",
"app_install_custom_no_manifest": "No manifest.json file",
"app_install_parameters": "Install settings",
Expand Down Expand Up @@ -118,6 +119,7 @@
"confirm_service_restart": "Are you sure you want to restart {name}?",
"confirm_service_start": "Are you sure you want to start {name}?",
"confirm_service_stop": "Are you sure you want to stop {name}?",
"confirm_force_upgrade": "Are you sure you want to force upgrade {name}?",
"confirm_uninstall": "Are you sure you want to uninstall {name}?",
"confirm_update_apps": "Are you sure you want to update all applications?",
"confirm_update_system": "Are you sure you want to update all system packages?",
Expand Down Expand Up @@ -384,6 +386,7 @@
"set_default": "Redirect '{domain}' domain root to '{name}'",
"perform_action": "Perform action '{action}' of app '{name}'",
"uninstall": "Uninstall app '{name}'",
"force_upgrade": "Force upgrade app '{name}'",
"update_config": "Update app '{name}' configuration"
},
"backups": {
Expand Down Expand Up @@ -507,6 +510,7 @@
"unauthorized": "Unauthorized",
"unignore": "Unignore",
"uninstall": "Uninstall",
"force_upgrade": "Force upgrade",
"unknown": "Unknown",
"unmaintained": "Unmaintained",
"unmaintained_details": "This app has not been updated for quite a while and the previous maintainer has gone away or does not have time to maintain this app. Feel free to check the app repository to provide your help",
Expand Down
20 changes: 20 additions & 0 deletions app/src/views/app/AppInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@
<hr>
</template>

<!-- FORCE UPGRADE -->
<b-form-group
:label="$t('app_info_force_upgrade_desc')" label-for="force-upgrade"
label-class="font-weight-bold" label-cols-md="4"
>
<b-button @click="performForceUpgrade" id="force-upgrade" variant="warning">
<icon iname="refresh" /> {{ $t('force_upgrade') }}
</b-button>
</b-form-group>

<!-- UNINSTALL -->
<b-form-group
:label="$t('app_info_uninstall_desc')" label-for="uninstall"
Expand Down Expand Up @@ -300,6 +310,16 @@ export default {
).then(this.$refs.view.fetchQueries)
},

async performForceUpgrade () {
const confirmed = await this.$askConfirmation(
this.$i18n.t('confirm_force_upgrade', { name: this.id })
)
if (!confirmed) return

api.put('apps/' + this.id + '/upgrade', { key: 'upgrade.' + this.id, app: this.id, force: true }
).then(this.$refs.view.fetchQueries)
},

async uninstall () {
const confirmed = await this.$askConfirmation(
this.$i18n.t('confirm_uninstall', { name: this.id })
Expand Down