+
    ñOsjÀ  ã                   ó  € R t ^ RIt^ RIt^ RIt^ RIHtHtHt ^ RIHt ^ RI	t	^ RI
Ht ^ RIHtHtHt ^ RIHt  ! R R]4      t]! 4       sR	 R
 ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR# )z:System operations used by the Remote Office Center routes.N)ÚdatetimeÚ	timedeltaÚtimezone)Ú	TypedDict)Úconfig)ÚAndroidDeviceRegistrationÚPhoneHealthÚPhoneHealthUpdate)Úwakec                   ó0   a € ] tR t^t o RtV 3R ltRtV tR# )ÚSystemHealthz:Desktop health information exposed by the system endpoint.c                óV   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[;R&   S[;R&   S[ ;R&   # )é   ÚhostnameÚcpuÚramÚdiskÚuptime)ÚstrÚfloat)ÚformatÚ__classdict__s   "€ÚD:\RemoteOffice\app\services.pyÚ__annotate__ÚSystemHealth.__annotate__   sA   ø‡ ‚ ñ �Mñ ñ 
�Jñ	 ñ
 
�Jñ ñ �Kñ ñ �Kò ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s   ø‡ € ÙD÷ ƒ r   r   c                ó   € V ^8„  d   QhRR/# ©r   ÚreturnNr   )r   s   "r   r   r      s   € ÷ ñ �dñ r   c                 ó8   € \        \        P                  4       R# )z;Send the existing Wake-on-LAN packet to the office desktop.N)r
   r   ÚMACr   r   r   Úwake_desktopr*      s   € äŒ�‰Ör   c                ó$   € V ^8„  d   QhR\         /# ©r   r'   )Úbool)r   s   "r   r   r   $   s   € ÷ "ñ "œ4ñ "r   c                 ó®   € \         P                  ! \        P                  \        P                  R\        P
                  .RRR7      p V P                  ^ 8H  # )zIReturn whether the configured desktop answers one platform-specific ping.Ú1T©Úcapture_outputÚtext)Ú
subprocessÚrunr   ÚPING_COMMANDÚPING_COUNT_ARGUMENTÚ
DESKTOP_IPÚ
returncode)Úresults    r   Úis_desktop_onliner:   $   sN   € ä�^Š^ä×ÑÜ×&Ñ&ØÜ×Ñð		
ð Øô	€Fð ×Ñ Ñ!Ð!r   c                ó   € V ^8„  d   QhRR/# r&   r   )r   s   "r   r   r   3   s   € ÷ Mñ M˜$ñ Mr   c                 óp   € \         P                  ! \        P                  R\        P                  .4       R# )z0Launch RustDesk using the configured desktop ID.z	--connectN)r3   ÚPopenr   ÚRUSTDESK_EXEÚRUSTDESK_IDr   r   r   Úconnect_rustdeskr@   3   s#   € ä×Ò”f×)Ñ)¨;¼×8JÑ8JÐKÖLr   c                ó   € V ^8„  d   QhRR/# r&   r   )r   s   "r   r   r   8   s   € ÷ Gñ G˜ñ Gr   c                 ón   € \         P                  ! \        P                  \        P                  .4       R# )zDOpen the configured NAS folder with the host's file-manager command.N)r3   r=   r   ÚFILE_MANAGER_COMMANDÚ
NAS_FOLDERr   r   r   Úopen_nas_folderrE   8   s!   € ä×Ò”f×1Ñ1´6×3DÑ3DÐEÖFr   c                ó$   € V ^8„  d   QhR\         /# r,   )r   )r   s   "r   r   r   =   s   € ÷ 
ñ 
œ<ñ 
r   c                 ó¢  € \        ^ \        \        P                  ! 4       \        P                  ! 4       ,
          4      4      p R\
        P                  ! 4       R\        P                  ! 4       R\        P                  ! 4       P                  R\        P                  ! \        P                  4      P                  R\        \        V R7      4      /# )z:Return the local machine's current desktop health metrics.r   r   r   r   r   )Úseconds)ÚmaxÚintÚtimeÚpsutilÚ	boot_timeÚsocketÚgethostnameÚcpu_percentÚvirtual_memoryÚpercentÚ
disk_usager   ÚSYSTEM_DISK_PATHr   r   )Úuptime_secondss    r   Úget_system_healthrV   =   sŽ   € ä˜œC¤§	¢	£¬f×.>Ò.>Ó.@Õ @ÓAÓB€Nð 	”F×&Ò&Ó(ØŒv×!Ò!Ó#ØŒv×$Ò$Ó&×.Ñ.Ø”×!Ò!¤&×"9Ñ"9Ó:×BÑBØ”#”i¨Ô7Ó8ðð r   c                ó$   € V ^8„  d   QhR\         /# r,   )r   )r   s   "r   r   r   J   s   € ÷ ñ œ+ñ r   c                 ó   € \         # )z7Return the most recent Android companion health report.)Ú_phone_healthr   r   r   Úget_phone_healthrZ   J   s   € äÐr   c                óR   € V ^8„  d   QhR\         \        \        3,          R\        /# )r   Úupdated_valuesr'   )Údictr   Úobjectr   )r   s   "r   r   r   O   s#   € ÷ ñ ¬¬S´&¨[Õ(9ð ¼kñ r   c                ó:   € \         P                  V R7      s \         # )zBMerge supplied Android data into the latest in-memory phone state.)Úupdate)rY   Ú
model_copy)r\   s   &r   Ú_store_phone_healthrb   O   s   € ô "×,Ñ,°NÐ,ÓC€MÜÐr   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úreportr'   )r	   r   )r   s   "r   r   r   W   s   € ÷ /ñ /Ô 1ð /´kñ /r   c                ó˜   € V P                  RR7      pRV9  d(   \        P                  ! \        P                  4      VR&   \        V4      # )zFStore submitted Android health, telemetry, and device identity values.T©Úexclude_unsetÚ	last_seen©Ú
model_dumpr   Únowr   Úutcrb   )rd   r\   s   & r   Úupdate_phone_healthrm   W   sA   € à×&Ñ&°TÐ&Ó:€Nð ˜.Ô(Ü&.§l¢l´8·<±<Ó&@ˆ�{Ñ#ä˜~Ó.Ð.r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úregistrationr'   )r   r   )r   s   "r   r   r   b   s   € ÷ /ñ /Ô*Cð /Ìñ /r   c                óŠ   € V P                  RR7      p\        P                  ! \        P                  4      VR&   \        V4      # )zDStore Android identity details, including an optional serial number.Trf   rh   ri   )ro   r\   s   & r   Úregister_android_devicerq   b   s7   € à!×,Ñ,¸4Ð,Ó@€NÜ"*§,¢,¬x¯|©|Ó"<€N�;ÑÜ˜~Ó.Ð.r   c                ó<   € V ^8„  d   QhR\         R\         R\        /# )r   Ústatus_textÚdevicer'   )r   r-   )r   s   "r   r   r   i   s!   € ÷ +ñ +¬Sð +¼#ð +Ä$ñ +r   c                ó\   € W9  d   R# V P                  V^4      ^,          R,          pRV9  # )zDPreserve the dashboard's original Tailscale status parsing behavior.F:Néx   NÚoffline)Úsplit)rs   rt   Údevice_sections   && r   Ú_is_tailscale_device_onlinerz   i   s2   € àÔ Ùà ×&Ñ& v¨qÓ1°!Õ4°TÕ:€NØ˜NÑ*Ð*r   c                ó”   € V ^8„  d   QhR\         \        \        3,          \         \        \        \        ,          3,          ,          /# r,   )r]   r   r-   )r   s   "r   r   r   r   s-   € ÷ 
ñ 
œd¤3¬ 9�o´´S¼$Ä½*°_Õ0EÕEñ 
r   c                 ó„  €  \         P                  ! \        P                  \        P                  .RRR7      p V P
                  P                  4       p\        P                  P                  4        UUu/ uF  w  r#V\        W4      bK  	  upp# u uppi   \         d    pRRRRRRRRR\        T4      /u R	p?# R	p?ii ; i)
zJReturn online states from ``tailscale status`` with the existing fallback.Tr0   ÚdesktopFÚphoneÚnasÚlaptopÚerrorN)r3   r4   r   ÚTAILSCALE_COMMANDÚTAILSCALE_STATUS_ARGUMENTÚstdoutÚlowerÚTAILSCALE_DEVICESÚitemsrz   Ú	Exceptionr   )r9   rs   Únamert   r�   s        r   Úget_tailscale_statusrŠ   r   s¿   € ð
Ü—’Ü×%Ñ%¤v×'GÑ'GÐHØØô
ˆð
 —m‘m×)Ñ)Ó+ˆô !'× 8Ñ 8× >Ñ >Ô @ô
á @‘�ð Ô-¨kÓBÒBÙ @ò
ð 	
ùó 
øô ô 
à�uØ�UØ�5Ø�eØ”S˜“Zð
õ 	
ûð
ús0   ‚A2B Á4BÂB ÂB ÂB?Â B:Â4B?Â:B?)r!   rN   r3   rK   r   r   r   Útypingr   rL   Úappr   Úapp.schemasr   r   r	   Úapp.wolr
   r   rY   r*   r:   r@   rE   rV   rZ   rb   rm   rq   rz   rŠ   r   r   r   Ú<module>r�      sw   ðÙ @ã Û Û ß 2Ñ 2Ý ã å ß QÑ QÝ ô�9ô ñ “€õõ
"õMõ
Gõ

õõ
õ/õ/õ+÷
r   