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
Gabriel Monnerat
slapos.toolbox
Commits
ad2f5fdd
Commit
ad2f5fdd
authored
Dec 11, 2012
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit only text file
parent
5789c3e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
slapos/runner/views.py
slapos/runner/views.py
+3
-0
No files found.
slapos/runner/views.py
View file @
ad2f5fdd
...
@@ -345,6 +345,9 @@ def removeSoftwareDir():
...
@@ -345,6 +345,9 @@ def removeSoftwareDir():
def
getFileContent
():
def
getFileContent
():
file_path
=
realpath
(
app
.
config
,
request
.
form
[
'file'
])
file_path
=
realpath
(
app
.
config
,
request
.
form
[
'file'
])
if
file_path
:
if
file_path
:
if
not
isText
(
file_path
):
return
jsonify
(
code
=
0
,
result
=
"Can not open a binary file, please select a text file!"
)
if
not
request
.
form
.
has_key
(
'truncate'
):
if
not
request
.
form
.
has_key
(
'truncate'
):
return
jsonify
(
code
=
1
,
result
=
open
(
file_path
,
'r'
).
read
())
return
jsonify
(
code
=
1
,
result
=
open
(
file_path
,
'r'
).
read
())
else
:
else
:
...
...
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