mirror of https://github.com/Requarks/wiki.git
14 changed files with 257 additions and 10 deletions
Unified View
Diff Options
-
13CHANGELOG.md
-
2assets/css/app.css
-
7assets/css/configure.css
-
27client/scss/configure.scss
-
8config.sample.yml
-
103configure.js
-
19gulpfile.js
-
4libs/markdown.js
-
2models/user.js
-
6server.js
-
58views/configure/index.pug
-
2views/pages/admin/profile.pug
-
2views/pages/view.pug
-
14wiki.js
2
assets/css/app.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
7
assets/css/configure.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,27 @@ |
|||||
|
|
||||
|
$primary: 'indigo'; |
||||
|
|
||||
|
@import 'core-client/scss/core'; |
||||
|
@import 'core-client/scss/components/button'; |
||||
|
@import 'core-client/scss/components/footer'; |
||||
|
@import 'core-client/scss/components/form'; |
||||
|
@import 'core-client/scss/components/grid'; |
||||
|
@import 'core-client/scss/components/modal'; |
||||
|
@import 'core-client/scss/components/nav'; |
||||
|
@import 'core-client/scss/components/panel'; |
||||
|
@import 'core-client/scss/components/typography'; |
||||
|
|
||||
|
.welcome { |
||||
|
text-align: center; |
||||
|
padding: 25px 0 0; |
||||
|
color: mc('grey', '700'); |
||||
|
|
||||
|
h1 { |
||||
|
margin-top: 5px; |
||||
|
} |
||||
|
|
||||
|
h2 { |
||||
|
margin: 0; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,103 @@ |
|||||
|
'use strict' |
||||
|
|
||||
|
module.exports = (port, spinner) => { |
||||
|
const ROOTPATH = __dirname |
||||
|
const IS_DEBUG = process.env.NODE_ENV === 'development' |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// Load modules
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
const bodyParser = require('body-parser') |
||||
|
const compression = require('compression') |
||||
|
const express = require('express') |
||||
|
const favicon = require('serve-favicon') |
||||
|
const http = require('http') |
||||
|
const path = require('path') |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// Define Express App
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
var app = express() |
||||
|
app.use(compression()) |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// Public Assets
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
app.use(favicon(path.join(ROOTPATH, 'assets', 'favicon.ico'))) |
||||
|
app.use(express.static(path.join(ROOTPATH, 'assets'))) |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// View Engine Setup
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
app.set('views', path.join(ROOTPATH, 'views')) |
||||
|
app.set('view engine', 'pug') |
||||
|
|
||||
|
app.use(bodyParser.json()) |
||||
|
app.use(bodyParser.urlencoded({ extended: false })) |
||||
|
|
||||
|
app.locals._ = require('lodash') |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// Controllers
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
app.get('*', (req, res) => { |
||||
|
res.render('configure/index') |
||||
|
}) |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// Error handling
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
app.use(function (req, res, next) { |
||||
|
var err = new Error('Not Found') |
||||
|
err.status = 404 |
||||
|
next(err) |
||||
|
}) |
||||
|
|
||||
|
app.use(function (err, req, res, next) { |
||||
|
res.status(err.status || 500) |
||||
|
res.send({ |
||||
|
message: err.message, |
||||
|
error: IS_DEBUG ? err : {} |
||||
|
}) |
||||
|
spinner.fail(err.message) |
||||
|
process.exit(1) |
||||
|
}) |
||||
|
|
||||
|
// ----------------------------------------
|
||||
|
// Start HTTP server
|
||||
|
// ----------------------------------------
|
||||
|
|
||||
|
spinner.text = 'Starting HTTP server...' |
||||
|
|
||||
|
app.set('port', port) |
||||
|
var server = http.createServer(app) |
||||
|
server.listen(port) |
||||
|
server.on('error', (error) => { |
||||
|
if (error.syscall !== 'listen') { |
||||
|
throw error |
||||
|
} |
||||
|
|
||||
|
switch (error.code) { |
||||
|
case 'EACCES': |
||||
|
spinner.fail('Listening on port ' + port + ' requires elevated privileges!') |
||||
|
process.exit(1) |
||||
|
break |
||||
|
case 'EADDRINUSE': |
||||
|
spinner.fail('Port ' + port + ' is already in use!') |
||||
|
process.exit(1) |
||||
|
break |
||||
|
default: |
||||
|
throw error |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
server.on('listening', () => { |
||||
|
spinner.text = 'Browse to http://localhost:' + port + ' to configure Wiki.js!' |
||||
|
}) |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
doctype html |
||||
|
html |
||||
|
head |
||||
|
meta(http-equiv='X-UA-Compatible', content='IE=edge') |
||||
|
meta(charset='UTF-8') |
||||
|
title Wiki.js | Configure |
||||
|
|
||||
|
// Favicon |
||||
|
each favsize in [32, 96, 16] |
||||
|
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png') |
||||
|
|
||||
|
// CSS |
||||
|
link(type='text/css', rel='stylesheet', href='/css/libs.css') |
||||
|
link(type='text/css', rel='stylesheet', href='/css/configure.css') |
||||
|
|
||||
|
// JS |
||||
|
script(type='text/javascript', src='/js/libs.js') |
||||
|
//script(type='text/javascript', src='/js/app.js') |
||||
|
|
||||
|
block head |
||||
|
|
||||
|
body |
||||
|
#root |
||||
|
#header-container |
||||
|
nav.nav#header |
||||
|
.nav-left |
||||
|
a.nav-item(href='/') |
||||
|
h1 |
||||
|
i.icon-layers |
||||
|
| Wiki.js |
||||
|
main |
||||
|
.container |
||||
|
.welcome(style={'padding-bottom': '5px'}) |
||||
|
img(src='/favicons/android-icon-96x96.png', alt='Wiki.js') |
||||
|
h1 Welcome to Wiki.js! |
||||
|
h2(style={'margin-bottom': 0}) Fill in the fields below to get up and running. |
||||
|
.content |
||||
|
.panel |
||||
|
h2.panel-title |
||||
|
span General |
||||
|
i(v-if='loading') |
||||
|
.panel-content.form-sections |
||||
|
section |
||||
|
p.control.is-fullwidth |
||||
|
label.label Site Title |
||||
|
input(type='text', placeholder='e.g. Wiki', v-model='title') |
||||
|
section |
||||
|
p.control.is-fullwidth |
||||
|
label.label Host |
||||
|
input(type='text', placeholder='http://', v-model='host') |
||||
|
.panel-footer |
||||
|
button.button.is-indigo(v-on:click='add', v-bind:disabled='loading') Continue |
||||
|
footer.footer |
||||
|
span |
||||
|
| Powered by |
||||
|
a(href='https://github.com/Requarks/wiki') Wiki.js |
||||
|
| . |
||||
|
block outside |
xxxxxxxxxx