⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
angular
/
View File Name :
misc.ts
import angular from 'angular'; import coreModule from './core_module'; coreModule.directive('tip', ['$compile', tip]); function tip($compile: any) { return { restrict: 'E', link: (scope: any, elem: any, attrs: any) => { let _t = '
&]/g, (m: string) => '&#' + m.charCodeAt(0) + ';') + '\'">
'; elem.replaceWith($compile(angular.element(_t))(scope)); }, }; } coreModule.directive('compile', ['$compile', compile]); function compile($compile: any) { return { restrict: 'A', link: (scope: any, element: any, attrs: any) => { scope.$watch( (scope: any) => { return scope.$eval(attrs.compile); }, (value: any) => { element.html(value); $compile(element.contents())(scope); } ); }, }; } coreModule.directive('watchChange', watchChange); function watchChange() { return { scope: { onchange: '&watchChange' }, link: (scope: any, element: any) => { element.on('input', () => { scope.$apply(() => { scope.onchange({ inputValue: element.val() }); }); }); }, }; } coreModule.directive('editorOptBool', ['$compile', editorOptBool]); function editorOptBool($compile: any) { return { restrict: 'E', link: (scope: any, elem: any, attrs: any) => { const ngchange = attrs.change ? ' ng-change="' + attrs.change + '"' : ''; const tip = attrs.tip ? '
' + attrs.tip + '
' : ''; const showIf = attrs.showIf ? ' ng-show="' + attrs.showIf + '" ' : ''; const template = '
' + '
' + attrs.text + tip + '
' + '
' + '
'; elem.replaceWith($compile(angular.element(template))(scope)); }, }; } coreModule.directive('editorCheckbox', ['$compile, $interpolate', editorCheckbox]); function editorCheckbox($compile: any, $interpolate: any) { return { restrict: 'E', link: (scope: any, elem: any, attrs: any) => { const text = $interpolate(attrs.text)(scope); const model = $interpolate(attrs.model)(scope); const ngchange = attrs.change ? ' ng-change="' + attrs.change + '"' : ''; const tip = attrs.tip ? '
' + attrs.tip + '
' : ''; const label = '
' + text + tip + '
'; let template = '
' + '
'; template = template + label; elem.addClass('gf-form-checkbox'); elem.html($compile(angular.element(template))(scope)); }, }; } coreModule.directive('gfDropdown', ['$parse', '$compile', '$timeout', gfDropdown]); function gfDropdown($parse: any, $compile: any, $timeout: any) { function buildTemplate(items: any, placement?: any) { const upclass = placement === 'top' ? 'dropup' : ''; const ul = ['
', '
']; for (let index = 0; index < items.length; index++) { const item = items[index]; if (item.divider) { ul.splice(index + 1, 0, '
'); continue; } let li = '
' + '
' + (item.text || '') + '
'; if (item.submenu && item.submenu.length) { li += buildTemplate(item.submenu).join('\n'); } li += '
'; ul.splice(index + 1, 0, li); } return ul; } return { restrict: 'EA', scope: true, link: function postLink(scope: any, iElement: any, iAttrs: any) { const getter = $parse(iAttrs.gfDropdown), items = getter(scope); $timeout(() => { const placement = iElement.data('placement'); const dropdown = angular.element(buildTemplate(items, placement).join('')); dropdown.insertAfter(iElement); $compile(iElement.next('ul.dropdown-menu'))(scope); }); iElement.addClass('dropdown-toggle').attr('data-toggle', 'dropdown'); }, }; }