✨ SWU: Offer to update in first run wizard
This will now be the very first step of the first run wizard, IF OctoPrint is detected as outdated. Implements #3936
This commit is contained in:
1 parent
32a52bdb0f
commit
5cde163f2b
5 files changed
+95
-17
No files matched your search
@@ -130,6 +130,13 @@ $(function () {
|
||||
[],
|
||||
0
|
||||
);
|
||||
|
||||
self.octoprintData = {
|
||||
item: undefined,
|
||||
current: ko.observable("unknown"),
|
||||
available: ko.observable("unknown")
|
||||
};
|
||||
|
||||
self.updatelog = ko.observableArray([]);
|
||||
|
||||
self.availableAndPossible = ko.pureComputed(function () {
|
||||
@@ -361,6 +368,12 @@ $(function () {
|
||||
});
|
||||
};
|
||||
|
||||
if (key === "octoprint") {
|
||||
self.octoprintData.item = value;
|
||||
self.octoprintData.current(value.information.local.name);
|
||||
self.octoprintData.available(value.information.remote.name);
|
||||
}
|
||||
|
||||
versions.push(value);
|
||||
});
|
||||
self.versions.updateItems(versions);
|
||||
@@ -671,8 +684,10 @@ $(function () {
|
||||
|
||||
self.performUpdate = function (force, items) {
|
||||
if (
|
||||
!self.loginState.hasPermission(
|
||||
self.access.permissions.PLUGIN_SOFTWAREUPDATE_UPDATE
|
||||
!(
|
||||
self.loginState.hasPermission(
|
||||
self.access.permissions.PLUGIN_SOFTWAREUPDATE_UPDATE
|
||||
) || CONFIG_FIRST_RUN
|
||||
)
|
||||
)
|
||||
return;
|
||||
@@ -735,8 +750,10 @@ $(function () {
|
||||
self.update = function (force, items) {
|
||||
if (
|
||||
self.updateInProgress ||
|
||||
!self.loginState.hasPermission(
|
||||
self.access.permissions.PLUGIN_SOFTWAREUPDATE_UPDATE
|
||||
!(
|
||||
self.loginState.hasPermission(
|
||||
self.access.permissions.PLUGIN_SOFTWAREUPDATE_UPDATE
|
||||
) || CONFIG_FIRST_RUN
|
||||
)
|
||||
) {
|
||||
self._updateClicked = false;
|
||||
@@ -1154,7 +1171,8 @@ $(function () {
|
||||
elements: [
|
||||
"#settings_plugin_softwareupdate",
|
||||
"#softwareupdate_confirmation_dialog",
|
||||
"#wizard_plugin_softwareupdate"
|
||||
"#wizard_plugin_softwareupdate_update",
|
||||
"#wizard_plugin_softwareupdate_settings"
|
||||
]
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user