Skip to content

Commit 11e9f4c

Browse files
committed
cloud
1 parent bdee45e commit 11e9f4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+211
-456
lines changed

SiteServer.BackgroundPages/Ajax/AjaxCreateService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public NameValueCollection CreateSiteByOnlineTemplateName(int siteId, bool isImp
166166

167167
var filePath = PathUtility.GetSiteTemplatesPath($"T_{onlineTemplateName}.zip");
168168
FileUtils.DeleteFileIfExists(filePath);
169-
var downloadUrl = OnlineTemplateManager.GetDownloadUrl(onlineTemplateName);
169+
var downloadUrl = CloudUtils.Dl.GetTemplatesUrl(onlineTemplateName);
170170
WebClientUtils.SaveRemoteFileToLocal(downloadUrl, filePath);
171171

172172
CacheUtils.Insert(cacheCurrentCountKey, "2");

SiteServer.BackgroundPages/Cms/ModalCrossSiteTransEdit.cs

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ protected void DdlTransType_OnSelectedIndexChanged(object sender, EventArgs e)
115115
foreach (var psId in siteIdList)
116116
{
117117
var psInfo = SiteManager.GetSiteInfo(psId);
118+
if(psInfo == null) continue;
119+
118120
var show = false;
119121
if (contributeType == ECrossSiteTransType.SpecifiedSite)
120122
{

SiteServer.BackgroundPages/Cms/PageTemplateReference.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public void Page_Load(object sender, EventArgs e)
4545

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

4950
allBuilder.Append($@"
5051
<tr class=""{(elementName == _elementName ? "bg-secondary text-white" : string.Empty)}"">
@@ -54,7 +55,7 @@ public void Page_Load(object sender, EventArgs e)
5455
</a>
5556
</td>
5657
<td>{stlAttribute.Title}</td>
57-
<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>
58+
<td><a href=""{tagNameUrl}"" target=""_blank"" class=""{(elementName == _elementName ? "text-white" : string.Empty)}"">{tagNameUrl}</a></td>
5859
</tr>");
5960
}
6061

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

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

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

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

@@ -118,7 +118,7 @@ public void Page_Load(object sender, EventArgs e)
118118
</h4>
119119
<p>
120120
{stlAttribute.Description}
121-
<a href=""{helpUrl}"" target=""_blank"">详细使用说明</a>
121+
<a href=""{tagNameUrl}"" target=""_blank"">详细使用说明</a>
122122
</p>
123123
<div class=""panel panel-default m-t-10"">
124124
<div class=""panel-body p-0"">

SiteServer.CMS/Api/Sys/Stl/ApiRouteActionsSearch.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static string GetUrl(string apiUrl)
1313
return PageUtils.Combine(apiUrl, Route);
1414
}
1515

16-
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)
16+
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)
1717
{
1818
return $@"
1919
{{
@@ -55,6 +55,7 @@ public static string GetParameters(bool isAllSites, string siteName, string site
5555
StlSearch.Since.ToLower(),
5656
StlSearch.PageNum.ToLower(),
5757
StlSearch.IsHighlight.ToLower(),
58+
StlSearch.IsDefaultDisplay.ToLower(),
5859
"siteid",
5960
"ajaxdivid",
6061
"template",

SiteServer.CMS/Core/OnlineTemplateManager.cs

-95
This file was deleted.

SiteServer.CMS/ImportExport/AtomUtility.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static AtomFeed GetEmptyFeed()
7676
{
7777
Title = new AtomContentConstruct("title", "siteserver channel"),
7878
Author = new AtomPersonConstruct("author",
79-
"siteserver", new Uri("https://www.siteserver.cn")),
79+
"siteserver", new Uri(CloudUtils.Root.Host)),
8080
Modified = new AtomDateConstruct("modified", DateTime.Now,
8181
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now))
8282
};
@@ -88,7 +88,7 @@ public static AtomEntry GetEmptyEntry()
8888
{
8989
var entry = new AtomEntry
9090
{
91-
Id = new Uri("https://www.siteserver.cn/"),
91+
Id = new Uri(CloudUtils.Root.Host),
9292
Title = new AtomContentConstruct("title", "title"),
9393
Modified = new AtomDateConstruct("modified", DateTime.Now,
9494
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)),

SiteServer.CMS/Packaging/PackageMetadata.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using NuGet.Packaging;
55
using NuGet.Versioning;
66
using SiteServer.Plugin;
7+
using SiteServer.Utils;
78

89
namespace SiteServer.CMS.Packaging
910
{
@@ -18,7 +19,7 @@ public PackageMetadata(string directoryName)
1819
{
1920
Id = directoryName;
2021
Title = directoryName;
21-
IconUrl = new Uri("https://www.siteserver.cn/assets/images/favicon.png");
22+
IconUrl = new Uri(CloudUtils.Root.IconUrl);
2223
Version = "0.0.0";
2324
}
2425

SiteServer.CMS/Packaging/PackageUtils.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ public static void DownloadPackage(string packageId, string version)
8484
}
8585

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

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

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

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

104102
ZipUtils.ExtractZip(localFilePath, directoryPath);
105103

0 commit comments

Comments
 (0)