Question
Huicai Wang · Jun 26

How to get the current IP in studio.sourcecontrol

I want to achieve the same function as the management portal under the Utilities menu。

I wrote a studio.sourcecontrol menu tool. I want to use chrome to open the CSP page. Now I can open it to CSP, but the IP address is the intranet IP of the cloud server. How can I get the IP of the current studio connection?

Set Action=3
Set CompName = $p(InternalName,".CLS")
//Do ##class(%Studio.General).GetWebServerPort(.IP,.Server,.urlprefix,.ipport)
Set url= ##class(csp.csp.download).%GetParameter("CSPURL")
Set IP = $p($zu(54,13,$zu(54,0)),",")    // Intranet IP  。 I want to get the connection IP of the current studio
Set WebPort = ^%SYS("WebServer","Port")
Set Target = "chrome.exe http://"_IP_":"_WebPort_url_"?InternalName="_##class(%CSP.Page).EscapeURL(CompName)_"&Menu=HISUIMGridGen" 

Product version: IRIS 2020.1
$ZV: IRIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT
00
2 0 1 107
Log in or sign up to continue

What about 

w $system.TCPDevice.LocalAddr()?