ltsecurityinc安防产品在线商城代码
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
/**
|
||||
* Plumrocket Inc.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the End-user License Agreement
|
||||
* that is available through the world-wide-web at this URL:
|
||||
* http://wiki.plumrocket.net/wiki/EULA
|
||||
* If you are unable to obtain it through the world-wide-web, please
|
||||
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
||||
*
|
||||
* @package Plumrocket_GeoIPLookup
|
||||
* @copyright Copyright (c) 2018 Plumrocket Inc. (http://www.plumrocket.com)
|
||||
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
||||
*/
|
||||
-->
|
||||
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<head>
|
||||
<css src="Plumrocket_GeoIPLookup::css/prgeoiplookup.css" />
|
||||
<script src="Plumrocket_GeoIPLookup::js/prgeoiplookup.js" />
|
||||
</head>
|
||||
</page>
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
/**
|
||||
* @package Plumrocket_GeoIPLookup
|
||||
* @copyright Copyright (c) 2024 Plumrocket Inc. (https://plumrocket.com)
|
||||
* @license https://plumrocket.com/license/ End-user License Agreement
|
||||
*/
|
||||
-->
|
||||
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="js">
|
||||
<block name="prgeoiplookup.dynamic.comment.script" template="Plumrocket_GeoIPLookup::system/config/script/dynamic_comment.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Plumrocket Inc.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the End-user License Agreement
|
||||
* that is available through the world-wide-web at this URL:
|
||||
* http://wiki.plumrocket.net/wiki/EULA
|
||||
* If you are unable to obtain it through the world-wide-web, please
|
||||
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
||||
*
|
||||
* @package Plumrocket_GeoIPLookup
|
||||
* @copyright Copyright (c) 2018 Plumrocket Inc. (http://www.plumrocket.com)
|
||||
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php /** @var \Plumrocket\GeoIPLookup\Block\Adminhtml\System\Config\Data\Buttons\AbstractBlock $block */ ?>
|
||||
|
||||
<div class="pp-buttons-container">
|
||||
<button id="<?= $block->escapeHtmlAttr($block->getHtmlId()) ?>"
|
||||
onclick="<?= /* @noEscape */ $block->getOnclick($block->getHtmlId()) ?>">
|
||||
<span>
|
||||
<span>
|
||||
<span>
|
||||
<?= $block->escapeHtml($block->getButtonLabel()) ?>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_GeoIPLookup
|
||||
* @copyright Copyright (c) 2024 Plumrocket Inc. (https://plumrocket.com)
|
||||
* @license https://plumrocket.com/license/ End-user License Agreement
|
||||
*/
|
||||
|
||||
use Plumrocket\GeoIPLookup\Model\System\Config\Source\Installmethods;
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
require([
|
||||
'jquery',
|
||||
'mage/translate'
|
||||
], function ($, $t) {
|
||||
const setComment = function (installMethod) {
|
||||
const commentField = $(installMethod).parent().find('.method_comment');
|
||||
if (! commentField.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fieldId = $(installMethod).attr('id') || '';
|
||||
const dbName = fieldId.includes('iptocountry') ? 'IpToCountry' : 'MaxMind';
|
||||
|
||||
switch (installMethod.value) {
|
||||
case '<?= /* @noEscape */ Installmethods::AUTOMATIC ?>':
|
||||
commentField.html($t("Automatically download the " + dbName + " IP geolocation database from Plumrocket servers. This database includes country, state, city, postal code, time zone, locale, latitude, and longitude. The installation may take around 5 minutes. Ensure you have 100 MB of free space on your web server for this method."));
|
||||
break;
|
||||
case '<?= /* @noEscape */ Installmethods::MANUAL ?>':
|
||||
commentField.html($t('Manually upload your own copy of the ' + dbName + ' IP geolocation database to your web server. This database includes country, state, city, postal code, time zone, locale, latitude, and longitude. The installation may take around 5 minutes. Ensure you have 100 MB of free space on your web server for this method. For manual installation instructions, please <a href=https://plumrocket.com/docs/magento-geoip-lookup/v1/devguide/databases-manual-installation#maxmind-geoip-database" target="_blank">click here</a>.'));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const installMethods = $('.install-method');
|
||||
|
||||
installMethods.each(function () {
|
||||
setComment(this);
|
||||
});
|
||||
|
||||
installMethods.on('change', function (event) {
|
||||
setComment(event.target);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Plumrocket Inc.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the End-user License Agreement
|
||||
* that is available through the world-wide-web at this URL:
|
||||
* http://wiki.plumrocket.net/wiki/EULA
|
||||
* If you are unable to obtain it through the world-wide-web, please
|
||||
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
||||
*
|
||||
* @package Plumrocket_GeoIPLookup
|
||||
* @copyright Copyright (c) 2018 Plumrocket Inc. (http://www.plumrocket.com)
|
||||
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
||||
*/
|
||||
|
||||
.status-container .status{font-weight: bold;}
|
||||
.progress-bar{width: 120px; display: inline-block;}
|
||||
.w3-container:after,.w3-container:before{padding:0.01em 16px}
|
||||
.w3-center{text-align:center!important}
|
||||
.w3-border{border:1px solid #ccc!important}
|
||||
/* Colors */
|
||||
.w3-blue,.w3-hover-blue:hover{color:#fff!important;background-color:#2196F3!important}
|
||||
.progress-title{display: inline-block; margin-left: 5px;}
|
||||
|
||||
.prgeoiplookup-service-notice {
|
||||
padding:10px;
|
||||
background-color:#f8f8f8;
|
||||
border:1px solid #ddd;
|
||||
margin-bottom:7px;
|
||||
text-decoration: underline red;
|
||||
}
|
||||
|
||||
#prgeoiplookup_geoiptest_geoinfo {
|
||||
height: 305px;
|
||||
}
|
||||
|
||||
#row_prgeoiplookup_geoiptest_geoinfo,
|
||||
#row_prgeoiplookup_geoiptest_location_on_map,
|
||||
#hidden_field_api_url,
|
||||
#row_prgeoiplookup_geoiptest_rest_ip {
|
||||
display: none;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Plumrocket Inc.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the End-user License Agreement
|
||||
* that is available through the world-wide-web at this URL:
|
||||
* http://wiki.plumrocket.net/wiki/EULA
|
||||
* If you are unable to obtain it through the world-wide-web, please
|
||||
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
||||
*
|
||||
* @package Plumrocket_Extension
|
||||
* @copyright Copyright (c) 2026 Plumrocket Inc. (http://www.plumrocket.com)
|
||||
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
||||
*/
|
||||
|
||||
var __prinitparam = 'MzM5Njkw';
|
||||
@@ -0,0 +1,202 @@
|
||||
/**
|
||||
* Plumrocket Inc.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the End-user License Agreement
|
||||
* that is available through the world-wide-web at this URL:
|
||||
* http://wiki.plumrocket.net/wiki/EULA
|
||||
* If you are unable to obtain it through the world-wide-web, please
|
||||
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
||||
*
|
||||
* @package Plumrocket_GeoIPLookup
|
||||
* @copyright Copyright (c) 2018 Plumrocket Inc. (http://www.plumrocket.com)
|
||||
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
||||
*/
|
||||
|
||||
require([
|
||||
'jquery',
|
||||
'mage/storage',
|
||||
'mage/translate',
|
||||
'Magento_Ui/js/modal/alert',
|
||||
'domReady!'
|
||||
], function ($, storage, __, alert) {
|
||||
'use strict';
|
||||
|
||||
window.runInstallation = function (serviceId, urlAutomatic, urlProgress) {
|
||||
let resultId = serviceId + '_status',
|
||||
timerProgress = null;
|
||||
|
||||
const enableSelect = function() {
|
||||
let selectId = serviceId + '_enabled',
|
||||
tooltip = serviceId + '_tooltip',
|
||||
tooltipElement = $('#' + tooltip);
|
||||
|
||||
$('#' + selectId).prop('disabled', false);
|
||||
if (tooltipElement) {
|
||||
tooltipElement.remove();
|
||||
}
|
||||
};
|
||||
|
||||
const updateStatus = function(data) {
|
||||
let percent = '0%',
|
||||
color = 'green',
|
||||
message = '';
|
||||
|
||||
switch (data.status) {
|
||||
case "process":
|
||||
$('#' + resultId + ' .status')[0].hide();
|
||||
$('#' + resultId + ' .progress-container')[0].show();
|
||||
percent = parseInt(parseInt(data.exec) * 100 / parseInt(data.total)) + '%';
|
||||
message = data.message;
|
||||
break;
|
||||
case "success":
|
||||
window.clearInterval(timerProgress);
|
||||
$('body').loader('hide');
|
||||
$('.loading-mask').css('background', 'rgba(255, 255, 255, 0.4)');
|
||||
$('#' + resultId + ' .progress-container')[0].hide();
|
||||
$('#' + resultId + ' .status')[0].setStyle({color: color}).update(data.message).show();
|
||||
enableSelect();
|
||||
break;
|
||||
default:
|
||||
window.clearInterval(timerProgress);
|
||||
$('body').loader('hide');
|
||||
$('.loading-mask').css('background', 'rgba(255, 255, 255, 0.4)');
|
||||
$('#' + resultId + ' .progress-container')[0].hide();
|
||||
color = 'red';
|
||||
message = (typeof data.message !== "undefined") ? data.message : __("Import Failed!");
|
||||
$('#' + resultId + ' .status')[0].setStyle({color: color}).update(message).show();
|
||||
}
|
||||
|
||||
$('#' + resultId + ' .progress-container .progress-value')[0].setStyle({width: percent}).update(percent);
|
||||
$('#' + resultId + ' .progress-container .progress-title')[0].update(message);
|
||||
if ('alert' in data) {
|
||||
window.showAlert(data.error,data.alert);
|
||||
}
|
||||
}
|
||||
|
||||
const getInstallationProgress = function () {
|
||||
storage.get(
|
||||
urlProgress
|
||||
).done(function (response) {
|
||||
response = JSON.parse(response);
|
||||
if (response && response.status) {
|
||||
updateStatus(response);
|
||||
}
|
||||
}).fail(function () {
|
||||
window.clearInterval(timerProgress);
|
||||
$('body').loader('hide');
|
||||
$('.loading-mask').css('background', 'rgba(255, 255, 255, 0.4)');
|
||||
});
|
||||
return true;
|
||||
};
|
||||
|
||||
updateStatus({
|
||||
status: 'process',
|
||||
exec: 1,
|
||||
total: 100,
|
||||
message: __('Installation in Progress...')
|
||||
});
|
||||
|
||||
timerProgress = setInterval(getInstallationProgress, 3000);
|
||||
|
||||
$('body').loader('show');
|
||||
$('.loading-mask').css('background', 'rgba(255, 255, 255, 0)');
|
||||
|
||||
storage.get(
|
||||
urlAutomatic
|
||||
).done(function(response) {
|
||||
response = JSON.parse(response);
|
||||
if (response) {
|
||||
updateStatus(response);
|
||||
}
|
||||
}).fail(function() {
|
||||
updateStatus({status: 'fail'});
|
||||
});
|
||||
};
|
||||
|
||||
window.prGeoIptestApiConnection = function (serviceUrl, serviceId) {
|
||||
let accessKey = $('#prgeoiplookup_methods_ipapigeoip_access_key').val(),
|
||||
useSsl = $('#prgeoiplookup_methods_ipapigeoip_use_https').val(),
|
||||
resultText = __('Connection Error!'),
|
||||
resultStyle = 'color: red;',
|
||||
resultClass = 'message-error error';
|
||||
|
||||
serviceUrl += '?access_key=%1&use_ssl=%2'.replace('%1', accessKey).replace('%2', useSsl);
|
||||
|
||||
$.ajax({
|
||||
showLoader: true,
|
||||
url: serviceUrl,
|
||||
type: "GET",
|
||||
dataType: 'JSON'
|
||||
}).done(function(response) {
|
||||
if (response.success) {
|
||||
resultText = __('Connection Successful!');
|
||||
resultStyle = 'color: green;';
|
||||
resultClass = 'message-success success';
|
||||
}
|
||||
|
||||
if (response.hasOwnProperty('message')) {
|
||||
resultText += '<br><p>' + response.message + '</p>';
|
||||
}
|
||||
}).always(function() {
|
||||
let resultContainerId = serviceId + '_result',
|
||||
resultBlock = $('#' + resultContainerId);
|
||||
|
||||
if (resultBlock.length) {
|
||||
resultBlock.remove();
|
||||
}
|
||||
|
||||
$('#' + serviceId).after(
|
||||
'<div id="' + resultContainerId + '" class="message '
|
||||
+ resultClass
|
||||
+ '" style="background: none;'
|
||||
+ resultStyle
|
||||
+ '">'
|
||||
+ resultText
|
||||
+ '</div>'
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
window.geoipTest = function (testUrl) {
|
||||
var ip = $('#prgeoiplookup_geoiptest_ip_address').val(),
|
||||
url = testUrl + 'ip/' + ip,
|
||||
geoInfo = $('#prgeoiplookup_geoiptest_geoinfo'),
|
||||
map = $('#prgeoiplookup_google_map'),
|
||||
mapUrl = 'https://maps.google.com/?q=',
|
||||
apiTestEl = $('#rest_ip_test'),
|
||||
restApiUrl = $('#hidden_field_api_url').text();
|
||||
|
||||
$('body').loader('show');
|
||||
storage.get(
|
||||
url
|
||||
).done(function(response) {
|
||||
response = JSON.parse(response);
|
||||
geoInfo.val(response.text);
|
||||
apiTestEl.attr('href', restApiUrl + ip);
|
||||
apiTestEl.text(restApiUrl + ip);
|
||||
if (response.latitude && response.longitude) {
|
||||
map.attr('href', mapUrl + response.latitude + ',' + response.longitude);
|
||||
} else if (response.country_name) {
|
||||
map.attr('href', mapUrl + response.country_name);
|
||||
}
|
||||
var prefix = 'row_prgeoiplookup_geoiptest';
|
||||
$('#' + prefix + '_rest_ip').show();
|
||||
$('#' + prefix + '_geoinfo').show();
|
||||
$('#' + prefix + '_location_on_map').show();
|
||||
}).fail(function() {
|
||||
}).always(function() {
|
||||
$('body').loader('hide');
|
||||
});
|
||||
};
|
||||
|
||||
$('#prgeoiplookup_geoiptest_geoinfo').val('');
|
||||
|
||||
window.showAlert = function (title, message) {
|
||||
alert({
|
||||
title: title,
|
||||
content: message
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user