getConnectionThemeMode
Description
Returns the server connection theme name the app is currently using.
LucyStudio lets you define server connection settings as several "connection themes". Each theme holds its own server details, such as IP address and port. Typically you use them to separate a development server (TestMode) from a production server (RealMode).
The theme selected last is restored automatically when the app starts, and this function tells you which theme the current connection uses.
Parameters
None
Returns
| Type | Description |
|---|---|
| String | Name of the active connection theme (for example, "TestMode" or "RealMode"). Returns an empty string "" when no theme exists |
Notes
- Connection themes must be predefined in the LucyStudio server connection settings.
- The current theme name is stored on disk under the
SERVER_MODEkey, so it survives an app restart. - To see every available theme name, use
$app.getThemeModes(). - When a theme's
isRealproperty isfalse, the app runs in test mode (see$app.isTestMode()).
Example
// Check the current connection theme
var mode = $app.getConnectionThemeMode();
console.log("현재 모드:", mode); // "TestMode" or "RealMode"
// Branch on the server environment
if (mode === "RealMode") {
$app.showAlert("운영 서버에 연결되어 있습니다.");
} else {
$app.showAlert("개발 서버에 연결되어 있습니다. (모드: " + mode + ")");
}
// Check the list of all available themes
var modes = $app.getThemeModes();
console.log("전체 테마:", modes); // ["TestMode", "RealMode"]