Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alp Deniz Ogut
Photos Web App
Commits
79bf81b7
Commit
79bf81b7
authored
1 year ago
by
Alp Deniz Ogut
Browse files
Options
Download
Email Patches
Plain Diff
init plugin progress check on reload
parent
7caf2613
Pipeline
#14826
passed with stage
in 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
public/index.html
+2
-2
public/index.html
public/js/app.js
+6
-3
public/js/app.js
with
8 additions
and
5 deletions
+8
-5
public/index.html
+
2
-
2
View file @
79bf81b7
...
...
@@ -88,8 +88,8 @@
</div>
</div>
<div
id=
"importer_bar"
class=
"row"
>
<div
class=
"importer"
v-on:click=
"run_importer('flickr')"
>
Import Flickr
<span><span>
{{ importers['flickr']['status'] }}
</span>
-
</span><span
v-if=
"importers['flickr']['status'] == '
running'"
>
{{ importers['flickr']['progress'] }}
</span></span></div>
<div
class=
"importer"
v-on:click=
"run_importer('dropbox')"
>
Import Dropbox
<span><span>
{{ importers['dropbox']['status'] }}
</span>
-
<span
v-if=
"importers['dropbox']['status'] == '
running'"
>
{{ importers['dropbox']['progress'] }}
</span></span></div>
<div
class=
"importer"
v-on:click=
"run_importer('flickr')"
>
Import Flickr
<span><span>
{{ importers['flickr']['status'] }}
</span></span><span
v-if=
"importers['flickr']['status'] == '
started' || !!importers['flickr']['progress']"
>
-
{{ importers['flickr']['progress'] }}
</span></span></div>
<div
class=
"importer"
v-on:click=
"run_importer('dropbox')"
>
Import Dropbox
<span><span>
{{ importers['dropbox']['status'] }}
</span>
-
<span
v-if=
"importers['dropbox']['status'] == '
started' || !!importers['dropbox']['progress']"
>
-
{{ importers['dropbox']['progress'] }}
</span></span></div>
</div>
<div
id=
"stage"
class=
"row"
>
<div
id=
"stage_bar"
v-if=
"items.length > 0"
>
...
...
This diff is collapsed.
Click to expand it.
public/js/app.js
+
6
-
3
View file @
79bf81b7
...
...
@@ -357,7 +357,10 @@ var app = new Vue({
for
(
let
p
of
[
'
flickr
'
,
'
dropbox
'
])
{
console
.
log
(
p
);
if
(
run
.
pluginName
.
toLowerCase
().
indexOf
(
p
)
!==
-
1
)
{
self
.
importers
[
p
][
'
status
'
]
=
run
.
status
;
// init progress listener if it is a fresh start or reload
if
(
run
.
status
!=
self
.
importers
[
p
][
status
]
&&
run
.
status
==
"
started
"
)
self
.
importers
[
p
][
'
status
'
]
=
run
.
status
;
self
.
check_plugin_progress
(
id
);
self
.
importers
[
p
][
'
progress
'
]
=
run
.
progress
;
}
}
...
...
@@ -401,13 +404,13 @@ var app = new Vue({
this
.
notify
=
`Started plugin
${
pluginName
}
`
;
this
.
importers
[
pluginName
][
'
status
'
]
=
'
starting
'
;
this
.
delay_hide_messages
();
this
.
check_plugin_progress
(
id
,
pluginName
);
this
.
check_plugin_progress
(
id
);
},
check_plugin_progress
:
function
(
id
)
{
var
authenticated
=
false
;
var
authenticating
=
false
;
var
self
=
this
;
interval
=
setInterval
(
function
()
{
var
interval
=
setInterval
(
function
()
{
self
.
client
.
get
(
id
).
then
(
function
(
response
)
{
console
.
log
(
`Run
${
response
.
status
}
:
${
JSON
.
stringify
(
response
)}
`
);
let
pluginName
=
response
.
pluginName
.
indexOf
(
'
dropbox
'
)
!=
-
1
?
'
dropbox
'
:
'
flickr
'
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets