@@ -211,7 +211,7 @@ function createUser(user, messages, errors) { | |||||
} | } | ||||
function updateUser(user, messages, errors) { | function updateUser(user, messages, errors) { | ||||
return fetch(`${config.apiUrl}/users/${user.name}`, util.postWithAuth(user)).then(util.handleCrudResponse(messages, errors)); | |||||
return fetch(`${config.apiUrl}/users/${user.email}`, util.postWithAuth(user)).then(util.handleCrudResponse(messages, errors)); | |||||
} | } | ||||
function deleteUser(userId, messages, errors) { | function deleteUser(userId, messages, errors) { | ||||
@@ -31,6 +31,7 @@ const state = { | |||||
securityLevels: null, | securityLevels: null, | ||||
jarVersion: null, | jarVersion: null, | ||||
jarUpgradeAvailable: null, | jarUpgradeAvailable: null, | ||||
maxUsers: null | |||||
}, | }, | ||||
entityConfigs: {}, | entityConfigs: {}, | ||||
searchResults: [], | searchResults: [], | ||||
@@ -310,7 +311,7 @@ const getters = { | |||||
index: 4, | index: 4, | ||||
apps: adminApps, | apps: adminApps, | ||||
}); | }); | ||||
} else if (isAdmin) { | |||||
} else if (isAdmin && configs.maxUsers > 1) { | |||||
dashApps.push({ | dashApps.push({ | ||||
href: '/admin/accounts', | href: '/admin/accounts', | ||||
title: messages.label_menu_admin_users, | title: messages.label_menu_admin_users, | ||||
@@ -319,6 +319,11 @@ | |||||
this.deviceName = null; | this.deviceName = null; | ||||
this.deviceType = null; | this.deviceType = null; | ||||
if (dev.uuid) this.showVpnConfig(dev.uuid); | if (dev.uuid) this.showVpnConfig(dev.uuid); | ||||
this.getDevicesByUserId({ | |||||
userId: this.userId, | |||||
messages: this.messages, | |||||
errors: this.errors | |||||
}); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -276,19 +276,19 @@ | |||||
<hr/> | <hr/> | ||||
<!-- sync password --> | <!-- sync password --> | ||||
<div class="form-group"> | |||||
<label for="syncPassword">{{messages.field_label_sync_password}}</label> | |||||
<input type="checkbox" id="syncPassword" v-model="accountPlan.syncPassword"> | |||||
<div v-if="submitted && errors.has('syncPassword')" class="invalid-feedback d-block">{{ errors.first('syncPassword') }}</div> | |||||
<p>{{messages.field_label_sync_password_description}}</p> | |||||
</div> | |||||
<!-- <div class="form-group">--> | |||||
<!-- <label for="syncPassword">{{messages.field_label_sync_password}}</label>--> | |||||
<!-- <input type="checkbox" id="syncPassword" v-model="accountPlan.syncPassword">--> | |||||
<!-- <div v-if="submitted && errors.has('syncPassword')" class="invalid-feedback d-block">{{ errors.first('syncPassword') }}</div>--> | |||||
<!-- <p>{{messages.field_label_sync_password_description}}</p>--> | |||||
<!-- </div>--> | |||||
<!-- launch lock --> | <!-- launch lock --> | ||||
<div class="form-group" v-if="networkType !== 'fork'"> | |||||
<label for="launchLock">{{messages.field_label_launch_lock}}</label> | |||||
<input type="checkbox" id="launchLock" v-model="accountPlan.launchLock"> | |||||
<div v-if="submitted && errors.has('launchLock')" class="invalid-feedback d-block">{{ errors.first('launchLock') }}</div> | |||||
<p>{{messages.field_label_launch_lock_description}}</p> | |||||
</div> | |||||
<!-- <div class="form-group" v-if="networkType !== 'fork'">--> | |||||
<!-- <label for="launchLock">{{messages.field_label_launch_lock}}</label>--> | |||||
<!-- <input type="checkbox" id="launchLock" v-model="accountPlan.launchLock">--> | |||||
<!-- <div v-if="submitted && errors.has('launchLock')" class="invalid-feedback d-block">{{ errors.first('launchLock') }}</div>--> | |||||
<!-- <p>{{messages.field_label_launch_lock_description}}</p>--> | |||||
<!-- </div>--> | |||||
<!-- error reporting --> | <!-- error reporting --> | ||||
<div class="form-group" v-if="configs.requireSendMetrics && configs.requireSendMetrics !== true"> | <div class="form-group" v-if="configs.requireSendMetrics && configs.requireSendMetrics !== true"> | ||||
<label for="sendErrors">{{messages.field_label_send_errors}}</label> | <label for="sendErrors">{{messages.field_label_send_errors}}</label> | ||||
@@ -71,9 +71,17 @@ | |||||
<span>{{messages.field_label_suspended}}: {{messages['message_'+subject.suspended]}}</span> | <span>{{messages.field_label_suspended}}: {{messages['message_'+subject.suspended]}}</span> | ||||
</div> | </div> | ||||
<!-- sync password --> | |||||
<div v-if="admin === true && currentUser.uuid === subject.uuid" class="form-group"> | |||||
<label for="syncPassword">{{messages.field_label_sync_password}}</label> | |||||
<input type="checkbox" id="syncPassword" v-model="subject.syncPassword"> | |||||
<div v-if="submitted && errors.has('syncPassword')" class="invalid-feedback d-block">{{ errors.first('syncPassword') }}</div> | |||||
<p>{{messages.field_label_sync_password_description}}</p> | |||||
</div> | |||||
<div> | <div> | ||||
<h3>{{messages.field_label_auto_update_policy}}</h3> | <h3>{{messages.field_label_auto_update_policy}}</h3> | ||||
<div class="form-group"> | |||||
<div v-if="admin === true && currentUser.uuid === subject.uuid" class="form-group"> | |||||
<label for="autoUpdatePolicy.jarUpdates">{{messages.field_label_auto_update_jar}}</label> | <label for="autoUpdatePolicy.jarUpdates">{{messages.field_label_auto_update_jar}}</label> | ||||
<input type="checkbox" id="autoUpdatePolicy.jarUpdates" v-model="subject.autoUpdatePolicy.jarUpdates"> | <input type="checkbox" id="autoUpdatePolicy.jarUpdates" v-model="subject.autoUpdatePolicy.jarUpdates"> | ||||
</div> | </div> | ||||
@@ -105,6 +113,7 @@ | |||||
locale: null, | locale: null, | ||||
admin: null, | admin: null, | ||||
suspended: null, | suspended: null, | ||||
syncPassword: null, | |||||
autoUpdatePolicy: { | autoUpdatePolicy: { | ||||
jarUpdates: true, | jarUpdates: true, | ||||
appUpdates: true | appUpdates: true | ||||
@@ -188,6 +197,7 @@ | |||||
locale: this.subject.locale, | locale: this.subject.locale, | ||||
admin: this.subject.admin, | admin: this.subject.admin, | ||||
suspended: this.subject.suspended, | suspended: this.subject.suspended, | ||||
syncPassword: this.subject.syncPassword, | |||||
autoUpdatePolicy: this.subject.autoUpdatePolicy | autoUpdatePolicy: this.subject.autoUpdatePolicy | ||||
}; | }; | ||||
this.submitted = true; | this.submitted = true; | ||||