mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: record_detail: click to expand compiler message
This commit is contained in:
5 files changed
+43
-12
No files matched your search
@@ -6,6 +6,9 @@
|
|||||||
&:empty
|
&:empty
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
|
.compiler-text-mask
|
||||||
|
display: none
|
||||||
|
|
||||||
.col--case
|
.col--case
|
||||||
width: rem(70px)
|
width: rem(70px)
|
||||||
|
|
||||||
@@ -28,3 +31,25 @@
|
|||||||
|
|
||||||
.col--memory
|
.col--memory
|
||||||
width: rem(100px)
|
width: rem(100px)
|
||||||
|
|
||||||
|
// dont hide compiler text if compile error
|
||||||
|
.hasjs .collapsed #status:not([data-status="7"])
|
||||||
|
.compiler-text
|
||||||
|
max-height: rem(250px)
|
||||||
|
overflow: hidden
|
||||||
|
position: relative
|
||||||
|
|
||||||
|
.compiler-text-mask, .compiler-text-mask p
|
||||||
|
display: block
|
||||||
|
position: absolute
|
||||||
|
cursor: pointer
|
||||||
|
bottom: 0
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
z-index: 1
|
||||||
|
|
||||||
|
.compiler-text-mask
|
||||||
|
height: rem(50px)
|
||||||
|
background-image: linear-gradient(to bottom, transparent, #ffffff 25px)
|
||||||
|
p
|
||||||
|
text-align: center
|
||||||
@@ -5,6 +5,20 @@ import { NamedPage } from 'vj/misc/Page';
|
|||||||
import { tpl, withTransistionCallback } from 'vj/utils';
|
import { tpl, withTransistionCallback } from 'vj/utils';
|
||||||
|
|
||||||
export default new NamedPage('record_detail', async () => {
|
export default new NamedPage('record_detail', async () => {
|
||||||
|
$(document).on('click', '.compiler-text', () => {
|
||||||
|
withTransistionCallback(() => {
|
||||||
|
$('.collapsed').removeClass('collapsed');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(document).on('click', '.subtask-case', function () {
|
||||||
|
const text = $(this).find('.message').text();
|
||||||
|
const data = $(this).find('.message').html();
|
||||||
|
if (!text?.trim()) return;
|
||||||
|
new InfoDialog({
|
||||||
|
$body: tpl(<pre dangerouslySetInnerHTML={{ __html: data }} />),
|
||||||
|
}).open();
|
||||||
|
});
|
||||||
|
|
||||||
if (!UiContext.socketUrl) return;
|
if (!UiContext.socketUrl) return;
|
||||||
const [{ default: WebSocket }, { DiffDOM }] = await Promise.all([
|
const [{ default: WebSocket }, { DiffDOM }] = await Promise.all([
|
||||||
import('../components/socket'),
|
import('../components/socket'),
|
||||||
@@ -25,12 +39,4 @@ export default new NamedPage('record_detail', async () => {
|
|||||||
dd.apply(oldSummary[0], dd.diff(oldSummary[0], newSummary[0]));
|
dd.apply(oldSummary[0], dd.diff(oldSummary[0], newSummary[0]));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
$(document).on('click', '.subtask-case', function () {
|
|
||||||
const text = $(this).find('.message').text();
|
|
||||||
const data = $(this).find('.message').html();
|
|
||||||
if (!text?.trim()) return;
|
|
||||||
new InfoDialog({
|
|
||||||
$body: tpl(<pre dangerouslySetInnerHTML={{ __html: data }} />),
|
|
||||||
}).open();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
{% if not isIE(handler.request.headers['user-agent']) and not handler.session.legacy %}
|
{% if not isIE(handler.request.headers['user-agent']) and not handler.session.legacy %}
|
||||||
<script type="text/javascript" src="/constant/{{ UiContext.constantVersion }}.js"></script>
|
<script type="text/javascript" src="/constant/{{ UiContext.constantVersion }}.js"></script>
|
||||||
<script type="text/javascript" src="{{ UiContext.cdn_prefix }}resource/{{ global.Hydro.version['ui-default'] }}/lang-{{ _('__id') }}.js"></script>
|
<script type="text/javascript" src="{{ UiContext.cdn_prefix }}resource/{{ global.Hydro.version['ui-default'] }}/lang-{{ _('__id') }}.js"></script>
|
||||||
<script type="text/javascript" src="{{ UiContext.cdn_prefix }}hydro-{{ global.Hydro.version['ui-default'] }}.js"></script>
|
<script type="text/javascript" src="{{ UiContext.cdn_prefix }}hydro-{{ global.Hydro.version['ui-default'] }}.js{% if process.env.DEV %}?version=dev{% endif %}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
{% block script %}{% endblock %}
|
{% block script %}{% endblock %}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
{{ set(UiContext, 'socketUrl', "record-detail-conn?domainId=" + rdoc.domainId + "&rid=" + rdoc._id) }}
|
{{ set(UiContext, 'socketUrl', "record-detail-conn?domainId=" + rdoc.domainId + "&rid=" + rdoc._id) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="medium-9 columns">
|
<div class="medium-9 columns collapsed">
|
||||||
{% if typeof(rdoc['status']) === 'number' %}
|
{% if typeof(rdoc['status']) === 'number' %}
|
||||||
{% include 'record_detail_status.html' %}
|
{% include 'record_detail_status.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="section visible" id="status">
|
<div class="section visible" id="status" data-status="{{ rdoc.status }}">
|
||||||
<div class="section__header">
|
<div class="section__header">
|
||||||
<h1 class="section__title">
|
<h1 class="section__title">
|
||||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% if rdoc.compilerTexts.length %}
|
{% if rdoc.compilerTexts.length %}
|
||||||
<div class="section__body">
|
<div class="section__body">
|
||||||
<pre class="compiler-text">{{ rdoc.compilerTexts|join('\n')|ansi|safe }}</pre>
|
<pre class="compiler-text">{{ rdoc.compilerTexts|join('\n')|ansi|safe }}<div class="compiler-text-mask"><p><span class="icon icon-expand_more">{{ _('Expand') }}</span></p></div></pre>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rdoc.judgeTexts.length %}
|
{% if rdoc.judgeTexts.length %}
|
||||||
|
|||||||
Reference in new issue
Block a user