Bug fixes; Small changes for slave UI

This commit is contained in:
Ilya Sosnovsky 2020-11-20 19:11:58 +03:00
parent bf37066475
commit 7df1ea3a0d
4 changed files with 25 additions and 10 deletions

View File

@ -2,5 +2,5 @@
ifconfig-push {{ .ClientAddress }} 255.255.255.255
{{- end }}
{{- range $route := .CustomRoutes }}
push "route {{ $route.Address }} {{ $route.Mask }}" ; {{ $route.Description }}
push "route {{ $route.Address }} {{ $route.Mask }}" # {{ $route.Description }}
{{- end }}

View File

@ -207,7 +207,7 @@ new Vue({
data.append('username', _this.username);
axios.request(axios_cfg('api/user/disconnect', data, 'form'))
.then(function(response) {
_this.u.ccd = response.data;
console.log(response.data);
});
})
},

View File

@ -16,7 +16,7 @@
:row-style-class="rowStyleClassFn"
:search-options="{ enabled: true}" >
<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>
<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>
@ -115,23 +115,38 @@
<th scope="col">Address</th>
<th scope="col">Mask</th>
<th scope="col">Description</th>
<th scope="col">Action</th>
<th scope="col" v-if="serverRole == 'master'">Action</th>
</tr>
</thead>
<tbody>
<tr v-for="(customRoute, index) in u.ccd.CustomRoutes">
<td>{{ customRoute.Address }}</td>
<td>{{ customRoute.Mask }}</td>
<td>{{ customRoute.Description }}</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>
</tr>
<tr v-if="serverRole == 'master'">
<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.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>
</td>
</tr>

View File

@ -758,7 +758,7 @@ func syncWithMaster() {
// https://community.openvpn.net/openvpn/ticket/623
func crlFix() {
os.Chmod(*easyrsaDirPath + "/pki", 0755)
err := os.Chmod(*easyrsaDirPath + "/pki/crl.pem", 0640)
err := os.Chmod(*easyrsaDirPath + "/pki/crl.pem", 0644)
if err != nil {
log.Println(err)
}