Skip to content

Commit

Permalink
feat: unify terminology to preopen ports (#1861)
Browse files Browse the repository at this point in the history
  • Loading branch information
agatha197 authored Aug 14, 2023
1 parent 9a2162a commit 887d72f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion config.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ force2FA = false # If true, user should be register the 2
appDownloadUrl = "" # URL to download the electron app. If blank, https://github.com/lablup/backend.ai-webui/releases/download will be used.
systemSSHImage = "" # This image is used to launch ssh session from the filebrowser dialog to support fast uploading.
directoryBasedUsage = false # If true, display the amount of usage per directory such as folder capacity, and number of files and directories.
maxCountForPreOpenedPort = 10 # The maximum allowed number of pre-opened ports. If you set this option to 0, the pre-open port is disabled.
maxCountForPreopenPorts = 10 # The maximum allowed number of preopen ports. If you set this option to 0, the feature of preopen ports is disabled.

[wsproxy]
proxyURL = "[Proxy URL]"
Expand Down
18 changes: 9 additions & 9 deletions resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"ResetStartTime": "Please reset the start time.",
"InfiniteTime": "Infinite",
"SetEnvironmentVariable": "Environment Variable (optional)",
"SetPreopenPorts": "Pre-open Ports (optional)",
"SetPreopenPorts": "Preopen Ports (optional)",
"Config": "Config",
"ChooseEnvironment": "Choose Environment",
"Version": "Version",
Expand Down Expand Up @@ -213,7 +213,7 @@
"NoFolderMounted": "No storage folder is mounted",
"NoAvailableFolderToMount": "There's no available folder to mount.",
"NoEnvConfigured": "No additional environment variable is configured",
"NoPreOpenPortsConfigured": "No additional pre-open port is configured",
"NoPreOpenPortsConfigured": "No additional preopen ports configured",
"HomeDirectoryDeletionDialog": "The home directory in the session is automatically deleted when the session ends.",
"LaunchConfirmationDialog": "To keep your code and data, or share it with other collaborators, simply create a storage folder in the data & storage sidebar, then mount that folder when you start the resource and keep it there.",
"Launch": "Launch",
Expand Down Expand Up @@ -270,14 +270,14 @@
"ImageDoesNotProvideModelPath": "Container image does not provide model path. It should be modified.",
"AIAccelerator": "AI Accelerator",
"DescAIAccelerator": "<p>AI accelerators (GPUs or NPUs) are well-suited for the matrix/vector computations involved in machine learning. AI accelerators speed up training / inference algorithms by orders of magnitude, reducing running times from weeks to days.</p>",
"PreOpenPortTitle": "Pre-Open Port",
"NotePreOpenPort": "This port is a container internal port.",
"DescSetPreOpenPort": "'Pre-open port' refers to a specific <span style='color:var(--paper-red-400);'>internal container port</span> that allows incoming connections from external devices or computers on a network device or computer.",
"PreOpenPortTitle": "Preopen Ports",
"NotePreOpenPort": "These ports are the container internal ports.",
"DescSetPreOpenPort": "'Preopen Ports' refers to a specific <span style='color:var(--paper-red-400);'>internal container port</span> that allows incoming connections from external devices or computers on a network device or computer.",
"PortsTitleWithRange": "Port value (between 1024 ~ 65535)",
"PrePortConfigWillDisappear": "Any unsaved pre-open ports will be disappeared.",
"PreOpenPortConfigurationDone": "Pre-open ports configured successfully.",
"PreOpenPortPanelTitle": "Pre-open ports to set (optional)",
"PreOpenPortRange": "Pre-open ports are only available from 1024 to 65535."
"PrePortConfigWillDisappear": "Any unsaved preopen ports will be disappeared.",
"PreOpenPortConfigurationDone": "Preopen ports configured successfully.",
"PreOpenPortPanelTitle": "Preopen ports to set (optional)",
"PreOpenPortRange": "Preopen ports are only available from 1024 to 65535."
},
"Preparing": "Preparing...",
"PreparingSession": "Preparing session...",
Expand Down
4 changes: 2 additions & 2 deletions src/components/backend-ai-app-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class BackendAiAppLauncher extends BackendAIPage {
overflow-y: hidden;
}
#pre-open-port-expansion {
#preopen-ports-expansion {
--expansion-header-font-size: 1.17em;
--expansion-header-padding: 0 0 0 15px;
--expansion-right-icon-margin: 0 10px 0 0;
Expand Down Expand Up @@ -1296,7 +1296,7 @@ export default class BackendAiAppLauncher extends BackendAIPage {
`)}
</div>
${this.preOpenedPortList.length > 0 ? html`
<lablup-expansion id="pre-open-port-expansion" open>
<lablup-expansion id="preopen-ports-expansion" open>
<span slot="title" class="horizontal layout">
${_t('session.launcher.PreOpenPortTitle')}
</span>
Expand Down
12 changes: 6 additions & 6 deletions src/components/backend-ai-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class BackendAILogin extends BackendAIPage {
@property({type: String}) otp;
@property({type: Boolean}) needToResetPassword = false;
@property({type: Boolean}) directoryBasedUsage = false;
@property({type: Number}) maxCountForPreOpenedPort = 10;
@property({type: Number}) maxCountForPreopenPorts = 10;
private _enableContainerCommit = false;
private _enablePipeline = false;
@query('#login-panel') loginPanel!: HTMLElementTagNameMap['backend-ai-dialog'];
Expand Down Expand Up @@ -782,12 +782,12 @@ export default class BackendAILogin extends BackendAIPage {
value: (generalConfig?.directoryBasedUsage),
} as ConfigValueObject) as boolean;

// Maximum allowed number of the pre-opend port
this.maxCountForPreOpenedPort = this._getConfigValueByExists(generalConfig,
// Maximum allowed number of the preopend port
this.maxCountForPreopenPorts = this._getConfigValueByExists(generalConfig,
{
valueType: 'number',
defaultValue: this.maxCountForPreOpenedPort, // default value has been already assigned in property declaration
value: parseInt(generalConfig?.maxCountForPreOpenedPort),
defaultValue: this.maxCountForPreopenPorts, // default value has been already assigned in property declaration
value: parseInt(generalConfig?.maxCountForPreopenPorts),
} as ConfigValueObject) as number;
}

Expand Down Expand Up @@ -1511,7 +1511,7 @@ export default class BackendAILogin extends BackendAIPage {
globalThis.backendaiclient._config.enable2FA = this.enable2FA;
globalThis.backendaiclient._config.force2FA = this.force2FA;
globalThis.backendaiclient._config.directoryBasedUsage = this.directoryBasedUsage;
globalThis.backendaiclient._config.maxCountForPreOpenedPort = this.maxCountForPreOpenedPort;
globalThis.backendaiclient._config.maxCountForPreopenPorts = this.maxCountForPreopenPorts;
globalThis.backendaiclient.ready = true;
if (this.endpoints.indexOf(globalThis.backendaiclient._config.endpoint as string) === -1) {
this.endpoints.push(globalThis.backendaiclient._config.endpoint as string);
Expand Down
Loading

0 comments on commit 887d72f

Please sign in to comment.