diff --git a/.eslintrc.json b/.eslintrc.json
index 7a48da07790d..3b7538e9271c 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -25,6 +25,7 @@
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"prefer-promise-reject-errors": ["error", { "allowEmptyReject": true }],
"react/jsx-indent": ["error", 4],
+ "semi": ["error", "always", { "omitLastInOneLineBlock": true }],
"camelcase": "off",
"comma-dangle": "off",
@@ -36,7 +37,6 @@
"react/jsx-curly-spacing": "off",
"react/jsx-indent-props": "off",
"react/prop-types": "off",
- "semi": "off",
"space-before-function-paren": "off",
"standard/no-callback-literal": "off",
diff --git a/pkg/apps/application-list.jsx b/pkg/apps/application-list.jsx
index 26ea79754d05..908c68976f1f 100644
--- a/pkg/apps/application-list.jsx
+++ b/pkg/apps/application-list.jsx
@@ -128,7 +128,7 @@ class ApplicationList extends React.Component {
refresh_button = ;
} else {
refresh_progress = null;
- refresh_button =
+ refresh_button = ;
}
table_classes = "table app-list";
diff --git a/pkg/apps/utils.jsx b/pkg/apps/utils.jsx
index 6b928108343b..35746be7679e 100644
--- a/pkg/apps/utils.jsx
+++ b/pkg/apps/utils.jsx
@@ -43,10 +43,10 @@ export function icon_url(path_or_url) {
payload: "fsread1",
binary: "raw",
path: path_or_url,
- }
+ };
if (path_or_url.endsWith(".svg")) {
- queryobj.external = {"content-type": "image/svg+xml"}
+ queryobj.external = {"content-type": "image/svg+xml"};
}
var query = window.btoa(JSON.stringify(queryobj));
@@ -75,7 +75,7 @@ export const ProgressBar = ({ title, data }) => {
);
}
-}
+};
export const CancelButton = ({ data }) => {
return (
@@ -85,7 +85,7 @@ export const CancelButton = ({ data }) => {
{_("Cancel")}
);
-}
+};
export const show_error = ex => {
if (ex.code == "cancelled")
@@ -107,7 +107,7 @@ export const show_error = ex => {
cancel_caption: _("Close"),
actions: [ ]
});
-}
+};
export const launch = (comp) => {
var i;
@@ -117,4 +117,4 @@ export const launch = (comp) => {
return;
}
}
-}
+};
diff --git a/pkg/dashboard/list.js b/pkg/dashboard/list.js
index f09ed52d65d5..1c8517f15b57 100644
--- a/pkg/dashboard/list.js
+++ b/pkg/dashboard/list.js
@@ -75,7 +75,7 @@ var resource_monitors = [
};
},
options: { yaxis: { tickColor: "#e1e6ed",
- tickFormatter: function(v) { return v + "%"; }} },
+ tickFormatter: function(v) { return v + "%" }} },
ymax_min: 100
},
{ selector: "#dashboard-plot-1",
@@ -350,7 +350,7 @@ PageDashboard.prototype = {
});
$.each(seen, function(addr) {
- series[addr].forEach(function (s) { s.remove(); });
+ series[addr].forEach(function (s) { s.remove() });
delete series[addr];
});
@@ -455,7 +455,7 @@ PageDashboard.prototype = {
}
function plot_refresh() {
- self.plots.forEach(function (p) { p.refresh(); });
+ self.plots.forEach(function (p) { p.refresh() });
}
function plot_add(addr, info) {
@@ -525,7 +525,7 @@ PageDashboard.prototype = {
}
$(window).on('resize.dashboard', function () {
- self.plots.forEach(function (p) { p.resize(); });
+ self.plots.forEach(function (p) { p.resize() });
});
renderer();
diff --git a/pkg/docker/atomic.js b/pkg/docker/atomic.js
index 0b4a597f84fe..e128fff0fe6b 100644
--- a/pkg/docker/atomic.js
+++ b/pkg/docker/atomic.js
@@ -58,7 +58,7 @@ function updateVulnerableInfo() {
/* Atomic sometimes returns containers for which it doesn't
* have scan results. Remove those. */
- var ids = Object.keys(infos).filter(function (id) { return infos[id].json_file; });
+ var ids = Object.keys(infos).filter(function (id) { return infos[id].json_file });
if (ids.length > 0) {
promises = ids.map(function (id) {
diff --git a/pkg/docker/containers-view.jsx b/pkg/docker/containers-view.jsx
index 2b920faebbd9..bf7592fc8275 100644
--- a/pkg/docker/containers-view.jsx
+++ b/pkg/docker/containers-view.jsx
@@ -80,7 +80,7 @@ var ContainerHeader = React.createClass({
return {
filter: 'running',
filterText: ''
- }
+ };
},
filterChanged: function () {
@@ -144,7 +144,7 @@ var ContainerProblems = React.createClass({
problem_cursors.push(
{problem[i][1]}
- )
+ );
}
return (
@@ -255,7 +255,7 @@ var ContainerList = React.createClass({
$(this.props.client).off('container.containers', this.containersChanged);
$(this.props.client).off('container.container-details', this.containersChanged);
this.service.removeEventListener("Crash", this.newProblemOccurred);
- this.problems_client.close()
+ this.problems_client.close();
},
render: function () {
@@ -276,9 +276,9 @@ var ContainerList = React.createClass({
var state;
if (this.props.client.waiting[container.Id]) {
- state = { element:
{_("Address")} | {source.address} |
{_("Port")} | {source.port} |
@@ -77,9 +77,9 @@ const VmNetworkTab = function ({ vm, dispatch, hostDevices }) {
server: addressPortSource,
client: addressPortSource,
udp: addressPortSource,
- }
+ };
if (mapSource[network.type] !== undefined) {
- return {mapSource[network.type](network.source, networkId)}
+ return {mapSource[network.type](network.source, networkId)}
;
} else {
return null;
}
@@ -145,7 +145,7 @@ const VmNetworkTab = function ({ vm, dispatch, hostDevices }) {
column = d.value(target, networkId);
}
return column;
- })
+ });
networkId++;
return ();
@@ -153,7 +153,7 @@ const VmNetworkTab = function ({ vm, dispatch, hostDevices }) {
);
-}
+};
VmNetworkTab.propTypes = {
vm: React.PropTypes.object.isRequired,
diff --git a/pkg/networkmanager/firewall.jsx b/pkg/networkmanager/firewall.jsx
index 4d953a684d83..5ee9bab66737 100644
--- a/pkg/networkmanager/firewall.jsx
+++ b/pkg/networkmanager/firewall.jsx
@@ -44,7 +44,7 @@ function EmptyState(props) {
function ServiceRow(props) {
if (!props.service.name)
- return
+ return ;
var tcp = props.service.ports.filter(p => p.protocol.toUpperCase() == 'TCP');
var udp = props.service.ports.filter(p => p.protocol.toUpperCase() == 'UDP');
@@ -109,7 +109,7 @@ class SearchInput extends React.Component {
render() {
return
+ onChange={this.onValueChanged} />;
}
}
@@ -144,7 +144,7 @@ class AddServicesDialogBody extends React.Component {
let selected = new Set(oldState.selected);
if (enabled)
- selected.add(service)
+ selected.add(service);
else
selected.delete(service);
@@ -228,7 +228,7 @@ export class Firewall extends React.Component {
if (prevState.pendingTarget === firewall.enabled)
return { firewall, pendingTarget: null };
- return { firewall }
+ return { firewall };
});
}
diff --git a/pkg/networkmanager/interfaces.js b/pkg/networkmanager/interfaces.js
index 90d375ee4df8..3277624d83df 100644
--- a/pkg/networkmanager/interfaces.js
+++ b/pkg/networkmanager/interfaces.js
@@ -117,7 +117,7 @@ function connection_settings(c) {
// each Connection object to have "connection" settings.
console.warn("Incomplete 'Connection' object accessed", c);
// HACK - phantomjs console.trace() prints nothing
- try { throw new Error(); } catch (e) { console.log(e.stack); }
+ try { throw new Error() } catch (e) { console.log(e.stack) }
return { };
}
}
@@ -394,7 +394,7 @@ function NetworkManagerModel() {
if (!export_pending) {
export_pending = true;
- window.setTimeout(function () { export_pending = false; doit(); }, 300);
+ window.setTimeout(function () { export_pending = false; doit() }, 300);
}
}
@@ -1335,7 +1335,7 @@ function NetworkManagerModel() {
if (priv(obj).type === type_Interface)
result.push(obj);
}
- return result.sort(function (a, b) { return a.Name.localeCompare(b.Name); });
+ return result.sort(function (a, b) { return a.Name.localeCompare(b.Name) });
};
self.find_interface = peek_interface;
@@ -1352,7 +1352,7 @@ function NetworkManagerModel() {
function compare_versions(a, b) {
function to_ints(str) {
- return str.split(".").map(function (s) { return s ? parseInt(s, 10) : 0; });
+ return str.split(".").map(function (s) { return s ? parseInt(s, 10) : 0 });
}
var a_ints = to_ints(a);
@@ -2371,7 +2371,7 @@ PageNetworkInterface.prototype = {
if (con && dev && dev.ActiveConnection && dev.ActiveConnection.Connection === con) {
if (con.Settings.connection.interface_name &&
con.Settings.connection.interface_name != dev.Interface) {
- return dev.disconnect().then(function () { return con.activate(null, null); }).
+ return dev.disconnect().then(function () { return con.activate(null, null) }).
fail(show_unexpected_error);
} else {
return con.activate(dev, null).
@@ -2719,7 +2719,7 @@ PageNetworkInterface.prototype = {
$('').append(
$('').
append(link_text).
- syn_click(self.model, function () { configure(); })));
+ syn_click(self.model, function () { configure() })));
}
function render_ip_settings_row(topic, title) {
@@ -2727,7 +2727,7 @@ PageNetworkInterface.prototype = {
return null;
return render_settings_row(title, render_ip_settings(topic),
- function () { configure_ip_settings(topic); });
+ function () { configure_ip_settings(topic) });
}
function render_mtu_settings_row() {
@@ -4603,9 +4603,9 @@ function PageNetworkMacSettings() {
function dialog_setup(d) {
d.setup();
$('#' + d.id).
- on('show.bs.modal', function () { d.enter(); }).
- on('shown.bs.modal', function () { d.show(); }).
- on('hidden.bs.modal', function () { d.leave(); });
+ on('show.bs.modal', function () { d.enter() }).
+ on('shown.bs.modal', function () { d.show() }).
+ on('hidden.bs.modal', function () { d.leave() });
}
function page_show(p, arg) {
diff --git a/pkg/ovirt/components/ClusterTemplates.jsx b/pkg/ovirt/components/ClusterTemplates.jsx
index bd6030e79339..d528b39917ea 100644
--- a/pkg/ovirt/components/ClusterTemplates.jsx
+++ b/pkg/ovirt/components/ClusterTemplates.jsx
@@ -55,7 +55,7 @@ class CreateVmFromTemplate extends React.Component {
}
onVmNameChanged (e) {
- this.setState({ vmName: e.target.value })
+ this.setState({ vmName: e.target.value });
}
onDoCreateVm () {
diff --git a/pkg/ovirt/components/ClusterVms.jsx b/pkg/ovirt/components/ClusterVms.jsx
index 8e9c868caa7f..c4556c41e2f2 100644
--- a/pkg/ovirt/components/ClusterVms.jsx
+++ b/pkg/ovirt/components/ClusterVms.jsx
@@ -68,7 +68,7 @@ const VmHost = ({ id, hosts, dispatch }) => {
const cockpitUrl = `https://${host.address}:${CONFIG.cockpitPort}/machines`;
// just the without the tabIndex="0" onClick handler is not working
- return ( { window.top.location = cockpitUrl; }}>
+ return ( { window.top.location = cockpitUrl }}>
{host.name}
);
};
@@ -81,7 +81,7 @@ const VmTemplate = ({ id, templates }) => {
const template = templates[id];
const baseTemplateName = template.version.baseTemplateId && templates[template.version.baseTemplateId] ? templates[template.version.baseTemplateId].name : '';
const tooltip = `${_("Description")}: ${template.description}\n${_("Version")}: ${valueOrDefault(template.version.name, '')}\n${_("Version num")}: ${valueOrDefault(template.version.number, '')}\n${_("Base template")}: ${baseTemplateName}\n`;
- return {template.name}
+ return {template.name};
};
const VmActions = ({ vm, hostName, dispatch }) => {
diff --git a/pkg/ovirt/components/HostToMaintenance.jsx b/pkg/ovirt/components/HostToMaintenance.jsx
index ef1b420e110e..222b0ffa965a 100644
--- a/pkg/ovirt/components/HostToMaintenance.jsx
+++ b/pkg/ovirt/components/HostToMaintenance.jsx
@@ -43,7 +43,7 @@ const hostToMaintenanceDialog = (dispatch, host) => {
let footerProps = {
'actions': [
- { 'clicked': () => { return dispatch(switchHostToMaintenance({ hostId })); },
+ { 'clicked': () => { return dispatch(switchHostToMaintenance({ hostId })) },
'caption': _("OK"),
'style': 'primary',
},
@@ -59,7 +59,7 @@ const showHostToMaintenanceDialog = (dispatch, hosts) => {
return;
}
hostToMaintenanceDialog(dispatch, hosts);
- }
+ };
};
const hostToMaintenance = ({ dispatch, host }) => {
@@ -75,7 +75,7 @@ const hostToMaintenance = ({ dispatch, host }) => {
{_("Host to Maintenance")}
- )
+ );
};
export default hostToMaintenance;
diff --git a/pkg/ovirt/components/OVirtTab.jsx b/pkg/ovirt/components/OVirtTab.jsx
index 9f4405ca92a4..4d4f20c85149 100644
--- a/pkg/ovirt/components/OVirtTab.jsx
+++ b/pkg/ovirt/components/OVirtTab.jsx
@@ -37,7 +37,7 @@ function canVmMigrateToHost ({ host }) {
class MigrateTo extends React.Component {
constructor (props) {
- super(props)
+ super(props);
this.state = {
confirmAction: false,
@@ -48,9 +48,9 @@ class MigrateTo extends React.Component {
render () {
const { vm, hosts, dispatch } = this.props;
- const onHostChange = e => { this.setState({selectedHostId: e.target.value}); };
- const onAction = () => { this.setState({ confirmAction: true }); };
- const onActionCanceled = () => { this.setState({ confirmAction: false }); };
+ const onHostChange = e => { this.setState({selectedHostId: e.target.value}) };
+ const onAction = () => { this.setState({ confirmAction: true }) };
+ const onActionCanceled = () => { this.setState({ confirmAction: false }) };
const onActionConfirmed = () => {
this.setState({ confirmAction: false });
dispatch(migrateVm(vm.id, vm.name, this.state.selectedHostId));
diff --git a/pkg/ovirt/components/VdsmView.jsx b/pkg/ovirt/components/VdsmView.jsx
index 91c3309ef6ec..cf19c8420259 100644
--- a/pkg/ovirt/components/VdsmView.jsx
+++ b/pkg/ovirt/components/VdsmView.jsx
@@ -28,7 +28,7 @@ const _ = cockpit.gettext;
class VdsmConf extends React.Component { // TODO: needs design
constructor (props) {
- super(props)
+ super(props);
this.state = {
fileContent: _("Loading data ..."),
@@ -63,29 +63,29 @@ class VdsmConf extends React.Component { // TODO: needs design
})
.fail(error => { // TODO: more visible for the user
logError(`Error reading ${VDSM_CONF_FILE}: ${JSON.stringify(error)}`);
- })
+ });
}
doSave () {
cockpit.file(VDSM_CONF_FILE, { superuser: 'try' }).replace(this.state.fileContent)
.done(() => {
- logDebug('Content of vdsm.conf replaced.')
+ logDebug('Content of vdsm.conf replaced.');
this.setState({ changed: false });
})
.fail(error => {
logError(`Error writing ${VDSM_CONF_FILE}: ${JSON.stringify(error)}`);
- })
+ });
}
- onSave () { this.setState({saveConfirmation: true}); } // render confirmation buttons
- onSaveConfirmed () { this.doSave(); this.setState({saveConfirmation: false}); }
- onSaveCanceled () { this.setState({saveConfirmation: false}); }
+ onSave () { this.setState({saveConfirmation: true}) } // render confirmation buttons
+ onSaveConfirmed () { this.doSave(); this.setState({saveConfirmation: false}) }
+ onSaveCanceled () { this.setState({saveConfirmation: false}) }
- onReload () { this.setState({reloadConfirmation: true}); } // render confirmation buttons
- onReloadConfirmed () { this.doReload(); this.setState({reloadConfirmation: false}); }
- onReloadCanceled () { this.setState({reloadConfirmation: false}); }
+ onReload () { this.setState({reloadConfirmation: true}) } // render confirmation buttons
+ onReloadConfirmed () { this.doReload(); this.setState({reloadConfirmation: false}) }
+ onReloadCanceled () { this.setState({reloadConfirmation: false}) }
- onEditorChange (event) { this.setState({fileContent: event.target.value, changed: true}); }
+ onEditorChange (event) { this.setState({fileContent: event.target.value, changed: true}) }
render () {
let reloadButton = null;
@@ -109,9 +109,9 @@ class VdsmConf extends React.Component { // TODO: needs design
- )
+ );
} else {
- saveButton = ()
+ saveButton = ();
}
}
diff --git a/pkg/ovirt/components/vcpuModal.jsx b/pkg/ovirt/components/vcpuModal.jsx
index ea645842f0b1..421f31ae9042 100644
--- a/pkg/ovirt/components/vcpuModal.jsx
+++ b/pkg/ovirt/components/vcpuModal.jsx
@@ -15,7 +15,7 @@ class VCPUModalBody extends React.Component {
threads: props.cpu.topology.threads || 1,
cores: props.cpu.topology.cores || 1,
count: (props.cpu.topology.sockets * props.cpu.topology.cores * props.cpu.topology.threads) || 1
- }
+ };
this.handleChange = this.handleChange.bind(this);
props.onChange(this.state);
@@ -38,7 +38,7 @@ class VCPUModalBody extends React.Component {
state.count = Object.values(state).reduce((accumulator, currentValue) => accumulator * currentValue, 1);
this.setState(state);
- }
+ };
}
render () {
@@ -84,7 +84,7 @@ export default function ({ vm, dispatch }) {
let state = {};
const onStateChange = (st) => {
state = Object.assign({}, st);
- }
+ };
return show_modal_dialog(
{
diff --git a/pkg/packagekit/autoupdates.jsx b/pkg/packagekit/autoupdates.jsx
index cb85b2e556a1..80320e7a4805 100644
--- a/pkg/packagekit/autoupdates.jsx
+++ b/pkg/packagekit/autoupdates.jsx
@@ -111,7 +111,7 @@ class DnfImpl extends ImplBase {
// check if we have a day of week
if (daysOfWeek.indexOf(words[0]) >= 0)
- this.day = words.shift()
+ this.day = words.shift();
else
this.day = ""; // daily
@@ -205,7 +205,7 @@ class DnfImpl extends ImplBase {
// automatic updates are not supported, backend will be null.
function getBackend() {
if (!getBackend.promise) {
- debug("getBackend() called first time, initializing promise")
+ debug("getBackend() called first time, initializing promise");
let dfd = cockpit.defer();
getBackend.promise = dfd.promise();
@@ -231,7 +231,7 @@ function getBackend() {
// the detection shell script is supposed to always succeed
console.error("automatic updates getBackend() detection failed:", error);
dfd.resolve(null);
- })
+ });
}
return getBackend.promise;
diff --git a/pkg/packagekit/updates.jsx b/pkg/packagekit/updates.jsx
index 1764bbfe6eea..a45b2bbe9381 100644
--- a/pkg/packagekit/updates.jsx
+++ b/pkg/packagekit/updates.jsx
@@ -41,7 +41,7 @@ const STATE_HEADINGS = {
"updateSuccess": null,
"updateError": _("Applying updates failed"),
"loadError": _("Loading available updates failed"),
-}
+};
const PK_STATUS_STRINGS = {
[PK.Enum.STATUS_DOWNLOAD]: _("Downloading"),
@@ -49,7 +49,7 @@ const PK_STATUS_STRINGS = {
[PK.Enum.STATUS_UPDATE]: _("Updating"),
[PK.Enum.STATUS_CLEANUP]: _("Setting up"),
[PK.Enum.STATUS_SIGCHECK]: _("Verifying"),
-}
+};
const PK_STATUS_LOG_STRINGS = {
[PK.Enum.STATUS_DOWNLOAD]: _("Downloaded"),
@@ -57,7 +57,7 @@ const PK_STATUS_LOG_STRINGS = {
[PK.Enum.STATUS_UPDATE]: _("Updated"),
[PK.Enum.STATUS_CLEANUP]: _("Set up"),
[PK.Enum.STATUS_SIGCHECK]: _("Verified"),
-}
+};
var packageSummaries = {};
@@ -74,7 +74,7 @@ function parseCVEs(text) {
function deduplicate(list) {
var d = { };
- list.forEach(i => { if (i) d[i] = true });
+ list.forEach(i => { if (i) d[i] = true; });
var result = Object.keys(d);
result.sort();
return result;
@@ -85,7 +85,7 @@ function deduplicate(list) {
function insertCommas(list) {
if (list.length <= 1)
return list;
- return list.reduce((prev, cur) => [prev, ", ", cur])
+ return list.reduce((prev, cur) => [prev, ", ", cur]);
}
// Fedora changelogs are a wild mix of enumerations or not, headings, etc.
@@ -688,7 +688,7 @@ class OsUpdates extends React.Component {
// only update the state once to avoid flicker
Finished: () => {
if (history.length > 0)
- this.setState({history: history})
+ this.setState({history: history});
}
})
.catch(ex => console.warn("Failed to load old transactions:", ex));
@@ -872,7 +872,7 @@ class OsUpdates extends React.Component {
return this.state.errorMessages.map(m => {m} );
case "applying":
- return
+ return ;
case "updateSuccess":
return ;
@@ -936,7 +936,7 @@ class OsUpdates extends React.Component {
}
handleRestart() {
- this.setState({state: "restart"})
+ this.setState({state: "restart"});
// give the user a chance to actually read the message
window.setTimeout(() => {
cockpit.spawn(["shutdown", "--reboot", "now"], { superuser: true, err: "message" })
diff --git a/pkg/playground/react-demo-onoff.jsx b/pkg/playground/react-demo-onoff.jsx
index d6a29370e4df..a873ca07a9e8 100644
--- a/pkg/playground/react-demo-onoff.jsx
+++ b/pkg/playground/react-demo-onoff.jsx
@@ -26,7 +26,7 @@ var OnOffDemo = React.createClass({
return {
onOffA: true,
onOffB: false
- }
+ };
},
onChangeA: function(val) {
this.setState({onOffA: val});
diff --git a/pkg/playground/test.js b/pkg/playground/test.js
index 1ace8b7faea4..5ed88b8bbb28 100644
--- a/pkg/playground/test.js
+++ b/pkg/playground/test.js
@@ -5,7 +5,7 @@
var cockpit = require("cockpit");
$(function() {
- $("#hammer").on("click", function () { $(this).hide(); });
+ $("#hammer").on("click", function () { $(this).hide() });
$(".cockpit-internal-reauthorize .btn").on("click", function() {
$(".cockpit-internal-reauthorize span").text("checking...");
diff --git a/pkg/realmd/operation.js b/pkg/realmd/operation.js
index 4e74cb9bfdc2..be92991a383b 100644
--- a/pkg/realmd/operation.js
+++ b/pkg/realmd/operation.js
@@ -454,7 +454,7 @@
$(".realms-op-error").show();
}
} else if (mode == 'leave') {
- call = cleanup_ws_credentials().then(function() { realm.Deconfigure(options); });
+ call = cleanup_ws_credentials().then(function() { realm.Deconfigure(options) });
}
if (!call) {
@@ -564,7 +564,7 @@
if (!joined || !joined.length)
text = _("Join Domain");
else
- text = joined.map(function(x) { return x.Name; }).join(", ");
+ text = joined.map(function(x) { return x.Name }).join(", ");
link.text(text);
}
diff --git a/pkg/selinux/setroubleshoot-view.jsx b/pkg/selinux/setroubleshoot-view.jsx
index 27cc0ab3da3f..e2f55e5f2b96 100644
--- a/pkg/selinux/setroubleshoot-view.jsx
+++ b/pkg/selinux/setroubleshoot-view.jsx
@@ -33,7 +33,7 @@ var SELinuxEventDetails = React.createClass({
var expanded;
// all details are collapsed by default
if (this.props.details)
- expanded = this.props.details.pluginAnalysis.map(function() { return false; });
+ expanded = this.props.details.pluginAnalysis.map(function() { return false });
return {
solutionExpanded: expanded, // show details for solution
diff --git a/pkg/shell/base_index.js b/pkg/shell/base_index.js
index 4d5bf0933dec..22d5acc7e24c 100644
--- a/pkg/shell/base_index.js
+++ b/pkg/shell/base_index.js
@@ -969,10 +969,10 @@
function follow(arg) {
/* A promise of some sort */
if (arguments.length == 1 && typeof arg.then == "function") {
- arg.then(function() { console.log.apply(console, arguments); },
- function() { console.error.apply(console, arguments); });
+ arg.then(function() { console.log.apply(console, arguments) },
+ function() { console.error.apply(console, arguments) });
if (typeof arg.stream == "function")
- arg.stream(function() { console.log.apply(console,arguments); });
+ arg.stream(function() { console.log.apply(console,arguments) });
}
}
@@ -982,8 +982,8 @@
Object.defineProperties(window, {
cockpit: { value: cockpit },
zz: {
- get: function() { return zz_value; },
- set: function(val) { zz_value = val; follow(val); }
+ get: function() { return zz_value },
+ set: function(val) { zz_value = val; follow(val) }
}
});
diff --git a/pkg/storaged/client.js b/pkg/storaged/client.js
index 34b2d9ec945a..db4dff3f4197 100644
--- a/pkg/storaged/client.js
+++ b/pkg/storaged/client.js
@@ -293,7 +293,7 @@
client.vgroups_lvols[lvol.VolumeGroup].push(lvol);
}
for (path in client.vgroups_lvols) {
- client.vgroups_lvols[path].sort(function (a, b) { return a.Name.localeCompare(b.Name); });
+ client.vgroups_lvols[path].sort(function (a, b) { return a.Name.localeCompare(b.Name) });
}
client.lvols_block = { };
@@ -312,7 +312,7 @@
client.lvols_pool_members[lvol.ThinPool].push(lvol);
}
for (path in client.lvols_pool_members) {
- client.lvols_pool_members[path].sort(function (a, b) { return a.Name.localeCompare(b.Name); });
+ client.lvols_pool_members[path].sort(function (a, b) { return a.Name.localeCompare(b.Name) });
}
client.blocks_cleartext = { };
@@ -332,7 +332,7 @@
client.blocks_partitions[part.Table].push(part);
}
for (path in client.blocks_partitions) {
- client.blocks_partitions[path].sort(function (a, b) { return a.Offset - b.Offset; });
+ client.blocks_partitions[path].sort(function (a, b) { return a.Offset - b.Offset });
}
client.path_jobs = { };
@@ -438,7 +438,7 @@
}
function enable_pk_features() {
- return PK.detect().then(function (available) { client.features.packagekit = available; });
+ return PK.detect().then(function (available) { client.features.packagekit = available });
}
function enable_features() {
@@ -623,12 +623,12 @@
}
function stop_and_unmount_entry(users, entry) {
- var units = users.map(function (u) { return u.unit; });
+ var units = users.map(function (u) { return u.unit });
return spawn_nfs_mounts([ "stop-and-unmount", JSON.stringify(units), JSON.stringify(entry) ]);
}
function stop_and_remove_entry(users, entry) {
- var units = users.map(function (u) { return u.unit; });
+ var units = users.map(function (u) { return u.unit });
return spawn_nfs_mounts([ "stop-and-remove", JSON.stringify(units), JSON.stringify(entry) ]);
}
@@ -793,12 +793,12 @@
}
function find_by_block(block) {
- function check(encoded) { return self.by_dev[utils.decode_filename(encoded)]; }
+ function check(encoded) { return self.by_dev[utils.decode_filename(encoded)] }
return check(block.Device) || some(block.Symlinks, check);
}
function find_by_backing_block(block) {
- function check(encoded) { return self.by_backing_dev[utils.decode_filename(encoded)]; }
+ function check(encoded) { return self.by_backing_dev[utils.decode_filename(encoded)] }
return check(block.Device) || some(block.Symlinks, check);
}
@@ -878,7 +878,7 @@
}
function find_by_block(block) {
- function check(encoded) { return self.info[utils.decode_filename(encoded)]; }
+ function check(encoded) { return self.info[utils.decode_filename(encoded)] }
return check(block.Device) || some(block.Symlinks, check);
}
diff --git a/pkg/storaged/content-views.jsx b/pkg/storaged/content-views.jsx
index 002d9e031da4..06c360d6b7f5 100644
--- a/pkg/storaged/content-views.jsx
+++ b/pkg/storaged/content-views.jsx
@@ -595,7 +595,7 @@ function append_logical_volume(client, rows, level, lvol) {
desc = {
size: lvol.Size,
text: lvol.Active ? _("Unsupported volume") : _("Inactive volume")
- }
+ };
tabs = create_tabs(client, lvol, false);
append_row(client, rows, level, lvol.Name, lvol.Name, desc, tabs, false);
}
diff --git a/pkg/storaged/crypto-tab.jsx b/pkg/storaged/crypto-tab.jsx
index 1de6f6852f67..2d080988c778 100644
--- a/pkg/storaged/crypto-tab.jsx
+++ b/pkg/storaged/crypto-tab.jsx
@@ -50,7 +50,7 @@ var CryptoTab = React.createClass({
block.GetSecretConfiguration({}).done(
function (items) {
- old_config = array_find(items, function (c) { return c[0] == "crypttab"; });
+ old_config = array_find(items, function (c) { return c[0] == "crypttab" });
new_config = [ "crypttab", old_config ? Object.assign({ }, old_config[1]) : { } ];
// UDisks insists on always having a "passphrase-contents" field when
@@ -80,7 +80,7 @@ var CryptoTab = React.createClass({
config["passphrase-contents"] = {
t: 'ay',
v: encode_filename(vals.passphrase)
- }
+ };
delete config["passphrase-path"];
return commit();
}
@@ -91,11 +91,11 @@ var CryptoTab = React.createClass({
var old_config, old_options;
- old_config = array_find(block.Configuration, function (c) { return c[0] == "crypttab"; });
+ old_config = array_find(block.Configuration, function (c) { return c[0] == "crypttab" });
if (old_config) {
old_options = (decode_filename(old_config[1].options.v)
.split(",")
- .filter(function (s) { return s.indexOf("x-parent") !== 0; })
+ .filter(function (s) { return s.indexOf("x-parent") !== 0 })
.join(","));
}
@@ -109,7 +109,7 @@ var CryptoTab = React.createClass({
config["options"] = {
t: 'ay',
v: encode_filename(crypto_options_dialog_options(vals))
- }
+ };
return commit();
}
}
diff --git a/pkg/storaged/details.jsx b/pkg/storaged/details.jsx
index a856cbe77a7a..be30ceb8916f 100644
--- a/pkg/storaged/details.jsx
+++ b/pkg/storaged/details.jsx
@@ -73,7 +73,7 @@ export class StdDetailsLayout extends React.Component {
class Details extends React.Component {
constructor() {
super();
- this.on_client_changed = () => { this.setState({}); };
+ this.on_client_changed = () => { this.setState({}) };
}
componentDidMount() {
diff --git a/pkg/storaged/dialog.js b/pkg/storaged/dialog.js
index 35241ea6163c..7986c63ff54e 100644
--- a/pkg/storaged/dialog.js
+++ b/pkg/storaged/dialog.js
@@ -66,7 +66,7 @@
if (def.Action && def.Action.Danger)
def.Action.DangerButton = true;
- function empty(obj) { return !obj || obj.length === 0; }
+ function empty(obj) { return !obj || obj.length === 0 }
def.HasBody = def.Body || def.ReactBody || !empty(def.Fields) || !empty(def.Alerts) || !empty(def.Blocking);
diff --git a/pkg/storaged/dialogx.jsx b/pkg/storaged/dialogx.jsx
index 16f6e668ce86..89ad8b3fe19f 100644
--- a/pkg/storaged/dialogx.jsx
+++ b/pkg/storaged/dialogx.jsx
@@ -154,7 +154,7 @@ const Validated = ({ errors, error_key, children }) => {
{ error ? {error} : null }
);
-}
+};
const Row = ({ tag, title, errors, children }) => {
return (
@@ -167,7 +167,7 @@ const Row = ({ tag, title, errors, children }) => {
|
);
-}
+};
function is_visible(field, values) {
return !field.options || field.options.visible == undefined || field.options.visible(values);
@@ -184,7 +184,7 @@ const Body = ({body, fields, values, errors, onChange}) => {
if (is_visible(f, values))
return (
- { f.render(values[f.tag], val => { values[f.tag] = val; onChange(); }) }
+ { f.render(values[f.tag], val => { values[f.tag] = val; onChange() }) }
);
})
@@ -194,13 +194,13 @@ const Body = ({body, fields, values, errors, onChange}) => {
}
);
-}
+};
export const dialog_open = (def) => {
let fields = def.Fields || [ ];
let values = { };
- fields.forEach(f => { values[f.tag] = f.initial_value; });
+ fields.forEach(f => { values[f.tag] = f.initial_value });
// We reconstruct the body everytime the values change so that it
// will be re-rendered. This could be done with some state in the
@@ -209,7 +209,7 @@ export const dialog_open = (def) => {
const update = (errors) => {
dlg.setProps(props(errors));
- }
+ };
const props = (errors) => {
return {
@@ -221,7 +221,7 @@ export const dialog_open = (def) => {
errors={errors}
onChange={() => update(null)} />
};
- }
+ };
const validate = () => {
return Promise.all(fields.map(f => {
@@ -234,7 +234,7 @@ export const dialog_open = (def) => {
fields.forEach((f, i) => { if (results[i]) errors[f.tag] = results[i]; });
return (Object.keys(errors).length > 0) ? errors : null;
});
- }
+ };
let actions = [ ];
if (def.Action) {
@@ -259,7 +259,7 @@ export const dialog_open = (def) => {
{ actions: actions,
cancel_caption: def.Action ? _("Cancel") : _("Close")
});
-}
+};
/* GENERIC FIELD TYPES
*/
@@ -275,8 +275,8 @@ export const TextInput = (tag, title, options) => {
change(event.target.value)} />
- }
-}
+ };
+};
export const PassInput = (tag, title, options) => {
return {
@@ -289,8 +289,8 @@ export const PassInput = (tag, title, options) => {
change(event.target.value)} />
- }
-}
+ };
+};
export const SelectOne = (tag, title, options, choices) => {
return {
@@ -308,8 +308,8 @@ export const SelectOne = (tag, title, options, choices) => {
);
}
- }
-}
+ };
+};
export const CheckBox = (tag, title, options) => {
return {
@@ -328,8 +328,8 @@ export const CheckBox = (tag, title, options) => {
);
}
- }
-}
+ };
+};
/* A text input that is guarded by a check box.
*
@@ -358,5 +358,5 @@ export const TextInputChecked = (tag, title, options) => {
);
}
- }
-}
+ };
+};
diff --git a/pkg/storaged/drives-panel.jsx b/pkg/storaged/drives-panel.jsx
index 55195150de1a..219f0ff571f2 100644
--- a/pkg/storaged/drives-panel.jsx
+++ b/pkg/storaged/drives-panel.jsx
@@ -29,7 +29,7 @@ const C_ = cockpit.gettext;
export class DrivesPanel extends React.Component {
constructor () {
super();
- this.on_io_samples = () => { this.setState({}); }
+ this.on_io_samples = () => { this.setState({}) };
}
componentDidMount() {
diff --git a/pkg/storaged/format-dialog.jsx b/pkg/storaged/format-dialog.jsx
index e071e65e54fa..d56c1e84739e 100644
--- a/pkg/storaged/format-dialog.jsx
+++ b/pkg/storaged/format-dialog.jsx
@@ -55,7 +55,7 @@ function extract_option(split, opt) {
function mounting_dialog_fields(is_custom, mount_dir, mount_options, visible) {
if (!visible)
- visible = function () { return true; };
+ visible = function () { return true };
var split_options = parse_options(mount_options == "defaults" ? "" : mount_options);
var opt_auto = !extract_option(split_options, "noauto");
diff --git a/pkg/storaged/fsys-panel.jsx b/pkg/storaged/fsys-panel.jsx
index 938aa6521e62..84b497cbde1e 100644
--- a/pkg/storaged/fsys-panel.jsx
+++ b/pkg/storaged/fsys-panel.jsx
@@ -28,7 +28,7 @@ const _ = cockpit.gettext;
export class FilesystemsPanel extends React.Component {
constructor () {
super();
- this.on_fsys_samples = () => { this.setState({}); }
+ this.on_fsys_samples = () => { this.setState({}) };
}
componentDidMount() {
diff --git a/pkg/storaged/fsys-tab.jsx b/pkg/storaged/fsys-tab.jsx
index 8022f339ad92..b84bf64410d0 100644
--- a/pkg/storaged/fsys-tab.jsx
+++ b/pkg/storaged/fsys-tab.jsx
@@ -83,12 +83,12 @@ var FilesystemTab = React.createClass({
var old_config, old_dir, old_opts;
- old_config = utils.array_find(block.Configuration, function (c) { return c[0] == "fstab"; });
+ old_config = utils.array_find(block.Configuration, function (c) { return c[0] == "fstab" });
if (old_config) {
old_dir = utils.decode_filename(old_config[1].dir.v);
old_opts = (utils.decode_filename(old_config[1].opts.v)
.split(",")
- .filter(function (s) { return s.indexOf("x-parent") !== 0; })
+ .filter(function (s) { return s.indexOf("x-parent") !== 0 })
.join(","));
}
diff --git a/pkg/storaged/iscsi-panel.jsx b/pkg/storaged/iscsi-panel.jsx
index 6941c4d94785..1bf27b3f6a38 100644
--- a/pkg/storaged/iscsi-panel.jsx
+++ b/pkg/storaged/iscsi-panel.jsx
@@ -265,7 +265,7 @@ export class IscsiPanel extends React.Component {
if (!event || event.button !== 0)
return;
this.setState({ armed: !this.state.armed });
- }
+ };
var sessions = Object.keys(client.iscsi_sessions).sort(cmp_session)
.map(make_session);
@@ -286,7 +286,7 @@ export class IscsiPanel extends React.Component {
var iscsi_feature = {
is_enabled: () => client.features.iscsi
- }
+ };
return (
+ return ;
}
}
diff --git a/pkg/storaged/lvol-tabs.jsx b/pkg/storaged/lvol-tabs.jsx
index 0757d6d187d2..d25e81b9115a 100644
--- a/pkg/storaged/lvol-tabs.jsx
+++ b/pkg/storaged/lvol-tabs.jsx
@@ -76,7 +76,7 @@ function lvol_and_fsys_resize(client, lvol, size, offline) {
if (fsys) {
// When doing an offline resize, we need to first repair the filesystem.
if (offline) {
- return fsys.Repair({ }).then(function () { return fsys.Resize(size - crypto_overhead, { }); });
+ return fsys.Repair({ }).then(function () { return fsys.Resize(size - crypto_overhead, { }) });
} else {
return fsys.Resize(size - crypto_overhead, { });
}
diff --git a/pkg/storaged/nfs-panel.jsx b/pkg/storaged/nfs-panel.jsx
index 3f3291e85dad..475ac8ea651d 100644
--- a/pkg/storaged/nfs-panel.jsx
+++ b/pkg/storaged/nfs-panel.jsx
@@ -84,7 +84,7 @@ export class NFSPanel extends React.Component {
client.features.nfs = true;
client.nfs.start();
}
- }
+ };
return (
{
feature.enable();
self.setState({ just_installed: "just-installed" });
- window.setTimeout(() => { self.setState({ just_installed: "just-installed faded" }); },
+ window.setTimeout(() => { self.setState({ just_installed: "just-installed faded" }) },
4000);
});
}
diff --git a/pkg/storaged/overview.jsx b/pkg/storaged/overview.jsx
index 7166d3bf475c..5707a5bfe56f 100644
--- a/pkg/storaged/overview.jsx
+++ b/pkg/storaged/overview.jsx
@@ -65,7 +65,7 @@ export class OverviewSidePanelRow extends React.Component {
if (!event || event.button !== 0)
return;
return this.props.go();
- }
+ };
return (
{ this.setState({}); };
+ this.on_client_changed = () => { this.setState({}) };
}
componentDidMount() {
diff --git a/pkg/storaged/plot.jsx b/pkg/storaged/plot.jsx
index f76352f8a074..bb3638dd045c 100644
--- a/pkg/storaged/plot.jsx
+++ b/pkg/storaged/plot.jsx
@@ -29,7 +29,7 @@ const _ = cockpit.gettext;
class ZoomControls extends React.Component {
constructor() {
super();
- this.classes = { }
+ this.classes = { };
this.plots = [ ];
}
@@ -113,8 +113,8 @@ class ZoomControls extends React.Component {
class StoragePlot extends React.Component {
constructor() {
super();
- this.state = { unit: "" }
- this.on_resize = () => { this.setState({}); };
+ this.state = { unit: "" };
+ this.on_resize = () => { this.setState({}) };
}
componentDidMount() {
@@ -247,13 +247,13 @@ export class StoragePlots extends React.Component {
this.controls = element;
this.controls.reset(this.plots);
}
- }
+ };
const new_plot = (p) => {
this.plots.push(p);
if (this.controls)
this.controls.reset(this.plots);
- }
+ };
return (
diff --git a/pkg/storaged/storage-controls.jsx b/pkg/storaged/storage-controls.jsx
index a1cad6c4f7b5..c9f9e570ba33 100644
--- a/pkg/storaged/storage-controls.jsx
+++ b/pkg/storaged/storage-controls.jsx
@@ -64,7 +64,7 @@ var StorageControl = React.createClass({
var markup = {
__html: cockpit.format(_("The user $0 is not permitted to manage storage"),
permission.user ? permission.user.name : '')
- }
+ };
excuse = ;
}
@@ -184,10 +184,8 @@ class StorageOnOff extends React.Component {
function onChange(val) {
var promise = self.props.onChange(val);
if (promise) {
- promise.always(function() {
- self.setState({ promise: null })
- });
- promise.fail(function(error) {
+ promise.always(() => { self.setState({ promise: null }) });
+ promise.fail((error) => {
$('#error-popup-title').text(_("Error"));
$('#error-popup-message').text(error.toString());
$('#error-popup').modal('show');
diff --git a/pkg/storaged/utils.js b/pkg/storaged/utils.js
index 8f137b93db96..cf028e4dfcdc 100644
--- a/pkg/storaged/utils.js
+++ b/pkg/storaged/utils.js
@@ -37,7 +37,7 @@
utils.compare_versions = function compare_versions(a, b) {
function to_ints(str) {
- return str.split(".").map(function (s) { return s ? parseInt(s, 10) : 0; });
+ return str.split(".").map(function (s) { return s ? parseInt(s, 10) : 0 });
}
var a_ints = to_ints(a);
@@ -672,9 +672,9 @@
handle_vg(p);
}
- return cockpit.all([ unmount(usage.raw.filter(function(use) { return use.usage == "mounted"; })),
- mdraid_remove(usage.raw.filter(function(use) { return use.usage == "mdraid-member"; })),
- pvol_remove(usage.raw.filter(function(use) { return use.usage == "pvol"; }))
+ return cockpit.all([ unmount(usage.raw.filter(function(use) { return use.usage == "mounted" })),
+ mdraid_remove(usage.raw.filter(function(use) { return use.usage == "mdraid-member" })),
+ pvol_remove(usage.raw.filter(function(use) { return use.usage == "pvol" }))
]);
};
diff --git a/pkg/storaged/vdo-details.jsx b/pkg/storaged/vdo-details.jsx
index faee796c88bb..47b15867ecaf 100644
--- a/pkg/storaged/vdo-details.jsx
+++ b/pkg/storaged/vdo-details.jsx
@@ -180,7 +180,7 @@ export class VDODetails extends React.Component {
.then(function (block) {
return block.Format("empty", { 'tear-down': { t: 'b', v: true } });
});
- })
+ });
}
}
diff --git a/pkg/storaged/vdos-panel.jsx b/pkg/storaged/vdos-panel.jsx
index 6540d49b741b..27feefa2af2e 100644
--- a/pkg/storaged/vdos-panel.jsx
+++ b/pkg/storaged/vdos-panel.jsx
@@ -162,7 +162,7 @@ export class VDOsPanel extends React.Component {
client.features.vdo = true;
client.vdo_overlay.start();
}
- }
+ };
return (
{ this.props.vgroup.Poll(); }, 2000);
+ this.poll_timer = window.setInterval(() => { this.props.vgroup.Poll() }, 2000);
} else if (!needs_polling && this.poll_timer !== null) {
window.clearInterval(this.poll_timer);
this.poll_timer = null;
diff --git a/pkg/storaged/vgroups-panel.jsx b/pkg/storaged/vgroups-panel.jsx
index 4ab5a1f4e08f..428192c22715 100644
--- a/pkg/storaged/vgroups-panel.jsx
+++ b/pkg/storaged/vgroups-panel.jsx
@@ -108,7 +108,7 @@ export class VGroupsPanel extends React.Component {
var lvm2_feature = {
is_enabled: () => client.features.lvm2
- }
+ };
return (
{
document.title = cockpit.gettext(document.title);
- moment.locale(cockpit.language)
+ moment.locale(cockpit.language);
detect().then(info => {
console.debug("hardware info collection data:", JSON.stringify(info));
React.render(, document.getElementById("hwinfo"));
diff --git a/pkg/systemd/init.js b/pkg/systemd/init.js
index fd54e4d5df62..52d8ba8f238c 100644
--- a/pkg/systemd/init.js
+++ b/pkg/systemd/init.js
@@ -264,7 +264,7 @@ $(function() {
function render_now() {
var pattern = $('#services-filter button.active').attr('data-pattern');
- function cmp_path(a, b) { return units_by_path[a].Id.localeCompare(units_by_path[b].Id); }
+ function cmp_path(a, b) { return units_by_path[a].Id.localeCompare(units_by_path[b].Id) }
var sorted_keys = Object.keys(units_by_path).sort(cmp_path);
var enabled = [ ], disabled = [ ], statics = [ ];
var header = {
diff --git a/pkg/users/local.js b/pkg/users/local.js
index f9e3c75c82f8..c67e2db54df9 100755
--- a/pkg/users/local.js
+++ b/pkg/users/local.js
@@ -388,7 +388,7 @@ PageAccountsCreate.prototype = {
$('#accounts-create-create').on('click', $.proxy(this, "create"));
$('#accounts-create-dialog .check-passwords').on('keydown change', $.proxy(this, "validate"));
$('#accounts-create-real-name').on('input', $.proxy(this, "suggest_username"));
- $('#accounts-create-user-name').on('input', function() { self.username_dirty = true; });
+ $('#accounts-create-user-name').on('input', function() { self.username_dirty = true });
},
enter: function() {
@@ -1411,9 +1411,9 @@ function show_unexpected_error(error) {
function dialog_setup(d) {
d.setup();
$('#' + d.id).
- on('show.bs.modal', function () { d.enter(); }).
- on('shown.bs.modal', function () { d.show(); }).
- on('hidden.bs.modal', function () { d.leave(); });
+ on('show.bs.modal', function () { d.enter() }).
+ on('shown.bs.modal', function () { d.show() }).
+ on('hidden.bs.modal', function () { d.leave() });
}
function page_show(p, arg) {
diff --git a/webpack.config.js b/webpack.config.js
index f8c8ae531115..35c3adfe8c3c 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -491,5 +491,6 @@ module.exports = {
undef: true,
unused: "vars",
predef: [ "window", "document", "console" ],
+ lastsemic : true,
},
};