2021-08-17 17:00:34 +08:00
|
|
|
{% extends "appbuilder/base.html" %}
|
|
|
|
|
|
|
|
{% block add_tail_js %}
|
|
|
|
<script src="{{url_for('appbuilder.static',filename='js/marked.min.js')}}"></script>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2021-10-14 17:34:27 +08:00
|
|
|
<div class="di-home" style="position: absolute;width: 100%;height: 100%;left: 0;top: 65px;background-color: #fff;">
|
|
|
|
<iframe src="/static/appbuilder/vison/index.html#/home" style="width:100%;height:100%;border: none;"></iframe>
|
2021-08-17 17:00:34 +08:00
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
window.onload = function () {
|
|
|
|
document.querySelector('.di-home').addEventListener('click', function (e) {
|
|
|
|
const event = e || window.event;
|
|
|
|
const target = event.target || event.srcElement;
|
|
|
|
console.log(target.dataset.url);
|
|
|
|
if (target.nodeName === 'LI' && target.dataset.url) {
|
|
|
|
if (target.dataset.open)
|
|
|
|
{
|
|
|
|
console.log(target.dataset.url);
|
|
|
|
location.href = target.dataset.url;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
console.log(target.dataset.url);
|
|
|
|
open(target.dataset.url);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelectorAll('.markdown').forEach(item => {
|
|
|
|
item.innerHTML = marked(item.textContent.trim())
|
|
|
|
item.classList.remove('loading');
|
|
|
|
});
|
|
|
|
}
|
2021-10-14 17:34:27 +08:00
|
|
|
// postMessage 事件
|
|
|
|
function appframeListener(event) {
|
|
|
|
if (event.data.type) {
|
|
|
|
switch (event.data.type) {
|
|
|
|
case 'link':
|
|
|
|
location.pathname = '/pipeline_modelview/web/' + event.data.message.pipelineId;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
window.addEventListener('message', appframeListener, false);
|
2021-08-17 17:00:34 +08:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|