🎨 Add prettier for js, less, yaml, json, ...
This commit is contained in:
1 parent
eb37b72dc1
commit
6b44909f21
159 files changed
+12772
-8543
No files matched your search
@@ -4,12 +4,12 @@
|
||||
} else {
|
||||
factory(global.OctoPrintClient);
|
||||
}
|
||||
})(this, function(OctoPrintClient) {
|
||||
var OctoPrintPluginManagerClient = function(base) {
|
||||
})(this, function (OctoPrintClient) {
|
||||
var OctoPrintPluginManagerClient = function (base) {
|
||||
this.base = base;
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.get = function(refresh, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.get = function (refresh, opts) {
|
||||
var refresh_repo, refresh_notices, refresh_orphans;
|
||||
if (_.isPlainObject(refresh)) {
|
||||
refresh_repo = refresh.repo || false;
|
||||
@@ -26,18 +26,26 @@
|
||||
if (refresh_notices) query.push("refresh_notices=true");
|
||||
if (refresh_orphans) query.push("refresh_orphans=true");
|
||||
|
||||
return this.base.get(this.base.getSimpleApiUrl("pluginmanager") + ((query.length) ? "?" + query.join("&") : ""), opts);
|
||||
return this.base.get(
|
||||
this.base.getSimpleApiUrl("pluginmanager") +
|
||||
(query.length ? "?" + query.join("&") : ""),
|
||||
opts
|
||||
);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.getWithRefresh = function(opts) {
|
||||
OctoPrintPluginManagerClient.prototype.getWithRefresh = function (opts) {
|
||||
return this.get(true, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.getWithoutRefresh = function(opts) {
|
||||
OctoPrintPluginManagerClient.prototype.getWithoutRefresh = function (opts) {
|
||||
return this.get(false, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.install = function(pluginUrl, dependencyLinks, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.install = function (
|
||||
pluginUrl,
|
||||
dependencyLinks,
|
||||
opts
|
||||
) {
|
||||
var data = {
|
||||
url: pluginUrl,
|
||||
dependency_links: !!dependencyLinks
|
||||
@@ -45,7 +53,12 @@
|
||||
return this.base.simpleApiCommand("pluginmanager", "install", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.reinstall = function(plugin, pluginUrl, dependencyLinks, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.reinstall = function (
|
||||
plugin,
|
||||
pluginUrl,
|
||||
dependencyLinks,
|
||||
opts
|
||||
) {
|
||||
var data = {
|
||||
url: pluginUrl,
|
||||
dependency_links: !!dependencyLinks,
|
||||
@@ -55,7 +68,7 @@
|
||||
return this.base.simpleApiCommand("pluginmanager", "install", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.uninstall = function(plugin, cleanup, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.uninstall = function (plugin, cleanup, opts) {
|
||||
// backwards compatibility to former argument list (plugin, opts)
|
||||
if (arguments.length === 2 && typeof cleanup === "object") {
|
||||
opts = cleanup;
|
||||
@@ -69,36 +82,42 @@
|
||||
return this.base.simpleApiCommand("pluginmanager", "uninstall", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.cleanup = function(plugin, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.cleanup = function (plugin, opts) {
|
||||
var data = {
|
||||
plugin: plugin
|
||||
};
|
||||
return this.base.simpleApiCommand("pluginmanager", "cleanup", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.cleanupAll = function(plugin, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.cleanupAll = function (plugin, opts) {
|
||||
var data = {};
|
||||
return this.base.simpleApiCommand("pluginmanager", "cleanup_all", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.enable = function(plugin, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.enable = function (plugin, opts) {
|
||||
var data = {
|
||||
plugin: plugin
|
||||
};
|
||||
return this.base.simpleApiCommand("pluginmanager", "enable", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.disable = function(plugin, opts) {
|
||||
OctoPrintPluginManagerClient.prototype.disable = function (plugin, opts) {
|
||||
var data = {
|
||||
plugin: plugin
|
||||
};
|
||||
return this.base.simpleApiCommand("pluginmanager", "disable", data, opts);
|
||||
};
|
||||
|
||||
OctoPrintPluginManagerClient.prototype.upload = function(file) {
|
||||
return this.base.upload(this.base.getBlueprintUrl("pluginmanager") + "upload_archive", file);
|
||||
OctoPrintPluginManagerClient.prototype.upload = function (file) {
|
||||
return this.base.upload(
|
||||
this.base.getBlueprintUrl("pluginmanager") + "upload_archive",
|
||||
file
|
||||
);
|
||||
};
|
||||
|
||||
OctoPrintClient.registerPluginComponent("pluginmanager", OctoPrintPluginManagerClient);
|
||||
OctoPrintClient.registerPluginComponent(
|
||||
"pluginmanager",
|
||||
OctoPrintPluginManagerClient
|
||||
);
|
||||
return OctoPrintPluginManagerClient;
|
||||
});
|
||||
Reference in new issue
Block a user