Пример #1
0
        public async Task <IActionResult> Server(ServerPathRequest request)
        {
            string name = request.Name;
            string path = request.Path;

            ModelState.Clear();

            Server server = await _serverService.GetServer(name);

            if (server == null)
            {
                return(RedirectToIndex());
            }

            IRemoteFolder folder = await _remoteService.GetFolder(name, path);

            if (folder == null)
            {
                return(RedirectToIndex());
            }

            return(View("Server", new ServerViewModel
            {
                BackupPath = server.Paths.Backup,
                CanDeleteChildren = await _remoteService.CanDeleteFromFolder(name, path),
                Deployments = await GetDeploymentList(server),
                DeployPath = server.Paths.Deploy,
                Folder = folder,
                Name = name,
                Path = folder.Path
            }));
        }