/** {@inheritDoc} */ @Override public Promise<String> expand() { return promises.resolve(appContext.getWorkspace().getConfig().getName()); } }
@Override public void onWorkspaceRunning(WorkspaceRunningEvent event) { if (arrow != null) { arrow.setAttribute( "href", constant.openDashboardUrlWorkspace(appContext.getWorkspace().getConfig().getName())); } }
@Override public void onDownloadOutput(OutputConsole console) { String id = consoleCommands.get(console); String fileName = appContext.getWorkspace().getNamespace() + "-" + appContext.getWorkspace().getConfig().getName() + " " + DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ".log"; download(fileName, getText(id)); }
@Override public void onDownloadWorkspaceOutput(DownloadWorkspaceOutputEvent event) { Optional<MachineImpl> devMachine = wsAgentServerUtil.getWsAgentServerMachine(); if (!devMachine.isPresent()) { return; } WorkspaceImpl workspace = appContext.getWorkspace(); String fileName = workspace.getNamespace() + "-" + workspace.getConfig().getName() + " " + DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ".log"; download(fileName, getText(devMachine.get().getName())); }
@Override public Path getProjectsRoot() { // default root (backward compatible solution) Path projectsRoot = Path.valueOf("/projects"); if (workspace != null && workspace.getStatus().equals(WorkspaceStatus.RUNNING)) { String machineName = wsAgentServerUtilProvider.get().getWsAgentServerMachine().get().getName(); String activeEnv = workspace.getRuntime().getActiveEnv(); EnvironmentImpl environment = workspace.getConfig().getEnvironments().get(activeEnv); VolumeImpl vol = null; if (environment != null) { vol = environment.getMachines().get(machineName).getVolume("projects"); } // if voulme exists return its path, otherwise use backward compatible path (/projects) if (vol != null) { projectsRoot = Path.valueOf(vol.getPath()); } } Log.debug( AppContextImpl.class, "Project Root: " + projectsRoot + " workspace: " + workspace.getConfig().getName()); return projectsRoot; }
final String workspaceName = appContext.getWorkspace().getConfig().getName(); Promise<SshPairDto> sshPairDtoPromise = sshServiceClient.getPair("workspace", appContext.getWorkspaceId());
if (!errorMessage.isEmpty()) { WorkspaceImpl currentWorkspace = appContext.getWorkspace(); String workspaceName = currentWorkspace.getConfig().getName();
constant.openDashboardUrlWorkspace(appContext.getWorkspace().getConfig().getName())); arrow.setAttribute("target", "_blank");