Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.toolbox
Commits
01b84885
Commit
01b84885
authored
Aug 07, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: minishell displays current path
parent
1f277080
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
slapos/runner/static/js/scripts/shell.js
slapos/runner/static/js/scripts/shell.js
+1
-1
slapos/runner/views.py
slapos/runner/views.py
+2
-2
No files found.
slapos/runner/static/js/scripts/shell.js
View file @
01b84885
...
...
@@ -39,7 +39,7 @@ $(document).ready(function () {
var
old_shell_btn_background
=
$
(
"
.shell_btn
"
).
css
(
"
background
"
);
$
(
"
.shell_btn
"
).
css
(
"
background
"
,
"
url(/static/css/images/loading-min.gif) center right no-repeat
"
)
$
.
post
(
"
/runCommand
"
,
data
,
function
(
data
)
{
var
data
=
"
<p><span class=
\"
runned-command
\"
>
>>>
"
+
command
+
"
</span></p><br/><pre>
"
+
data
+
"
</pre><br/>
"
;
var
data
=
"
<p><span class=
\"
runned-command
\"
>
"
+
data
.
path
+
"
>>>
"
+
command
+
"
</span></p><br/><pre>
"
+
data
.
data
+
"
</pre><br/>
"
;
$
(
"
#shell-result
"
).
append
(
data
);
$
(
"
#shell-input
"
).
val
(
""
);
$
(
"
#shell-result
"
).
scrollTop
(
$
(
"
#shell-result
"
)[
0
].
scrollHeight
);
...
...
slapos/runner/views.py
View file @
01b84885
...
...
@@ -727,10 +727,10 @@ def runCommand():
# if the command was just cd, execute it. Otherwise, execute the rest
command
=
command
.
replace
(
' '
.
join
(
cmd
),
''
).
strip
(
';'
)
if
not
command
:
return
"Changed directory, now in : "
+
cwd
return
jsonify
(
path
=
cwd
,
data
=
"Changed directory, now in : "
+
cwd
)
try
:
setMiniShellHistory
(
app
.
config
,
command
)
return
subprocess
.
check_output
(
command
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
,
cwd
=
cwd
)
return
jsonify
(
path
=
cwd
,
data
=
subprocess
.
check_output
(
command
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
,
cwd
=
cwd
)
)
except
subprocess
.
CalledProcessError
as
e
:
error
=
"Error : process exited with exit code "
+
str
(
e
.
returncode
)
+
\
"
\
n
Process says :
\
n
"
+
e
.
output
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment