File tree Expand file tree Collapse file tree 11 files changed +86
-14
lines changed
src/dashboard/ServerSettings Expand file tree Collapse file tree 11 files changed +86
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ const path = require('path');
4
4
const packageJson = require ( 'package-json' ) ;
5
5
const csrf = require ( 'csurf' ) ;
6
6
const Authentication = require ( './Authentication.js' ) ;
7
- var fs = require ( 'fs' ) ;
7
+ const fs = require ( 'fs' ) ;
8
+ const settings = require ( '@back4app/back4app-settings' ) ;
8
9
9
10
const currentVersionFeatures = require ( '../package.json' ) . parseDashboardFeatures ;
10
11
@@ -201,6 +202,7 @@ module.exports = function(config, options) {
201
202
${ errors }
202
203
<script id="csrf" type="application/json">"${ req . csrfToken ( ) } "</script>
203
204
<script src="${ mountPath } bundles/${ loginUrl } "></script>
205
+ <script src="${ settings . BACK4APP_NAVIGATION_PATH } /back4app-navigation.bundle.js"></script>
204
206
</body>
205
207
</html>
206
208
` ) ;
@@ -224,7 +226,7 @@ module.exports = function(config, options) {
224
226
<body>
225
227
<div id="browser_mount"></div>
226
228
<script src="${ mountPath } bundles/${ dashboardUrl } "></script>
227
- <script src="https://static.back4app.com /back4app-navigation.bundle.js"></script>
229
+ <script src="${ settings . BACK4APP_NAVIGATION_PATH } /back4app-navigation.bundle.js"></script>
228
230
</body>
229
231
</html>
230
232
` ) ;
Original file line number Diff line number Diff line change 5
5
<script >
6
6
PARSE_DASHBOARD_PATH = " /" ;
7
7
</script >
8
- < script src ="https://static.back4app.com/back4app-navigation.bundle.js "> </ script >
9
8
</head >
10
9
<html >
11
10
<title >Parse Dashboard</title >
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ branch=$(git symbolic-ref --short HEAD)
10
10
git=' ~/bin/git-parse-dashboard'
11
11
12
12
ssh -t -i $b4a_certs_path /$pem $user @$host " sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && $git reset --hard && $git remote update && $git checkout $branch && $git merge origin/$branch && npm install'"
13
- ssh -t -i $b4a_certs_path /$pem $user @$host " sudo su back4app -c 'cd ~/scm/parse-dashboard && sed -i \" s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard-homolog.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run prepublish && npm run build'"
13
+ ssh -t -i $b4a_certs_path /$pem $user @$host " sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && sed -i \" s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard-homolog.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run prepublish && npm run build-homolog '"
14
14
15
15
# ssh -t aws_B4ANFS_Homolog "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/back4app-site && yarn install && npm run build && pm2 reload site'"
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ branch=master
11
11
git=' ~/bin/git-parse-dashboard'
12
12
13
13
ssh -t -i $b4a_certs_path /$pem $user @$host " sudo su back4app -c 'cp -r ~/scm/parse-dashboard ~/scm/parse-dashboard-$now && . ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && $git reset --hard && $git remote update && $git checkout $branch && $git merge origin/$branch && yarn install --production=false '"
14
- ssh -t -i $b4a_certs_path /$pem $user @$host " sudo su back4app -c 'cd ~/scm/parse-dashboard && sed -i \" s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run prepublish && npm run build'"
14
+ ssh -t -i $b4a_certs_path /$pem $user @$host " sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && sed -i \" s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run prepublish && npm run build'"
15
15
16
16
curl -X DELETE " https://api.cloudflare.com/client/v4/zones/69ace06909c83213745231d2c6d0fd27/purge_cache" -H " X-Auth-Email: $CF_EMAIL " -H " X-Auth-Key: $CF_KEY " -H " Content-Type: application/json" --data ' {"files":[
17
17
"https://parse-dashboard.back4app.com/bundles/dashboard.bundle.js",
Original file line number Diff line number Diff line change 33
33
" LICENSE"
34
34
],
35
35
"dependencies" : {
36
+ "@back4app/back4app-settings" : " ^1.0.1" ,
36
37
"axios" : " ^0.18.0" ,
37
38
"bcryptjs" : " ^2.3.0" ,
38
39
"body-parser" : " ^1.15.2" ,
42
43
"cookie-session" : " ^2.0.0-alpha.1" ,
43
44
"csurf" : " ^1.9.0" ,
44
45
"express" : " ^4.13.4" ,
46
+ "html-webpack-externals-plugin" : " ^3.8.0" ,
45
47
"html-webpack-plugin" : " ^3.2.0" ,
46
48
"jquery" : " ^3.2.1" ,
47
49
"json-file-plus" : " ^3.2.0" ,
96
98
"webpack" : " ~2.5.1"
97
99
},
98
100
"scripts" : {
99
- "dev" : " node ./Parse-Dashboard/index.js & webpack --config webpack/build.config.js --devtool eval-source-map --progress --watch" ,
101
+ "dev" : " NODE_ENV=dev webpack --config webpack/build.config.js --devtool eval-source-map --progress --watch" ,
100
102
"dashboard" : " node ./Parse-Dashboard/index.js & webpack --config webpack/build.config.js --progress --watch" ,
101
103
"pig" : " http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch" ,
102
104
"build" : " NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js" ,
105
+ "build-homolog" : " NODE_ENV=homolog webpack --config webpack/homolog.config.js && webpack --config webpack/PIG.config.js" ,
103
106
"test" : " NODE_PATH=./node_modules jest" ,
104
107
"lint" : " eslint . --ignore-path .gitignore --cache" ,
105
108
"pretest" : " npm run lint" ,
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ export default class ServerSettings extends DashboardView {
34
34
let content = (
35
35
this . state . appId ?
36
36
< div className = { styles . content } >
37
- < iframe src = { `https://dashboard.back4app.com /apps/settings/${ this . state . appId } ?showCardsOnly=true` } className = { styles . iframeContent } >
37
+ < iframe src = { `${ b4aSettings . DASHBOARD_PATH } /apps/settings/${ this . state . appId } ?showCardsOnly=true` } className = { styles . iframeContent } >
38
38
</ iframe >
39
39
</ div > :
40
- < div > Carregando ...</ div >
40
+ < div > Loading ...</ div >
41
41
) ;
42
42
43
43
return (
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ var webpack = require('webpack');
15
15
var fs = require ( 'fs' ) ;
16
16
var json = JSON . parse ( fs . readFileSync ( 'package.json' , 'utf8' ) ) ;
17
17
var version = json . version ;
18
+ var settings = require ( '@back4app/back4app-settings' ) ;
18
19
19
20
module . exports = {
20
21
context : path . join ( __dirname , '../src' ) ,
@@ -61,9 +62,8 @@ module.exports = {
61
62
source : path . join ( __dirname , '../src' , 'icons' )
62
63
} ) ,
63
64
new webpack . DefinePlugin ( {
64
- 'process.env' : {
65
- 'version' : JSON . stringify ( version )
66
- }
65
+ 'process.env' : { 'version' : JSON . stringify ( version ) } ,
66
+ b4aSettings : JSON . stringify ( settings )
67
67
} ) ,
68
68
new webpack . ProvidePlugin ( {
69
69
$ : 'jquery' ,
Original file line number Diff line number Diff line change 8
8
var configuration = require ( './base.config.js' ) ;
9
9
var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
10
10
var path = require ( 'path' ) ;
11
+ var HtmlWebpackExternalsPlugin = require ( 'html-webpack-externals-plugin' ) ;
12
+ var settings = require ( '@back4app/back4app-settings' ) ;
11
13
12
14
configuration . entry = {
13
15
dashboard : './dashboard/index.js' ,
@@ -18,8 +20,14 @@ configuration.output.filename = "[name].[chunkhash].js";
18
20
19
21
configuration . plugins . push (
20
22
new HtmlWebpackPlugin ( {
21
- template : '../Parse-Dashboard/index.template.html ' ,
23
+ template : '../Parse-Dashboard/index.ejs ' ,
22
24
filename : path . resolve ( './Parse-Dashboard/public/index.html' )
25
+ } ) ,
26
+ new HtmlWebpackExternalsPlugin ( {
27
+ externals : [ {
28
+ module : '@back4app/back4app-navigation' ,
29
+ entry : settings . BACK4APP_NAVIGATION_PATH + '/back4app-navigation.bundle.js'
30
+ } ]
23
31
} )
24
32
) ;
25
33
Original file line number Diff line number Diff line change
1
+ var configuration = require ( './base.config.js' ) ;
2
+ var HtmlWebpackExternalsPlugin = require ( 'html-webpack-externals-plugin' ) ;
3
+ var settings = require ( '@back4app/back4app-settings' ) ;
4
+
5
+ configuration . entry = {
6
+ dashboard : './dashboard/index.js' ,
7
+ login : './login/index.js' ,
8
+ PIG : './parse-interface-guide/index.js' ,
9
+ quickstart : './quickstart/index.js' ,
10
+ } ;
11
+ configuration . output . path = require ( 'path' ) . resolve ( './production/bundles' ) ;
12
+
13
+ var webpack = require ( 'webpack' ) ;
14
+
15
+ // Enable minification
16
+ configuration . plugins . push (
17
+ new webpack . DefinePlugin ( {
18
+ 'process.env' : {
19
+ 'NODE_ENV' : '"homolog"'
20
+ }
21
+ } ) ,
22
+ new webpack . optimize . UglifyJsPlugin ( {
23
+ compress : {
24
+ warnings : false
25
+ }
26
+ } ) ,
27
+ new webpack . optimize . OccurrenceOrderPlugin ( ) ,
28
+ function ( ) {
29
+ this . plugin ( 'done' , function ( stats ) {
30
+ if ( stats . compilation . errors && stats . compilation . errors . length ) {
31
+ console . log ( stats . compilation . errors ) ;
32
+ process . exit ( 1 ) ;
33
+ }
34
+ } ) ;
35
+ } ,
36
+ new HtmlWebpackExternalsPlugin ( {
37
+ externals : [ {
38
+ module : '@back4app/back4app-navigation' ,
39
+ entry : settings . BACK4APP_NAVIGATION_PATH + '/back4app-navigation.bundle.js'
40
+ } ]
41
+ } )
42
+ ) ;
43
+
44
+ module . exports = configuration ;
Original file line number Diff line number Diff line change 6
6
* the root directory of this source tree.
7
7
*/
8
8
var configuration = require ( './base.config.js' ) ;
9
+ var HtmlWebpackExternalsPlugin = require ( 'html-webpack-externals-plugin' ) ;
10
+ var settings = require ( '@back4app/back4app-settings' ) ;
9
11
10
12
configuration . entry = {
11
13
dashboard : './dashboard/index.js' ,
@@ -37,7 +39,13 @@ configuration.plugins.push(
37
39
process . exit ( 1 ) ;
38
40
}
39
41
} ) ;
40
- }
42
+ } ,
43
+ new HtmlWebpackExternalsPlugin ( {
44
+ externals : [ {
45
+ module : '@back4app/back4app-navigation' ,
46
+ entry : settings . BACK4APP_NAVIGATION_PATH + '/back4app-navigation.bundle.js'
47
+ } ]
48
+ } )
41
49
) ;
42
50
43
51
module . exports = configuration ;
Original file line number Diff line number Diff line change 8
8
var configuration = require ( './base.config.js' ) ;
9
9
var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
10
10
var path = require ( 'path' ) ;
11
+ var HtmlWebpackExternalsPlugin = require ( 'html-webpack-externals-plugin' ) ;
12
+ var settings = require ( '@back4app/back4app-settings' ) ;
11
13
12
14
configuration . entry = {
13
15
dashboard : './dashboard/index.js' ,
@@ -32,9 +34,15 @@ configuration.plugins.push(
32
34
} ) ,
33
35
new webpack . optimize . OccurrenceOrderPlugin ( ) ,
34
36
new HtmlWebpackPlugin ( {
35
- template : '../Parse-Dashboard/index.template.html ' ,
37
+ template : '../Parse-Dashboard/index.ejs ' ,
36
38
filename : path . resolve ( './Parse-Dashboard/public/index.html' )
37
39
} ) ,
40
+ new HtmlWebpackExternalsPlugin ( {
41
+ externals : [ {
42
+ module : '@back4app/back4app-navigation' ,
43
+ entry : settings . BACK4APP_NAVIGATION_PATH + '/back4app-navigation.bundle.js'
44
+ } ]
45
+ } ) ,
38
46
function ( ) {
39
47
this . plugin ( 'done' , function ( stats ) {
40
48
if ( stats . compilation . errors && stats . compilation . errors . length ) {
You can’t perform that action at this time.
0 commit comments