authscape 1.0.238 → 1.0.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +109 -67
- package/package.json +1 -1
- package/src/components/EditableDatagrid.js +17 -8
- package/src/components/OEMEditor.js +232 -201
package/index.js
CHANGED
|
@@ -426,7 +426,10 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
426
426
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
427
427
|
var EditableDatagrid = function EditableDatagrid(_ref) {
|
|
428
428
|
var loadedUser = _ref.loadedUser,
|
|
429
|
-
url = _ref.url,
|
|
429
|
+
_ref$url = _ref.url,
|
|
430
|
+
url = _ref$url === void 0 ? null : _ref$url,
|
|
431
|
+
_ref$eRows = _ref.eRows,
|
|
432
|
+
eRows = _ref$eRows === void 0 ? null : _ref$eRows,
|
|
430
433
|
columns = _ref.columns,
|
|
431
434
|
_ref$isCellEditable = _ref.isCellEditable,
|
|
432
435
|
_isCellEditable = _ref$isCellEditable === void 0 ? null : _ref$isCellEditable,
|
|
@@ -465,18 +468,29 @@ var EditableDatagrid = function EditableDatagrid(_ref) {
|
|
|
465
468
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
466
469
|
while (1) switch (_context.prev = _context.next) {
|
|
467
470
|
case 0:
|
|
468
|
-
|
|
471
|
+
if (!(url != null)) {
|
|
472
|
+
_context.next = 7;
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
_context.next = 3;
|
|
469
476
|
return apiService().post(url, {
|
|
470
477
|
offset: offset,
|
|
471
478
|
length: pageSize
|
|
472
479
|
});
|
|
473
|
-
case
|
|
480
|
+
case 3:
|
|
474
481
|
response = _context.sent;
|
|
475
482
|
if (response != null && response.status == 200) {
|
|
476
483
|
setTotalRows(response.data.recordsTotal);
|
|
477
484
|
setRows(response.data.data);
|
|
478
485
|
}
|
|
479
|
-
|
|
486
|
+
_context.next = 8;
|
|
487
|
+
break;
|
|
488
|
+
case 7:
|
|
489
|
+
if (rows != null) {
|
|
490
|
+
setTotalRows(eRows.length);
|
|
491
|
+
setRows(eRows);
|
|
492
|
+
}
|
|
493
|
+
case 8:
|
|
480
494
|
case "end":
|
|
481
495
|
return _context.stop();
|
|
482
496
|
}
|
|
@@ -1427,16 +1441,14 @@ var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
|
|
|
1427
1441
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
1428
1442
|
var _material = require("@mui/material");
|
|
1429
1443
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
1430
|
-
var
|
|
1444
|
+
var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
|
|
1445
|
+
var _image = _interopRequireDefault(require("next/image"));
|
|
1431
1446
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1432
1447
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
1433
1448
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1434
1449
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
1435
1450
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
1436
1451
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
1437
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1438
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
1439
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
1440
1452
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
1441
1453
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1442
1454
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -1448,53 +1460,39 @@ function OEMEditor(_ref) {
|
|
|
1448
1460
|
notification = _ref.notification,
|
|
1449
1461
|
_ref$companyId = _ref.companyId,
|
|
1450
1462
|
companyId = _ref$companyId === void 0 ? null : _ref$companyId;
|
|
1463
|
+
var monaco = (0, _react2.useMonaco)();
|
|
1451
1464
|
var cssEditorRef = (0, _react.useRef)(null);
|
|
1452
1465
|
var htmlEditorRef = (0, _react.useRef)(null);
|
|
1453
1466
|
var _useState = (0, _react.useState)(''),
|
|
1454
1467
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1455
1468
|
data = _useState2[0],
|
|
1456
1469
|
setData = _useState2[1];
|
|
1457
|
-
var
|
|
1458
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1459
|
-
value = _React$useState2[0],
|
|
1460
|
-
setValue = _React$useState2[1];
|
|
1461
|
-
var _useState3 = (0, _react.useState)([]),
|
|
1470
|
+
var _useState3 = (0, _react.useState)(0),
|
|
1462
1471
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1463
|
-
|
|
1464
|
-
|
|
1472
|
+
value = _useState4[0],
|
|
1473
|
+
setValue = _useState4[1];
|
|
1465
1474
|
var _useState5 = (0, _react.useState)([]),
|
|
1466
1475
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
var _useState7 = (0, _react.useState)(
|
|
1476
|
+
fonts = _useState6[0],
|
|
1477
|
+
setFonts = _useState6[1];
|
|
1478
|
+
var _useState7 = (0, _react.useState)([]),
|
|
1470
1479
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
id: "simple-tabpanel-".concat(index),
|
|
1482
|
-
"aria-labelledby": "simple-tab-".concat(index)
|
|
1483
|
-
}, other), value === index && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1484
|
-
sx: {
|
|
1485
|
-
p: 3
|
|
1486
|
-
}
|
|
1487
|
-
}, children));
|
|
1488
|
-
}
|
|
1489
|
-
function a11yProps(index) {
|
|
1490
|
-
return {
|
|
1491
|
-
id: "simple-tab-".concat(index),
|
|
1492
|
-
'aria-controls': "simple-tabpanel-".concat(index)
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1480
|
+
dnsFields = _useState8[0],
|
|
1481
|
+
setDnsFields = _useState8[1];
|
|
1482
|
+
var _useState9 = (0, _react.useState)(null),
|
|
1483
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1484
|
+
selectedFont = _useState10[0],
|
|
1485
|
+
setSelectedFont = _useState10[1];
|
|
1486
|
+
var _useState11 = (0, _react.useState)(''),
|
|
1487
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
1488
|
+
stateBaseUri = _useState12[0],
|
|
1489
|
+
setBaseUri = _useState12[1];
|
|
1495
1490
|
var handleChange = function handleChange(event, newValue) {
|
|
1496
1491
|
setValue(newValue);
|
|
1497
1492
|
};
|
|
1493
|
+
var GetBaseUrl = function GetBaseUrl() {
|
|
1494
|
+
return window.location.protocol + "//" + window.location.host;
|
|
1495
|
+
};
|
|
1498
1496
|
(0, _react.useEffect)(function () {
|
|
1499
1497
|
if (loadedUser) {
|
|
1500
1498
|
var fetchData = /*#__PURE__*/function () {
|
|
@@ -1512,7 +1510,7 @@ function OEMEditor(_ref) {
|
|
|
1512
1510
|
}
|
|
1513
1511
|
domain = GetBaseUrl();
|
|
1514
1512
|
_context.next = 7;
|
|
1515
|
-
return apiService().get("/OEM/GetFields?domain=" + domain + "&companyId=" + companyId);
|
|
1513
|
+
return apiService().get("/OEM/GetFields?domain=" + domain + (companyId != null ? "&companyId=" + companyId : ""));
|
|
1516
1514
|
case 7:
|
|
1517
1515
|
responseFields = _context.sent;
|
|
1518
1516
|
if (responseFields != null && responseFields.status == 200) {
|
|
@@ -1531,13 +1529,19 @@ function OEMEditor(_ref) {
|
|
|
1531
1529
|
fetchData();
|
|
1532
1530
|
}
|
|
1533
1531
|
}, [loadedUser]);
|
|
1532
|
+
var _React$useState = _react["default"].useState({
|
|
1533
|
+
page: 0,
|
|
1534
|
+
pageSize: 5
|
|
1535
|
+
}),
|
|
1536
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1537
|
+
paginationModel = _React$useState2[0],
|
|
1538
|
+
setPaginationModel = _React$useState2[1];
|
|
1534
1539
|
function handleCSSEditorDidMount(editor, monaco) {
|
|
1535
1540
|
cssEditorRef.current = editor;
|
|
1536
1541
|
}
|
|
1537
1542
|
function handleHtmlEditorDidMount(editor, monaco) {
|
|
1538
1543
|
htmlEditorRef.current = editor;
|
|
1539
1544
|
}
|
|
1540
|
-
var monaco = (0, _react2.useMonaco)();
|
|
1541
1545
|
var columns = [{
|
|
1542
1546
|
field: "label",
|
|
1543
1547
|
headerName: "Fonts",
|
|
@@ -1571,15 +1575,16 @@ function OEMEditor(_ref) {
|
|
|
1571
1575
|
// //console.log("here is the monaco instance:", monaco);
|
|
1572
1576
|
// }
|
|
1573
1577
|
baseUri = GetBaseUrl();
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1578
|
+
setBaseUri(baseUri);
|
|
1579
|
+
_context2.next = 4;
|
|
1580
|
+
return apiService().get("/oem/GetEditorData?domain=" + baseUri + (companyId != null ? "&companyId=" + companyId : ""));
|
|
1581
|
+
case 4:
|
|
1577
1582
|
response = _context2.sent;
|
|
1578
1583
|
if (response.status == 200) {
|
|
1579
1584
|
setData(response.data);
|
|
1580
1585
|
setSelectedFont(response.data.fontFamily);
|
|
1581
1586
|
}
|
|
1582
|
-
case
|
|
1587
|
+
case 6:
|
|
1583
1588
|
case "end":
|
|
1584
1589
|
return _context2.stop();
|
|
1585
1590
|
}
|
|
@@ -1607,19 +1612,48 @@ function OEMEditor(_ref) {
|
|
|
1607
1612
|
value: value,
|
|
1608
1613
|
onChange: handleChange,
|
|
1609
1614
|
"aria-label": "basic tabs example"
|
|
1610
|
-
}, /*#__PURE__*/_react["default"].createElement(_Tab["default"],
|
|
1615
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
1611
1616
|
label: "General"
|
|
1612
|
-
}
|
|
1617
|
+
}), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
1613
1618
|
label: "Fonts"
|
|
1614
|
-
}
|
|
1619
|
+
}), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
1615
1620
|
label: "Style Sheet Editor"
|
|
1616
|
-
}
|
|
1621
|
+
}), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
1617
1622
|
label: "HTML Import Editor"
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
+
}))), /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1624
|
+
sx: {
|
|
1625
|
+
padding: 2
|
|
1626
|
+
}
|
|
1627
|
+
}, value == 0 && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1628
|
+
sx: {
|
|
1629
|
+
paddingBottom: 4
|
|
1630
|
+
}
|
|
1631
|
+
}, data.appIconUrl == null && /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
1632
|
+
src: "/DefaultNoImage.svg",
|
|
1633
|
+
width: 200,
|
|
1634
|
+
height: 200
|
|
1635
|
+
}), data.appIconUrl != null && /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
1636
|
+
src: data.appIconUrl,
|
|
1637
|
+
width: 200,
|
|
1638
|
+
height: 200
|
|
1639
|
+
}), /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
1640
|
+
url: "/oem/UploadAppIcon",
|
|
1641
|
+
params: {
|
|
1642
|
+
domain: stateBaseUri
|
|
1643
|
+
},
|
|
1644
|
+
multiple: true,
|
|
1645
|
+
variant: "custom",
|
|
1646
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
1647
|
+
window.location.reload();
|
|
1648
|
+
}
|
|
1649
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
1650
|
+
color: "primary",
|
|
1651
|
+
variant: "contained",
|
|
1652
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null)
|
|
1653
|
+
}, "Upload App Icon"))), dnsFields != null && dnsFields.map(function (dnsField, index) {
|
|
1654
|
+
return /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1655
|
+
key: index
|
|
1656
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
1623
1657
|
container: true,
|
|
1624
1658
|
spacing: 2
|
|
1625
1659
|
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
@@ -1655,7 +1689,7 @@ function OEMEditor(_ref) {
|
|
|
1655
1689
|
};
|
|
1656
1690
|
}()
|
|
1657
1691
|
}))));
|
|
1658
|
-
})), /*#__PURE__*/_react["default"].createElement(
|
|
1692
|
+
})), value == 1 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1659
1693
|
value: value,
|
|
1660
1694
|
index: 1
|
|
1661
1695
|
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
@@ -1664,14 +1698,22 @@ function OEMEditor(_ref) {
|
|
|
1664
1698
|
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
1665
1699
|
item: true,
|
|
1666
1700
|
xs: 6
|
|
1667
|
-
}, loadedUser && /*#__PURE__*/_react["default"].createElement(_xDataGrid.DataGrid, {
|
|
1701
|
+
}, loadedUser == true && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_xDataGrid.DataGrid, {
|
|
1668
1702
|
rows: fonts,
|
|
1669
1703
|
columns: columns,
|
|
1670
1704
|
sx: {
|
|
1671
1705
|
height: "80vh"
|
|
1672
1706
|
},
|
|
1707
|
+
pagination: true,
|
|
1708
|
+
disableSelectionOnClick: true,
|
|
1709
|
+
onPaginationModelChange: setPaginationModel,
|
|
1710
|
+
paginationModel: paginationModel
|
|
1711
|
+
//pageSizeOptions={[5]}
|
|
1712
|
+
// rowCount={100}
|
|
1713
|
+
// rowSelectionModel={selectedFont}
|
|
1714
|
+
,
|
|
1673
1715
|
onRowClick: /*#__PURE__*/function () {
|
|
1674
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(
|
|
1716
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
1675
1717
|
var baseUri, response;
|
|
1676
1718
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1677
1719
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -1681,12 +1723,12 @@ function OEMEditor(_ref) {
|
|
|
1681
1723
|
return apiService().post("/OEM/SetFont", {
|
|
1682
1724
|
companyId: companyId,
|
|
1683
1725
|
domain: baseUri,
|
|
1684
|
-
value:
|
|
1726
|
+
value: params.row.label
|
|
1685
1727
|
});
|
|
1686
1728
|
case 3:
|
|
1687
1729
|
response = _context4.sent;
|
|
1688
1730
|
if (response != null && response.status == 200) {
|
|
1689
|
-
setSelectedFont(
|
|
1731
|
+
setSelectedFont(params.row.label);
|
|
1690
1732
|
notification("Font saved!");
|
|
1691
1733
|
}
|
|
1692
1734
|
case 5:
|
|
@@ -1699,7 +1741,7 @@ function OEMEditor(_ref) {
|
|
|
1699
1741
|
return _ref5.apply(this, arguments);
|
|
1700
1742
|
};
|
|
1701
1743
|
}()
|
|
1702
|
-
})), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
1744
|
+
}))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
1703
1745
|
item: true,
|
|
1704
1746
|
xs: 6,
|
|
1705
1747
|
sx: {
|
|
@@ -1715,7 +1757,7 @@ function OEMEditor(_ref) {
|
|
|
1715
1757
|
sx: {
|
|
1716
1758
|
fontFamily: selectedFont
|
|
1717
1759
|
}
|
|
1718
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst. Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc. Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis. Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus. Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), "Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti")))), /*#__PURE__*/_react["default"].createElement(
|
|
1760
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst. Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc. Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis. Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus. Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), "Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti")))), value == 2 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1719
1761
|
value: value,
|
|
1720
1762
|
index: 2
|
|
1721
1763
|
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
@@ -1767,13 +1809,13 @@ function OEMEditor(_ref) {
|
|
|
1767
1809
|
sx: {
|
|
1768
1810
|
paddingTop: 1
|
|
1769
1811
|
}
|
|
1770
|
-
}, /*#__PURE__*/_react["default"].createElement(_react2["default"], {
|
|
1812
|
+
}, data != null && /*#__PURE__*/_react["default"].createElement(_react2["default"], {
|
|
1771
1813
|
height: "70vh",
|
|
1772
1814
|
onMount: handleCSSEditorDidMount,
|
|
1773
1815
|
defaultLanguage: "css",
|
|
1774
1816
|
theme: "vs-dark",
|
|
1775
1817
|
defaultValue: data.prettyCSS == null ? "" : data.prettyCSS
|
|
1776
|
-
}))), /*#__PURE__*/_react["default"].createElement(
|
|
1818
|
+
}), data.prettyCSS)), value == 3 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1777
1819
|
value: value,
|
|
1778
1820
|
index: 3
|
|
1779
1821
|
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
@@ -1831,7 +1873,7 @@ function OEMEditor(_ref) {
|
|
|
1831
1873
|
defaultLanguage: "html",
|
|
1832
1874
|
theme: "vs-dark",
|
|
1833
1875
|
defaultValue: data.prettyHTML == null ? "" : data.prettyHTML
|
|
1834
|
-
})))));
|
|
1876
|
+
})))))));
|
|
1835
1877
|
}
|
|
1836
1878
|
"use strict";
|
|
1837
1879
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
|
|
|
2
2
|
import { DataGrid, GridActionsCellItem } from "@mui/x-data-grid";
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
|
|
5
|
-
export const EditableDatagrid = ({loadedUser, url, columns, isCellEditable = null, onCellEdited = null, sx = {}, height="50vh", pageSize = 50, rowsPerPage = [25, 50, 100], rowHeight = 70}) => {
|
|
5
|
+
export const EditableDatagrid = ({loadedUser, url = null, eRows = null, columns, isCellEditable = null, onCellEdited = null, sx = {}, height="50vh", pageSize = 50, rowsPerPage = [25, 50, 100], rowHeight = 70}) => {
|
|
6
6
|
|
|
7
7
|
const [rows, setRows] = useState([]);
|
|
8
8
|
const [totalRows, setTotalRows] = useState(0);
|
|
@@ -19,16 +19,25 @@ export const EditableDatagrid = ({loadedUser, url, columns, isCellEditable = nul
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
const reloadDataGrid = async () => {
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
if (url != null)
|
|
23
24
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
let response = await apiService().post(url,
|
|
26
|
+
{
|
|
27
|
+
offset: offset,
|
|
28
|
+
length: pageSize
|
|
29
|
+
});
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
if (response != null && response.status == 200)
|
|
32
|
+
{
|
|
33
|
+
setTotalRows(response.data.recordsTotal);
|
|
34
|
+
setRows(response.data.data);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if (rows != null)
|
|
29
38
|
{
|
|
30
|
-
setTotalRows(
|
|
31
|
-
setRows(
|
|
39
|
+
setTotalRows(eRows.length);
|
|
40
|
+
setRows(eRows);
|
|
32
41
|
}
|
|
33
42
|
}
|
|
34
43
|
|
|
@@ -7,49 +7,32 @@ import Tab from '@mui/material/Tab';
|
|
|
7
7
|
import Box from '@mui/material/Box';
|
|
8
8
|
import { Grid } from "@mui/material";
|
|
9
9
|
import { DataGrid } from "@mui/x-data-grid";
|
|
10
|
+
import PublishRoundedIcon from '@mui/icons-material/PublishRounded';
|
|
11
|
+
import Image from "next/image";
|
|
10
12
|
|
|
11
13
|
export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
12
14
|
|
|
15
|
+
const monaco = useMonaco();
|
|
16
|
+
|
|
13
17
|
const cssEditorRef = useRef(null);
|
|
14
18
|
const htmlEditorRef = useRef(null);
|
|
15
19
|
|
|
16
20
|
const [data, setData] = useState('');
|
|
17
|
-
const [value, setValue] =
|
|
21
|
+
const [value, setValue] = useState(0);
|
|
18
22
|
const [fonts, setFonts] = useState([]);
|
|
19
23
|
const [dnsFields, setDnsFields] = useState([]);
|
|
20
24
|
const [selectedFont, setSelectedFont] = useState(null);
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
const { children, value, index, ...other } = props;
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div
|
|
27
|
-
role="tabpanel"
|
|
28
|
-
hidden={value !== index}
|
|
29
|
-
id={`simple-tabpanel-${index}`}
|
|
30
|
-
aria-labelledby={`simple-tab-${index}`}
|
|
31
|
-
{...other}
|
|
32
|
-
>
|
|
33
|
-
{value === index && (
|
|
34
|
-
<Box sx={{ p: 3 }}>
|
|
35
|
-
{children}
|
|
36
|
-
</Box>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function a11yProps(index) {
|
|
43
|
-
return {
|
|
44
|
-
id: `simple-tab-${index}`,
|
|
45
|
-
'aria-controls': `simple-tabpanel-${index}`,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
26
|
+
const [stateBaseUri, setBaseUri] = useState('');
|
|
48
27
|
|
|
49
28
|
const handleChange = (event, newValue) => {
|
|
50
29
|
setValue(newValue);
|
|
51
30
|
};
|
|
52
31
|
|
|
32
|
+
const GetBaseUrl = () => {
|
|
33
|
+
return window.location.protocol + "//" + window.location.host;
|
|
34
|
+
}
|
|
35
|
+
|
|
53
36
|
useEffect(() => {
|
|
54
37
|
|
|
55
38
|
if (loadedUser)
|
|
@@ -63,7 +46,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
63
46
|
}
|
|
64
47
|
|
|
65
48
|
var domain = GetBaseUrl();
|
|
66
|
-
let responseFields = await apiService().get("/OEM/GetFields?domain=" + domain + "&companyId=" + companyId);
|
|
49
|
+
let responseFields = await apiService().get("/OEM/GetFields?domain=" + domain + (companyId != null ? ("&companyId=" + companyId) : ""));
|
|
67
50
|
if (responseFields != null && responseFields.status == 200)
|
|
68
51
|
{
|
|
69
52
|
setDnsFields(responseFields.data);
|
|
@@ -74,6 +57,12 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
74
57
|
}
|
|
75
58
|
|
|
76
59
|
}, [loadedUser]);
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
const [paginationModel, setPaginationModel] = React.useState({
|
|
63
|
+
page: 0,
|
|
64
|
+
pageSize: 5,
|
|
65
|
+
});
|
|
77
66
|
|
|
78
67
|
|
|
79
68
|
function handleCSSEditorDidMount(editor, monaco) {
|
|
@@ -84,7 +73,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
84
73
|
htmlEditorRef.current = editor;
|
|
85
74
|
}
|
|
86
75
|
|
|
87
|
-
|
|
76
|
+
|
|
88
77
|
|
|
89
78
|
const columns = [
|
|
90
79
|
{
|
|
@@ -117,7 +106,9 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
117
106
|
// }
|
|
118
107
|
|
|
119
108
|
var baseUri = GetBaseUrl();
|
|
120
|
-
|
|
109
|
+
setBaseUri(baseUri);
|
|
110
|
+
|
|
111
|
+
let response = await apiService().get("/oem/GetEditorData?domain=" + baseUri + (companyId != null ? ("&companyId=" + companyId) : ""));
|
|
121
112
|
if (response.status == 200)
|
|
122
113
|
{
|
|
123
114
|
setData(response.data);
|
|
@@ -130,191 +121,231 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
130
121
|
|
|
131
122
|
return (
|
|
132
123
|
<>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
{selectedFont != null &&
|
|
136
|
-
<link href={"https://fonts.googleapis.com/css2?family=" + selectedFont} rel="stylesheet"></link>
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
|
140
|
-
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
|
|
141
|
-
<Tab label="General" {...a11yProps(0)} />
|
|
142
|
-
<Tab label="Fonts" {...a11yProps(1)} />
|
|
143
|
-
<Tab label="Style Sheet Editor" {...a11yProps(2)} />
|
|
144
|
-
<Tab label="HTML Import Editor" {...a11yProps(3)} />
|
|
145
|
-
</Tabs>
|
|
146
|
-
</Box>
|
|
147
|
-
<TabPanel value={value} index={0}>
|
|
148
|
-
|
|
149
|
-
{dnsFields != null && dnsFields.map((dnsField) => {
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<Box>
|
|
153
|
-
<Grid container spacing={2}>
|
|
154
|
-
<Grid item xs={3}>
|
|
155
|
-
{dnsField.name}
|
|
156
|
-
</Grid>
|
|
157
|
-
<Grid item xs={9}>
|
|
124
|
+
<Box sx={{ width: '100%' }}>
|
|
158
125
|
|
|
159
|
-
|
|
126
|
+
{selectedFont != null &&
|
|
127
|
+
<link href={"https://fonts.googleapis.com/css2?family=" + selectedFont} rel="stylesheet"></link>
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
|
131
|
+
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
|
|
132
|
+
<Tab label="General" />
|
|
133
|
+
<Tab label="Fonts" />
|
|
134
|
+
<Tab label="Style Sheet Editor" />
|
|
135
|
+
<Tab label="HTML Import Editor" />
|
|
136
|
+
</Tabs>
|
|
137
|
+
</Box>
|
|
138
|
+
<Box>
|
|
139
|
+
|
|
140
|
+
<Box sx={{padding:2}}>
|
|
141
|
+
{value == 0 &&
|
|
142
|
+
<Box>
|
|
160
143
|
|
|
161
|
-
|
|
162
|
-
id: dnsField.id,
|
|
163
|
-
fieldId: dnsField.fieldId,
|
|
164
|
-
value: hex
|
|
165
|
-
});
|
|
144
|
+
<Box sx={{paddingBottom:4}}>
|
|
166
145
|
|
|
167
|
-
|
|
146
|
+
{data.appIconUrl == null &&
|
|
147
|
+
<Image src={"/DefaultNoImage.svg"} width={200} height={200} />
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
{data.appIconUrl != null &&
|
|
151
|
+
<Image src={data.appIconUrl} width={200} height={200} />
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
<FileUploader url={"/oem/UploadAppIcon"} params={{
|
|
155
|
+
domain: stateBaseUri
|
|
156
|
+
}} multiple={true} variant='custom' onUploadCompleted={() => {
|
|
157
|
+
window.location.reload();
|
|
158
|
+
}}>
|
|
159
|
+
|
|
160
|
+
<Button color="primary" variant="contained" startIcon={<PublishRoundedIcon/>}>Upload App Icon</Button>
|
|
161
|
+
|
|
162
|
+
</FileUploader>
|
|
168
163
|
|
|
169
|
-
}} />
|
|
170
|
-
</Grid>
|
|
171
|
-
</Grid>
|
|
172
164
|
</Box>
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
})}
|
|
178
|
-
|
|
179
|
-
{/* {dnsFields != null &&
|
|
180
|
-
<Box sx={{marginTop:2}}>
|
|
181
|
-
<Button startIcon={<SaveRoundedIcon/>} variant="contained" onClick={async () => {
|
|
182
|
-
|
|
183
|
-
await apiService().post("/oem/SetFieldValue", {
|
|
184
|
-
id: dnsField.id,
|
|
185
|
-
name: dnsField.name,
|
|
186
|
-
value: JSON.stringify(rgb)
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
}}>Save Changes</Button>
|
|
190
|
-
</Box>
|
|
191
|
-
} */}
|
|
192
|
-
|
|
193
|
-
</TabPanel>
|
|
194
|
-
<TabPanel value={value} index={1}>
|
|
195
|
-
|
|
196
|
-
<Grid container spacing={2}>
|
|
197
|
-
<Grid item xs={6}>
|
|
198
|
-
|
|
199
|
-
{(loadedUser) &&
|
|
200
|
-
|
|
201
|
-
<DataGrid
|
|
202
|
-
rows={fonts}
|
|
203
|
-
columns={columns}
|
|
204
|
-
sx={{height:"80vh"}}
|
|
205
|
-
onRowClick={async (row) => {
|
|
206
|
-
|
|
207
|
-
var baseUri = GetBaseUrl();
|
|
208
|
-
let response = await apiService().post("/OEM/SetFont", {
|
|
209
|
-
companyId: companyId,
|
|
210
|
-
domain: baseUri,
|
|
211
|
-
value: row.row.label
|
|
212
|
-
});
|
|
213
|
-
if (response != null && response.status == 200)
|
|
214
|
-
{
|
|
215
|
-
setSelectedFont(row.row.label);
|
|
216
|
-
notification("Font saved!");
|
|
217
|
-
}
|
|
218
|
-
}}
|
|
219
|
-
/>
|
|
220
|
-
}
|
|
221
165
|
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
{dnsFields != null && dnsFields.map((dnsField, index) => {
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<Box key={index}>
|
|
172
|
+
<Grid container spacing={2}>
|
|
173
|
+
<Grid item xs={3}>
|
|
174
|
+
{dnsField.name}
|
|
175
|
+
</Grid>
|
|
176
|
+
<Grid item xs={9}>
|
|
177
|
+
|
|
178
|
+
<ColorPicker name={dnsField.name} defaultColor={dnsField.value} onColorChanged={async (name, hex) => {
|
|
179
|
+
|
|
180
|
+
await apiService().post("/OEM/SetFieldValue", {
|
|
181
|
+
id: dnsField.id,
|
|
182
|
+
fieldId: dnsField.fieldId,
|
|
183
|
+
value: hex
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
notification(dnsField.name + " Saved");
|
|
187
|
+
|
|
188
|
+
}} />
|
|
189
|
+
</Grid>
|
|
190
|
+
</Grid>
|
|
191
|
+
</Box>
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
})}
|
|
197
|
+
</Box>
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
{value == 1 &&
|
|
201
|
+
<Box value={value} index={1}>
|
|
202
|
+
|
|
203
|
+
<Grid container spacing={2}>
|
|
204
|
+
<Grid item xs={6}>
|
|
205
|
+
|
|
206
|
+
{loadedUser == true &&
|
|
207
|
+
|
|
208
|
+
<Box>
|
|
209
|
+
<DataGrid
|
|
210
|
+
rows={fonts}
|
|
211
|
+
columns={columns}
|
|
212
|
+
sx={{height:"80vh"}}
|
|
213
|
+
pagination
|
|
214
|
+
disableSelectionOnClick={true}
|
|
215
|
+
onPaginationModelChange={setPaginationModel}
|
|
216
|
+
paginationModel={paginationModel}
|
|
217
|
+
//pageSizeOptions={[5]}
|
|
218
|
+
// rowCount={100}
|
|
219
|
+
// rowSelectionModel={selectedFont}
|
|
220
|
+
onRowClick={async (params) => {
|
|
221
|
+
|
|
222
|
+
var baseUri = GetBaseUrl();
|
|
223
|
+
let response = await apiService().post("/OEM/SetFont", {
|
|
224
|
+
companyId: companyId,
|
|
225
|
+
domain: baseUri,
|
|
226
|
+
value: params.row.label
|
|
227
|
+
});
|
|
228
|
+
if (response != null && response.status == 200)
|
|
229
|
+
{
|
|
230
|
+
setSelectedFont(params.row.label);
|
|
231
|
+
notification("Font saved!");
|
|
232
|
+
}
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
</Box>
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</Grid>
|
|
240
|
+
<Grid item xs={6} sx={{marginTop:4}}>
|
|
241
|
+
<Box>Font Selected:</Box>
|
|
242
|
+
<Box sx={{marginBottom:2, fontWeight:"bold", fontSize:20}}> {selectedFont}</Box>
|
|
243
|
+
<hr />
|
|
244
|
+
<Box sx={{fontFamily: selectedFont}}>
|
|
245
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst.
|
|
246
|
+
Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc.
|
|
247
|
+
Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi.
|
|
248
|
+
Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
|
|
249
|
+
Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis.
|
|
250
|
+
Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus.
|
|
251
|
+
Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.
|
|
252
|
+
<br/><br/>
|
|
253
|
+
Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti
|
|
254
|
+
</Box>
|
|
255
|
+
</Grid>
|
|
222
256
|
</Grid>
|
|
223
|
-
<Grid item xs={6} sx={{marginTop:4}}>
|
|
224
|
-
<Box>Font Selected:</Box>
|
|
225
|
-
<Box sx={{marginBottom:2, fontWeight:"bold", fontSize:20}}> {selectedFont}</Box>
|
|
226
|
-
<hr />
|
|
227
|
-
<Box sx={{fontFamily: selectedFont}}>
|
|
228
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst.
|
|
229
|
-
Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc.
|
|
230
|
-
Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi.
|
|
231
|
-
Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
|
|
232
|
-
Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis.
|
|
233
|
-
Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus.
|
|
234
|
-
Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.
|
|
235
|
-
<br/><br/>
|
|
236
|
-
Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti
|
|
237
|
-
</Box>
|
|
238
|
-
</Grid>
|
|
239
|
-
</Grid>
|
|
240
|
-
|
|
241
|
-
</TabPanel>
|
|
242
|
-
<TabPanel value={value} index={2}>
|
|
243
|
-
|
|
244
|
-
<Grid container spacing={2}>
|
|
245
|
-
<Grid item xs={6}>
|
|
246
|
-
<h4 style={{marginBottom:"0px"}}>Global CSS edits</h4>
|
|
247
|
-
<small>You can make edits to your stylesheet</small>
|
|
248
|
-
</Grid>
|
|
249
|
-
<Grid item xs={6} sx={{textAlign:"right"}}>
|
|
250
|
-
<Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
|
|
251
|
-
|
|
252
|
-
var baseUri = GetBaseUrl();
|
|
253
|
-
let response = await apiService().post("/OEM/SetGlobalCSS", {
|
|
254
|
-
companyId: companyId,
|
|
255
|
-
domain: baseUri,
|
|
256
|
-
value: cssEditorRef.current.getValue()
|
|
257
|
-
});
|
|
258
|
-
if (response != null && response.status == 200)
|
|
259
|
-
{
|
|
260
|
-
notification("CSS Saved!")
|
|
261
|
-
}
|
|
262
257
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
</Box>
|
|
277
|
-
|
|
278
|
-
</TabPanel>
|
|
279
|
-
<TabPanel value={value} index={3}>
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
<Grid container spacing={2}>
|
|
283
|
-
<Grid item xs={6}>
|
|
284
|
-
<h4 style={{marginBottom:"0px"}}>HTML import Edits</h4>
|
|
285
|
-
<small>You can add imports such as google analytics or clarity</small>
|
|
286
|
-
</Grid>
|
|
287
|
-
<Grid item xs={6} sx={{textAlign:"right"}}>
|
|
288
|
-
<Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
|
|
258
|
+
</Box>
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
{value == 2 &&
|
|
262
|
+
<Box value={value} index={2}>
|
|
263
|
+
|
|
264
|
+
<Grid container spacing={2}>
|
|
265
|
+
<Grid item xs={6}>
|
|
266
|
+
<h4 style={{marginBottom:"0px"}}>Global CSS edits</h4>
|
|
267
|
+
<small>You can make edits to your stylesheet</small>
|
|
268
|
+
</Grid>
|
|
269
|
+
<Grid item xs={6} sx={{textAlign:"right"}}>
|
|
270
|
+
<Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
|
|
289
271
|
|
|
290
272
|
var baseUri = GetBaseUrl();
|
|
291
|
-
let response = await apiService().post("/OEM/
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
273
|
+
let response = await apiService().post("/OEM/SetGlobalCSS", {
|
|
274
|
+
companyId: companyId,
|
|
275
|
+
domain: baseUri,
|
|
276
|
+
value: cssEditorRef.current.getValue()
|
|
295
277
|
});
|
|
296
278
|
if (response != null && response.status == 200)
|
|
297
279
|
{
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
280
|
+
notification("CSS Saved!")
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
}}>Save Changes</Button>
|
|
284
|
+
</Grid>
|
|
285
|
+
</Grid>
|
|
286
|
+
|
|
287
|
+
<Box sx={{paddingTop:1}}>
|
|
288
|
+
|
|
289
|
+
{data != null &&
|
|
290
|
+
<Editor
|
|
291
|
+
height="70vh"
|
|
292
|
+
onMount={handleCSSEditorDidMount}
|
|
293
|
+
defaultLanguage="css"
|
|
294
|
+
theme="vs-dark"
|
|
295
|
+
defaultValue={data.prettyCSS == null ? "" : data.prettyCSS}
|
|
296
|
+
/>
|
|
297
|
+
}
|
|
298
|
+
{data.prettyCSS}
|
|
299
|
+
</Box>
|
|
300
|
+
|
|
301
|
+
</Box>
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
{value == 3 &&
|
|
305
|
+
<Box value={value} index={3}>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
<Grid container spacing={2}>
|
|
309
|
+
<Grid item xs={6}>
|
|
310
|
+
<h4 style={{marginBottom:"0px"}}>HTML import Edits</h4>
|
|
311
|
+
<small>You can add imports such as google analytics or clarity</small>
|
|
312
|
+
</Grid>
|
|
313
|
+
<Grid item xs={6} sx={{textAlign:"right"}}>
|
|
314
|
+
<Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
|
|
315
|
+
|
|
316
|
+
var baseUri = GetBaseUrl();
|
|
317
|
+
let response = await apiService().post("/OEM/SetGlobalHTML", {
|
|
318
|
+
companyId: companyId,
|
|
319
|
+
domain: baseUri,
|
|
320
|
+
value: htmlEditorRef.current.getValue()
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
if (response != null && response.status == 200)
|
|
324
|
+
{
|
|
325
|
+
notification("HTML saved!")
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
}}>Save Changes</Button>
|
|
329
|
+
</Grid>
|
|
330
|
+
</Grid>
|
|
331
|
+
|
|
332
|
+
<Box sx={{paddingTop:1}}>
|
|
333
|
+
<Editor
|
|
334
|
+
height="70vh"
|
|
335
|
+
onMount={handleHtmlEditorDidMount}
|
|
336
|
+
defaultLanguage="html"
|
|
337
|
+
theme="vs-dark"
|
|
338
|
+
defaultValue={data.prettyHTML == null ? "" : data.prettyHTML}
|
|
339
|
+
/>
|
|
340
|
+
</Box>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
</Box>
|
|
344
|
+
}
|
|
345
|
+
</Box>
|
|
346
|
+
|
|
317
347
|
</Box>
|
|
348
|
+
</Box>
|
|
318
349
|
</>
|
|
319
350
|
)
|
|
320
351
|
}
|