From 58b95f1a8c4432edf766b065c40f38d89fd367e1 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Fri, 4 Nov 2022 11:30:32 +0100 Subject: [PATCH] pkg: make JavaScript keyspacing consistent cockpit-ostree enables this by default and we have to disable it now. Having consistent key spacing for all our JavaScript objects seems like something we want everywhere as eslint --fix can automatically. --- .eslintrc.json | 1 - pkg/base1/test-browser-storage.js | 2 +- pkg/base1/test-chan.js | 2 +- pkg/base1/test-framed.js | 4 +- pkg/lib/cockpit-components-shutdown.jsx | 2 +- pkg/lib/cockpit.js | 2 +- pkg/networkmanager/interfaces.js | 102 +++++++++--------- pkg/shell/hosts_dialog.jsx | 2 +- pkg/shell/indexes.jsx | 6 +- pkg/shell/machines/test-machines.js | 24 ++--- pkg/storaged/crypto-keyslots.jsx | 2 +- pkg/storaged/crypto-panel.jsx | 4 +- pkg/storaged/dialog.jsx | 12 +-- pkg/storaged/fsys-panel.jsx | 2 +- pkg/storaged/jobs-panel.jsx | 88 +++++++-------- pkg/storaged/mdraid-details.jsx | 8 +- pkg/storaged/nfs-panel.jsx | 2 +- pkg/storaged/stratis-details.jsx | 2 +- pkg/storaged/utils.js | 6 +- .../overview-cards/configurationCard.jsx | 2 +- pkg/users/account-create-dialog.js | 32 +++--- pkg/users/account-roles.js | 8 +- pkg/users/expiration-dialogs.js | 2 +- pkg/users/password-dialogs.js | 2 +- 24 files changed, 159 insertions(+), 160 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f99b8fc16..d7f7da3a2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -41,7 +41,6 @@ "curly": "off", "no-template-curly-in-string": "off", "jsx-quotes": "off", - "key-spacing": "off", "no-console": "off", "quotes": "off", "react/jsx-curly-spacing": "off", diff --git a/pkg/base1/test-browser-storage.js b/pkg/base1/test-browser-storage.js index dc301ce36..b36ec3092 100644 --- a/pkg/base1/test-browser-storage.js +++ b/pkg/base1/test-browser-storage.js @@ -5,7 +5,7 @@ function test_storage (assert, storage, cockpitStorage) { assert.expect(29); storage.clear(); window.mock = { - pathname : "/cockpit+test/test" + pathname: "/cockpit+test/test" }; assert.equal(cockpitStorage.prefixedKey("key1"), "cockpit+test:key1", "prefixed key has application"); diff --git a/pkg/base1/test-chan.js b/pkg/base1/test-chan.js index 9808cce19..d351a3d3c 100644 --- a/pkg/base1/test-chan.js +++ b/pkg/base1/test-chan.js @@ -467,7 +467,7 @@ QUnit.test("close peer", function (assert) { const cmd = { command: "close", channel: channel.id, - problem : "marmalade", + problem: "marmalade", extra: 5 }; mock_peer.send("", JSON.stringify(cmd)); diff --git a/pkg/base1/test-framed.js b/pkg/base1/test-framed.js index 7efd92369..114a914d9 100644 --- a/pkg/base1/test-framed.js +++ b/pkg/base1/test-framed.js @@ -51,7 +51,7 @@ function child_frame() { let spawn_done = false; let binary_done = false; - const promise = cockpit.spawn(["/bin/sh", "-c", "echo hi"], { host : "localhost" }) + const promise = cockpit.spawn(["/bin/sh", "-c", "echo hi"], { host: "localhost" }) .then(resp => { assert.equal(resp, "hi\n", "framed channel got output"); }) @@ -67,7 +67,7 @@ function child_frame() { const channel = cockpit.channel({ payload: "echo", binary: true, - host : "localhost" + host: "localhost" }); channel.addEventListener("message", function(ev, payload) { assert.equal(typeof payload[0], "number", "binary channel got a byte array"); diff --git a/pkg/lib/cockpit-components-shutdown.jsx b/pkg/lib/cockpit-components-shutdown.jsx index e3d918934..a5eb3b673 100644 --- a/pkg/lib/cockpit-components-shutdown.jsx +++ b/pkg/lib/cockpit-components-shutdown.jsx @@ -79,7 +79,7 @@ export class ShutdownModal extends React.Component { } updateDate(value, dateObject) { - this.setState({ date : value, dateObject }, this.calculate); + this.setState({ date: value, dateObject }, this.calculate); } updateTime(value, hour, minute) { diff --git a/pkg/lib/cockpit.js b/pkg/lib/cockpit.js index ad59c2d75..d462fb827 100644 --- a/pkg/lib/cockpit.js +++ b/pkg/lib/cockpit.js @@ -948,7 +948,7 @@ function Channel(options) { if (!options) options = { }; else if (typeof options == "string") - options = { problem : options }; + options = { problem: options }; options.command = "close"; options.channel = id; diff --git a/pkg/networkmanager/interfaces.js b/pkg/networkmanager/interfaces.js index b2127ace5..18801b0e0 100644 --- a/pkg/networkmanager/interfaces.js +++ b/pkg/networkmanager/interfaces.js @@ -483,28 +483,28 @@ export function NetworkManagerModel() { function get_ip(first, addr_from_nm, route_from_nm, ip_to_text) { return { - method: get(first, "method", "auto"), - ignore_auto_dns: get(first, "ignore-auto-dns", false), + method: get(first, "method", "auto"), + ignore_auto_dns: get(first, "ignore-auto-dns", false), ignore_auto_routes: get(first, "ignore-auto-routes", false), - addresses: get(first, "addresses", []).map(addr_from_nm), - dns: get(first, "dns", []).map(ip_to_text), - dns_search: get(first, "dns-search", []), - routes: get(first, "routes", []).map(route_from_nm) + addresses: get(first, "addresses", []).map(addr_from_nm), + dns: get(first, "dns", []).map(ip_to_text), + dns_search: get(first, "dns-search", []), + routes: get(first, "routes", []).map(route_from_nm) }; } const result = { connection: { - type: get("connection", "type"), - uuid: get("connection", "uuid"), + type: get("connection", "type"), + uuid: get("connection", "uuid"), interface_name: get("connection", "interface-name"), - timestamp: get("connection", "timestamp", 0), - id: get("connection", "id", _("Unknown")), - autoconnect: get("connection", "autoconnect", true), + timestamp: get("connection", "timestamp", 0), + id: get("connection", "id", _("Unknown")), + autoconnect: get("connection", "autoconnect", true), autoconnect_members: get("connection", "autoconnect-slaves", -1), - member_type: get("connection", "slave-type"), - group: get("connection", "master") + member_type: get("connection", "slave-type"), + group: get("connection", "master") } }; @@ -525,7 +525,7 @@ export function NetworkManagerModel() { https://www.kernel.org/doc/Documentation/networking/bonding.txt */ result.bond = { - options: { ...get("bond", "options", { }) }, + options: { ...get("bond", "options", { }) }, interface_name: get("bond", "interface-name") }; } @@ -540,39 +540,39 @@ export function NetworkManagerModel() { if (settings.team) { result.team = { - config: JSON_parse_carefully(get("team", "config", "{}")), + config: JSON_parse_carefully(get("team", "config", "{}")), interface_name: get("team", "interface-name") }; } if (settings["team-port"] || result.connection.member_type == "team") { - result.team_port = { config: JSON_parse_carefully(get("team-port", "config", "{}")), }; + result.team_port = { config: JSON_parse_carefully(get("team-port", "config", "{}")), }; } if (settings.bridge) { result.bridge = { interface_name: get("bridge", "interface-name"), - stp: get("bridge", "stp", true), - priority: get("bridge", "priority", 32768), - forward_delay: get("bridge", "forward-delay", 15), - hello_time: get("bridge", "hello-time", 2), - max_age: get("bridge", "max-age", 20), - ageing_time: get("bridge", "ageing-time", 300) + stp: get("bridge", "stp", true), + priority: get("bridge", "priority", 32768), + forward_delay: get("bridge", "forward-delay", 15), + hello_time: get("bridge", "hello-time", 2), + max_age: get("bridge", "max-age", 20), + ageing_time: get("bridge", "ageing-time", 300) }; } if (settings["bridge-port"] || result.connection.member_type == "bridge") { result.bridge_port = { - priority: get("bridge-port", "priority", 32), - path_cost: get("bridge-port", "path-cost", 100), - hairpin_mode: get("bridge-port", "hairpin-mode", false) + priority: get("bridge-port", "priority", 32), + path_cost: get("bridge-port", "path-cost", 100), + hairpin_mode: get("bridge-port", "hairpin-mode", false) }; } if (settings.vlan) { result.vlan = { - parent: get("vlan", "parent"), - id: get("vlan", "id"), + parent: get("vlan", "parent"), + id: get("vlan", "id"), interface_name: get("vlan", "interface-name") }; } @@ -823,7 +823,7 @@ export function NetworkManagerModel() { ], props: { - Addresses: { conv: conv_Array(ip4_address_from_nm), def: [] } + Addresses: { conv: conv_Array(ip4_address_from_nm), def: [] } } }; @@ -833,7 +833,7 @@ export function NetworkManagerModel() { ], props: { - Addresses: { conv: conv_Array(ip6_address_from_nm), def: [] } + Addresses: { conv: conv_Array(ip6_address_from_nm), def: [] } } }; @@ -843,7 +843,7 @@ export function NetworkManagerModel() { ], props: { - Unsaved: { } + Unsaved: { } }, signals: { @@ -945,9 +945,9 @@ export function NetworkManagerModel() { ], props: { - Connection: { conv: conv_Object(type_Connection) }, - Ip4Config: { conv: conv_Object(type_Ipv4Config) }, - Ip6Config: { conv: conv_Object(type_Ipv6Config) } + Connection: { conv: conv_Object(type_Connection) }, + Ip4Config: { conv: conv_Object(type_Ipv4Config) }, + Ip6Config: { conv: conv_Object(type_Ipv6Config) } // See below for "Group" }, @@ -972,22 +972,22 @@ export function NetworkManagerModel() { ], props: { - DeviceType: { conv: device_type_to_symbol }, - Interface: { }, - StateText: { prop: "State", conv: device_state_to_text, def: _("Unknown") }, - State: { }, - HwAddress: { }, + DeviceType: { conv: device_type_to_symbol }, + Interface: { }, + StateText: { prop: "State", conv: device_state_to_text, def: _("Unknown") }, + State: { }, + HwAddress: { }, AvailableConnections: { conv: conv_Array(conv_Object(type_Connection)), def: [] }, - ActiveConnection: { conv: conv_Object(type_ActiveConnection) }, - Ip4Config: { conv: conv_Object(type_Ipv4Config) }, - Ip6Config: { conv: conv_Object(type_Ipv6Config) }, - Udi: { trigger: refresh_udev }, - IdVendor: { def: "" }, - IdModel: { def: "" }, - Driver: { def: "" }, - Carrier: { def: true }, - Speed: { }, - Managed: { def: false }, + ActiveConnection: { conv: conv_Object(type_ActiveConnection) }, + Ip4Config: { conv: conv_Object(type_Ipv4Config) }, + Ip6Config: { conv: conv_Object(type_Ipv6Config) }, + Udi: { trigger: refresh_udev }, + IdVendor: { def: "" }, + IdModel: { def: "" }, + Driver: { def: "" }, + Carrier: { def: true }, + Speed: { }, + Managed: { def: false }, // See below for "Members" }, @@ -1102,7 +1102,7 @@ export function NetworkManagerModel() { ], props: { - Connections: { conv: conv_Array(conv_Object(type_Connection)), def: [] } + Connections: { conv: conv_Array(conv_Object(type_Connection)), def: [] } }, prototype: { @@ -1155,12 +1155,12 @@ export function NetworkManagerModel() { ], props: { - Version: { }, + Version: { }, Devices: { conv: conv_Array(conv_Object(type_Device)), def: [] }, - ActiveConnections: { conv: conv_Array(conv_Object(type_ActiveConnection)), def: [] } + ActiveConnections: { conv: conv_Array(conv_Object(type_ActiveConnection)), def: [] } }, prototype: { diff --git a/pkg/shell/hosts_dialog.jsx b/pkg/shell/hosts_dialog.jsx index 46af491c5..7bc51131e 100644 --- a/pkg/shell/hosts_dialog.jsx +++ b/pkg/shell/hosts_dialog.jsx @@ -698,7 +698,7 @@ class ChangeAuth extends React.Component { return this.props.try2Connect(this.props.full_address, options) .then(() => { if (machine) - return this.props.machines_ins.change(machine.address, { user : user }); + return this.props.machines_ins.change(machine.address, { user: user }); else return Promise.resolve(); }) diff --git a/pkg/shell/indexes.jsx b/pkg/shell/indexes.jsx index 922f2db95..8aaa56b97 100644 --- a/pkg/shell/indexes.jsx +++ b/pkg/shell/indexes.jsx @@ -280,10 +280,10 @@ function MachinesIndex(index_options, machines, loader) { } const new_item = Object.assign({}, item); - new_item.keyword = { score:-1 }; + new_item.keyword = { score: -1 }; if (!term) return new_item; - const best_keyword = new_item.keywords.reduce(keyword_relevance, { score:-1 }); + const best_keyword = new_item.keywords.reduce(keyword_relevance, { score: -1 }); if (best_keyword.score > -1) { new_item.keyword = best_keyword; return new_item; @@ -327,7 +327,7 @@ function MachinesIndex(index_options, machines, loader) { name: _("Apps"), items: compiled.ordered("dashboard"), }, { - name: _("System"), + name: _("System"), items: compiled.ordered("menu"), }, { name: _("Tools"), diff --git a/pkg/shell/machines/test-machines.js b/pkg/shell/machines/test-machines.js index a8efab2a5..fa0f7b602 100644 --- a/pkg/shell/machines/test-machines.js +++ b/pkg/shell/machines/test-machines.js @@ -85,7 +85,7 @@ QUnit.test("merge several JSON files", function (assert) { assert, { "01-green.json": '{"green": {"visible": true, "address": "1.2.3.4"}}', - "02-blue.json": '{"blue": {"address": "9.8.7.6"}}', + "02-blue.json": '{"blue": {"address": "9.8.7.6"}}', "09-webui.json": '{"green": {"visible": false}, ' + ' "blue": {"user": "joe"}, ' + ' "yellow": {"address": "fe80::1", "user": "sue"}}' @@ -111,21 +111,21 @@ QUnit.test("merge JSON files with errors", function (assert) { machinesParseTest( assert, { - "01-valid.json": '{"green": {"visible": true, "address": "1.2.3.4"}}', - "02-syntax.json": '[a', - "03-toptype.json": '["green"]', - "04-toptype.json": '{"green": ["visible"]}', - "05-valid.json": '{"blue": {"address": "fe80::1"}}', + "01-valid.json": '{"green": {"visible": true, "address": "1.2.3.4"}}', + "02-syntax.json": '[a', + "03-toptype.json": '["green"]', + "04-toptype.json": '{"green": ["visible"]}', + "05-valid.json": '{"blue": {"address": "fe80::1"}}', // goodprop should still be considered "06-proptype.json": '{"green": {"visible": [], "address": {"bar": null}, "goodprop": "yeah"}}', - "07-valid.json": '{"green": {"user": "joe"}}', - "08-empty.json": '' + "07-valid.json": '{"green": {"user": "joe"}}', + "08-empty.json": '' }, { green: { - address: { t: "s", v: "1.2.3.4" }, - visible: { t: "b", v: true }, - user: { t: "s", v: "joe" }, + address: { t: "s", v: "1.2.3.4" }, + visible: { t: "b", v: true }, + user: { t: "s", v: "joe" }, goodprop: { t: "s", v: "yeah" }, }, blue: { @@ -177,7 +177,7 @@ QUnit.test("add host to existing map", function (assert) { { visible: cockpit.variant('b', false), address: cockpit.variant('s', "9.8.7.6") }, { green: { address: "1.2.3.4", visible: true }, - blue: { address: "9.8.7.6", visible: false } + blue: { address: "9.8.7.6", visible: false } }); }); diff --git a/pkg/storaged/crypto-keyslots.jsx b/pkg/storaged/crypto-keyslots.jsx index 8040209f4..12754dd34 100644 --- a/pkg/storaged/crypto-keyslots.jsx +++ b/pkg/storaged/crypto-keyslots.jsx @@ -70,7 +70,7 @@ function jwk_b64_encode(bytes) { function compute_thp(jwk) { const REQUIRED_ATTRS = { RSA: ['kty', 'p', 'd', 'q', 'dp', 'dq', 'qi', 'oth'], - EC: ['kty', 'crv', 'x', 'y'], + EC: ['kty', 'crv', 'x', 'y'], oct: ['kty', 'k'], }; diff --git a/pkg/storaged/crypto-panel.jsx b/pkg/storaged/crypto-panel.jsx index cfe465c1f..5c13f28ee 100644 --- a/pkg/storaged/crypto-panel.jsx +++ b/pkg/storaged/crypto-panel.jsx @@ -52,8 +52,8 @@ export class LockedCryptoPanel extends React.Component { return { props: { path, client, key: path }, columns: [ - { title: name }, - { title: block_name(block) }, + { title: name }, + { title: block_name(block) }, ] }; } diff --git a/pkg/storaged/dialog.jsx b/pkg/storaged/dialog.jsx index 9372a8672..1d5a9584e 100644 --- a/pkg/storaged/dialog.jsx +++ b/pkg/storaged/dialog.jsx @@ -1022,9 +1022,9 @@ export const SizeSlider = (tag, title, options) => { export const BlockingMessage = (usage) => { const usage_desc = { - pvol: _("physical volume of LVM2 volume group"), - mdraid: _("member of RAID device"), - vdo: _("backing device for VDO device"), + pvol: _("physical volume of LVM2 volume group"), + mdraid: _("member of RAID device"), + vdo: _("backing device for VDO device"), "stratis-pool-member": _("member of Stratis pool") }; @@ -1048,7 +1048,7 @@ export const BlockingMessage = (usage) => { columns={[ { title: _("Device") }, { title: _("Location") }, - { title: _("Use") } + { title: _("Use") } ]} rows={rows} /> ); @@ -1126,8 +1126,8 @@ export const TeardownMessage = (usage) => { columns={[ { title: _("Device") }, { title: _("Location") }, - { title: _("Action") }, - { title: "" } + { title: _("Action") }, + { title: "" } ]} rows={rows} /> ); diff --git a/pkg/storaged/fsys-panel.jsx b/pkg/storaged/fsys-panel.jsx index 1218aa2ab..2e69b95c3 100644 --- a/pkg/storaged/fsys-panel.jsx +++ b/pkg/storaged/fsys-panel.jsx @@ -177,7 +177,7 @@ export class FilesystemsPanel extends React.Component { { title: _("Source"), sortable: true }, { title: _("Type"), sortable: true }, { title: _("Mount"), sortable: true }, - { title: _("Size") } + { title: _("Size") } ]} rows={mounts.concat(flatten(pools))} /> diff --git a/pkg/storaged/jobs-panel.jsx b/pkg/storaged/jobs-panel.jsx index 5aad79a76..9f0a058fe 100644 --- a/pkg/storaged/jobs-panel.jsx +++ b/pkg/storaged/jobs-panel.jsx @@ -39,50 +39,50 @@ const _ = cockpit.gettext; */ const descriptions = { - 'ata-smart-selftest': _("SMART self-test of $target"), - 'drive-eject': _("Ejecting $target"), - 'encrypted-unlock': _("Unlocking $target"), - 'encrypted-lock': _("Locking $target"), - 'encrypted-modify': _("Modifying $target"), - 'encrypted-resize': _("Resizing $target"), - 'swapspace-start': _("Starting swapspace $target"), - 'swapspace-stop': _("Stopping swapspace $target"), - 'filesystem-mount': _("Mounting $target"), - 'filesystem-unmount': _("Unmounting $target"), - 'filesystem-modify': _("Modifying $target"), - 'filesystem-resize': _("Resizing $target"), - 'filesystem-check': _("Checking $target"), - 'filesystem-repair': _("Repairing $target"), - 'format-erase': _("Erasing $target"), - 'format-mkfs': _("Creating filesystem on $target"), - 'loop-setup': _("Setting up loop device $target"), - 'partition-modify': _("Modifying $target"), - 'partition-delete': _("Deleting $target"), - 'partition-create': _("Creating partition $target"), - cleanup: _("Cleaning up for $target"), - 'ata-secure-erase': _("Securely erasing $target"), - 'ata-enhanced-secure-erase': _("Very securely erasing $target"), - 'md-raid-stop': _("Stopping RAID device $target"), - 'md-raid-start': _("Starting RAID device $target"), - 'md-raid-fault-device': _("Marking $target as faulty"), - 'md-raid-remove-device': _("Removing $target from RAID device"), - 'md-raid-create': _("Creating RAID device $target"), - 'mdraid-check-job': _("Checking RAID device $target"), - 'mdraid-repair-job': _("Checking and repairing RAID device $target"), - 'mdraid-recover-job': _("Recovering RAID device $target"), - 'mdraid-sync-job': _("Synchronizing RAID device $target"), - 'lvm-lvol-delete': _("Deleting $target"), - 'lvm-lvol-activate': _("Activating $target"), - 'lvm-lvol-deactivate': _("Deactivating $target"), - 'lvm-lvol-snapshot': _("Creating snapshot of $target"), - 'lvm-vg-create': _("Creating LVM2 volume group $target"), - 'lvm-vg-delete': _("Deleting LVM2 volume group $target"), - 'lvm-vg-add-device': _("Adding physical volume to $target"), - 'lvm-vg-rem-device': _("Removing physical volume from $target"), - 'lvm-vg-empty-device': _("Emptying $target"), - 'lvm-vg-create-volume': _("Creating logical volume $target"), - 'lvm-vg-rename': _("Renaming $target"), - 'lvm-vg-resize': _("Resizing $target") + 'ata-smart-selftest': _("SMART self-test of $target"), + 'drive-eject': _("Ejecting $target"), + 'encrypted-unlock': _("Unlocking $target"), + 'encrypted-lock': _("Locking $target"), + 'encrypted-modify': _("Modifying $target"), + 'encrypted-resize': _("Resizing $target"), + 'swapspace-start': _("Starting swapspace $target"), + 'swapspace-stop': _("Stopping swapspace $target"), + 'filesystem-mount': _("Mounting $target"), + 'filesystem-unmount': _("Unmounting $target"), + 'filesystem-modify': _("Modifying $target"), + 'filesystem-resize': _("Resizing $target"), + 'filesystem-check': _("Checking $target"), + 'filesystem-repair': _("Repairing $target"), + 'format-erase': _("Erasing $target"), + 'format-mkfs': _("Creating filesystem on $target"), + 'loop-setup': _("Setting up loop device $target"), + 'partition-modify': _("Modifying $target"), + 'partition-delete': _("Deleting $target"), + 'partition-create': _("Creating partition $target"), + cleanup: _("Cleaning up for $target"), + 'ata-secure-erase': _("Securely erasing $target"), + 'ata-enhanced-secure-erase': _("Very securely erasing $target"), + 'md-raid-stop': _("Stopping RAID device $target"), + 'md-raid-start': _("Starting RAID device $target"), + 'md-raid-fault-device': _("Marking $target as faulty"), + 'md-raid-remove-device': _("Removing $target from RAID device"), + 'md-raid-create': _("Creating RAID device $target"), + 'mdraid-check-job': _("Checking RAID device $target"), + 'mdraid-repair-job': _("Checking and repairing RAID device $target"), + 'mdraid-recover-job': _("Recovering RAID device $target"), + 'mdraid-sync-job': _("Synchronizing RAID device $target"), + 'lvm-lvol-delete': _("Deleting $target"), + 'lvm-lvol-activate': _("Activating $target"), + 'lvm-lvol-deactivate': _("Deactivating $target"), + 'lvm-lvol-snapshot': _("Creating snapshot of $target"), + 'lvm-vg-create': _("Creating LVM2 volume group $target"), + 'lvm-vg-delete': _("Deleting LVM2 volume group $target"), + 'lvm-vg-add-device': _("Adding physical volume to $target"), + 'lvm-vg-rem-device': _("Removing physical volume from $target"), + 'lvm-vg-empty-device': _("Emptying $target"), + 'lvm-vg-create-volume': _("Creating logical volume $target"), + 'lvm-vg-rename': _("Renaming $target"), + 'lvm-vg-resize': _("Resizing $target") }; function make_description(client, job) { diff --git a/pkg/storaged/mdraid-details.jsx b/pkg/storaged/mdraid-details.jsx index 5e15b010c..c8ab2aeaa 100644 --- a/pkg/storaged/mdraid-details.jsx +++ b/pkg/storaged/mdraid-details.jsx @@ -108,11 +108,11 @@ class MDRaidSidebar extends React.Component { function state_text(state) { return { - faulty: _("Failed"), - in_sync: _("In sync"), - spare: active_state[1] < 0 ? _("Spare") : _("Recovering"), + faulty: _("Failed"), + in_sync: _("In sync"), + spare: active_state[1] < 0 ? _("Spare") : _("Recovering"), write_mostly: _("Write-mostly"), - blocked: _("Blocked") + blocked: _("Blocked") }[state] || cockpit.format(_("Unknown ($0)"), state); } diff --git a/pkg/storaged/nfs-panel.jsx b/pkg/storaged/nfs-panel.jsx index c5b516bad..f84abdda3 100644 --- a/pkg/storaged/nfs-panel.jsx +++ b/pkg/storaged/nfs-panel.jsx @@ -101,7 +101,7 @@ export class NFSPanel extends React.Component { columns={[ { title: _("Server"), sortable: true }, { title: _("Mount point"), sortable: true }, - { title: _("Size") } + { title: _("Size") } ]} rows={mounts} /> diff --git a/pkg/storaged/stratis-details.jsx b/pkg/storaged/stratis-details.jsx index 16dea2781..065901ef3 100644 --- a/pkg/storaged/stratis-details.jsx +++ b/pkg/storaged/stratis-details.jsx @@ -204,7 +204,7 @@ const StratisPoolSidebar = ({ client, pool }) => { desc = cockpit.format(_("$0 of unknown tier"), fmt_size(Number(blockdev.TotalPhysicalSize))); - return { client, block, detail: desc, key:blockdev.path }; + return { client, block, detail: desc, key: blockdev.path }; } const actions = ( diff --git a/pkg/storaged/utils.js b/pkg/storaged/utils.js index 6c67bc679..c20e41a70 100644 --- a/pkg/storaged/utils.js +++ b/pkg/storaged/utils.js @@ -143,9 +143,9 @@ export function validate_lvm2_name(name) { export function validate_fsys_label(label, type) { const fs_label_max = { - xfs: 12, - ext4: 16, - vfat: 11, + xfs: 12, + ext4: 16, + vfat: 11, ntfs: 128, }; diff --git a/pkg/systemd/overview-cards/configurationCard.jsx b/pkg/systemd/overview-cards/configurationCard.jsx index c02716224..45f6a1d41 100644 --- a/pkg/systemd/overview-cards/configurationCard.jsx +++ b/pkg/systemd/overview-cards/configurationCard.jsx @@ -210,7 +210,7 @@ const PageSystemInformationChangeHostname = () => { const [error, set_error] = useState([]); useInit(() => { - const client = cockpit.dbus('org.freedesktop.hostname1', { superuser : "try" }); + const client = cockpit.dbus('org.freedesktop.hostname1', { superuser: "try" }); const hostname_proxy = client.proxy(); hostname_proxy.wait() diff --git a/pkg/users/account-create-dialog.js b/pkg/users/account-create-dialog.js index 49fbf9f6b..5c23e5f30 100644 --- a/pkg/users/account-create-dialog.js +++ b/pkg/users/account-create-dialog.js @@ -119,22 +119,22 @@ function validate_username(username, accounts) { function suggest_username(realname) { function remove_diacritics(str) { const translate_table = { - a : '[àáâãäå]', - ae: 'æ', - c : '[čç]', - d : 'ď', - e : '[èéêë]', - i : '[íìïî]', - l : '[ĺľ]', - n : '[ňñ]', - o : '[òóôõö]', - oe: 'œ', - r : '[ŕř]', - s : 'š', - t : 'ť', - u : '[ùúůûűü]', - y : '[ýÿ]', - z : 'ž', + a: '[àáâãäå]', + ae: 'æ', + c: '[čç]', + d: 'ď', + e: '[èéêë]', + i: '[íìïî]', + l: '[ĺľ]', + n: '[ňñ]', + o: '[òóôõö]', + oe: 'œ', + r: '[ŕř]', + s: 'š', + t: 'ť', + u: '[ùúůûűü]', + y: '[ýÿ]', + z: 'ž', }; for (const i in translate_table) str = str.replace(new RegExp(translate_table[i], 'g'), i); diff --git a/pkg/users/account-roles.js b/pkg/users/account-roles.js index 6fd07056c..2ec63fe2d 100644 --- a/pkg/users/account-roles.js +++ b/pkg/users/account-roles.js @@ -54,10 +54,10 @@ export function AccountRoles({ account, groups, currently_logged_in }) { } const role_groups = { - wheel: _("Server administrator"), - sudo: _("Server administrator"), - docker: _("Container administrator"), - weldr: _("Image builder") + wheel: _("Server administrator"), + sudo: _("Server administrator"), + docker: _("Container administrator"), + weldr: _("Image builder") }; const roles = []; diff --git a/pkg/users/expiration-dialogs.js b/pkg/users/expiration-dialogs.js index 3d811049f..4ae408596 100644 --- a/pkg/users/expiration-dialogs.js +++ b/pkg/users/expiration-dialogs.js @@ -119,7 +119,7 @@ export function account_expiration_dialog(account, expire_date) { } else prog.push(""); prog.push(account.name); - return cockpit.spawn(prog, { superuser : true, err: "message" }); + return cockpit.spawn(prog, { superuser: true, err: "message" }); } else { update(); return Promise.reject(); diff --git a/pkg/users/password-dialogs.js b/pkg/users/password-dialogs.js index fc517380d..0f7955146 100644 --- a/pkg/users/password-dialogs.js +++ b/pkg/users/password-dialogs.js @@ -278,7 +278,7 @@ export function reset_password_dialog(account) { style: "primary", clicked: () => { return cockpit.spawn(["/usr/bin/passwd", "-e", account.name], - { superuser : true, err: "message" }); + { superuser: true, err: "message" }); } } ]