refactor: centralize remaining error paths and popout strings via formatError + getStrings (final polish pass)
This commit is contained in:
parent
4a7803dc42
commit
a40d8d49a4
1 changed files with 7 additions and 7 deletions
|
|
@ -35,8 +35,8 @@ PluginComponent {
|
|||
onExited: (code, status) => {
|
||||
if (code !== 0) {
|
||||
var action = root.isConnected ? "disconnect" : "connect"
|
||||
var detail = toggleProcess.stderr.text.trim().slice(0, 120)
|
||||
ToastService.showError("tailscalectl", TailscaleLib.errorMessage(action) + (detail ? " — " + detail : ""))
|
||||
var detail = toggleProcess.stderr.text.trim()
|
||||
ToastService.showError("tailscalectl", TailscaleLib.formatError(action, detail))
|
||||
}
|
||||
statusCheck.running = true
|
||||
}
|
||||
|
|
@ -68,8 +68,8 @@ PluginComponent {
|
|||
|
||||
onExited: (code, status) => {
|
||||
if (code !== 0) {
|
||||
var detail = exitNodeProcess.stderr.text.trim().slice(0, 120)
|
||||
ToastService.showError("tailscalectl", TailscaleLib.errorMessage("set") + (detail ? " — " + detail : ""))
|
||||
var detail = exitNodeProcess.stderr.text.trim()
|
||||
ToastService.showError("tailscalectl", TailscaleLib.formatError("set", detail))
|
||||
}
|
||||
statusCheck.running = true
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ PluginComponent {
|
|||
root.tailscaleIP = ""
|
||||
root.currentExitNode = ""
|
||||
root.peers = []
|
||||
ToastService.showError("tailscalectl", TailscaleLib.errorMessage("status"))
|
||||
ToastService.showError("tailscalectl", TailscaleLib.formatError("status"))
|
||||
}
|
||||
|
||||
// Post-action verification: if a toggle was requested, use the fresh state we just received.
|
||||
|
|
@ -137,7 +137,7 @@ PluginComponent {
|
|||
popoutContent: Component {
|
||||
PopoutComponent {
|
||||
headerText: "Tailscale"
|
||||
detailsText: root.isConnected ? "Connected" : "Disconnected"
|
||||
detailsText: root.isConnected ? TailscaleLib.getStrings().connected : TailscaleLib.getStrings().disconnected
|
||||
showCloseButton: true
|
||||
|
||||
Item {
|
||||
|
|
@ -184,7 +184,7 @@ PluginComponent {
|
|||
Item { width: 1; height: 1; Layout.fillWidth: true }
|
||||
|
||||
StyledText {
|
||||
text: "Exit node: " + (root.currentExitNode || "None")
|
||||
text: TailscaleLib.getStrings().exitNodePrefix + (root.currentExitNode || TailscaleLib.getStrings().none)
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue