Skip to content

Commit

Permalink
cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
starlying committed May 22, 2020
1 parent bdee45e commit 11e9f4c
Show file tree
Hide file tree
Showing 46 changed files with 211 additions and 456 deletions.
2 changes: 1 addition & 1 deletion SiteServer.BackgroundPages/Ajax/AjaxCreateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public NameValueCollection CreateSiteByOnlineTemplateName(int siteId, bool isImp

var filePath = PathUtility.GetSiteTemplatesPath($"T_{onlineTemplateName}.zip");
FileUtils.DeleteFileIfExists(filePath);
var downloadUrl = OnlineTemplateManager.GetDownloadUrl(onlineTemplateName);
var downloadUrl = CloudUtils.Dl.GetTemplatesUrl(onlineTemplateName);
WebClientUtils.SaveRemoteFileToLocal(downloadUrl, filePath);

CacheUtils.Insert(cacheCurrentCountKey, "2");
Expand Down
2 changes: 2 additions & 0 deletions SiteServer.BackgroundPages/Cms/ModalCrossSiteTransEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ protected void DdlTransType_OnSelectedIndexChanged(object sender, EventArgs e)
foreach (var psId in siteIdList)
{
var psInfo = SiteManager.GetSiteInfo(psId);
if(psInfo == null) continue;

var show = false;
if (contributeType == ECrossSiteTransType.SpecifiedSite)
{
Expand Down
10 changes: 5 additions & 5 deletions SiteServer.BackgroundPages/Cms/PageTemplateReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void Page_Load(object sender, EventArgs e)

var tagName = elementName.Substring(4);
var stlAttribute = (StlElementAttribute)Attribute.GetCustomAttribute(elementType, typeof(StlElementAttribute));
var tagNameUrl = CloudUtils.Root.GetDocsStlUrl(tagName);

allBuilder.Append($@"
<tr class=""{(elementName == _elementName ? "bg-secondary text-white" : string.Empty)}"">
Expand All @@ -54,7 +55,7 @@ public void Page_Load(object sender, EventArgs e)
</a>
</td>
<td>{stlAttribute.Title}</td>
<td><a href=""https://www.siteserver.cn/docs/stl/{tagName}/"" target=""_blank"" class=""{(elementName == _elementName ? "text-white" : string.Empty)}"">https://www.siteserver.cn/docs/stl/{tagName}/</a></td>
<td><a href=""{tagNameUrl}"" target=""_blank"" class=""{(elementName == _elementName ? "text-white" : string.Empty)}"">{tagNameUrl}</a></td>
</tr>");
}

Expand Down Expand Up @@ -96,8 +97,7 @@ public void Page_Load(object sender, EventArgs e)

if (attr != null)
{
var attrUrl =
$"https://www.siteserver.cn/docs/stl/{tagName}/#{fieldName.ToLower()}-{attr.Title.ToLower()}";
var attrUrl = CloudUtils.Root.GetDocsStlUrl(tagName, fieldName, attr.Title);
attrBuilder.Append($@"
<tr>
<td>{fieldName}</td>
Expand All @@ -107,7 +107,7 @@ public void Page_Load(object sender, EventArgs e)
}
}

var helpUrl = $"https://www.siteserver.cn/docs/stl/{tagName}/";
var tagNameUrl = CloudUtils.Root.GetDocsStlUrl(tagName);

var stlAttribute = (StlElementAttribute)Attribute.GetCustomAttribute(elementType, typeof(StlElementAttribute));

Expand All @@ -118,7 +118,7 @@ public void Page_Load(object sender, EventArgs e)
</h4>
<p>
{stlAttribute.Description}
<a href=""{helpUrl}"" target=""_blank"">详细使用说明</a>
<a href=""{tagNameUrl}"" target=""_blank"">详细使用说明</a>
</p>
<div class=""panel panel-default m-t-10"">
<div class=""panel-body p-0"">
Expand Down
3 changes: 2 additions & 1 deletion SiteServer.CMS/Api/Sys/Stl/ApiRouteActionsSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static string GetUrl(string apiUrl)
return PageUtils.Combine(apiUrl, Route);
}

public static string GetParameters(bool isAllSites, string siteName, string siteDir, string siteIds, string channelIndex, string channelName, string channelIds, string type, string word, string dateAttribute, string dateFrom, string dateTo, string since, int pageNum, bool isHighlight, int siteId, string ajaxDivId, string template)
public static string GetParameters(bool isAllSites, string siteName, string siteDir, string siteIds, string channelIndex, string channelName, string channelIds, string type, string word, string dateAttribute, string dateFrom, string dateTo, string since, int pageNum, bool isHighlight, bool isDefaultDisplay, int siteId, string ajaxDivId, string template)
{
return $@"
{{
Expand Down Expand Up @@ -55,6 +55,7 @@ public static string GetParameters(bool isAllSites, string siteName, string site
StlSearch.Since.ToLower(),
StlSearch.PageNum.ToLower(),
StlSearch.IsHighlight.ToLower(),
StlSearch.IsDefaultDisplay.ToLower(),
"siteid",
"ajaxdivid",
"template",
Expand Down
95 changes: 0 additions & 95 deletions SiteServer.CMS/Core/OnlineTemplateManager.cs

This file was deleted.

4 changes: 2 additions & 2 deletions SiteServer.CMS/ImportExport/AtomUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static AtomFeed GetEmptyFeed()
{
Title = new AtomContentConstruct("title", "siteserver channel"),
Author = new AtomPersonConstruct("author",
"siteserver", new Uri("https://www.siteserver.cn")),
"siteserver", new Uri(CloudUtils.Root.Host)),
Modified = new AtomDateConstruct("modified", DateTime.Now,
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now))
};
Expand All @@ -88,7 +88,7 @@ public static AtomEntry GetEmptyEntry()
{
var entry = new AtomEntry
{
Id = new Uri("https://www.siteserver.cn/"),
Id = new Uri(CloudUtils.Root.Host),
Title = new AtomContentConstruct("title", "title"),
Modified = new AtomDateConstruct("modified", DateTime.Now,
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)),
Expand Down
3 changes: 2 additions & 1 deletion SiteServer.CMS/Packaging/PackageMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NuGet.Packaging;
using NuGet.Versioning;
using SiteServer.Plugin;
using SiteServer.Utils;

namespace SiteServer.CMS.Packaging
{
Expand All @@ -18,7 +19,7 @@ public PackageMetadata(string directoryName)
{
Id = directoryName;
Title = directoryName;
IconUrl = new Uri("https://www.siteserver.cn/assets/images/favicon.png");
IconUrl = new Uri(CloudUtils.Root.IconUrl);
Version = "0.0.0";
}

Expand Down
6 changes: 2 additions & 4 deletions SiteServer.CMS/Packaging/PackageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public static void DownloadPackage(string packageId, string version)
}

var localFilePath = PathUtils.Combine(directoryPath, idWithVersion + ".nupkg");
WebClientUtils.SaveRemoteFileToLocal(
$"https://api.siteserver.cn/downloads/update/{version}", localFilePath);
WebClientUtils.SaveRemoteFileToLocal(CloudUtils.Dl.GetPackagesUrl(PackageIdSsCms, version), localFilePath);

ZipUtils.ExtractZip(localFilePath, directoryPath);
}
Expand All @@ -98,8 +97,7 @@ public static void DownloadPackage(string packageId, string version)

var localFilePath = PathUtils.Combine(directoryPath, idWithVersion + ".nupkg");

WebClientUtils.SaveRemoteFileToLocal(
$"https://api.siteserver.cn/downloads/package/{packageId}/{version}", localFilePath);
WebClientUtils.SaveRemoteFileToLocal(CloudUtils.Dl.GetPackagesUrl(packageId, version), localFilePath);

ZipUtils.ExtractZip(localFilePath, directoryPath);

Expand Down
Loading

0 comments on commit 11e9f4c

Please sign in to comment.