ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
//
|
||||
// Amasty Elastic Search
|
||||
// ____________________________________________
|
||||
|
||||
@import 'module/components/_tooltip';
|
||||
@import 'module/_base';
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// Amasty Elastic Search Base Styles
|
||||
// ______________________________________________
|
||||
|
||||
//
|
||||
// Common
|
||||
// ----------------------------------------------
|
||||
|
||||
& when (@media-common = true) {
|
||||
.amasty-elastic-relevancerule-edit .admin__field-tooltip .admin__field-tooltip-content {
|
||||
& {
|
||||
background: #41362f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:after,
|
||||
&:before {
|
||||
border-top-color: #41362f;
|
||||
}
|
||||
}
|
||||
|
||||
.amelastic-datefield ._has-datepicker + .ui-datepicker-trigger {
|
||||
z-index: 2; // mozilla input + button equal z-index fix
|
||||
}
|
||||
|
||||
#row_amasty_elastic_catalog_query_settings {
|
||||
.label span {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.admin__control-table th,
|
||||
.admin__control-table td {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.amasty-elastic-form-wrapper {
|
||||
& {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.amasty-elastic-form-comment {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Desktop
|
||||
// ----------------------------------------------
|
||||
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__xl) {
|
||||
#row_amasty_elastic_catalog_query_settings .admin__control-table {
|
||||
td,
|
||||
th {
|
||||
& {
|
||||
padding: 1.3rem 1rem 1.3rem 0;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+80
@@ -0,0 +1,80 @@
|
||||
//phpcs:ignoreFile
|
||||
|
||||
//
|
||||
// Amasty Elastic Search Tooltip
|
||||
// ______________________________________________
|
||||
|
||||
//
|
||||
// Common
|
||||
// ----------------------------------------------
|
||||
|
||||
& when (@media-common = true) {
|
||||
#row_amasty_elastic_catalog_query_settings {
|
||||
.value.with-tooltip {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -20px;
|
||||
bottom: inherit;
|
||||
left: inherit;
|
||||
float: none;
|
||||
margin: 20px 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.accordion .config .value.with-tooltip div.tooltip .help span {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.amelastic-field-block {
|
||||
.admin__field-tooltip .admin__field-tooltip-action:before {
|
||||
font-size: 1.7rem;
|
||||
}
|
||||
|
||||
.admin__field-tooltip-content {
|
||||
& {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 100%;
|
||||
z-index: 20;
|
||||
margin: 0 -17px 10px 0;
|
||||
padding: 18px;
|
||||
max-width: 400px;
|
||||
width: 400px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background: rgba(49, 48, 43, .8);
|
||||
box-shadow: none;
|
||||
color: #fff;
|
||||
text-shadow: none;
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
top: auto;
|
||||
right: 20px;
|
||||
bottom: -5px;
|
||||
left: auto;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: none; // Override Magento style
|
||||
border-top: 5px solid #35302c;
|
||||
border-right: 5px solid transparent;
|
||||
border-bottom: 0;
|
||||
border-left: 5px solid transparent;
|
||||
content: '';
|
||||
opacity: .8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -0,0 +1,62 @@
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Ui/js/modal/alert',
|
||||
], function ($, alert) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.connectionchecker', {
|
||||
options: {
|
||||
successText: '',
|
||||
failedText: '',
|
||||
url: '',
|
||||
elementId: '',
|
||||
fieldMapping: ''
|
||||
},
|
||||
|
||||
_create: function () {
|
||||
this._on({
|
||||
'click': $.proxy(this._ping, this)
|
||||
});
|
||||
},
|
||||
|
||||
_ping: function () {
|
||||
var buttonTitle = this.options.failedText,
|
||||
element = $('#' + this.options.elementId),
|
||||
self = this;
|
||||
element.removeClass('success').addClass('fail');
|
||||
|
||||
$.ajax({
|
||||
url: self.options.url,
|
||||
showLoader: true,
|
||||
data: self._collectParams()
|
||||
}).done(function (response) {
|
||||
if (response.success) {
|
||||
element.removeClass('fail').addClass('success');
|
||||
buttonTitle = self.options.successText;
|
||||
} else {
|
||||
var error = response.errorMessage;
|
||||
if (error) {
|
||||
alert({
|
||||
content: error
|
||||
});
|
||||
}
|
||||
}
|
||||
}).always(function () {
|
||||
if (buttonTitle) {
|
||||
$('#' + self.options.elementId + '_result').text(buttonTitle);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_collectParams: function () {
|
||||
var params = {};
|
||||
$.each(this.options.fieldMapping, function (key, el) {
|
||||
params[key] = $('#amasty_elastic_connection_' + el).val();
|
||||
});
|
||||
|
||||
return params;
|
||||
}
|
||||
});
|
||||
|
||||
return $.mage.connectionchecker;
|
||||
});
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Ui/js/grid/provider',
|
||||
'ko'
|
||||
], function ($, provider, ko) {
|
||||
'use strict';
|
||||
|
||||
return provider.extend({
|
||||
defaults: {
|
||||
externalLinks: {
|
||||
relevanceRuleWebsite: null
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
initObservable: function () {
|
||||
this.externalLinks.relevanceRuleWebsite = ko.observable(this.externalLinks.relevanceRuleWebsite);
|
||||
|
||||
return this._super();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {object} options
|
||||
*/
|
||||
reload: function (options) {
|
||||
var relevanceRuleCondition = $('[data-form-part="amasty_elastic_relevancerule_form"]').serialize(),
|
||||
selectedWebsite = +this.externalLinks.relevanceRuleWebsite();
|
||||
|
||||
if (typeof this.params.filters === 'undefined') {
|
||||
this.params.filters = {};
|
||||
}
|
||||
|
||||
if (selectedWebsite) {
|
||||
relevanceRuleCondition += '&websites[]=' + selectedWebsite;
|
||||
}
|
||||
|
||||
this.params.filters.elastic_rule_condition = relevanceRuleCondition;
|
||||
return this._super({'refresh': true});
|
||||
}
|
||||
});
|
||||
});
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Ui/js/form/components/html',
|
||||
'ko',
|
||||
'uiRegistry'
|
||||
], function ($, html, ko, uiRegistry) {
|
||||
'use strict';
|
||||
|
||||
return html.extend({
|
||||
afterRenderCallback: function () {
|
||||
var ns = this.ns,
|
||||
gridName = ns + '.' + ns + '.conditions_fieldset.products_grid';
|
||||
|
||||
uiRegistry.get(gridName, this.initChangeListener.bind(this));
|
||||
},
|
||||
|
||||
initChangeListener: function (productsGrid) {
|
||||
var observer = new MutationObserver(subscriber);
|
||||
|
||||
function subscriber(mutations) {
|
||||
mutations.forEach(function (mutation) {
|
||||
if (mutation.type === 'childList') {
|
||||
productsGrid.visible(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
observer.observe($('.rule-tree')[0], {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Elasticsearch char mapping rule validation
|
||||
*/
|
||||
require([
|
||||
'jquery',
|
||||
'mage/translate',
|
||||
'jquery/validate',
|
||||
'mage/validation'
|
||||
], function ($) {
|
||||
'use strict';
|
||||
|
||||
$.validator.addMethod(
|
||||
'amasty-validate-char-mapping',
|
||||
function (value) {
|
||||
return $.mage.isEmptyNoTrim(value) || /^\S+ ?=> ?\S+$/gm.test(value);
|
||||
},
|
||||
$.mage.__('Please enter a valid character mapping (E.g."& => and").')
|
||||
);
|
||||
});
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<div class="amasty-elastic-form-wrapper">
|
||||
<div class="amasty-elastic-form-comment" html="content"
|
||||
css="$data.additionalClasses"
|
||||
visible="visible"></div>
|
||||
</div>
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
<div html="content"
|
||||
css="$data.additionalClasses"
|
||||
visible="visible"
|
||||
afterRender="afterRenderCallback"></div>
|
||||
|
||||
<div data-role="spinner"
|
||||
class="admin__data-grid-loading-mask"
|
||||
visible="loading"
|
||||
if="showSpinner">
|
||||
<div class="spinner">
|
||||
<span repeat="8"></span>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user