diff --git a/.gitignore b/.gitignore index cade9e07..41183d2b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ npm-debug.log* # Generated assets /assets +/assets-legacy server/views/master.pug server/views/legacy/master.pug server/views/setup.pug diff --git a/client/components/not-found.vue b/client/components/not-found.vue index 5a23892a..4ddf4f1f 100644 --- a/client/components/not-found.vue +++ b/client/components/not-found.vue @@ -2,7 +2,7 @@ v-app .notfound .notfound-content - img.animated.fadeIn(src='/_assets/svg/icon-delete-file.svg', alt='Not Found') + img.animated.fadeIn(src='/_assets-legacy/svg/icon-delete-file.svg', alt='Not Found') .headline {{$t('notfound.title')}} .subheading.mt-3 {{$t('notfound.subtitle')}} v-btn.mt-5(color='red lighten-4', href='/', large, outlined) diff --git a/client/components/unauthorized.vue b/client/components/unauthorized.vue index 59026d80..aa372c83 100644 --- a/client/components/unauthorized.vue +++ b/client/components/unauthorized.vue @@ -2,7 +2,7 @@ v-app .unauthorized .unauthorized-content - img.animated.fadeIn(src='/_assets/svg/icon-delete-shield.svg', alt='Unauthorized') + img.animated.fadeIn(src='/_assets-legacy/svg/icon-delete-shield.svg', alt='Unauthorized') .headline {{$t('unauthorized.title')}} .subtitle-1.mt-3 {{$t('unauthorized.action.' + action)}} v-btn.mt-5(href='/login', x-large) diff --git a/client/components/welcome.vue b/client/components/welcome.vue index 3e4f4af3..c182efdd 100644 --- a/client/components/welcome.vue +++ b/client/components/welcome.vue @@ -2,7 +2,7 @@ v-app .onboarding .onboarding-content - img.animated.fadeIn(src='/_assets/svg/logo-wikijs.svg', alt='Wiki.js') + img.animated.fadeIn(src='/_assets-legacy/svg/logo-wikijs.svg', alt='Wiki.js') .headline.animated.fadeInUp {{ $t('welcome.title') }} .subtitle-1.mt-3.animated.fadeInUp.wait-p1s {{ $t('welcome.subtitle') }} div diff --git a/dev/webpack/webpack.dev.js b/dev/webpack/webpack.dev.js index e769e052..ed570944 100644 --- a/dev/webpack/webpack.dev.js +++ b/dev/webpack/webpack.dev.js @@ -19,7 +19,7 @@ const babelDir = path.join(process.cwd(), '.webpack-cache/babel') process.noDeprecation = true -fs.emptyDirSync(path.join(process.cwd(), 'assets')) +fs.emptyDirSync(path.join(process.cwd(), 'assets-legacy')) module.exports = { mode: 'development', @@ -29,8 +29,8 @@ module.exports = { setup: ['./client/index-setup.js', 'webpack-hot-middleware/client'] }, output: { - path: path.join(process.cwd(), 'assets'), - publicPath: '/_assets/', + path: path.join(process.cwd(), 'assets-legacy'), + publicPath: '/_assets-legacy/', filename: 'js/[name].js', chunkFilename: 'js/[name].js', globalObject: 'this', diff --git a/dev/webpack/webpack.prod.js b/dev/webpack/webpack.prod.js index 0b170d7b..f7bc315b 100644 --- a/dev/webpack/webpack.prod.js +++ b/dev/webpack/webpack.prod.js @@ -24,7 +24,7 @@ const babelDir = path.join(process.cwd(), '.webpack-cache/babel') process.noDeprecation = true -fs.emptyDirSync(path.join(process.cwd(), 'assets')) +fs.emptyDirSync(path.join(process.cwd(), 'assets-legacy')) module.exports = { mode: 'production', @@ -34,8 +34,8 @@ module.exports = { setup: './client/index-setup.js' }, output: { - path: path.join(process.cwd(), 'assets'), - publicPath: '/_assets/', + path: path.join(process.cwd(), 'assets-legacy'), + publicPath: '/_assets-legacy/', filename: `js/[name].js?${now}`, chunkFilename: `js/[name].js?${now}`, globalObject: 'this', diff --git a/package.json b/package.json index 66b45616..9bb75bfb 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "node server", "dev": "nodemon server", "legacy:dev": "node dev", - "legacy:build": "webpack --profile --config dev/webpack/webpack.prod.js", + "legacy:build": "NODE_OPTIONS=--openssl-legacy-provider webpack --profile --config dev/webpack/webpack.prod.js", "test": "eslint --format codeframe --ext .js,.vue . && pug-lint server/views && jest", "cypress:open": "cypress open" }, diff --git a/server/controllers/common.js b/server/controllers/common.js index 052c3757..709103ac 100644 --- a/server/controllers/common.js +++ b/server/controllers/common.js @@ -4,6 +4,7 @@ const pageHelper = require('../helpers/page') const _ = require('lodash') const CleanCSS = require('clean-css') const moment = require('moment') +const path = require('path') /* global WIKI */ @@ -35,24 +36,28 @@ router.get('/healthz', (req, res, next) => { /** * Administration */ -router.get(['/a', '/a/*'], (req, res, next) => { - if (!WIKI.auth.checkAccess(req.user, [ - 'manage:system', - 'write:users', - 'manage:users', - 'write:groups', - 'manage:groups', - 'manage:navigation', - 'manage:theme', - 'manage:api' - ])) { - _.set(res.locals, 'pageMeta.title', 'Unauthorized') - return res.status(403).render('unauthorized', { action: 'view' }) - } - - _.set(res.locals, 'pageMeta.title', 'Admin') - res.render('admin') +router.get(['/_admin', '/_admin/*'], (req, res, next) => { + res.sendFile(path.join(WIKI.ROOTPATH, 'assets/index.html')) }) +// router.get(['/_admin', '/_admin/*'], (req, res, next) => { +// if (!WIKI.auth.checkAccess(req.user, [ +// 'manage:system', +// 'write:users', +// 'manage:users', +// 'write:groups', +// 'manage:groups', +// 'manage:navigation', +// 'manage:theme', +// 'manage:api' +// ])) { +// _.set(res.locals, 'pageMeta.title', 'Unauthorized') +// return res.status(403).render('unauthorized', { action: 'view' }) +// } + +// _.set(res.locals, 'pageMeta.title', 'Admin') +// res.render('admin') + +// }) /** * Download Page / Version diff --git a/server/core/servers.js b/server/core/servers.js index 782a386b..2bc30ffa 100644 --- a/server/core/servers.js +++ b/server/core/servers.js @@ -134,7 +134,7 @@ module.exports = { ] }) await this.servers.graph.start() - this.servers.graph.applyMiddleware({ app: WIKI.app, cors: false }) + this.servers.graph.applyMiddleware({ app: WIKI.app, cors: false, path: '/_graphql' }) }, /** * Close all active connections diff --git a/server/master.js b/server/master.js index 6ea6778f..7c6fd342 100644 --- a/server/master.js +++ b/server/master.js @@ -53,14 +53,18 @@ module.exports = async () => { // ---------------------------------------- app.use(favicon(path.join(WIKI.ROOTPATH, 'assets', 'favicon.ico'))) - app.use('/_assets/svg/twemoji', async (req, res, next) => { + app.use('/_assets', express.static(path.join(WIKI.ROOTPATH, 'assets/_assets'), { + index: false, + maxAge: '7d' + })) + app.use('/_assets-legacy/svg/twemoji', async (req, res, next) => { try { WIKI.asar.serve('twemoji', req, res, next) } catch (err) { res.sendStatus(404) } }) - app.use('/_assets', express.static(path.join(WIKI.ROOTPATH, 'assets'), { + app.use('/_assets-legacy', express.static(path.join(WIKI.ROOTPATH, 'assets-legacy'), { index: false, maxAge: '7d' })) @@ -175,7 +179,7 @@ module.exports = async () => { }) app.use((err, req, res, next) => { - if (req.path === '/graphql') { + if (req.path === '/_graphql') { res.status(err.status || 500).json({ data: {}, errors: [{ diff --git a/ux/index.html b/ux/index.html index c03cd480..ac7a142b 100644 --- a/ux/index.html +++ b/ux/index.html @@ -69,6 +69,5 @@
- diff --git a/ux/package.json b/ux/package.json index 3bd69b0e..3db047bd 100644 --- a/ux/package.json +++ b/ux/package.json @@ -71,11 +71,11 @@ "luxon": "2.4.0", "pinia": "2.0.14", "pug": "3.0.2", - "quasar": "2.7.1", + "quasar": "2.7.2", "tippy.js": "6.3.7", "uuid": "8.3.2", "v-network-graph": "0.5.19", - "vue": "3.2.31", + "vue": "3.2.37", "vue-codemirror": "5.1.0", "vue-i18n": "9.1.10", "vue-router": "4.0.16", @@ -84,10 +84,10 @@ }, "devDependencies": { "@intlify/vite-plugin-vue-i18n": "3.4.0", - "@quasar/app-vite": "1.0.1", + "@quasar/app-vite": "1.0.2", "@types/lodash": "4.14.182", "autoprefixer": "10.4.7", - "eslint": "8.17.0", + "eslint": "8.18.0", "eslint-config-standard": "17.0.0", "eslint-plugin-import": "2.26.0", "eslint-plugin-n": "15.2.3", diff --git a/ux/public/_assets/icons/fluent-message-settings-animated.svg b/ux/public/_assets/icons/fluent-message-settings-animated.svg new file mode 100644 index 00000000..2d8d2562 --- /dev/null +++ b/ux/public/_assets/icons/fluent-message-settings-animated.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ux/public/_assets/icons/fluent-message-settings.svg b/ux/public/_assets/icons/fluent-message-settings.svg index 4999d0f5..ff180bfb 100644 --- a/ux/public/_assets/icons/fluent-message-settings.svg +++ b/ux/public/_assets/icons/fluent-message-settings.svg @@ -1 +1,48 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ux/public/_assets/icons/fluent-ssd-animated.svg b/ux/public/_assets/icons/fluent-ssd-animated.svg new file mode 100644 index 00000000..43e1cb9d --- /dev/null +++ b/ux/public/_assets/icons/fluent-ssd-animated.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ux/public/_assets/icons/fluent-ssd.svg b/ux/public/_assets/icons/fluent-ssd.svg index 43e1cb9d..79baeaf3 100644 --- a/ux/public/_assets/icons/fluent-ssd.svg +++ b/ux/public/_assets/icons/fluent-ssd.svg @@ -51,9 +51,7 @@ - - - + diff --git a/ux/public/favicon.ico b/ux/public/favicon.ico index ae7bbdb7..b69c4b6f 100644 Binary files a/ux/public/favicon.ico and b/ux/public/favicon.ico differ diff --git a/ux/public/icons/favicon-128x128.png b/ux/public/icons/favicon-128x128.png deleted file mode 100644 index 14011761..00000000 Binary files a/ux/public/icons/favicon-128x128.png and /dev/null differ diff --git a/ux/public/icons/favicon-16x16.png b/ux/public/icons/favicon-16x16.png deleted file mode 100644 index 679063a3..00000000 Binary files a/ux/public/icons/favicon-16x16.png and /dev/null differ diff --git a/ux/public/icons/favicon-32x32.png b/ux/public/icons/favicon-32x32.png deleted file mode 100644 index fd1fbc6f..00000000 Binary files a/ux/public/icons/favicon-32x32.png and /dev/null differ diff --git a/ux/public/icons/favicon-96x96.png b/ux/public/icons/favicon-96x96.png deleted file mode 100644 index e93b80a0..00000000 Binary files a/ux/public/icons/favicon-96x96.png and /dev/null differ diff --git a/ux/quasar.config.js b/ux/quasar.config.js index 78974286..460d2f81 100644 --- a/ux/quasar.config.js +++ b/ux/quasar.config.js @@ -57,7 +57,7 @@ module.exports = configure(function (/* ctx */) { build: { target: { browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'], - node: 'node16' + node: 'node18' }, vueRouterMode: 'history', // available values: 'hash', 'history' @@ -74,9 +74,11 @@ module.exports = configure(function (/* ctx */) { // ignorePublicFolder: true, // minify: false, // polyfillModulePreload: true, - // distDir + distDir: '../assets', - // extendViteConf (viteConf) {}, + extendViteConf (viteConf) { + viteConf.build.assetsDir = '_assets' + }, // viteVuePluginOptions: {}, vitePlugins: [ @@ -96,7 +98,7 @@ module.exports = configure(function (/* ctx */) { open: false, // opens browser window automatically port: 3001, proxy: { - '/_graphql': 'http://localhost:3000/graphql' + '/_graphql': 'http://localhost:3000/_graphql' } }, diff --git a/ux/src/components/AccountMenu.vue b/ux/src/components/AccountMenu.vue index 5ee7e1ff..067d364b 100644 --- a/ux/src/components/AccountMenu.vue +++ b/ux/src/components/AccountMenu.vue @@ -1,13 +1,13 @@ - diff --git a/ux/src/components/UserCreateDialog.vue b/ux/src/components/UserCreateDialog.vue index a6d47616..df81783b 100644 --- a/ux/src/components/UserCreateDialog.vue +++ b/ux/src/components/UserCreateDialog.vue @@ -178,6 +178,7 @@ defineEmits([ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent() const $q = useQuasar() +defineExpose({ $q }) // I18N diff --git a/ux/src/components/UserEditOverlay.vue b/ux/src/components/UserEditOverlay.vue index 07ea135d..36ab16d5 100644 --- a/ux/src/components/UserEditOverlay.vue +++ b/ux/src/components/UserEditOverlay.vue @@ -510,6 +510,7 @@ import UtilCodeEditor from './UtilCodeEditor.vue' // QUASAR const $q = useQuasar() +defineExpose({ $q }) // STORES diff --git a/ux/src/components/WebhookEditDialog.vue b/ux/src/components/WebhookEditDialog.vue index b0459f5c..5b4f44ae 100644 --- a/ux/src/components/WebhookEditDialog.vue +++ b/ux/src/components/WebhookEditDialog.vue @@ -218,6 +218,7 @@ defineEmits([ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent() const $q = useQuasar() +defineExpose({ $q }) // I18N diff --git a/ux/src/layouts/AdminLayout.vue b/ux/src/layouts/AdminLayout.vue index 735ae620..99731c1a 100644 --- a/ux/src/layouts/AdminLayout.vue +++ b/ux/src/layouts/AdminLayout.vue @@ -3,7 +3,7 @@ q-layout.admin(view='hHh Lpr lff') q-header.bg-black.text-white .row.no-wrap q-toolbar(style='height: 64px;', dark) - q-btn(dense, flat, to='/') + q-btn(dense, flat, href='/') q-avatar(size='34px', square) img(src='/_assets/logo-wikijs.svg') q-toolbar-title.text-h6.font-poppins Wiki.js @@ -184,7 +184,7 @@ q-layout.admin(view='hHh Lpr lff')