mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
Web interface spelling fixes and improvements
Also make the popup message for pasting characters change plurality depending on the amount of characters.
This commit is contained in:
parent
c9ee9b2e6a
commit
cc909352b4
@ -37,9 +37,15 @@ export function Atx() {
|
|||||||
$("atx-hdd-led").title = "Disk Activity Led";
|
$("atx-hdd-led").title = "Disk Activity Led";
|
||||||
|
|
||||||
for (let args of [
|
for (let args of [
|
||||||
["atx-power-button", "power", "Are you sure to click the power button?"],
|
["atx-power-button", "power", "Are you sure you want to press the power button?"],
|
||||||
["atx-power-button-long", "power_long", "Are you sure to perform the long press of the power button?"],
|
["atx-power-button-long", "power_long", `
|
||||||
["atx-reset-button", "reset", "Are you sure to reboot the server?"],
|
Are you sure you want to long press the power button?<br>
|
||||||
|
(Warning! This could cause data loss on the server.)
|
||||||
|
`],
|
||||||
|
["atx-reset-button", "reset", `
|
||||||
|
Are you sure you want to press the reset button?<br>
|
||||||
|
(Warning! This could case data loss on the server.)
|
||||||
|
`],
|
||||||
]) {
|
]) {
|
||||||
tools.setOnClick($(args[0]), () => __clickButton(args[1], args[2]));
|
tools.setOnClick($(args[0]), () => __clickButton(args[1], args[2]));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,7 +123,7 @@ export function Gpio() {
|
|||||||
`;
|
`;
|
||||||
} else if (item.type === "output") {
|
} else if (item.type === "output") {
|
||||||
let controls = [];
|
let controls = [];
|
||||||
let confirm = (item.confirm ? "Are you sure to act this control?" : "");
|
let confirm = (item.confirm ? "Are you sure you want to perform this action?" : "");
|
||||||
if (item.scheme["switch"]) {
|
if (item.scheme["switch"]) {
|
||||||
controls.push(`
|
controls.push(`
|
||||||
<td><div class="switch-box">
|
<td><div class="switch-box">
|
||||||
|
|||||||
@ -196,10 +196,10 @@ export function Hid() {
|
|||||||
var __clickPasteAsKeysButton = function() {
|
var __clickPasteAsKeysButton = function() {
|
||||||
let text = $("hid-pak-text").value.replace(/[^\x00-\x7F]/g, ""); // eslint-disable-line no-control-regex
|
let text = $("hid-pak-text").value.replace(/[^\x00-\x7F]/g, ""); // eslint-disable-line no-control-regex
|
||||||
if (text) {
|
if (text) {
|
||||||
let confirm_msg = `
|
let confirm_msg = text.length !== 1 ?
|
||||||
You're going to paste ${text.length} characters.<br>
|
`You're going to paste ${text.length} characters.<br>` :
|
||||||
Are you sure you want to continue?
|
`You're going to paste ${text.length} character.<br>`;
|
||||||
`;
|
confirm_msg += "Are you sure you want to continue?";
|
||||||
|
|
||||||
wm.confirm(confirm_msg).then(function(ok) {
|
wm.confirm(confirm_msg).then(function(ok) {
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user