mirror of https://github.com/MISP/MISP
Merge remote-tracking branch 'origin/develop' into feature-workflows-2
commit
0d5361fcb6
|
@ -35,7 +35,7 @@ class AppController extends Controller
|
|||
|
||||
public $helpers = array('OrgImg', 'FontAwesome', 'UserName');
|
||||
|
||||
private $__queryVersion = '141';
|
||||
private $__queryVersion = '143';
|
||||
public $pyMispVersion = '2.4.159';
|
||||
public $phpmin = '7.2';
|
||||
public $phprec = '7.4';
|
||||
|
|
|
@ -68,9 +68,9 @@ class AuditLogsController extends AppController
|
|||
],
|
||||
];
|
||||
|
||||
public function __construct($id = false, $table = null, $ds = null)
|
||||
public function __construct($request = null, $response = null)
|
||||
{
|
||||
parent::__construct($id, $table, $ds);
|
||||
parent::__construct($request, $response);
|
||||
$this->actions = [
|
||||
AuditLog::ACTION_ADD => __('Add'),
|
||||
AuditLog::ACTION_EDIT => __('Edit'),
|
||||
|
@ -345,7 +345,7 @@ class AuditLogsController extends AppController
|
|||
return ['event_id' => $event['Event']['id']];
|
||||
}
|
||||
|
||||
$event = $this->Event->fetchEvent($this->Auth->user(), [
|
||||
$event = $this->AuditLog->Event->fetchEvent($this->Auth->user(), [
|
||||
'eventid' => $event['Event']['id'],
|
||||
'sgReferenceOnly' => 1,
|
||||
'deleted' => [0, 1],
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
'jquery-ui.min',
|
||||
'doT',
|
||||
'markdown-it',
|
||||
'mermaid',
|
||||
'highlight.min',
|
||||
'FileSaver',
|
||||
),
|
||||
|
|
|
@ -137,6 +137,35 @@ function initMarkdownIt() {
|
|||
if (typeof markdownItCustomPostInit === 'function') {
|
||||
markdownItCustomPostInit()
|
||||
}
|
||||
// patch md.fence to support mermaid
|
||||
md.mermaid = mermaid
|
||||
const fenceBackup = md.renderer.rules.fence.bind(md.renderer.rules)
|
||||
md.renderer.rules.fence = function (tokens, idx, options, env, slf) {
|
||||
const token = tokens[idx]
|
||||
const code = token.content.trim()
|
||||
if (token.info === 'mermaid') {
|
||||
return renderMermaid(code)
|
||||
}
|
||||
const firstLine = code.split(/\n/)[0].trim()
|
||||
if (firstLine === 'gantt' || firstLine === 'sequenceDiagram' || firstLine.match(/^graph (?:TB|BT|RL|LR|TD);?$/)) {
|
||||
return renderMermaid(code)
|
||||
}
|
||||
return fenceBackup(tokens, idx, options, env, slf)
|
||||
}
|
||||
var mermaidTheme = 'neutral'
|
||||
mermaid.mermaidAPI.initialize({
|
||||
startOnLoad: false,
|
||||
theme: mermaidTheme,
|
||||
})
|
||||
}
|
||||
|
||||
function renderMermaid(code) {
|
||||
try {
|
||||
var result = mermaid.mermaidAPI.render('mermaid-graph', code)
|
||||
return '<div class="mermaid">' + (result !== undefined ? result : '- error while parsing mermaid graph -') + '</div>'
|
||||
} catch (err) {
|
||||
return '<pre>' + 'mermaid error:\n' + err.message + '</pre>'
|
||||
}
|
||||
}
|
||||
|
||||
function initCodeMirror() {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue