Skip to content

Commit 8653927

Browse files
client changes build
1 parent 21a6053 commit 8653927

12 files changed

+67
-55
lines changed

client_src/js/printerManagementRunner.js

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -574,13 +574,12 @@ scanNetworkBtn.addEventListener("click", async (e) => {
574574

575575
function pluginListTemplate(plugin) {
576576
//Also need check inplace for incompatible...
577-
578577
let abandoned = ``;
579578
if (plugin.abandoned === true) {
580579
abandoned = `<i class="fa fa-heartbeat" title="Abandoned by its maintainer"></i>`;
581580
}
582581
let latestRelease = ``;
583-
582+
console.log(plugin);
584583
if (
585584
typeof plugin.github !== "undefined" &&
586585
typeof plugin.github.latest_release !== "undefined"
@@ -659,7 +658,7 @@ const pluginAction = async function (action) {
659658
"printers/pluginList/" + printerInfo[index]._id
660659
);
661660
} else {
662-
printerPluginList = await OctoFarmClient.get("printers/plugins/");
661+
printerPluginList = await OctoFarmClient.get("printers/pluginList/");
663662
}
664663

665664
printerPluginList = await printerPluginList.json();
@@ -946,6 +945,20 @@ blkPluginsBtn.addEventListener("click", async (e) => {
946945
);
947946
});
948947

948+
const blkPluginsUninstallBtn = document.getElementById(
949+
"blkPluginsUnInstallBtn"
950+
);
951+
blkPluginsUninstallBtn.addEventListener("click", async (e) => {
952+
PrinterSelect.create(
953+
document.getElementById("multiPrintersSection"),
954+
false,
955+
"Uninstall Plugins",
956+
function () {
957+
pluginAction("uninstall");
958+
}
959+
);
960+
});
961+
949962
const searchOffline = document.getElementById("searchOfflineBtn");
950963
searchOffline.addEventListener("click", async (e) => {
951964
let alert = UI.createAlert(
@@ -1808,6 +1821,45 @@ class dashUpdate {
18081821
socketBadge.className = `tag badge badge-${printer.webSocketState.colour} badge-pill`;
18091822
socketBadge.setAttribute("title", printer.webSocketState.desc);
18101823

1824+
if (typeof printer.updateAvailable !== "undefined") {
1825+
let updateButton = document.getElementById(
1826+
`octoprintUpdate-${printer._id}`
1827+
);
1828+
let updatePluginButton = document.getElementById(
1829+
`octoprintPluginUpdate-${printer._id}`
1830+
);
1831+
if (printer.updateAvailable.octoPrintUpdate.updateAvailable) {
1832+
if (updateButton.classList.contains("d-none")) {
1833+
updateButton.classList.remove("d-none");
1834+
}
1835+
bulkOctoPrintsToUpdate = true;
1836+
} else {
1837+
if (!updateButton.classList.contains("d-none")) {
1838+
updateButton.classList.add("d-none");
1839+
}
1840+
}
1841+
if (printer.updateAvailable.pluginUpdates.length > 0) {
1842+
if (updatePluginButton.classList.contains("d-none")) {
1843+
updatePluginButton.classList.remove("d-none");
1844+
}
1845+
bulkPluginsToUpdate = true;
1846+
} else {
1847+
if (!updatePluginButton.classList.contains("d-none")) {
1848+
updatePluginButton.classList.add("d-none");
1849+
}
1850+
}
1851+
if (bulkOctoPrintsToUpdate) {
1852+
if (bulkOctoPrintUpdateButton.classList.contains("d-none")) {
1853+
bulkOctoPrintUpdateButton.classList.remove("d-none");
1854+
}
1855+
}
1856+
if (bulkPluginsToUpdate) {
1857+
if (bulkPluginUpdateButton.classList.contains("d-none")) {
1858+
bulkPluginUpdateButton.classList.remove("d-none");
1859+
}
1860+
}
1861+
}
1862+
18111863
webButton.href = printer.printerURL;
18121864

18131865
printerOctoPrintVersion.innerHTML = printer.octoPrintVersion;
@@ -2138,45 +2190,6 @@ class dashUpdate {
21382190
connectionLogs = await connectionLogs.json();
21392191
PrinterLogs.loadLogs(printer, connectionLogs);
21402192
});
2141-
if (typeof printer.updateAvailable !== "undefined") {
2142-
let updateButton = document.getElementById(
2143-
`octoprintUpdate-${printer._id}`
2144-
);
2145-
let updatePluginButton = document.getElementById(
2146-
`octoprintPluginUpdate-${printer._id}`
2147-
);
2148-
2149-
if (printer.updateAvailable.octoPrintUpdate.updateAvailable) {
2150-
if (updateButton.classList.contains("d-none")) {
2151-
updateButton.classList.remove("d-none");
2152-
}
2153-
bulkOctoPrintsToUpdate = true;
2154-
} else {
2155-
if (!updateButton.classList.contains("d-none")) {
2156-
updateButton.classList.add("d-none");
2157-
}
2158-
}
2159-
if (printer.updateAvailable.pluginUpdates.length > 0) {
2160-
if (updatePluginButton.classList.contains("d-none")) {
2161-
updatePluginButton.classList.remove("d-none");
2162-
}
2163-
bulkPluginsToUpdate = true;
2164-
} else {
2165-
if (!updatePluginButton.classList.contains("d-none")) {
2166-
updatePluginButton.classList.add("d-none");
2167-
}
2168-
}
2169-
if (bulkOctoPrintsToUpdate) {
2170-
if (bulkOctoPrintUpdateButton.classList.contains("d-none")) {
2171-
bulkOctoPrintUpdateButton.classList.remove("d-none");
2172-
}
2173-
}
2174-
if (bulkPluginsToUpdate) {
2175-
if (bulkPluginUpdateButton.classList.contains("d-none")) {
2176-
bulkPluginUpdateButton.classList.remove("d-none");
2177-
}
2178-
}
2179-
}
21802193
}
21812194
}
21822195
});

views/assets/js/cameraViewRunner.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/cameraViewRunner.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/listViewRunner.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/listViewRunner.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/panelViewRunner.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/panelViewRunner.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/printerManagementRunner.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/printerManagementRunner.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/settings.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/assets/js/settings.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/printerManagement.ejs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@
158158
href="#"
159159
aria-expanded="false"
160160
data-toggle="modal" data-target="#printerEditModal"
161-
disabled
162161
>
162+
163+
163164
<i class="fas fa-plug"></i> Uninstall Plugins
164165
</button>
165166
<button
@@ -170,7 +171,6 @@
170171
href="#"
171172
aria-expanded="false"
172173
data-toggle="modal" data-target="#printerEditModal"
173-
disabled
174174
>
175175
<i class="fas fa-plug"></i> Enable Plugin
176176
</button>
@@ -182,7 +182,6 @@
182182
href="#"
183183
aria-expanded="false"
184184
data-toggle="modal" data-target="#printerEditModal"
185-
disabled
186185
>
187186
<i class="fas fa-plug"></i> Disable Plugin
188187
</button>

0 commit comments

Comments
 (0)