Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf: Change SFTP Connect Token #1617

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ui/src/components/pamFileList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ const { t } = useI18n();
const fileManageStore = useFileManageStore();

const isLoaded = ref(false);
// todo)) 还原为 false
const isShowList = ref(true);
const isShowList = ref(false);
const settingDrawer = ref(false);
const tabDefaultValue = ref('fileManage');
const tableData = ref<RowData[]>([]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code does not seem to be an actual JavaScript code with specific context like files, components, modules etc. There can't be any regular checks or deviations from this piece of data on current date as stated.

There are some small changes I would suggest:

  1. Remove the todo) comments at line 205 (since it doesn't refer back to a function/method). Comments should relate directly to how they impact functionality.
 // Assuming there's something relevant here...
  1. If you're using React or TypeScript with functional components then instead of <RowData... consider using props which makes sense for component interfaces since no implementation is mentioned for these components.

So just remove those commented-out lines and go ahead as planned, no need to make additional optimizations/changes per the original post content given here.

Expand Down
6 changes: 3 additions & 3 deletions ui/src/hooks/useFileManage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { type UploadFileInfo, useMessage } from 'naive-ui';
import { useWebSocket } from '@vueuse/core';
import { useFileManageStore } from '@/store/modules/fileManage.ts';

import { v4 as uuid } from 'uuid';
import { BASE_WS_URL } from '@/config';

import mittBus from '@/utils/mittBus.ts';
import { v4 as uuid } from 'uuid';

import type { Ref } from 'vue';
import type { RouteRecordNameGeneric } from 'vue-router';
import type { MessageApiInjection } from 'naive-ui/es/message/src/MessageProvider';
import type { IFileManage, IFileManageConnectData, IFileManageSftpFileItem } from '@/hooks/interface';
import { Ref } from 'vue';

export enum MessageType {
CONNECT = 'CONNECT',
Expand Down Expand Up @@ -42,7 +42,7 @@ const getFileManageUrl = () => {
let fileConnectionUrl: string = '';

if (routeName === 'Terminal') {
fileConnectionUrl = urlParams ? `${BASE_WS_URL}/koko/ws/sftp/?${urlParams.toString()}` : '';
fileConnectionUrl = urlParams ? `${BASE_WS_URL}/koko/ws/sftp/?token=${urlParams.toString().split('&')[1].split('=')[1]}` : '';

return fileConnectionUrl;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but there was an issue with the syntax of your code block. The code snippets you provided appear to be incomplete or incorrect. Could you please revise them? Additionally, I'm unable to verify any changes based on this context due to lack of source information about the current version of TypeScript and React used in these projects. Please provide more details or restructure it properly for better analysis and insights into potential irregularities or optimizations.

If you're asking whether there are any differences between the given two files (which seem to be JavaScript), here would be something similar:

// This is the first part before differences were made.
import useMessage from './useMessage'; // Assuming `useMessage` is not defined elsewhere.
import { type UploadFileInfo } from './naive-ui/dist';

...

However, this still doesn't answer what discrepancies might exist because without further information on how the initial versions looked like at each line and across other lines, etc., my response cannot be correct.

Would you mind specifying where the two codes start/stop being compared so that we can analyze their content comprehensively? Thank you!

Expand Down
Loading