Skip to content

Commit

Permalink
fix: fix styles and bug with document root
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrdrvn committed Dec 23, 2019
1 parent d993a34 commit 617386a
Show file tree
Hide file tree
Showing 34 changed files with 52 additions and 43 deletions.
12 changes: 8 additions & 4 deletions admin/controller/extension/module/d_vuefront.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ public function vf_turn_on()
$catalog_url_info = parse_url($catalog);

$catalog_path = $catalog_url_info['path'];
$document_path = $catalog_path;
if(!empty($this->request->server['DOCUMENT_ROOT'])) {
$document_path = str_replace(realpath($this->request->server['DOCUMENT_ROOT']), '', $rootFolder) . '/';
}

if (strpos($_SERVER["SERVER_SOFTWARE"], "Apache") !== false) {

Expand Down Expand Up @@ -212,28 +216,28 @@ public function vf_turn_on()
# VueFront home page
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
RewriteCond %{QUERY_STRING} !.*(rest_route)
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/index.html -f
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html -f
RewriteRule ^$ vuefront/index.html [L]
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
RewriteCond %{QUERY_STRING} !.*(rest_route)
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/index.html !-f
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html !-f
RewriteRule ^$ vuefront/200.html [L]
# VueFront page if exists html file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
RewriteCond %{QUERY_STRING} !.*(rest_route)
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/$1.html -f
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html -f
RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
# VueFront page if not exists html file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
RewriteCond %{QUERY_STRING} !.*(rest_route)
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/$1.html !-f
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html !-f
RewriteRule ^([^?]*) vuefront/200.html [L,QSA]";

$content = file_get_contents($rootFolder . '/.htaccess');
Expand Down
15 changes: 9 additions & 6 deletions admin/view/javascript/d_pax/components/header/Account.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div class="header-account">
<div
id="vf-header-account"
class="header-account"
>
<b-nav-item-dropdown
toggle-class="text-decoration-none text-1 m-0 font-weight-semibold"
no-caret
Expand Down Expand Up @@ -84,7 +87,7 @@ export default {
}
</script>
<style lang="scss">
.header-account {
#vf-header-account.header-account {
display: flex;
align-items: center;
height: 52px;
Expand All @@ -93,7 +96,7 @@ export default {
background-color: $white;
padding: 13px 17px;
&__separator {
.header-account__separator {
border-top: 1px solid $white-eight;
margin-top: 0;
margin: 15px 0;
Expand Down Expand Up @@ -159,12 +162,12 @@ export default {
box-shadow: none;
}
&__icon {
.header-account__icon {
font-size: 24px;
color: #1a1a1a;
}
&__full_name {
.header-account__full_name {
margin-right: 5px;
font-size: 18px;
font-weight: 600;
Expand All @@ -177,7 +180,7 @@ export default {
}
}
&__image {
.header-account__image {
border-radius: 50%;
margin-right: 10px;
width: 24px;
Expand Down
6 changes: 4 additions & 2 deletions admin/view/javascript/d_pax/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ module.exports = (env, argv) => {
body = body
.split(currentUrl.replace(/http[s]?:/g, ''))
.join(proxyUrl.replace(/http[s]?:/g, ''))

fs.appendFileSync('./test.html', `${body}\r\n`)
let newBuffer = new Buffer.from(body)

const gzipRes = isZipped ? zlib.gzipSync(newBuffer) : newBuffer
res.setHeader('content-length', gzipRes.length);
if(isZipped) {
res.setHeader('content-length', gzipRes.length);
}
_write.call(res, gzipRes)
} catch (e) {
_write.call(res, buffer)
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Loading

0 comments on commit 617386a

Please sign in to comment.