Bug fixes; Small changes for slave UI
This commit is contained in:
parent
bf37066475
commit
7df1ea3a0d
4 changed files with 25 additions and 10 deletions
2
ccd.tpl
2
ccd.tpl
|
@ -2,5 +2,5 @@
|
||||||
ifconfig-push {{ .ClientAddress }} 255.255.255.255
|
ifconfig-push {{ .ClientAddress }} 255.255.255.255
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range $route := .CustomRoutes }}
|
{{- range $route := .CustomRoutes }}
|
||||||
push "route {{ $route.Address }} {{ $route.Mask }}" ; {{ $route.Description }}
|
push "route {{ $route.Address }} {{ $route.Mask }}" # {{ $route.Description }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -207,7 +207,7 @@ new Vue({
|
||||||
data.append('username', _this.username);
|
data.append('username', _this.username);
|
||||||
axios.request(axios_cfg('api/user/disconnect', data, 'form'))
|
axios.request(axios_cfg('api/user/disconnect', data, 'form'))
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
_this.u.ccd = response.data;
|
console.log(response.data);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
:row-style-class="rowStyleClassFn"
|
:row-style-class="rowStyleClassFn"
|
||||||
:search-options="{ enabled: true}" >
|
:search-options="{ enabled: true}" >
|
||||||
<div slot="table-actions">
|
<div slot="table-actions">
|
||||||
<button type="button" class="btn btn-sm btn-success el-square" v-if="serverRole == 'master'" v-on:click.stop="u.modalNewUserVisible=true">Add user</button>
|
<button type="button" class="btn btn-sm btn-success el-square" v-show="serverRole == 'master'" v-on:click.stop="u.modalNewUserVisible=true">Add user</button>
|
||||||
<b-badget class="btn btn-sm btn-info el-square" v-if="serverRole == 'slave'">Slave - last sync: {{ lastSync }}</b-badget>
|
<b-badget class="btn btn-sm btn-info el-square" v-if="serverRole == 'slave'">Slave - last sync: {{ lastSync }}</b-badget>
|
||||||
<button type="button" class="btn btn-sm btn-secondary el-square" v-on:click.stop="filters.hideRevoked=!filters.hideRevoked;this.$cookies.set('hideRevoked',!(this.$cookies.get('hideRevoked') == 'true'), -1);">{{ revokeFilterText }}</button>
|
<button type="button" class="btn btn-sm btn-secondary el-square" v-on:click.stop="filters.hideRevoked=!filters.hideRevoked;this.$cookies.set('hideRevoked',!(this.$cookies.get('hideRevoked') == 'true'), -1);">{{ revokeFilterText }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -115,23 +115,38 @@
|
||||||
<th scope="col">Address</th>
|
<th scope="col">Address</th>
|
||||||
<th scope="col">Mask</th>
|
<th scope="col">Mask</th>
|
||||||
<th scope="col">Description</th>
|
<th scope="col">Description</th>
|
||||||
<th scope="col">Action</th>
|
<th scope="col" v-if="serverRole == 'master'">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(customRoute, index) in u.ccd.CustomRoutes">
|
<tr v-for="(customRoute, index) in u.ccd.CustomRoutes">
|
||||||
<td>{{ customRoute.Address }}</td>
|
|
||||||
<td>{{ customRoute.Mask }}</td>
|
|
||||||
<td>{{ customRoute.Description }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn btn-primary btn-sm el-square modal-el-margin" v-if="serverRole == 'master'" v-on:click.stop="u.ccd.CustomRoutes.splice(index, 1)">Delete</button>
|
<div v-if = "serverRole == 'slave'">
|
||||||
|
{{ customRoute.Address }}
|
||||||
|
</div>
|
||||||
|
<input v-if = "serverRole == 'master'" v-model = "customRoute.Address">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div v-if = "serverRole == 'slave'">
|
||||||
|
{{ customRoute.Mask }}
|
||||||
|
</div>
|
||||||
|
<input v-if = "serverRole == 'master'" v-model = "customRoute.Mask">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div v-if = "serverRole == 'slave'">
|
||||||
|
{{ customRoute.Description }}
|
||||||
|
</div>
|
||||||
|
<input v-if = "serverRole == 'master'" v-model = "customRoute.Description">
|
||||||
|
</td>
|
||||||
|
<td class="text-right" v-if="serverRole == 'master'">
|
||||||
|
<button type="button" class="btn btn-danger btn-sm el-square modal-el-margin" v-if="serverRole == 'master'" v-on:click.stop="u.ccd.CustomRoutes.splice(index, 1)">Delete</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="serverRole == 'master'">
|
<tr v-if="serverRole == 'master'">
|
||||||
<td><input type="text" v-model="u.newRoute.Address"/></td>
|
<td><input type="text" v-model="u.newRoute.Address"/></td>
|
||||||
<td><input type="text" v-model="u.newRoute.Mask"/></td>
|
<td><input type="text" v-model="u.newRoute.Mask"/></td>
|
||||||
<td><input type="text" v-model="u.newRoute.Description"/></td>
|
<td><input type="text" v-model="u.newRoute.Description"/></td>
|
||||||
<td>
|
<td class="text-right" v-if="serverRole == 'master'">
|
||||||
<button type="button" class="btn btn-success el-square modal-el-margin" v-on:click.stop="u.ccd.CustomRoutes.push(u.newRoute);u.newRoute={};">Add</button>
|
<button type="button" class="btn btn-success el-square modal-el-margin" v-on:click.stop="u.ccd.CustomRoutes.push(u.newRoute);u.newRoute={};">Add</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
2
main.go
2
main.go
|
@ -758,7 +758,7 @@ func syncWithMaster() {
|
||||||
// https://community.openvpn.net/openvpn/ticket/623
|
// https://community.openvpn.net/openvpn/ticket/623
|
||||||
func crlFix() {
|
func crlFix() {
|
||||||
os.Chmod(*easyrsaDirPath + "/pki", 0755)
|
os.Chmod(*easyrsaDirPath + "/pki", 0755)
|
||||||
err := os.Chmod(*easyrsaDirPath + "/pki/crl.pem", 0640)
|
err := os.Chmod(*easyrsaDirPath + "/pki/crl.pem", 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue