FTP文件写入

main
吴顺明 9 months ago
parent 0729d7a288
commit 8011f2f1fb

@ -348,14 +348,13 @@ namespace UMC.ITME
}
public static void Check()
{
var now = Utility.TimeSpan();
var ls = System.Buffers.ArrayPool<byte>.Shared.Rent(9);
try
{
var vs = _bridgeClients.Values.ToArray();
foreach (var b in vs)
{
b.Write(0, ls, 9, 0);
}

@ -499,6 +499,7 @@ class SiteSSHActivities : Web.WebActivity
using (var sftp = new SftpClient(new PasswordConnectionInfo(device.Ip, device.Port ?? 22, device.Username, password)))
{
sftp.Connect();
var Content = this.AsyncDialog("Content", r =>
{
String s = String.Empty;
@ -514,9 +515,10 @@ class SiteSSHActivities : Web.WebActivity
response.Redirect(new WebMeta().Put("Content", s).Put("title", Path));
});
sftp.DeleteFile(Path);
sftp.WriteAllText(Path, Content);
SSHLog(device, this.Context.Token.Username, $"upload {Path}");
SSHLog(device, this.Context.Token.Username, $"write {Path}");
}
}
break;

@ -15,7 +15,7 @@ using UMC.Data;
namespace UMC.ITME.Activities
{
/// <summary>
/// 邮箱账户
/// 应用安装
/// </summary>
[UMC.Web.Apiumc("ITME", "Setup", Auth = WebAuthType.Admin)]
class SiteSetupActivity : WebActivity
@ -84,7 +84,7 @@ namespace UMC.ITME.Activities
}
from.Title = "开发者发布";
from.Add(UICell.Create("QRCode", new WebMeta().Put("value", $"https://api.apiumc.com/UMC/Platform/EditCert/{appId}")));
from.Add(UICell.QRCode($"https://api.apiumc.com/UMC/Platform/EditCert/{appId}"));
from.AddConfirm("请开发者用ITME App扫一扫生成开发者证书再点击下一步", "Settings", "YES");
from.Submit("下一步", $"{request.Model}.{request.Command}");
@ -227,7 +227,7 @@ namespace UMC.ITME.Activities
Domain = new Uri(orgDomain, "/").AbsoluteUri;//
this.Context.Request.Arguments.Put("ConfKey", "UMC");
this.Context.Request.Arguments.Put("Domain", Domain);
var str = new Uri(orgDomain, "/UMC.Conf").WebRequest().Put(new WebMeta().Put("domain", $"{Web.WebResource.Instance().WebDomain()}")).ReadAsString();
var str = new Uri(orgDomain, "/UMC/Conf").WebRequest().Put(new WebMeta().Put("domain", $"{Web.WebResource.Instance().WebDomain()}")).ReadAsString();
var data = JSON.Deserialize<System.Collections.Hashtable>(str);
if (data?.ContainsKey("appConf") == true)
{
@ -237,6 +237,14 @@ namespace UMC.ITME.Activities
this.Context.Request.Arguments.Put("IconSrc", appConf["IconSrc"]);
config.Put("IconSrc", appConf["IconSrc"]);
}
if (appConf.ContainsKey("MarketKey"))
{
site.AuthConf = "#";
site.UserModel = UserModel.Bridge;
site.AuthType = WebAuthType.Guest;
ConfKey = appConf["MarketKey"] as string;
}
if (appConf.ContainsKey("Open"))
{

@ -40,6 +40,8 @@ namespace UMC.ITME
SiteConfig site;
public override void ProcessActivity(WebRequest request, WebResponse response)
{
var user = this.Context.Token.Identity();
var httpProxy = new HttpProxy(site, this.Context.Client.Context, -1, "/", String.Empty);
if (httpProxy.Domain == null)
@ -347,8 +349,21 @@ namespace UMC.ITME
{
var site = DataFactory.Instance().SiteConfig(p.Attributes["root"]);
if (site != null)
{
if (site.IsClose)
{
if (site.Site.Flag < 0 || site.Domains.Length == 0 || String.IsNullOrEmpty(site.Site.MarketKey))
{
return WebActivity.Empty;
}
else
{
this.Prompt("许可证已过期", $"{site.Site}的许可证已经过期,请联系管理员更新许可证");
}
}
return new XHRActivity(site);
}
}
}

@ -31,8 +31,7 @@
<div id="app">
<div class="sidebar-container">
<div class="sidebar-logo-container">
<a model="Account" cmd="Self" send="Cashier" class="box-card-component" data-name="">
<a model="Account" cmd="Self" class="box-card-component" data-name="">
<img alt="" class="pan-thumb" />
</a><div class="umc-logo-name"></div>
</div>

Loading…
Cancel
Save