first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
define("core/check/check_result",["exports","./repository","core/str","core/templates"],(function(_exports,_repository,_str,Templates){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.getAndRender=
/**
* Check API result functions
*
* @module core/check
* @author Matthew Hilton <matthewhilton@catalyst-au.net>
* @copyright Catalyst IT, 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
async function(domSelector,adminTreeId,settingName,includeDetails){const element=document.querySelector(domSelector);if(!element)return void window.console.error("Check selector not found");try{const result=await(0,_repository.getCheckResult)(adminTreeId,settingName,includeDetails),decoded=(new DOMParser).parseFromString(result.html,"text/html").documentElement.textContent;element.innerHTML=decoded}catch(e){window.console.error(e),element.innerHTML=await Templates.render("core/notification",{iserror:!0,closebutton:!1,announce:0,extraclasses:"",message:await(0,_str.getString)("checkerror","core",adminTreeId)})}},Templates=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(Templates)}));
//# sourceMappingURL=check_result.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"check_result.min.js","sources":["../../src/check/check_result.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Check API result functions\n *\n * @module core/check\n * @author Matthew Hilton <matthewhilton@catalyst-au.net>\n * @copyright Catalyst IT, 2023\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getCheckResult} from './repository';\nimport {getString} from 'core/str';\nimport * as Templates from 'core/templates';\n\n/**\n * Get the result of a check and replace a given DOM element with the result.\n *\n * @method getAndRender\n * @param {String} domSelector A CSS selector for a dom element to replace the the HTML for.\n * @param {String} adminTreeId Id of the admin_setting that called this webservice. Used to retrieve the check registered to it.\n * @param {String} settingName Name of setting (used to find the parent node in the admin tree)\n * @param {Boolean} includeDetails If true, details will be included in the check.\n * By default only the status and the summary is returned.\n */\nexport async function getAndRender(domSelector, adminTreeId, settingName, includeDetails) {\n const element = document.querySelector(domSelector);\n\n if (!element) {\n window.console.error('Check selector not found');\n return;\n }\n\n try {\n const result = await getCheckResult(adminTreeId, settingName, includeDetails);\n const decoded = new DOMParser().parseFromString(result.html, \"text/html\").documentElement.textContent;\n element.innerHTML = decoded;\n } catch (e) {\n window.console.error(e);\n\n // Render error as a red notification.\n element.innerHTML = await Templates.render('core/notification', {\n iserror: true,\n closebutton: false,\n announce: 0,\n extraclasses: '',\n message: await getString('checkerror', 'core', adminTreeId)\n });\n }\n}\n"],"names":["domSelector","adminTreeId","settingName","includeDetails","element","document","querySelector","window","console","error","result","decoded","DOMParser","parseFromString","html","documentElement","textContent","innerHTML","e","Templates","render","iserror","closebutton","announce","extraclasses","message"],"mappings":";;;;;;;;;eAsCmCA,YAAaC,YAAaC,YAAaC,sBAChEC,QAAUC,SAASC,cAAcN,iBAElCI,oBACDG,OAAOC,QAAQC,MAAM,sCAKfC,aAAe,8BAAeT,YAAaC,YAAaC,gBACxDQ,SAAU,IAAIC,WAAYC,gBAAgBH,OAAOI,KAAM,aAAaC,gBAAgBC,YAC1FZ,QAAQa,UAAYN,QACtB,MAAOO,GACLX,OAAOC,QAAQC,MAAMS,GAGrBd,QAAQa,gBAAkBE,UAAUC,OAAO,oBAAqB,CAC5DC,SAAS,EACTC,aAAa,EACbC,SAAU,EACVC,aAAc,GACdC,cAAe,kBAAU,aAAc,OAAQxB"}
+3
View File
@@ -0,0 +1,3 @@
define("core/check/repository",["exports","core/ajax"],(function(_exports,_ajax){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.getCheckResult=void 0;_exports.getCheckResult=(adminTreeId,settingName,includeDetails)=>(0,_ajax.call)([{methodname:"core_check_get_result_admintree",args:{admintreeid:adminTreeId,settingname:settingName,includedetails:includeDetails}}])[0]}));
//# sourceMappingURL=repository.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"repository.min.js","sources":["../../src/check/repository.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Check API webservice repository\n *\n * @module core/check\n * @author Matthew Hilton <matthewhilton@catalyst-au.net>\n * @copyright Catalyst IT, 2023\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {call as fetchMany} from 'core/ajax';\n\n/**\n * Call check_get_result webservice function\n *\n * @param {String} adminTreeId Id of the admin_setting that called this webservice. Used to retrieve the check registered to it.\n * @param {String} settingName Setting name (used to find it's parent)\n * @param {Boolean} includeDetails If details should be included in the response\n */\nexport const getCheckResult = (adminTreeId, settingName, includeDetails) => fetchMany([{\n methodname: 'core_check_get_result_admintree',\n args: {\n admintreeid: adminTreeId,\n settingname: settingName,\n includedetails: includeDetails,\n },\n}])[0];\n\n"],"names":["adminTreeId","settingName","includeDetails","methodname","args","admintreeid","settingname","includedetails"],"mappings":"gMAiC8B,CAACA,YAAaC,YAAaC,kBAAmB,cAAU,CAAC,CACnFC,WAAY,kCACZC,KAAM,CACFC,YAAaL,YACbM,YAAaL,YACbM,eAAgBL,mBAEpB"}