Selectron-based desktop application file display method, operating system and medium
By using Electron's dialog and shell modules to present file operation options on the front end, a number of file management convenience issues have been resolved, and an intuitive and easy-to-use file operation interface has been implemented, supporting file opening, copying, saving as, and opening folders, thus improving the user experience.
Patent Information
- Application Number
- CN202510852742.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-11-07
AI Technical Summary
How to effectively process and manage large amounts of operation logs, device status screenshots, and other files to improve ease of operation, reduce manual intervention, and optimize file management.
Electron's dialog and shell modules are used to present file operation options on the front end, including opening files, copying, saving as, and opening folders. The corresponding strategies are executed according to the user's actions and the results are returned.
It provides an intuitive and easy-to-use interface, supports quick access and management of various file types, enhances user experience, and strengthens file management functionality.
Smart Images

Figure CN120910002A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of application file operating system, in particular to an electron-based desktop application file display method, an operating system and a medium. BACKGROUND
[0002] With the progress of the times and technology, more and more devices and systems begin to be automatically controlled by software, gradually reducing manual intervention, which not only improves work efficiency, but also makes operation more convenient. However, with the improvement of the degree of device automation, the amount of data such as running logs, operation logs, device state screenshots also increases sharply. These log and screenshot files contain important information in the system running process, helping operators to discover and eliminate device abnormalities in time and ensure stable operation of the device.
[0003] Therefore, how to effectively process and manage these large amounts of files becomes crucial. Including quickly viewing log files, copying file contents, locating the position of the file, saving backups and other operations, are key links to ensure that operators can timely and efficiently handle device abnormalities and respond. In order to improve the operation convenience, reduce manual intervention, optimizing these file management operations has become the focus of current technical development. SUMMARY
[0004] The main purpose of the application is to provide an electron-based desktop application file display method, an operating system and a medium, which aims to provide a more intuitive and convenient interactive screen to realize the functions of viewing, copying, saving as and locating the position of the file.
[0005] To achieve the above purpose, the application provides an electron-based desktop application file display method, which comprises the following steps:
[0006] Step S10, after obtaining the log file.txt / screenshot path on the front end, the Electron dialog and shell module are used to present application file operation options for user selection, wherein the operation options include file opening, file copying, file saving as and file folder opening;
[0007] Step S20, when receiving the application file operation options triggered by the user, the corresponding application file operation strategy is executed;
[0008] Step S30, according to the operation result, the corresponding feedback information is displayed on the front-end interface.
[0009] The further technical scheme of the application is that the step S20 comprises:
[0010] Step S201, when the user triggered application file operation option is file opening, first verify whether the file path exists, if exists, open the file of specified path through shell.openPath.
[0011] The further technical solution of the present application is that the step S20 further comprises:
[0012] Step S202, when the user triggered application file operation option is file copying, first verify whether the source file exists locally, and judge the application file type, then execute corresponding application file operation strategy according to the verification result and the file type.
[0013] The further technical solution of the present application is that the step S202 comprises:
[0014] When the source file exists locally and the application file is a text file, dialog.showOpenDialog pops up a dialog box for the user to select a file or folder, if the same name file already exists in the target folder, then automatically rename, and then fs.copyFile copies the source file to the destination path, based on the source file address and the user selected target folder address, copies the file to the target folder.
[0015] When the source file exists locally and the application file is an image file, clipboard.writeImage copies the image object to the system clipboard, so that the user can paste it at any time in any application.
[0016] The further technical solution of the present application is that the step S20 further comprises:
[0017] Step S203, when the user triggered application file operation option is file saving as, first verify whether the source file exists, if exists, use file extension to determine the file type.
[0018] The further technical solution of the present application is that the step S203 comprises:
[0019] Through dialog.showSaveDialogSync, determine the path of the file selected by the user to save, and set the file type according to the filter in options, then return the file path selected by the user, show the save dialog box with appropriate file type filter, after selecting the target path, read the source file and write it to the target position.
[0020] The further technical solution of the present application is that the step S20 further comprises:
[0021] Step S204, when the user triggered application file operation option is opening a folder, open the folder containing the specified file through shell.showItemInFolder, and display in the system file manager.
[0022] To achieve the above object, the application further provides an operating system, which comprises a memory, a processor and an electron-based desktop application file display program stored in the processor, and the electron-based desktop application file display program performs the steps of the method as described above when run by the processor.
[0023] To achieve the above object, the application further provides a computer readable storage medium, which stores an electron-based desktop application file display program, and the electron-based desktop application file display program performs the steps of the method as described above when run by a processor.
[0024] The electron-based desktop application file display method, operating system and medium of the application have the following advantages:
[0025] According to the technical scheme, after the log file.txt / screenshot path is acquired in the front end, the Electron dialog and shell modules are used to present application file operation options for the user to select, wherein the operation options include file opening, file copying, file saving as and file opening folder; when the user triggered application file operation option is received, the corresponding application file operation strategy is executed; and according to the operation result, the corresponding feedback information is displayed on the front end interface, so that the operation interface is intuitive and easy to use, the user can quickly access and operate the file, the user experience is improved, the file management function is enhanced, the file opening, copying, saving as and opening folder are supported, and various types of files such as text files and image files are supported. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from the drawings shown without creative labor.
[0027] Figure 1 is the flow of the preferred embodiment of the electron-based desktop application file display method of the application;
[0028] Figure 2is the overall flow schematic diagram of a preferred embodiment of the electron-based desktop application file display method of the present application.
[0029] Figure 3 is the hardware architecture schematic diagram of the operating system of the present application.
[0030] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0032] The present application provides an electron-based desktop application file display method, as shown in Figure 1 The preferred embodiment of the electron-based desktop application file display method of the present application comprises the following steps:
[0033] Step S10, after the front end obtains the log file.txt / screenshot path, the Electron dialog and shell modules are used to present application file operation options for user selection, wherein the operation options include file opening, file copying, file saving as and file folder opening.
[0034] In this embodiment, after the front end obtains the log file.txt / screenshot path, the right-click menu displays four operation options (open, copy, save as and open folder), and the implementation process mainly uses the Electron dialog and shell modules. The dialog and shell modules are two core modules provided by the Electron framework, which are used to interact with the system file manager and dialog box.
[0035] Step S20, when receiving the application file operation options triggered by the user, the corresponding application file operation strategy is executed.
[0036] Step S30, according to the operation result, the corresponding feedback information is displayed on the front-end interface.
[0037] Specifically, please refer to Figure 2 In this embodiment, the step S20 comprises:
[0038] Step S201, when the user triggered application file operation option is file opening, first verify whether the file path exists, if it exists, open the file of the specified path through shell.openPath.
[0039] This embodiment verifies whether the file path exists before attempting file opening. shell.openPath(path) can open the file of the specified path, path is the path of the file, through this method the default application program can open the file, and according to the operation result returns success or error status.
[0040] The step S20 further comprises:
[0041] Step S202, when the user triggered application file operation option is file copying, first verify whether the source file exists locally, and judge the application file type, then according to the verification result and the file type execute the corresponding application file operation strategy.
[0042] The step S202 specifically comprises:
[0043] When the source file exists locally and the application file is a text file, dialog.showOpenDialog pops up a dialog box for the user to select a file or folder, if the same name file already exists in the target folder, it is automatically renamed, then fs.copyFile copies the source file to the destination path, based on the source file address and the user selected target folder address, the file is copied to the target folder;
[0044] When the source file exists locally and the application file is an image file, clipboard.writeImage copies the image object to the system clipboard, so that the user can paste it at any time in any application.
[0045] The embodiment first verifies whether the source file exists locally when the user selects file copy. For a text file: dialog.showOpenDialog can pop up a dialog box to allow the user to select a file or folder. After clicking copy, the file folder selection box is popped up through this method to prompt the user to select the target folder. If the same name file already exists in the target folder, it is automatically renamed. Then, fs.copyFile can copy the source file to the destination path. The source file address is known, and the user-selected target folder address is also obtained. The file can be copied to the target folder through this method. For an image file: clipboard.writeImage can copy the image object to the system clipboard. The image is copied to the system clipboard using this method, and the user can paste it at any time in any application.
[0046] Further, the step S20 further comprises:
[0047] Step S203, when the user triggered application file operation option is file save as, first verify whether the source file exists, if exists, use file extension to determine the file type.
[0048] The step S203 specifically comprises:
[0049] dialog.showSaveDialogSync(options) allows the user to select the path of the saved file, and sets the file type according to the filter in options. The user-selected file path is returned. This method shows a save dialog box with appropriate file type filters. After selecting the target path, the source file is read and written to the target location.
[0050] In the embodiment, when the user selects file save as, after verifying whether the source file exists, the file extension is used to determine the file type.
[0051] dialog.showSaveDialogSync(options) allows the user to select the path of the saved file, and sets the file type according to the filter in options. The user-selected file path is returned. This method shows a save dialog box with appropriate file type filters. After selecting the target path, the source file is read and written to the target location.
[0052] Further, the step S20 further comprises:
[0053] Step S204, when the user triggered application file operation option is open folder, open the folder containing the specified file through shell.showItemInFolder, and display it in the system file manager.
[0054] In this embodiment, shell.showItemInFolder(path) can open the folder containing the specified file, and path is the path of the file, using this method to open the folder containing the file and display in the system file manager.
[0055] The electron-based desktop application file display method has the following advantages:
[0056] The electron-based desktop application file display method has the following advantages:
[0057] To achieve the above object, the application further provides an operating system, as shown in the accompanying drawings, the system comprises a processor 1001, a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002, and an electron-based desktop application file display program stored on the processor, wherein the communication bus 1002 is used to realize the connection communication between the components. The user interface 1003 can include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 can further include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can optionally be a storage device independent of the aforementioned processor 1001. Figure 3
[0058] Those skilled in the art can understand that the system structure shown in the accompanying drawings does not constitute a limitation on the system, and can include more or fewer components than the drawings, or combine certain components, or different component arrangements. Figure 3
[0059] As shown in the accompanying drawings, the system comprises a processor 1001, a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002, and an electron-based desktop application file display program stored on the processor, wherein the communication bus 1002 is used to realize the connection communication between the components. The user interface 1003 can include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 can further include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can optionally be a storage device independent of the aforementioned processor 1001. Figure 3 As shown, the memory 1005 as a computer storage medium can include an operating device, a network communication module, a user interface module and an electron-based desktop application file display program.
[0060] In Figure 3 In the system shown, the network interface 1004 is mainly used for connecting the network server and communicating data with the network server; the user interface 1003 is mainly used for interacting with the user terminal and receiving the instruction input by the user; and the processor 1001 can be used for calling the electron-based desktop application file display program stored in the memory 1005.
[0061] To achieve the above object, the application further provides a computer readable storage medium, which stores a decoding layer information based hierarchical adaptive code generation program.
[0062] The above description is only the preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation, direct / indirect application in other related technical fields within the concept of the present application, and the content of the present application specification and drawings are included in the patent protection scope of the present application.
Claims
1. An electron-based desktop application file presentation method, characterized by, The method comprises the following steps: Step S10, after obtaining the log file.txt / screenshot path at the front end, the Electron dialog and shell module are used to present application file operation options for user selection, wherein the operation options include file opening, file copying, file saving as, and file folder opening; Step S20, when receiving the application file operation options triggered by the user, the corresponding application file operation strategy is executed; Step S30, according to the operation result, the corresponding feedback information is displayed on the front-end interface.
2. The electron-based desktop application file presentation method of claim 1, wherein, The step S20 comprises: Step S201, when the application file operation option triggered by the user is file opening, it is verified whether the file path exists, if it exists, the file in the specified path is opened through shell.openPath.
3. The electron-based desktop application file presentation method of claim 1, wherein, The step S20 further comprises: Step S202, when the application file operation option triggered by the user is file copying, it is verified whether the source file exists in the local, and the application file type is judged, and then the corresponding application file operation strategy is executed according to the verification result and the file type.
4. The electron-based desktop application file presentation method of claim 3, wherein, The step S202 comprises: When the source file exists in the local and the application file is a text file, dialog.showOpenDialog pops up a dialog box for the user to select a file or a folder, if the same name file already exists in the target folder, it is automatically renamed, then fs.copyFile copies the source file to the destination path, based on the source file address and the target folder address selected by the user, the file is copied to the target folder; When the source file exists in the local and the application file is an image file, clipboard.writeImage copies the image object to the system clipboard, so that the user can paste it at any time in any application.
5. The electron-based desktop application file presentation method of claim 1, wherein, The step S20 further comprises: Step S203, when the application file operation option triggered by the user is file saving as, it is verified whether the source file exists, if it exists, the file extension is used to determine the file type.
6. The electron-based desktop application file presentation method of claim 5, wherein, The step S203 comprises: dialog.showSaveDialogSync is used to determine the path selected by the user to save the file, and the file type is set according to the filter in options, then the file path selected by the user is returned, a save dialog box with appropriate file type filter is displayed, after selecting the target path, the source file is read and written to the target position.
7. The electron-based desktop application file presentation method of claim 1, wherein, The step S20 further comprises: Step S204, when the application file operation option triggered by the user is file folder opening, the shell.showItemInFolder is used to open the folder containing the specified file, and the folder is displayed in the system file manager.
8. An operating system, characterized by The system comprises a memory, a processor and an electron-based desktop application file presentation program stored on the processor, which, when executed by the processor, performs the steps of the method of any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an electron-based desktop application file presentation program, which, when executed by a processor, performs the steps of the method of any one of claims 1 to 7.