mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-10-27 19:11:18 +00:00
Merge pull request #327 from gnh1201/dev
Rename CitiQuery to IpQuery and update API references
This commit is contained in:
commit
376fd8f852
|
|
@ -132,30 +132,30 @@ namespace WelsonJS.Launcher.Properties {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// https://copilot.microsoft.com/과(와) 유사한 지역화된 문자열을 찾습니다.
|
||||||
|
/// </summary>
|
||||||
|
internal static string CopilotUrl {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("CopilotUrl", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
|
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string CitiApiKey {
|
internal static string CriminalIpApiKey {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("CitiApiKey", resourceCulture);
|
return ResourceManager.GetString("CriminalIpApiKey", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// https://api.criminalip.io/v1/과(와) 유사한 지역화된 문자열을 찾습니다.
|
/// https://api.criminalip.io/v1/과(와) 유사한 지역화된 문자열을 찾습니다.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string CitiApiPrefix {
|
internal static string CriminalIpApiPrefix {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("CitiApiPrefix", resourceCulture);
|
return ResourceManager.GetString("CriminalIpApiPrefix", resourceCulture);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// https://copilot.microsoft.com/과(와) 유사한 지역화된 문자열을 찾습니다.
|
|
||||||
/// </summary>
|
|
||||||
internal static string CopilotUrl {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("CopilotUrl", resourceCulture);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -190,10 +190,10 @@
|
||||||
<data name="HttpClientTimeout" xml:space="preserve">
|
<data name="HttpClientTimeout" xml:space="preserve">
|
||||||
<value>90</value>
|
<value>90</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="CitiApiKey" xml:space="preserve">
|
<data name="CriminalIpApiKey" xml:space="preserve">
|
||||||
<value />
|
<value />
|
||||||
</data>
|
</data>
|
||||||
<data name="CitiApiPrefix" xml:space="preserve">
|
<data name="CriminalIpApiPrefix" xml:space="preserve">
|
||||||
<value>https://api.criminalip.io/v1/</value>
|
<value>https://api.criminalip.io/v1/</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="DateTimeFormat" xml:space="preserve">
|
<data name="DateTimeFormat" xml:space="preserve">
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace WelsonJS.Launcher
|
||||||
_tools.Add(new ResourceTools.Settings(this, _httpClient));
|
_tools.Add(new ResourceTools.Settings(this, _httpClient));
|
||||||
_tools.Add(new ResourceTools.ChromiumDevTools(this, _httpClient));
|
_tools.Add(new ResourceTools.ChromiumDevTools(this, _httpClient));
|
||||||
_tools.Add(new ResourceTools.DnsQuery(this, _httpClient));
|
_tools.Add(new ResourceTools.DnsQuery(this, _httpClient));
|
||||||
_tools.Add(new ResourceTools.CitiQuery(this, _httpClient));
|
_tools.Add(new ResourceTools.IpQuery(this, _httpClient));
|
||||||
_tools.Add(new ResourceTools.TwoFactorAuth(this, _httpClient));
|
_tools.Add(new ResourceTools.TwoFactorAuth(this, _httpClient));
|
||||||
_tools.Add(new ResourceTools.Whois(this, _httpClient));
|
_tools.Add(new ResourceTools.Whois(this, _httpClient));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace WelsonJS.Launcher.ResourceTools
|
namespace WelsonJS.Launcher.ResourceTools
|
||||||
{
|
{
|
||||||
public class CitiQuery : IResourceTool
|
public class IpQuery : IResourceTool
|
||||||
{
|
{
|
||||||
private readonly ResourceServer Server;
|
private readonly ResourceServer Server;
|
||||||
private readonly HttpClient _httpClient;
|
private readonly HttpClient _httpClient;
|
||||||
private const string Prefix = "citi-query/";
|
private const string Prefix = "ip-query/";
|
||||||
|
|
||||||
public CitiQuery(ResourceServer server, HttpClient httpClient)
|
public IpQuery(ResourceServer server, HttpClient httpClient)
|
||||||
{
|
{
|
||||||
Server = server;
|
Server = server;
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
|
|
@ -32,15 +32,15 @@ namespace WelsonJS.Launcher.ResourceTools
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string target = path.Substring(Prefix.Length).Trim();
|
string target = path.Substring(Prefix.Length).Trim();
|
||||||
string apiKey = Program.GetAppConfig("CitiApiKey");
|
string apiKey = Program.GetAppConfig("CriminalIpApiKey");
|
||||||
if (string.IsNullOrEmpty(apiKey))
|
if (string.IsNullOrEmpty(apiKey))
|
||||||
{
|
{
|
||||||
Server.ServeResource(context, "<error>Missing API key<error>", "application/xml", 500);
|
Server.ServeResource(context, "<error>Missing API key</error>", "application/xml", 500);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string encoded = Uri.EscapeDataString(target);
|
string encoded = Uri.EscapeDataString(target);
|
||||||
string apiPrefix = Program.GetAppConfig("CitiApiPrefix");
|
string apiPrefix = Program.GetAppConfig("CriminalIpApiPrefix");
|
||||||
string url = $"{apiPrefix}asset/ip/report?ip={encoded}&full=true";
|
string url = $"{apiPrefix}asset/ip/report?ip={encoded}&full=true";
|
||||||
|
|
||||||
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="ICompatibleLogger.cs" />
|
<Compile Include="ICompatibleLogger.cs" />
|
||||||
<Compile Include="IResourceTool.cs" />
|
<Compile Include="IResourceTool.cs" />
|
||||||
<Compile Include="ResourceTools\CitiQuery.cs" />
|
<Compile Include="ResourceTools\IpQuery.cs" />
|
||||||
<Compile Include="ResourceTools\Settings.cs" />
|
<Compile Include="ResourceTools\Settings.cs" />
|
||||||
<Compile Include="ResourceTools\Completion.cs" />
|
<Compile Include="ResourceTools\Completion.cs" />
|
||||||
<Compile Include="ResourceTools\ChromiumDevTools.cs" />
|
<Compile Include="ResourceTools\ChromiumDevTools.cs" />
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
function RibbonMenu({
|
function RibbonMenu({
|
||||||
onOpenFileClick, onSaveFileClick, onCopliotClick, onAzureAiClick,
|
onOpenFileClick, onSaveFileClick, onCopliotClick, onAzureAiClick,
|
||||||
onSavePromptClick, onLoadPromptClick, onQueryWhoisClick, onQueryDnsClick,
|
onSavePromptClick, onLoadPromptClick, onQueryWhoisClick, onQueryDnsClick,
|
||||||
onQueryCitiClick
|
onQueryIpClick
|
||||||
}) {
|
}) {
|
||||||
const fileButtons = [
|
const fileButtons = [
|
||||||
{
|
{
|
||||||
|
|
@ -157,7 +157,7 @@
|
||||||
const networkToolsButtons = [
|
const networkToolsButtons = [
|
||||||
{ id: 'btnWhois', icon: 'mif-earth', caption: 'Whois', onClick: onQueryWhoisClick },
|
{ id: 'btnWhois', icon: 'mif-earth', caption: 'Whois', onClick: onQueryWhoisClick },
|
||||||
{ id: 'btnQueryDns', icon: 'mif-earth', caption: 'DNS', onClick: onQueryDnsClick },
|
{ id: 'btnQueryDns', icon: 'mif-earth', caption: 'DNS', onClick: onQueryDnsClick },
|
||||||
{ id: 'btnQueryCiti', icon: 'mif-user-secret', caption: 'IP', onClick: onQueryCitiClick }
|
{ id: 'btnQueryIp', icon: 'mif-user-secret', caption: 'IP', onClick: onQueryIpClick }
|
||||||
];
|
];
|
||||||
|
|
||||||
return _e(
|
return _e(
|
||||||
|
|
@ -583,23 +583,23 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const queryCiti = () => {
|
const queryIp = () => {
|
||||||
const hostname = prompt("Enter IP address:", '');
|
const hostname = prompt("Enter IP address:", '');
|
||||||
if (!hostname || hostname.trim() === '') {
|
if (!hostname || hostname.trim() === '') {
|
||||||
appendTextToEditor("\n// IP address is required.");
|
appendTextToEditor("\n// IP address is required.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiKey = settingsRef.current.CitiApiKey;
|
const apiKey = settingsRef.current.CriminalIpApiKey;
|
||||||
if (!apiKey || apiKey.trim() === '') {
|
if (!apiKey || apiKey.trim() === '') {
|
||||||
appendTextToEditor("\n// Criminal IP API key is not set.");
|
appendTextToEditor("\n// Criminal IP API key is not set.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiPrefix = settingsRef.current.CitiApiPrefix;
|
const apiPrefix = settingsRef.current.CriminalIpApiPrefix;
|
||||||
const ip = encodeURIComponent(hostname.trim());
|
const ip = encodeURIComponent(hostname.trim());
|
||||||
|
|
||||||
axios.get(`/citi-query/${hostname}`).then(response => {
|
axios.get(`/ip-query/${hostname}`).then(response => {
|
||||||
if (!response) {
|
if (!response) {
|
||||||
appendTextToEditor("\n// No data returned from Criminal IP.");
|
appendTextToEditor("\n// No data returned from Criminal IP.");
|
||||||
return;
|
return;
|
||||||
|
|
@ -664,7 +664,7 @@
|
||||||
onLoadPromptClick: loadPromptMessages,
|
onLoadPromptClick: loadPromptMessages,
|
||||||
onQueryWhoisClick: queryWhois,
|
onQueryWhoisClick: queryWhois,
|
||||||
onQueryDnsClick: queryDns,
|
onQueryDnsClick: queryDns,
|
||||||
onQueryCitiClick: queryCiti
|
onQueryIpClick: queryIp
|
||||||
}),
|
}),
|
||||||
_e('div', { id: 'container' },
|
_e('div', { id: 'container' },
|
||||||
_e(Editor, { editorRef }),
|
_e(Editor, { editorRef }),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user