diff --git a/src/components/desktop/ConfirmDialog.vue b/src/components/desktop/ConfirmDialog.vue new file mode 100644 index 00000000..a8977e24 --- /dev/null +++ b/src/components/desktop/ConfirmDialog.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/desktop-main.js b/src/desktop-main.js index 7fcb9309..2c8310b9 100644 --- a/src/desktop-main.js +++ b/src/desktop-main.js @@ -5,6 +5,7 @@ import { createI18n } from 'vue-i18n'; import { createVuetify } from 'vuetify'; import { VApp } from 'vuetify/components/VApp'; import { VAvatar } from 'vuetify/components/VAvatar'; +import { VAutocomplete } from 'vuetify/components/VAutocomplete'; import { VBtn } from 'vuetify/components/VBtn'; import { VCard, VCardActions, VCardItem, VCardSubtitle, VCardText, VCardTitle } from 'vuetify/components/VCard'; import { VChip } from 'vuetify/components/VChip'; @@ -15,6 +16,7 @@ import { VContainer, VCol, VRow, VSpacer } from 'vuetify/components/VGrid'; import { VIcon } from 'vuetify/components/VIcon'; import { VImg } from 'vuetify/components/VImg'; import { VInput } from 'vuetify/components/VInput'; +import { VLabel } from 'vuetify/components/VLabel'; import { VList, VListGroup, VListImg, VListItem, VListItemAction, VListItemMedia, VListItemSubtitle, VListItemTitle, VListSubheader } from 'vuetify/components/VList'; import { VMenu } from 'vuetify/components/VMenu'; import { VOverlay } from 'vuetify/components/VOverlay'; @@ -27,6 +29,8 @@ import { VSnackbar } from 'vuetify/components/VSnackbar'; import { VTabs, VTab } from 'vuetify/components/VTabs'; import { VTable } from 'vuetify/components/VTable'; import { VTextField } from 'vuetify/components/VTextField'; +import { VToolbar } from 'vuetify/components/VToolbar'; +import { VTooltip } from 'vuetify/components/VTooltip'; import { VWindow, VWindowItem } from 'vuetify/components/VWindow'; import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'; import 'vuetify/styles'; @@ -51,6 +55,7 @@ import { } from '@/lib/i18n.js'; import AmountInput from '@/components/desktop/AmountInput.vue'; +import ConfirmDialog from '@/components/desktop/ConfirmDialog.vue'; import '@/styles/desktop/template/base/libs/vuetify/_index.scss'; import '@/styles/desktop/template/template/index.scss'; @@ -68,6 +73,7 @@ const vuetify = createVuetify({ components: { VApp, VAvatar, + VAutocomplete, VBtn, VCard, VCardActions, @@ -86,6 +92,7 @@ const vuetify = createVuetify({ VIcon, VImg, VInput, + VLabel, VList, VListGroup, VListImg, @@ -107,6 +114,8 @@ const vuetify = createVuetify({ VTab, VTable, VTextField, + VToolbar, + VTooltip, VWindow, VWindowItem }, @@ -193,6 +202,9 @@ const vuetify = createVuetify({ color: 'primary', hideDetails: 'auto' }, + VToolbar: { + color: 'primary' + }, VTooltip: { location: 'top' } @@ -310,6 +322,7 @@ app.component('PerfectScrollbar', PerfectScrollbar); app.component('VueDatePicker', VueDatePicker); app.component('AmountInput', AmountInput); +app.component('ConfirmDialog', ConfirmDialog); app.config.globalProperties.$version = version.getVersion(); app.config.globalProperties.$buildTime = version.getBuildTime(); diff --git a/src/lib/ui.js b/src/lib/ui.js index a9cc2c2b..778d973f 100644 --- a/src/lib/ui.js +++ b/src/lib/ui.js @@ -5,3 +5,16 @@ export function getSystemTheme() { return 'light'; } } + +export function startDownloadFile(fileName, fileData) { + const dataObjectUrl = URL.createObjectURL(fileData); + const dataLink = document.createElement('a'); + + dataLink.style.display = 'none'; + dataLink.href = dataObjectUrl; + dataLink.setAttribute('download', fileName); + + document.body.appendChild(dataLink); + + dataLink.click(); +} diff --git a/src/locales/en.js b/src/locales/en.js index b714c2d2..bd1ddd9c 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -692,12 +692,16 @@ export default { }, 'OK': 'OK', 'Cancel': 'Cancel', + 'Operation': 'Operation', 'Close': 'Close', 'Submit': 'Submit', 'Add': 'Add', 'Apply': 'Apply', 'Save': 'Save', + 'Save changes': 'Save changes', 'Update': 'Update', + 'Refresh': 'Refresh', + 'Clear': 'Clear', 'None': 'None', 'Not Specified': 'Not Specified', 'No results': 'No results', @@ -711,6 +715,7 @@ export default { 'Enabled': 'Enabled', 'Disable': 'Disable', 'Disabled': 'Disabled', + 'Copy': 'Copy', 'Visible': 'Visible', 'Version': 'Version', 'Edit': 'Edit', @@ -743,6 +748,7 @@ export default { 'Sort By': 'Sort By', 'User': 'User', 'Application': 'Application', + 'Danger Zone': 'Danger Zone', 'Details': 'Details', 'Accounts': 'Accounts', 'Statistics': 'Statistics', @@ -790,6 +796,8 @@ export default { 'Create an account': 'Create an account', 'Username cannot be empty': 'Username cannot be empty', 'Password cannot be empty': 'Password cannot be empty', + 'Current password cannot be empty': 'Current password cannot be empty', + 'New password cannot be empty': 'New password cannot be empty', 'Confirmation password cannot be empty': 'Confirmation password cannot be empty', 'Password and confirmation password do not match': 'Password and confirmation password do not match', 'Email address cannot be empty': 'Email address cannot be empty', @@ -797,6 +805,10 @@ export default { 'Default currency cannot be empty': 'Default currency cannot be empty', 'Unable to login': 'Unable to login', 'Two-Factor Authentication': 'Two-Factor Authentication', + 'Two-factor authentication is not enabled yet.': 'Two-factor authentication is not enabled yet.', + 'Two-factor authentication has been enabled.': 'Two-factor authentication has been enabled.', + 'Disable two-factor authentication': 'Disable two-factor authentication', + 'Enable two-factor authentication': 'Enable two-factor authentication', 'Passcode': 'Passcode', 'Backup Code': 'Backup Code', 'Verify': 'Verify', @@ -953,6 +965,7 @@ export default { 'Name': 'Name', 'Filter Accounts': 'Filter Accounts', 'Filter Transaction Categories': 'Filter Transaction Categories', + 'User Settings': 'User Settings', 'User Profile': 'User Profile', 'Language': 'Language', 'Theme': 'Theme', @@ -980,7 +993,13 @@ export default { 'Unable to sign up': 'Unable to sign up', 'User registration is disabled': 'User registration is disabled', 'Unable to get user profile': 'Unable to get user profile', + 'Basic': 'Basic', + 'Security': 'Security', + 'Basic Settings': 'Basic Settings', + 'Security Settings': 'Security Settings', + 'Two-Factor Authentication Settings': 'Two-Factor Authentication Settings', 'Current Password': 'Current Password', + 'New Password': 'New Password', 'Modify Password': 'Modify Password', 'Please enter your current password when modifying your password': 'Please enter your current password when modifying your password', 'Nothing has been modified': 'Nothing has been modified', @@ -990,6 +1009,7 @@ export default { 'Unable to get user statistics data': 'Unable to get user statistics data', 'Export Data': 'Export Data', 'Clear User Data': 'Clear User Data', + 'Export all data to csv file.': 'Export all data to csv file.', 'Are you sure you want to export all data to csv file?': 'Are you sure you want to export all data to csv file?', 'It may take a long time, please wait for a few minutes.': 'It may take a long time, please wait for a few minutes.', 'Unable to get exported user data': 'Unable to get exported user data', @@ -999,6 +1019,8 @@ export default { 'All user data has been cleared': 'All user data has been cleared', 'Unable to clear user data': 'Unable to clear user data', 'Device & Sessions': 'Device & Sessions', + 'Device Info': 'Device Info', + 'Last Activity Time': 'Last Activity Time', 'Logout All': 'Logout All', 'Unable to get session list': 'Unable to get session list', 'Session list is up to date': 'Session list is up to date', @@ -1073,6 +1095,7 @@ export default { 'Please use two factor authentication app scan the below qrcode and input current passcode': 'Please use two factor authentication app scan the below qrcode and input current passcode', 'Please enter your current password when disable two factor authentication': 'Please enter your current password when disable two factor authentication', 'Please enter your current password when regenerate two factor authentication backup codes. If you regenerate backup codes, the old codes will be invalidated.': 'Please enter your current password when regenerate two factor authentication backup codes. If you regenerate backup codes, the old codes will be invalidated.', + 'Please enter your current password when disable two factor authentication or regenerate two factor authentication backup codes. If you regenerate backup codes, the old codes will be invalidated.': 'Please enter your current password when disable two factor authentication or regenerate two factor authentication backup codes. If you regenerate backup codes, the old codes will be invalidated.', 'Please copy these backup codes to safe place, the below codes can only be shown once. If these codes were lost, you can regenerate backup codes at any time.': 'Please copy these backup codes to safe place, the below codes can only be shown once. If these codes were lost, you can regenerate backup codes at any time.', 'Backup codes copied': 'Backup codes copied', 'Two factor authentication has been disabled': 'Two factor authentication has been disabled', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 04b973d1..3013e7b4 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -692,12 +692,16 @@ export default { }, 'OK': '确定', 'Cancel': '取消', + 'Operation': '操作', 'Close': '关闭', 'Submit': '提交', 'Add': '添加', 'Apply': '应用', 'Save': '保存', + 'Save changes': '保存修改', 'Update': '更新', + 'Refresh': '刷新', + 'Clear': '清除', 'None': '无', 'Not Specified': '未指定', 'No results': '无结果', @@ -711,6 +715,7 @@ export default { 'Enabled': '启用', 'Disable': '禁用', 'Disabled': '禁用', + 'Copy': '复制', 'Visible': '可见', 'Version': '版本', 'Edit': '编辑', @@ -743,6 +748,7 @@ export default { 'Sort By': '排序方式', 'User': '用户', 'Application': '应用', + 'Danger Zone': '危险区域', 'Details': '详情', 'Accounts': '账户', 'Statistics': '统计', @@ -790,6 +796,8 @@ export default { 'Create an account': '创建新账号', 'Username cannot be empty': '用户名不能为空', 'Password cannot be empty': '密码不能为空', + 'Current password cannot be empty': '当前密码不能为空', + 'New password cannot be empty': '新密码不能为空', 'Confirmation password cannot be empty': '确认密码不能为空', 'Password and confirmation password do not match': '密码和确认密码不匹配', 'Email address cannot be empty': '电子邮箱地址不能为空', @@ -797,6 +805,10 @@ export default { 'Default currency cannot be empty': '默认货币不能为空', 'Unable to login': '无法登录', 'Two-Factor Authentication': '两步验证', + 'Two-factor authentication is not enabled yet.': '两步验证没有启用。', + 'Two-factor authentication has been enabled.': '两步验证已经启用。', + 'Disable two-factor authentication': '禁用两步验证', + 'Enable two-factor authentication': '启用两步验证', 'Passcode': '验证码', 'Backup Code': '备用码', 'Verify': '验证', @@ -953,6 +965,7 @@ export default { 'Name': '名称', 'Filter Accounts': '过滤账户', 'Filter Transaction Categories': '过滤交易类型', + 'User Settings': '用户设置', 'User Profile': '用户信息', 'Language': '语言', 'Theme': '主题', @@ -980,7 +993,13 @@ export default { 'Unable to sign up': '无法注册', 'User registration is disabled': '用户注册已禁用', 'Unable to get user profile': '无法获取用户信息', + 'Basic': '基本', + 'Security': '安全', + 'Basic Settings': '基本设置', + 'Security Settings': '安全设置', + 'Two-Factor Authentication Settings': '两步验证设置', 'Current Password': '当前密码', + 'New Password': '新密码', 'Modify Password': '修改密码', 'Please enter your current password when modifying your password': '修改密码时请输入您的当前密码', 'Nothing has been modified': '没有修改的项目', @@ -990,6 +1009,7 @@ export default { 'Unable to get user statistics data': '无法获取用户统计数据', 'Export Data': '导出数据', 'Clear User Data': '清除用户数据', + 'Export all data to csv file.': '导出所有数据到 csv 文件。', 'Are you sure you want to export all data to csv file?': '您确定要导出所有数据到 csv 文件?', 'It may take a long time, please wait for a few minutes.': '这可能花费一些时间,请稍等几分钟。', 'Unable to get exported user data': '无法获取导出的用户数据', @@ -999,6 +1019,8 @@ export default { 'All user data has been cleared': '用户所有数据已经清空', 'Unable to clear user data': '无法清除用户数据', 'Device & Sessions': '设备和会话', + 'Device Info': '设备信息', + 'Last Activity Time': '最后活跃时间', 'Logout All': '注销全部', 'Unable to get session list': '无法获取会话列表', 'Session list is up to date': '会话列表已是最新', @@ -1073,6 +1095,7 @@ export default { 'Please use two factor authentication app scan the below qrcode and input current passcode': '请使用两步验证应用扫描下方的二维码并输入当前的验证码', 'Please enter your current password when disable two factor authentication': '禁用两步验证时需要输入您的当前密码', 'Please enter your current password when regenerate two factor authentication backup codes. If you regenerate backup codes, the old codes will be invalidated.': '重新生成两步验证备用码时需要输入您的当前密码。如果您重新生成备用码,之前的备用码将失效。', + 'Please enter your current password when disable two factor authentication or regenerate two factor authentication backup codes. If you regenerate backup codes, the old codes will be invalidated.': '禁用两步验证或重新生成两步验证备用码时需要输入您的当前密码。如果您重新生成备用码,之前的备用码将失效。', 'Please copy these backup codes to safe place, the below codes can only be shown once. If these codes were lost, you can regenerate backup codes at any time.': '请将备用码复制到安全的地方,下列备用码只会展示一次。如果这些备用码丢失,您可以随时重新生成备用码。', 'Backup codes copied': '备用码已复制', 'Two factor authentication has been disabled': '两步验证已经禁用', diff --git a/src/views/desktop/MainLayout.vue b/src/views/desktop/MainLayout.vue index 447ff964..649d6539 100644 --- a/src/views/desktop/MainLayout.vue +++ b/src/views/desktop/MainLayout.vue @@ -121,7 +121,7 @@ - {{ $t('User Profile') }} + {{ $t('User Settings') }}