Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianyazhichiC
algorithm-visualizer
提交
84a972c8
A
algorithm-visualizer
项目概览
tianyazhichiC
/
algorithm-visualizer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
algorithm-visualizer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
84a972c8
编写于
8月 08, 2018
作者:
J
Jason Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refine compile/run error messages
上级
c5aa4f8b
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
16 addition
and
17 deletion
+16
-17
src/backend/common/util.js
src/backend/common/util.js
+2
-2
src/backend/controllers/tracers.js
src/backend/controllers/tracers.js
+3
-7
src/frontend/common/stylesheet/fonts.scss
src/frontend/common/stylesheet/fonts.scss
+2
-0
src/frontend/common/stylesheet/index.scss
src/frontend/common/stylesheet/index.scss
+2
-1
src/frontend/components/App/stylesheet.scss
src/frontend/components/App/stylesheet.scss
+1
-1
src/frontend/components/ToastContainer/stylesheet.scss
src/frontend/components/ToastContainer/stylesheet.scss
+2
-2
src/frontend/core/renderers/LogRenderer/stylesheet.scss
src/frontend/core/renderers/LogRenderer/stylesheet.scss
+1
-0
src/frontend/core/renderers/Renderer/stylesheet.scss
src/frontend/core/renderers/Renderer/stylesheet.scss
+2
-3
src/frontend/template.html
src/frontend/template.html
+1
-1
未找到文件。
src/backend/common/util.js
浏览文件 @
84a972c8
...
@@ -4,7 +4,7 @@ import child_process from 'child_process';
...
@@ -4,7 +4,7 @@ import child_process from 'child_process';
const
execute
=
(
command
,
cwd
,
{
stdout
=
process
.
stdout
,
stderr
=
process
.
stderr
}
=
{})
=>
new
Promise
((
resolve
,
reject
)
=>
{
const
execute
=
(
command
,
cwd
,
{
stdout
=
process
.
stdout
,
stderr
=
process
.
stderr
}
=
{})
=>
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
cwd
)
return
reject
(
new
Error
(
'
CWD Not Specified
'
));
if
(
!
cwd
)
return
reject
(
new
Error
(
'
CWD Not Specified
'
));
const
child
=
child_process
.
exec
(
command
,
{
cwd
},
(
error
,
stdout
,
stderr
)
=>
{
const
child
=
child_process
.
exec
(
command
,
{
cwd
},
(
error
,
stdout
,
stderr
)
=>
{
if
(
error
)
return
reject
(
new
Error
(
stderr
)
);
if
(
error
)
return
reject
(
error
.
code
?
new
Error
(
stderr
)
:
error
);
resolve
(
stdout
);
resolve
(
stdout
);
});
});
if
(
stdout
)
child
.
stdout
.
pipe
(
stdout
);
if
(
stdout
)
child
.
stdout
.
pipe
(
stdout
);
...
@@ -13,4 +13,4 @@ const execute = (command, cwd, { stdout = process.stdout, stderr = process.stder
...
@@ -13,4 +13,4 @@ const execute = (command, cwd, { stdout = process.stdout, stderr = process.stder
export
{
export
{
execute
,
execute
,
};
};
\ No newline at end of file
src/backend/controllers/tracers.js
浏览文件 @
84a972c8
...
@@ -29,13 +29,9 @@ const trace = lang => (req, res, next) => {
...
@@ -29,13 +29,9 @@ const trace = lang => (req, res, next) => {
const
tempPath
=
getCodesPath
(
uuid
.
v4
());
const
tempPath
=
getCodesPath
(
uuid
.
v4
());
fs
.
outputFile
(
path
.
resolve
(
tempPath
,
`Main.
${
lang
}
`
),
code
)
fs
.
outputFile
(
path
.
resolve
(
tempPath
,
`Main.
${
lang
}
`
),
code
)
.
then
(()
=>
execute
(
`LANG=
${
lang
}
TEMP_PATH=
${
tempPath
}
./bin/compile`
,
repoPath
,
{
stdout
:
null
,
stderr
:
null
})
.
then
(()
=>
execute
(
`LANG=
${
lang
}
TEMP_PATH=
${
tempPath
}
./bin/compile`
,
repoPath
,
{
stdout
:
null
,
stderr
:
null
})
.
catch
(
error
=>
{
.
catch
(
error
=>
Promise
.
reject
(
new
CompileError
(
error
.
message
))))
throw
new
CompileError
(
error
);
}))
.
then
(()
=>
execute
(
`LANG=
${
lang
}
TEMP_PATH=
${
tempPath
}
./bin/run`
,
repoPath
,
{
stdout
:
null
,
stderr
:
null
})
.
then
(()
=>
execute
(
`LANG=
${
lang
}
TEMP_PATH=
${
tempPath
}
./bin/run`
,
repoPath
,
{
stdout
:
null
,
stderr
:
null
})
.
catch
(
error
=>
{
.
catch
(
error
=>
Promise
.
reject
(
new
RuntimeError
(
error
.
message
))))
throw
new
RuntimeError
(
error
);
}))
.
then
(()
=>
res
.
sendFile
(
path
.
resolve
(
tempPath
,
'
traces.json
'
)))
.
then
(()
=>
res
.
sendFile
(
path
.
resolve
(
tempPath
,
'
traces.json
'
)))
.
catch
(
next
)
.
catch
(
next
)
.
finally
(()
=>
fs
.
remove
(
tempPath
));
.
finally
(()
=>
fs
.
remove
(
tempPath
));
...
@@ -51,4 +47,4 @@ router.route('/java')
...
@@ -51,4 +47,4 @@ router.route('/java')
router
.
route
(
'
/cpp
'
)
router
.
route
(
'
/cpp
'
)
.
post
(
trace
(
'
cpp
'
));
.
post
(
trace
(
'
cpp
'
));
export
default
router
;
export
default
router
;
\ No newline at end of file
src/frontend/common/stylesheet/fonts.scss
0 → 100644
浏览文件 @
84a972c8
$font-family-normal
:
'Roboto'
,
sans-serif
;
$font-family-monospace
:
'Monaco'
,
'Menlo'
,
'Ubuntu Mono'
,
'Consolas'
,
'source-code-pro'
,
monospace
;
\ No newline at end of file
src/frontend/common/stylesheet/index.scss
浏览文件 @
84a972c8
@import
"colors"
;
@import
"colors"
;
@import
"dimensions"
;
@import
"dimensions"
;
\ No newline at end of file
@import
"fonts"
;
\ No newline at end of file
src/frontend/components/App/stylesheet.scss
浏览文件 @
84a972c8
...
@@ -10,7 +10,7 @@ body {
...
@@ -10,7 +10,7 @@ body {
}
}
body
{
body
{
font-family
:
'Roboto'
,
sans-serif
;
font-family
:
$font-family-normal
;
-webkit-font-smoothing
:
subpixel-antialiased
;
-webkit-font-smoothing
:
subpixel-antialiased
;
user-select
:
none
;
user-select
:
none
;
color
:
$color-font
;
color
:
$color-font
;
...
...
src/frontend/components/ToastContainer/stylesheet.scss
浏览文件 @
84a972c8
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
border-radius
:
4px
;
border-radius
:
4px
;
padding
:
16px
;
padding
:
16px
;
margin
:
8px
;
margin
:
8px
;
font-size
:
$font-size-large
;
white-space
:
pre-wrap
;
white-space
:
pre-line
;
pointer-events
:
auto
;
pointer-events
:
auto
;
font-family
:
$font-family-monospace
;
&
.success
{
&
.success
{
border-color
:
rgb
(
0
,
150
,
0
);
border-color
:
rgb
(
0
,
150
,
0
);
...
...
src/frontend/core/renderers/LogRenderer/stylesheet.scss
浏览文件 @
84a972c8
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
overflow-y
:
auto
;
overflow-y
:
auto
;
font-family
:
$font-family-monospace
;
.message
{
.message
{
margin
:
2px
0
;
margin
:
2px
0
;
...
...
src/frontend/core/renderers/Renderer/stylesheet.scss
浏览文件 @
84a972c8
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
font-family
:
'Roboto Mono'
,
monospace
;
&
:first-child
{
&
:first-child
{
border-top
:
none
;
border-top
:
none
;
...
@@ -17,9 +16,9 @@
...
@@ -17,9 +16,9 @@
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
background-color
:
$
color-shadow
;
background-color
:
$
theme-light
;
color
:
$color-font
;
color
:
$color-font
;
padding
:
4px
;
padding
:
4px
6px
;
font-size
:
$font-size-large
;
font-size
:
$font-size-large
;
}
}
}
}
\ No newline at end of file
src/frontend/template.html
浏览文件 @
84a972c8
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<meta
name=
"theme-color"
content=
"#393939"
>
<meta
name=
"theme-color"
content=
"#393939"
>
<link
rel=
"shortcut icon"
href=
"/favicon.png"
type=
"image/png"
>
<link
rel=
"shortcut icon"
href=
"/favicon.png"
type=
"image/png"
>
<link
rel=
"manifest"
href=
"/manifest.json"
>
<link
rel=
"manifest"
href=
"/manifest.json"
>
<link
href=
"https://fonts.googleapis.com/css?family=Roboto
+Mono:400,700|Roboto
:400,700"
rel=
"stylesheet"
>
<link
href=
"https://fonts.googleapis.com/css?family=Roboto:400,700"
rel=
"stylesheet"
>
</head>
</head>
<body>
<body>
<div
id=
"root"
style=
"height: 100%"
></div>
<div
id=
"root"
style=
"height: 100%"
></div>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录