Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
baas
Commits
ef6bb24a
Commit
ef6bb24a
authored
Nov 04, 2015
by
Efthymia Bika
Browse files
Save timeview data to ~/.baas/cache dir
parent
9e6a9e9d
Changes
1
Show whitespace changes
Inline
Side-by-side
baas/timeview.js
View file @
ef6bb24a
function
show_contents_by_date
(
error
,
stdout
,
stderr
)
{
$
(
"
#time-contents
"
).
empty
();
if
(
error
)
$
(
"
#msg
"
).
html
(
error
);
var
ul
=
$
(
"
<ul></ul>
"
)
.
attr
(
"
class
"
,
"
no-bullet
"
)
.
attr
(
"
id
"
,
"
timeview-contents-list
"
);
var
contents
=
JSON
.
parse
(
stdout
);
$
.
each
(
contents
,
function
(
i
,
el
)
{
var
f
=
"
open_folder('
"
+
el
.
name
+
"
')
"
;
...
...
@@ -119,6 +117,8 @@ function get_contents_by_date(value) {
init_path
=
time_path
;
}
var
time_script
=
path
.
join
(
exec_path
,
'
timeview.py
'
);
var
datapath
=
path
.
join
(
BAAS_CACHE_DIR
,
'
timeviews
'
);
if
(
process
.
platform
==
'
win32
'
)
{
time_script
=
time_script
.
replace
(
/
\\
/g
,
"
\\\\
"
);
exec
(
CYGWIN_BASH
+
"
-c
\"
/usr/bin/cygpath '
"
+
time_script
+
"
'
\"
"
,
...
...
@@ -126,13 +126,13 @@ function get_contents_by_date(value) {
time_script
=
String
(
stdout
).
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
);
if
(
error
)
$
(
"
#msg
"
).
html
(
error
);
var
cmd
=
build_win_commands
();
var
time_cmd
=
"
python
"
+
time_script
+
"
timeviews/
swift://
"
+
var
time_cmd
=
"
python
"
+
time_script
+
"
"
+
datapath
+
"
swift://
"
+
container
+
"
get
"
+
value
+
"
'
"
+
time_path
+
"
'
"
exec
(
CYGWIN_BASH
+
"
-c '
"
+
cmd
+
time_cmd
+
"
'
"
,
show_contents_by_date
);
});
}
else
{
var
time_cmd
=
"
python
"
+
time_script
+
"
timeviews/
swift://
"
+
var
time_cmd
=
"
python
"
+
time_script
+
"
"
+
datapath
+
"
swift://
"
+
container
+
"
get
"
+
value
+
"
'
"
+
time_path
+
"
'
"
exec
(
time_cmd
,
show_contents_by_date
);
}
...
...
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