Skip to content

Commit

Permalink
fix: lint issue #2
Browse files Browse the repository at this point in the history
Signed-off-by: seven <zilisheng1996@gmail.com>
  • Loading branch information
Blankll committed Feb 21, 2024
1 parent 749c7e8 commit aa5d534
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/store/secretStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export enum SecretType {
PASSWORD = 'PASSWORD',
}
export type Secret = {
id?: number;
id?: string;
name: string;
type: SecretType;
priKey?: string;
Expand Down
43 changes: 21 additions & 22 deletions src/views/secret/components/new-key-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
</template>

<script setup lang="ts">
import { CustomError } from '../../../common';
import { Secret, useSecretStore } from '../../../store';
import { useLang } from '../../../lang';
import { FormValidationError } from 'naive-ui';
Expand All @@ -120,7 +119,7 @@ const connectFormRef = ref();
const showModal = ref(false);
const modalTitle = ref(lang.t('secret.new'));
const testLoading = ref(false);
// const testLoading = ref(false);
const saveLoading = ref(false);
type SecretInput = Omit<Secret, 'id' | 'type'>;
const defaultFormData = {
Expand All @@ -141,7 +140,7 @@ const formRules = reactive({
],
});
const message = useMessage();
// const message = useMessage();
const showMedal = (secret: Secret | null) => {
showModal.value = true;
Expand All @@ -166,25 +165,25 @@ const validationPassed = watch(formData.value, async () => {
}
});
const verify = async (event: MouseEvent) => {
event.preventDefault();
testLoading.value = !testLoading.value;
try {
// @TODO: verify secret
// await testConnection({ ...formData.value });
message.success(lang.t('connection.testSuccess'));
} catch (e) {
const error = e as CustomError;
message.error(`status: ${error.status}, details: ${error.details}`, {
closable: true,
keepAliveOnHover: true,
duration: 10000,
});
} finally {
testLoading.value = !testLoading.value;
}
};
// const verify = async (event: MouseEvent) => {
// event.preventDefault();
// testLoading.value = !testLoading.value;
// try {
// // @TODO: verify secret
// // await testConnection({ ...formData.value });
// message.success(lang.t('connection.testSuccess'));
// } catch (e) {
// const error = e as CustomError;
// message.error(`status: ${error.status}, details: ${error.details}`, {
// closable: true,
// keepAliveOnHover: true,
// duration: 10000,
// });
// } finally {
// testLoading.value = !testLoading.value;
// }
// };
//
const submitSaveSecret = async (event: MouseEvent) => {
event.preventDefault();
saveLoading.value = !saveLoading.value;
Expand Down

0 comments on commit aa5d534

Please sign in to comment.