Allow renaming devices from the monitor, localhost only by default
This commit is contained in:
1 parent
4320f55bd4
commit
a28db4d1c9
2 files changed
+307
-9
No files matched your search
+15
-1
@@ -372,7 +372,10 @@ def cmd_monitor(args):
|
||||
|
||||
try:
|
||||
server, sampler = monitor_module.serve(
|
||||
port=args.port, interval=args.interval, host=args.host
|
||||
port=args.port,
|
||||
interval=args.interval,
|
||||
host=args.host,
|
||||
allow_remote_edit=args.allow_remote_edit,
|
||||
)
|
||||
except OSError as err:
|
||||
fail(
|
||||
@@ -388,6 +391,12 @@ def cmd_monitor(args):
|
||||
print(" Anker box says it has no live data:")
|
||||
print(f" {paths.command('service <profile>')}")
|
||||
print()
|
||||
if monitor_module.Handler.allow_edit:
|
||||
print(" Click a device name to rename it.")
|
||||
else:
|
||||
print(" Renaming is disabled because this is reachable from other")
|
||||
print(" machines. Add --allow-remote-edit to permit it.")
|
||||
print()
|
||||
print(" Press Ctrl-C to stop.")
|
||||
|
||||
if not args.no_open:
|
||||
@@ -1384,6 +1393,11 @@ def build_parser():
|
||||
monitor_parser.add_argument(
|
||||
"--no-open", action="store_true", help="do not open a browser"
|
||||
)
|
||||
monitor_parser.add_argument(
|
||||
"--allow-remote-edit",
|
||||
action="store_true",
|
||||
help="permit renaming devices even when reachable from other machines",
|
||||
)
|
||||
monitor_parser.set_defaults(func=cmd_monitor)
|
||||
|
||||
service_parser = subparsers.add_parser(
|
||||
|
||||
Reference in new issue
Block a user