public async Task <RemoteSiteRes> GetSite(string id)
        {
            var site = await RemoteSiteUtil.GetSite(id);

            var res = new RemoteSiteRes(site);

            return(res);
        }
Ejemplo n.º 2
0
        // GET: RemoteSite/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            RemoteSite site;

            if (id == null)
            {
                site = new RemoteSite();
            }
            else
            {
                site = await RemoteSiteUtil.GetSite(id);
            }
            return(View(site));
        }
        public async Task GetSetupZip(string siteId)
        {
            var path   = Request.MapPath("/Files/");
            var ApiUrl = string.Format("{0}://{1}/", Request.Url.Scheme, Request.Url.Authority);
            var site   = await RemoteSiteUtil.GetSite(siteId);

            var filename = string.Format("{0}_setup.zip", site.OnPremDomainName.Replace(".", "_"));

            var zip = ZipCopy.SetupZip(path, site, ApiUrl);

            Response.Clear();
            Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
            Response.AddHeader("Content-Length", zip.Length.ToString());
            Response.ContentType = "application/octet-stream";
            Response.BinaryWrite(zip.ToArray());
        }
Ejemplo n.º 4
0
        public static async Task <MemoryStream> GetSetupZip(string siteId, string pathToFiles, string apiUrl)
        {
            var site = await RemoteSiteUtil.GetSite(siteId);

            return(SetupZip(pathToFiles, site, apiUrl));
        }
        public async Task <RemoteSite> GetSiteConfig()
        {
            var siteId = User.Identity.GetClaim(CustomClaimTypes.SiteId);

            return(await RemoteSiteUtil.GetSite(siteId));
        }