2020-05-14 19:13:33 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2020-10-29 06:50:19 -04:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>openvpn-admin</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
2021-02-26 07:11:13 -05:00
|
|
|
<script src="dist/style.min.js"></script>
|
2020-10-29 06:50:19 -04:00
|
|
|
<div id="app">
|
|
|
|
<vue-good-table
|
|
|
|
:columns="columns"
|
2020-11-02 11:30:36 -05:00
|
|
|
:rows="filteredRows"
|
2020-10-29 06:50:19 -04:00
|
|
|
:line-numbers="true"
|
|
|
|
:row-style-class="rowStyleClassFn"
|
|
|
|
:search-options="{ enabled: true}" >
|
|
|
|
<div slot="table-actions">
|
2020-11-20 11:11:58 -05:00
|
|
|
<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>
|
2020-11-17 12:48:26 -05:00
|
|
|
<b-badget class="btn btn-sm btn-info el-square" v-if="serverRole == 'slave'">Slave - last sync: {{ lastSync }}</b-badget>
|
2020-11-03 11:32:37 -05:00
|
|
|
<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>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
2020-11-02 11:30:36 -05:00
|
|
|
<div slot="emptystate" class="d-flex justify-content-center">
|
|
|
|
<h4>No users have been created yet.</h4>
|
2020-11-17 12:48:26 -05:00
|
|
|
<br>
|
|
|
|
<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>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
<template slot="table-row" slot-scope="props">
|
|
|
|
<span v-if="props.column.field == 'actions'">
|
|
|
|
<button
|
2021-02-15 01:03:38 -05:00
|
|
|
class="btn btn-sm el-square modal-el-margin"
|
2020-10-29 06:50:19 -04:00
|
|
|
type="button"
|
|
|
|
:title="action.label"
|
|
|
|
:data-username="props.row.Identity"
|
|
|
|
:data-name="action.name"
|
|
|
|
:data-text="action.label"
|
|
|
|
@click.left.stop="rowActionFn"
|
|
|
|
v-for="action in actions"
|
2021-02-15 01:03:38 -05:00
|
|
|
v-bind:class="action.class"
|
2021-02-26 07:11:13 -05:00
|
|
|
v-if="action.showWhenStatus == props.row.AccountStatus && action.showForServerRole.includes(serverRole) && action.showForModule.some(p=> modulesEnabled.includes(p))">
|
2020-10-29 06:50:19 -04:00
|
|
|
{{ action.label }}
|
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
</vue-good-table>
|
|
|
|
|
|
|
|
<!-- <div class="d-flex justify-content-md-end">-->
|
|
|
|
<!-- <button type="button" class="btn btn-sm btn-success el-square new-user-btn" v-on:click.stop="u.ctxVisible=false;u.modalNewUserVisible=true">Add user</button>-->
|
|
|
|
<!-- </div>-->
|
2020-05-14 19:13:33 -04:00
|
|
|
|
2020-10-29 06:50:19 -04:00
|
|
|
<div class="modal-wrapper" v-if="u.modalNewUserVisible" v-bind:style="modalNewUserDisplay">
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2021-02-15 01:03:38 -05:00
|
|
|
<h4>Add new user</h4>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<input type="text" class="form-control el-square modal-el-margin" placeholder="Username [_a-zA-Z0-9\.-]" v-model="u.newUserName">
|
2021-03-15 04:35:12 -04:00
|
|
|
<input type="password" class="form-control el-square modal-el-margin" minlength="6" autocomplete="off" placeholder="Password [_a-zA-Z0-9\.-]" v-model="u.newUserPassword" v-if="modulesEnabled.includes('passwdAuth')">
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
2020-05-14 19:13:33 -04:00
|
|
|
|
2020-10-29 06:50:19 -04:00
|
|
|
<div class="modal-footer justify-content-center" v-if="u.newUserCreateError.length > 0">
|
|
|
|
<div class="alert alert-danger" role="alert" >
|
|
|
|
{{ u.newUserCreateError }}
|
2020-05-14 19:13:33 -04:00
|
|
|
</div>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2021-02-15 01:03:38 -05:00
|
|
|
<button type="button" class="btn btn-success el-square modal-el-margin" v-on:click.stop="createUser()">Create</button>
|
2020-10-29 06:50:19 -04:00
|
|
|
<button type="button" class="btn btn-primary el-square d-flex justify-content-sm-end modal-el-margin" v-on:click.stop="u.newUserName='';u.newUserPassword='nopass';u.modalNewUserVisible=false">Close</button>
|
|
|
|
</div>
|
2020-05-14 19:13:33 -04:00
|
|
|
</div>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-14 19:13:33 -04:00
|
|
|
|
2021-02-15 01:03:38 -05:00
|
|
|
<div class="modal-wrapper" v-if="u.modalChangePasswordVisible" v-bind:style="modalChangePasswordDisplay">
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h4>Change password for: <strong>{{ username }}</strong></h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<input type="password" class="form-control el-square modal-el-margin" minlength="6" autocomplete="off" placeholder="Password [_a-zA-Z0-9\.-]" v-model="u.newPassword">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer justify-content-center" v-if="u.passwordChangeMessage.length > 0">
|
|
|
|
<div class="alert" v-bind:class="passwordChangeStatusCssClass" role="alert" >
|
|
|
|
{{ u.passwordChangeMessage }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-success el-square modal-el-margin" v-on:click.stop="changeUserPassword(username)">Change password</button>
|
2021-02-20 07:48:41 -05:00
|
|
|
<button type="button" class="btn btn-primary el-square d-flex justify-content-sm-end modal-el-margin" v-on:click.stop="u.newPassword='';u.passwordChangeMessage='';u.modalChangePasswordVisible=false">Close</button>
|
2021-02-15 01:03:38 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-10-29 06:50:19 -04:00
|
|
|
<div class="modal-wrapper" v-if="u.modalShowConfigVisible" v-bind:style="modalShowConfigDisplay">
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2021-02-15 01:03:38 -05:00
|
|
|
<h4>ovpn config for: <strong>{{ username }}</strong></h4>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="d-flex">
|
|
|
|
<pre class="modal-show-config-txt-box">{{ u.openvpnConfig }}</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<div class="d-flex">
|
|
|
|
<button type="button" class="btn btn-success el-square modal-el-margin" v-clipboard:copy="u.openvpnConfig">Copy </button>
|
|
|
|
<button type="button" class="btn btn-primary el-square modal-el-margin" v-on:click.stop="u.openvpnConfig='';u.modalShowConfigVisible=false">Cancel</button>
|
2020-05-14 19:13:33 -04:00
|
|
|
</div>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
2020-05-14 19:13:33 -04:00
|
|
|
</div>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-14 19:13:33 -04:00
|
|
|
|
2020-10-29 06:50:19 -04:00
|
|
|
<div class="modal-wrapper" v-if="u.modalShowCcdVisible" v-bind:style="modalShowCcdDisplay">
|
|
|
|
<div class="modal-dialog modal-lg modal-dialog-scrollable">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2021-02-15 01:03:38 -05:00
|
|
|
<h3 class="static-address-label ">Routes table for: <strong>{{ username }}</strong></h3>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2020-10-29 06:50:19 -04:00
|
|
|
<div class="input-group">
|
2021-02-15 01:03:38 -05:00
|
|
|
<h5 class="static-address-label ">Static address:</h5>
|
2020-10-29 06:50:19 -04:00
|
|
|
<div class="input-group-prepend">
|
|
|
|
<div class="input-group-text">
|
2021-02-20 07:48:41 -05:00
|
|
|
<input id="enable-static" type="checkbox" @change="staticAddrCheckboxOnChange()" v-if="serverRole == 'master'" v-bind:checked="!customAddressDisabled">
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
2020-10-15 12:12:31 -04:00
|
|
|
</div>
|
2021-02-20 07:48:41 -05:00
|
|
|
<input id="static-address" type="text" class="form-control" v-model="u.ccd.ClientAddress" placeholder="127.0.0.1" v-bind:disabled="customAddressDisabled">
|
2020-10-15 12:12:31 -04:00
|
|
|
</div>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="d-flex ">
|
2021-02-26 07:11:13 -05:00
|
|
|
<table class="table table-bordered table-hover ccd-routes" >
|
2020-10-29 06:50:19 -04:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">Address</th>
|
|
|
|
<th scope="col">Mask</th>
|
|
|
|
<th scope="col">Description</th>
|
2020-11-20 11:11:58 -05:00
|
|
|
<th scope="col" v-if="serverRole == 'master'">Action</th>
|
2020-10-29 06:50:19 -04:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr v-for="(customRoute, index) in u.ccd.CustomRoutes">
|
|
|
|
<td>
|
2021-02-20 07:48:41 -05:00
|
|
|
<div v-if="serverRole == 'slave'">
|
2020-11-20 11:11:58 -05:00
|
|
|
{{ customRoute.Address }}
|
|
|
|
</div>
|
2021-02-20 07:48:41 -05:00
|
|
|
<input v-if="serverRole == 'master'" v-model="customRoute.Address">
|
2020-11-20 11:11:58 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2021-02-20 07:48:41 -05:00
|
|
|
<div v-if="serverRole == 'slave'">
|
2020-11-20 11:11:58 -05:00
|
|
|
{{ customRoute.Mask }}
|
|
|
|
</div>
|
2021-02-20 07:48:41 -05:00
|
|
|
<input v-if="serverRole == 'master'" v-model="customRoute.Mask">
|
2020-11-20 11:11:58 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2021-02-20 07:48:41 -05:00
|
|
|
<div v-if="serverRole == 'slave'">
|
2020-11-20 11:11:58 -05:00
|
|
|
{{ customRoute.Description }}
|
|
|
|
</div>
|
2021-02-20 07:48:41 -05:00
|
|
|
<input v-if="serverRole == 'master'" v-model="customRoute.Description">
|
2020-11-20 11:11:58 -05:00
|
|
|
</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>
|
2020-10-29 06:50:19 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
2020-11-17 12:48:26 -05:00
|
|
|
<tr v-if="serverRole == 'master'">
|
2020-10-29 06:50:19 -04:00
|
|
|
<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>
|
2020-11-20 11:11:58 -05:00
|
|
|
<td class="text-right" v-if="serverRole == 'master'">
|
2020-10-29 06:50:19 -04:00
|
|
|
<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>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer justify-content-center" v-if="u.ccdApplyStatusMessage.length > 0">
|
|
|
|
<div class="alert" v-bind:class="ccdApplyStatusCssClass" role="alert">
|
|
|
|
{{ u.ccdApplyStatusMessage }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2020-11-17 12:48:26 -05:00
|
|
|
<button type="button" class="btn btn-success el-square modal-el-margin" v-if="serverRole == 'master'" v-on:click.stop="ccdApply()">Save</button>
|
2020-10-29 06:50:19 -04:00
|
|
|
<button type="button" class="btn btn-primary el-square modal-el-margin" v-on:click.stop="u.ccd={Name:'',ClientAddress:'',CustomRoutes:[]};u.ccdApplyStatusMessage='';u.ccdApplyStatus='';u.modalShowCcdVisible=false">Close</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-14 19:13:33 -04:00
|
|
|
</div>
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
|
|
|
|
2021-02-20 07:48:41 -05:00
|
|
|
<notifications position="bottom left" :speed="900" />
|
2020-10-29 06:50:19 -04:00
|
|
|
</div>
|
2021-02-26 07:11:13 -05:00
|
|
|
<script src="dist/bundle.min.js"></script>
|
2020-10-29 06:50:19 -04:00
|
|
|
</body>
|
2020-05-14 19:13:33 -04:00
|
|
|
</html>
|