This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (95 loc) · 3.04 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=7">
<title>XAMPP Alias Tool</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" type="text/less" href="res/style.less">
<!-- <link rel="stylesheet" href="res/style.css"> -->
</head>
<body>
<main>
<section class="browser">
<div class="browserui">
<div class="toolbar">
<div class="tabs">
<div class="tab">{{name}}</div>
</div>
<div class="controls">
<div onClick="win.close();" class="close"></div>
<div onClick="win.showDevTools();" class="max"></div>
<div onClick="win.minimize();" class="min"></div>
</div>
</div>
<div class="navbar row-12">
<div class="controls col-2 row-11">
<i class="col-1"> </i>
<i class="col-3 fa fa-chevron-left"></i>
<i class="col-3 fa fa-chevron-right"></i>
<i class="col-3 fa fa-repeat"></i>
<i class="col-1"> </i>
</div>
<div class="addr col-9">
127.0.0.1/
<input type="text" v-model.sync="name">
</div>
<i class="menu fa fa-bars col-1"></i>
</div>
<div class="webview row-11">
<div class="col-5">
Set the XAMPP root path
<input type="file" v-model="xampp" nwdirectory>
</div>
<div class="col-1"><br></div>
<div class="col-5">
Set your project's path
<input type="file" v-model="dir" nwdirectory>
</div>
<button class="col-11 accent big" onclick="createConf()">
Create {{name}}.conf
</button>
</div>
</div>
</section>
</main>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/2.6.1/less.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js"></script>
<script>
var fs = require('fs'),
mkdirp = require('mkdirp'),
gui = require('nw.gui'),
win = gui.Window.get();
var vue = new Vue({
el: 'main',
data: {
xampp: '',
name: 'ProjectName',
dir: ''
}
});
function prepareXampp(){
// create alias folder
// edit httpd.conf / add include
}
function createConf(name, dir){
var name = vue.name,
dir = vue.dir,
xampp = vue.xampp;
var string = '<Directory "'+dir+'">\nOptions Indexes FollowSymLinks Includes ExecCGI\nAllowOverride All\nRequire all granted\n</Directory>\nAlias /'+name+' "'+dir+'"';
console.log(string, xampp);
mkdirp(xampp+'/apache/conf/alias', function(){
fs.writeFile(xampp+'\\apache\\conf\\alias\\'+name+'.conf', string);
});
}
// <Directory "/Users/Pedro Realinho/Desktop/Espaco Criativo">
// Options Indexes FollowSymLinks Includes ExecCGI
// AllowOverride All
// Require all granted
// </Directory>
// Alias /ec "/Users/Pedro Realinho/Desktop/Espaco Criativo"
</script>
</body>
</html>