瀏覽代碼

add account syncPassword flag. fix device refresh. don't show users on dashboard if max 1 user.

pull/32/head
Jonathan Cobb 4 年之前
父節點
當前提交
74117dccae
共有 5 個檔案被更改,包括 31 行新增15 行删除
  1. +1
    -1
      src/_services/user.service.js
  2. +2
    -1
      src/_store/system.module.js
  3. +5
    -0
      src/account/DevicesPage.vue
  4. +12
    -12
      src/account/NewNetworkPage.vue
  5. +11
    -1
      src/account/profile/ProfilePage.vue

+ 1
- 1
src/_services/user.service.js 查看文件

@@ -211,7 +211,7 @@ function createUser(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) {


+ 2
- 1
src/_store/system.module.js 查看文件

@@ -31,6 +31,7 @@ const state = {
securityLevels: null,
jarVersion: null,
jarUpgradeAvailable: null,
maxUsers: null
},
entityConfigs: {},
searchResults: [],
@@ -310,7 +311,7 @@ const getters = {
index: 4,
apps: adminApps,
});
} else if (isAdmin) {
} else if (isAdmin && configs.maxUsers > 1) {
dashApps.push({
href: '/admin/accounts',
title: messages.label_menu_admin_users,


+ 5
- 0
src/account/DevicesPage.vue 查看文件

@@ -319,6 +319,11 @@
this.deviceName = null;
this.deviceType = null;
if (dev.uuid) this.showVpnConfig(dev.uuid);
this.getDevicesByUserId({
userId: this.userId,
messages: this.messages,
errors: this.errors
});
}
}
}


+ 12
- 12
src/account/NewNetworkPage.vue 查看文件

@@ -276,19 +276,19 @@
<hr/>

<!-- 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 -->
<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 -->
<div class="form-group" v-if="configs.requireSendMetrics && configs.requireSendMetrics !== true">
<label for="sendErrors">{{messages.field_label_send_errors}}</label>


+ 11
- 1
src/account/profile/ProfilePage.vue 查看文件

@@ -71,9 +71,17 @@
<span>{{messages.field_label_suspended}}: {{messages['message_'+subject.suspended]}}</span>
</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>
<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>
<input type="checkbox" id="autoUpdatePolicy.jarUpdates" v-model="subject.autoUpdatePolicy.jarUpdates">
</div>
@@ -105,6 +113,7 @@
locale: null,
admin: null,
suspended: null,
syncPassword: null,
autoUpdatePolicy: {
jarUpdates: true,
appUpdates: true
@@ -188,6 +197,7 @@
locale: this.subject.locale,
admin: this.subject.admin,
suspended: this.subject.suspended,
syncPassword: this.subject.syncPassword,
autoUpdatePolicy: this.subject.autoUpdatePolicy
};
this.submitted = true;


Loading…
取消
儲存