Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
4dd79170
Commit
4dd79170
authored
Mar 28, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup wizard completed + restart call
parent
df4da745
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
4 deletions
+79
-4
configure.min.js
assets/js/configure.min.js
+14
-1
configure.js
client/js/configure.js
+11
-0
configure.js
configure.js
+38
-2
index.pug
views/configure/index.pug
+16
-1
No files found.
assets/js/configure.min.js
View file @
4dd79170
...
...
@@ -339,7 +339,20 @@ _vue2.default.use(_veeValidate2.default, {
});
},
1000
);
},
finish
:
function
finish
(
ev
)
{}
finish
:
function
finish
(
ev
)
{
var
self
=
this
;
self
.
state
=
'restart'
;
_lodash2
.
default
.
delay
(
function
()
{
_axios2
.
default
.
post
(
'/restart'
,
{}).
then
(
function
(
resp
)
{
_lodash2
.
default
.
delay
(
function
()
{
window
.
location
.
assign
(
self
.
conf
.
host
);
},
10000
);
}).
catch
(
function
(
err
)
{
window
.
alert
(
err
.
message
);
});
},
1000
);
}
}
});
});
client/js/configure.js
View file @
4dd79170
...
...
@@ -267,7 +267,18 @@ jQuery(document).ready(function ($) {
},
1000
)
},
finish
:
function
(
ev
)
{
let
self
=
this
self
.
state
=
'restart'
_
.
delay
(()
=>
{
axios
.
post
(
'/restart'
,
{}).
then
(
resp
=>
{
_
.
delay
(()
=>
{
window
.
location
.
assign
(
self
.
conf
.
host
)
},
10000
)
}).
catch
(
err
=>
{
window
.
alert
(
err
.
message
)
})
},
1000
)
}
}
})
...
...
configure.js
View file @
4dd79170
...
...
@@ -26,6 +26,8 @@ module.exports = (port, spinner) => {
var
app
=
express
()
app
.
use
(
compression
())
var
server
// ----------------------------------------
// Public Assets
// ----------------------------------------
...
...
@@ -165,7 +167,6 @@ module.exports = (port, spinner) => {
const
gitDir
=
path
.
resolve
(
ROOTPATH
,
req
.
body
.
pathRepo
)
let
gitRemoteUrl
=
''
console
.
log
(
req
.
body
)
if
(
req
.
body
.
gitUseRemote
===
true
)
{
let
urlObj
=
url
.
parse
(
req
.
body
.
gitUrl
)
...
...
@@ -356,6 +357,23 @@ module.exports = (port, spinner) => {
})
})
/**
* Restart in normal mode
*/
app
.
post
(
'/restart'
,
(
req
,
res
)
=>
{
res
.
status
(
204
).
end
()
server
.
destroy
(()
=>
{
spinner
.
text
=
'Setup wizard terminated. Restarting in normal mode...'
_
.
delay
(()
=>
{
const
exec
=
require
(
'execa'
)
exec
.
stdout
(
'node'
,
[
'wiki'
,
'start'
]).
then
(
result
=>
{
spinner
.
succeed
(
'Wiki.js is now running in normal mode!'
)
process
.
exit
(
0
)
})
},
1000
)
})
})
// ----------------------------------------
// Error handling
// ----------------------------------------
...
...
@@ -383,8 +401,26 @@ module.exports = (port, spinner) => {
spinner
.
text
=
'Starting HTTP server...'
app
.
set
(
'port'
,
port
)
var
server
=
http
.
createServer
(
app
)
server
=
http
.
createServer
(
app
)
server
.
listen
(
port
)
var
openConnections
=
[]
server
.
on
(
'connection'
,
(
conn
)
=>
{
let
key
=
conn
.
remoteAddress
+
':'
+
conn
.
remotePort
openConnections
[
key
]
=
conn
conn
.
on
(
'close'
,
()
=>
{
delete
openConnections
[
key
]
})
})
server
.
destroy
=
(
cb
)
=>
{
server
.
close
(
cb
)
for
(
let
key
in
openConnections
)
{
openConnections
[
key
].
destroy
()
}
}
server
.
on
(
'error'
,
(
error
)
=>
{
if
(
error
.
syscall
!==
'listen'
)
{
throw
error
...
...
views/configure/index.pug
View file @
4dd79170
...
...
@@ -26,7 +26,7 @@ html(data-logic='configure')
main
.container
transition(name='tst-welcome')
.welcome(style={'padding-bottom': '5px'}, v-if='state === "welcome"')
.welcome(style={'padding-bottom': '5px'}, v-if='state === "welcome"
|| state === "restart"
')
img(src='/favicons/android-icon-96x96.png', alt='Wiki.js')
h1 Welcome to Wiki.js!
h2(style={'margin-bottom': 0}) A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown
...
...
@@ -356,6 +356,21 @@ html(data-logic='configure')
button.button.is-teal(v-on:click='proceedToFinal', v-if='!loading && !final.ok') Try Again
button.button.is-green(v-on:click='finish', v-if='loading || final.ok', v-bind:disabled='loading') Start
//- ==============================================
//- RESTART
//- ==============================================
template(v-else-if='state === "restart"')
.panel
h2.panel-title.is-featured
span Restarting...
i
.panel-content.is-text
p #[i.icon-loader.animated.rotateIn.infinite] Restarting Wiki.js in normal mode...
p You'll automatically be redirected to the homepage when ready. Please be patient...
.panel-footer
button.button.is-green(disabled='disabled') Start
footer.footer
span
| Powered by
...
...
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