| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  | {{define "settings/panel/security"}} | 
					
						
							| 
									
										
										
										
											2025-03-25 15:13:17 +00:00
										 |  |  | <a-collapse default-active-key="1"> | 
					
						
							|  |  |  |     <a-collapse-panel key="1" header='{{ i18n "pages.settings.security.admin"}}'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.settings.oldUsername"}}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							|  |  |  |                 <a-input autocomplete="username" v-model="user.oldUsername"></a-input> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.settings.currentPassword"}}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                 <a-input-password autocomplete="current-password" v-model="user.oldPassword"></a-input-password> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.settings.newUsername"}}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							|  |  |  |                 <a-input v-model="user.newUsername"></a-input> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.settings.newPassword"}}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                 <a-input-password autocomplete="new-password" v-model="user.newPassword"></a-input-password> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <a-list-item> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |             <a-space direction="horizontal" :style="{ padding: '0 20px' }"> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                 <a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button> | 
					
						
							|  |  |  |             </a-space> | 
					
						
							|  |  |  |         </a-list-item> | 
					
						
							|  |  |  |     </a-collapse-panel> | 
					
						
							| 
									
										
										
										
											2025-03-25 15:13:17 +00:00
										 |  |  |     <a-collapse-panel key="2" header='{{ i18n "pages.settings.security.secret"}}'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.settings.security.loginSecurity" }}</template> | 
					
						
							|  |  |  |             <template #description>{{ i18n "pages.settings.security.loginSecurityDesc" }}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							|  |  |  |                 <a-switch @change="toggleToken(allSetting.secretEnable)" v-model="allSetting.secretEnable"></a-switch> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                 <a-icon :style="{ marginLeft: '1rem' }" v-if="allSetting.secretEnable" :spin="this.changeSecret" type="sync" | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                     @click="getNewSecret"></a-icon> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.settings.security.secretToken" }}</template> | 
					
						
							|  |  |  |             <template #description>{{ i18n "pages.settings.security.secretTokenDesc" }}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							|  |  |  |                 <a-textarea type="text" :disabled="!allSetting.secretEnable" v-model="user.loginSecret"></a-textarea> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <a-list-item> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |             <a-space direction="horizontal" :style="{ padding: '0 20px' }"> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                 <a-button type="primary" :loading="this.changeSecret" @click="updateSecret"> | 
					
						
							|  |  |  |                     <span>{{ i18n "confirm"}}</span> | 
					
						
							|  |  |  |                 </a-button> | 
					
						
							|  |  |  |             </a-space> | 
					
						
							|  |  |  |         </a-list-item> | 
					
						
							|  |  |  |     </a-collapse-panel> | 
					
						
							|  |  |  | </a-collapse> | 
					
						
							|  |  |  | {{end}} |