fix: enable update if commits available but version number is above
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
2 files changed
+15
-3
No files matched your search
@@ -314,6 +314,8 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return 'primary'
|
||||
|
||||
if ((object.commits_behind ?? []).length) return 'primary'
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object && (
|
||||
@@ -346,6 +348,8 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return this.$t('Machine.UpdatePanel.Update')
|
||||
|
||||
if ((object.commits_behind ?? []).length) return this.$t('Machine.UpdatePanel.Update')
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object && (
|
||||
@@ -378,6 +382,8 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return 'progress-upload'
|
||||
|
||||
if ((object.commits_behind ?? []).length) return 'progress-upload'
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object && (
|
||||
@@ -398,6 +404,8 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
if ('is_dirty' in object && object.is_dirty) return false
|
||||
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ((object.commits_behind ?? []).length) return false
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
@@ -411,8 +419,9 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
getVersionOutput(object: any) {
|
||||
const local_version = 'version' in object ? object.version : '?'
|
||||
const remote_version = 'remote_version' in object ? object.remote_version : '?'
|
||||
const local_version = object.version ?? '?'
|
||||
const remote_version = object.remote_version ?? '?'
|
||||
const commits_behind = object.commits_behind ?? []
|
||||
|
||||
let output = ''
|
||||
if ('remote_alias' in object && object.remote_alias !== 'origin') output += object.remote_alias
|
||||
@@ -425,6 +434,8 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
|
||||
if (semver.valid(remote_version) && semver.valid(local_version) && semver.gt(remote_version, local_version))
|
||||
output += local_version+' > '+remote_version
|
||||
else if (commits_behind.length)
|
||||
output += local_version+' > '+ this.$tc('Machine.UpdatePanel.CommitsAvailabe', commits_behind.length, { count: commits_behind.length })
|
||||
else if ('full_version_string' in object && object.full_version_string !== '?')
|
||||
output += object.full_version_string
|
||||
else
|
||||
|
||||
+2
-1
@@ -568,7 +568,8 @@
|
||||
"CommittedYesterday": "committed yesterday",
|
||||
"CommittedDaysAgo": "committed {days} days ago",
|
||||
"CommittedOnDate": "committed on {date}",
|
||||
"UpdateAll": "Update all components"
|
||||
"UpdateAll": "Update all components",
|
||||
"CommitsAvailabe": "no commits available | {count} commit available | {count} commits available"
|
||||
},
|
||||
"SystemPanel": {
|
||||
"SystemLoad": "System Loads",
|
||||
|
||||
Reference in new issue
Block a user