Skip to content

Commit 416185a

Browse files
committed
Virtual Hosts 0.7
- Renamed to Virtual Hosts, starting at 0.7 - Added PHP Runner - Moved settings from control bar to additional tab - Added more instructions on forms - Added buttons to append to PHPMyAdmin CSS & Config - Reworked JavaScript to support above and reorganise
1 parent 26ad193 commit 416185a

26 files changed

+10556
-244
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Edit Virtual Hosts
1+
# Virtual Hosts
22

3-
Get the latest version from here: [https://github.com/manngo/edit-virtual-hosts/releases/latest](https://github.com/manngo/edit-virtual-hosts/releases/latest).
3+
Get the latest version from here: [https://github.com/manngo/virtual-hosts/releases/latest](https://github.com/manngo/virtual-hosts/releases/latest).
44

55
## Introduction
66

compile.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rem electron-packager . --overwrite --platform=win32 --arch=x64 --prune=true --extra-resource="resources/fakemail" --out="..\release-builds"
22

33
npm run dist
4-
rem cd "../electron-builder/edit-virtual-hosts/";
5-
rem mv "mac" "Edit Virtual Hosts macOS";
4+
rem cd "../electron-builder/virtual-hosts/";
5+
rem mv "mac" "Virtual Hosts macOS";

compile.sh

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
# rm -rf ../release-builds/*;
22

3-
# electron-packager . --overwrite --platform=darwin --arch=x64 --prune=true --extra-resource="resources/fakemail" --out="../release-builds/" --icon ./images/edit-virtual-hosts.icns;
4-
# electron-packager . --overwrite --platform=win32 --arch=x64 --prune=true --out="../release-builds" --icon images/edit-virtual-hosts.ico;
3+
# electron-packager . --overwrite --platform=darwin --arch=x64 --prune=true --extra-resource="resources/fakemail" --out="../release-builds/" --icon ./images/virtual-hosts.icns;
4+
# electron-packager . --overwrite --platform=win32 --arch=x64 --prune=true --out="../release-builds" --icon images/virtual-hosts.ico;
55

66
# cd "../release-builds";
77

8-
# mv "Edit Virtual Hosts-darwin-x64" "Edit Virtual Hosts MacOS";
9-
# mv "Edit Virtual Hosts-win32-x64" "Edit Virtual Hosts Windows";
8+
# mv "Virtual Hosts-darwin-x64" "Virtual Hosts MacOS";
9+
# mv "Virtual Hosts-win32-x64" "Virtual Hosts Windows";
1010

11-
# zip -r -X "Edit Virtual Hosts MacOS.zip" "Edit Virtual Hosts MacOS/";
12-
# zip -r -X "Edit Virtual Hosts Windows.zip" "Edit Virtual Hosts Windows/";
11+
# zip -r -X "Virtual Hosts MacOS.zip" "Virtual Hosts MacOS/";
12+
# zip -r -X "Virtual Hosts Windows.zip" "Virtual Hosts Windows/";
1313

14-
npm run dist
15-
cd "../electron-builder/edit-virtual-hosts/";
16-
# mv "mac" "Edit Virtual Hosts macOS";
17-
# mv "mac" "Edit Virtual Hosts macOS";
14+
# npm run dist
15+
npx electron-builder -m --x64 --arm64 --publish never
16+
cd "../electron-builder/virtual-hosts/";
17+
# mv "mac" "Virtual Hosts macOS";
18+
# mv "mac" "Virtual Hosts macOS";
1819

1920

2021

2122

2223
cd ..
24+
25+
echo Compiled at: `date`

content/about.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2>About Edit Virtual Hosts</h2>
1+
<h2>About Virtual Hosts</h2>
22
<p>An Electron-based tool to simplify editing the hosts file
33
and to create virtual hosts.</p>
44
<p>The application has the following benefits:</p>
@@ -10,7 +10,7 @@ <h2>About Edit Virtual Hosts</h2>
1010

1111
<p>Written by Mark Simon</p>
1212
<p>You can find the latest version at:
13-
<a target="_blank" href="https://github.com/manngo/edit-virtual-hosts/releases/latest">https://github.com/manngo/edit-virtual-hosts/releases/latest</a>
13+
<a target="_blank" href="https://github.com/manngo/virtual-hosts/releases/latest">https://github.com/manngo/virtual-hosts/releases/latest</a>
1414

1515
<h3>Disclaimer</h3>
1616
<p>This application does what it does and doesn’t do what it doesn’t do.

content/instructions.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ <h2>Install XAMPP</h2>
3535

3636
<h2>Add the Domain Name</h2>
3737
<p>For development purposes, we can use the domain name australia.example.com.
38-
Using Edit Virtual Hosts File, select the Hosts File tab and add:</p>
38+
Using Virtual Hosts File, select the Hosts File tab and add:</p>
3939
<pre>127.0.0.1 www.example.com</pre>
4040

4141
<p>Save the file, giving administrative permission if asked.</p>
4242

4343

4444
<h2>Enable Virtual Hosts</h2>
45-
<p>This is not enabled by default. Using Edit Virtual Hosts File, select the httpd.conf tab.</p>
45+
<p>This is not enabled by default. Using Virtual Hosts File, select the httpd.conf tab.</p>
4646

4747
<ol>
4848
<li>Find the line containing Include etc/extra/httpd-vhosts.conf</li>

content/popup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5-
<title>Edit Virtual Hosts</title>
5+
<title>Virtual Hosts</title>
66
<link rel="stylesheet" type="text/css" href="styles/SourceCodePro/SourceCodePro.css">
77
<link rel="stylesheet" type="text/css" href="styles/SourceSansPro/SourceSansPro.css">
88
<link rel="stylesheet" type="text/css" href="styles/SourceSerifPro/SourceSerifPro.css">

data/servers.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"htdocs": "/xamppfiles/htdocs",
1313
"mysql": "/xamppfiles/var/mysql",
1414
"phpini": "/xamppfiles/etc/php.ini",
15-
"phpmyadmin": "/xamppfiles/phpmyadmin/"
15+
"phpmyadmin": "/xamppfiles/phpmyadmin/",
16+
"phpcli": "/xamppfiles/bin/php"
1617
},
1718
"win32": {
1819
"root": "C:/xampp",
@@ -21,7 +22,8 @@
2122
"htdocs": "/htdocs/",
2223
"mysql": "/mysql/data",
2324
"phpini": "/php/php.ini",
24-
"phpmyadmin": "/phpMyAdmin/"
25+
"phpmyadmin": "/phpMyAdmin/",
26+
"phpcli": "/php/php.exe"
2527
},
2628
"vhost": ""
2729
},
@@ -33,15 +35,18 @@
3335
"htdocs": "/htdocs",
3436
"mysql": "/db/mysql57",
3537
"phpini": "/bin/php/php{version}/conf/php.ini",
36-
"phpmyadmin": "/bin/phpmyadmin/"
38+
"phpmyadmin": "/bin/phpmyadmin/",
39+
"phpcli": "/bin/php/php{version}/bin/php"
3740
},
3841
"win32": {
3942
"root": "C:/MAMP",
4043
"conf": "/conf/apache/httpd.conf",
4144
"vhosts": "/bin/apache/conf/extra/httpd-vhosts.conf",
4245
"htdocs": "/htdocs/",
4346
"mysql": "/db/mysql",
44-
"phpmyadmin": "/bin/phpMyAdmin/"
47+
"phpini": "/conf/php{version}/php.ini",
48+
"phpmyadmin": "/bin/phpMyAdmin/",
49+
"phpcli": "/bin/php/php{version}/php.exe"
4550
},
4651
"vhost": ""
4752
},
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.html

+64-17
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5-
<title>Edit Virtual Hosts</title>
5+
<title>Virtual Hosts</title>
66
<link rel="stylesheet" type="text/css" href="styles/SourceCodePro/SourceCodePro.css">
77
<link rel="stylesheet" type="text/css" href="styles/SourceSansPro/SourceSansPro.css">
88
<link rel="stylesheet" type="text/css" href="styles/SourceSerifPro/SourceSerifPro.css">
99
<link rel="stylesheet" type="text/css" href="styles/main.css">
10+
<script type="text/javascript" src="resources/prism/prism.js" crossorigin></script>
1011
<script>
1112
document.addEventListener('DOMContentLoaded',init);
1213
function init() {
1314
// require('./renderer.js');
1415
require('./scripts/utilities.js');
15-
require('./scripts/edit-virtual-hosts.js');
16+
require('./scripts/virtual-hosts.js');
1617
// require('./scripts/do-virtual-hosts.js');
1718
// alert('hello')
1819
}
@@ -21,29 +22,56 @@
2122
<body>
2223
<form id="controls">
2324
<div id="tabs">
25+
<button value="settings">Settings</button>
2426
<button value="hosts-file">hosts File</button>
2527
<button value="httpd-conf">httpd.conf</button>
2628
<button value="virtual-hosts">Virtual Hosts</button>
2729
<button value="generator">Generator</button>
2830
<button value="php-ini">php.ini</button>
2931
<button value="misc-text">File</button>
3032
<button value="misc-actions">Actions</button>
31-
</div>
32-
<div id="choose-server-root">
33-
<label for="server-root">Server Root</label>
34-
<input type="text" id="server-root" name="server-root" value="" placeholder="Leave empty for default" title="Full Path to Server Folder">
35-
<button name="server-path">Select Folder …</button>
36-
</div>
37-
<div id="misc">
38-
<select name="server" size="1">
39-
<option value="">Choose One …</option>
40-
<option value="xampp">XAMPP</option>
41-
<option value="mamp">MAMP</option>
42-
<!--option value="ampps">AMPPS</option-->
43-
</select>
33+
<button value="php-runner">PHP Runner</button>
4434
</div>
4535
</form>
4636
<div id="forms">
37+
<form id="settings">
38+
<div class="help">
39+
<h3>Virtual Host Settings</h3>
40+
<ol>
41+
<li>Choose a Web Server Package</li>
42+
<li>If you have installed the Web Server in a non-default location, select the folder.</li>
43+
<li>If you prefer to use a different PHP Interpreter, choose the alternative interpreter executable.</li>
44+
</ol>
45+
</div>
46+
<div id="misc">
47+
<h4>Choose a Web Server Package</h4>
48+
<select name="server">
49+
<option value="">Choose One …</option>
50+
<option value="xampp">XAMPP</option>
51+
<option value="mamp">MAMP</option>
52+
<!--option value="ampps">AMPPS</option-->
53+
</select>
54+
<p>Note: When you select a server, the Web Server Root Folder and the PHP Interpreter below will be reset to the default for the server.</p>
55+
</div>
56+
<div id="choose-server-root">
57+
<h4>Choose a Web Server Root Folder</h4>
58+
<!--
59+
<label for="server-root">Server Root</label>
60+
<input type="text" id="server-root" name="server-root" value="" placeholder="Leave empty for default" title="Full Path to Server Folder">
61+
-->
62+
<output type="text" name="server-root" value="" placeholder="Leave empty for default" title="Full Path to Server Folder"></output>
63+
<button name="server-path">Select Folder …</button>
64+
</div>
65+
<div id="choose-php-interpreter">
66+
<h4>Choose a PHP Interpreter</h4>
67+
<!--
68+
<label for="php-interpreter">Server Root</label>
69+
<input type="text" id="php-interpreter" name="php-interpreter" value="" placeholder="Leave empty for default" title="Full Path to PHP Interpreter">
70+
-->
71+
<output name="php-interpreter" value="" placeholder="Leave empty for default" title="Full Path to PHP Interpreter"></output>
72+
<button name="php-interpreter-path">Select Interpreter …</button>
73+
</div>
74+
</form>
4775
<form id="hosts-file">
4876
<div class="help">
4977
<h3>Hosts File (etc/host)</h3>
@@ -143,8 +171,27 @@ <h3>Miscellaeous Actions</h3>
143171
</div>
144172
<div class="etc">
145173
<p><button type="button" name="reset-mysql">Reset MySQL</button></p>
146-
<p><button type="button" name="phpmyadmin-css">PHPMyAdmin CSS</button></p>
147-
<p><button type="button" name="phpmyadmin-config">PHPMyAdmin Config</button></p>
174+
<p><button type="button" name="phpmyadmin-css">PHPMyAdmin CSS</button><button type="button" name="phpmyadmin-css-append">Append CSS Settings</button></p>
175+
<p><button type="button" name="phpmyadmin-config">PHPMyAdmin Config</button><button type="button" name="phpmyadmin-config-pappend">Append Config Settings</button></p>
176+
</div>
177+
</form>
178+
<form id="php-runner">
179+
<div class="help" id="php-help">
180+
<h3>PHP Runner</h3>
181+
</div>
182+
<div id="php-code">
183+
<textarea name="code" placeholder="Enter your PHP"></textarea>
184+
<code class="language-php" contenteditable="true">Content</code>
185+
<button name="doit">Run</button>
186+
</div>
187+
<!--
188+
<div id="php-control">
189+
<label><input type="checkbox" name="html"> HTML Mode</label>
190+
<button name="doit">Run</button>
191+
</div>
192+
-->
193+
<div id="php-result">
194+
148195
</div>
149196
</form>
150197
</div>

main.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
menu=[
2626
{
27-
label: 'Edit Virtual Hosts',
27+
label: 'Virtual Hosts',
2828
submenu: [
2929
{ label: `New Document`, accelerator: 'CmdOrCtrl+N', id:'NEW', click: send },
3030
{ label: `Open …`, accelerator: 'CmdOrCtrl+O', id:'OPEN', click: send },
@@ -56,7 +56,7 @@
5656
{ label: 'About …', id: 'ABOUT', click: send },
5757
{ label: 'Instructions …', id: 'INSTRUCTIONS', click: send },
5858
{ type:'separator' },
59-
{ label: 'Edit Virtual Hosts Home', icon: path.join(__dirname, 'images/external.png'), click: () => { shell.openExternal('https://github.com/manngo/edit-virtual-hosts'); } },
59+
{ label: 'Virtual Hosts Home', icon: path.join(__dirname, 'images/external.png'), click: () => { shell.openExternal('https://github.com/manngo/virtual-hosts'); } },
6060
{ label: 'Internotes Virtual Hosts', icon: path.join(__dirname,'images/external.png'), click: () => { shell.openExternal('https://www.internotes.net/virtual-hosts'); } },
6161
{ id: 'debug-separator', type:'separator' },
6262
{ id: 'debug-developer-tools', accelerator: 'CmdOrCtrl+Shift+I', label: 'Show Development Tools', click: function (menuItem, focusedWindow) { window.webContents.openDevTools({mode: 'detach'}); } },
@@ -96,7 +96,7 @@ if(DEVELOPMENT) menu=menu.concat(developmentMenu);
9696
window.show();
9797
});
9898

99-
window.setTitle('Edit Virtual Hosts');
99+
window.setTitle('Virtual Hosts');
100100
menu=Menu.buildFromTemplate(menu);
101101

102102
Menu.setApplicationMenu(menu);
@@ -136,10 +136,14 @@ if(DEVELOPMENT) menu=menu.concat(developmentMenu);
136136
});
137137
}
138138

139-
ipcMain.on('home',(event,options)=>{
139+
ipcMain.on('home',(event,options) => {
140140
var home=`${app.getPath('home')}`;
141141
event.returnValue = home;
142142
});
143+
ipcMain.on('init',(event,data) => {
144+
var home = `${app.getPath('home')}`;
145+
event.returnValue = JSON.stringify({home});
146+
});
143147
ipcMain.on('app-path',(event,options)=>{
144148
var home=`${app.getAppPath()}`;
145149
event.returnValue = home;

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "edit-virtual-hosts",
3-
"version": "0.6.4",
4-
"description": "Edit Virtual Hosts",
2+
"name": "virtual-hosts",
3+
"version": "0.7.0",
4+
"description": "Virtual Hosts",
55
"main": "main.js",
6-
"repository": "https://github.com/manngo/edit-virtual-hosts",
6+
"repository": "https://github.com/manngo/virtual-hosts",
77
"keywords": [],
88
"author": "Mark Simon",
99
"license": "CC0-1.0",
@@ -16,25 +16,25 @@
1616
"sudo-prompt": "^9.0.0",
1717
"temp": "^0.9.0"
1818
},
19-
"productName": "Edit Virtual Hosts",
19+
"productName": "Virtual Hosts",
2020
"build": {
21-
"appId": "com.webcraft101.edit-virtual-hosts",
21+
"appId": "com.webcraft101.virtual-hosts",
2222
"mac": {
2323
"category": "public.app-category.developer-tools",
2424
"target": [
2525
"zip",
2626
"dmg",
2727
"dir"
2828
],
29-
"icon": "images/edit-virtual-hosts.icns"
29+
"icon": "images/virtual-hosts.icns"
3030
},
3131
"win": {
3232
"target": [
3333
"zip",
3434
"nsis",
3535
"portable"
3636
],
37-
"icon": "images/edit-virtual-hosts.ico"
37+
"icon": "images/virtual-hosts.ico"
3838
},
3939
"nsis": {
4040
"oneClick": false,

0 commit comments

Comments
 (0)