Skip to content

Commit

Permalink
optimize custom viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
qishibo committed Aug 27, 2024
1 parent d78b891 commit 007ed03
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/components/viewers/ViewerCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export default {
}

this.fullCommand = this.fullCommand
.replace('{HEX}', '')
.replace('{HEX_FILE}', filePath);
.replace('{HEX_FILE}', filePath)
.replace('{HEX}', '<Content Too Long, Use {HEX_FILE} Instead!>');
this.previewCommand = this.previewCommand
.replace('{HEX}', '')
.replace('{HEX_FILE}', filePath);
.replace('{HEX_FILE}', filePath)
.replace('{HEX}', '<Content Too Long, Use {HEX_FILE} Instead!>');

this.exec();
});
Expand All @@ -117,17 +117,16 @@ export default {
// common content just exec
else {
this.fullCommand = this.fullCommand
.replace('{HEX_FILE}', '')
.replace(
'{HEX}',
hexStr,
);
.replace('{HEX}', hexStr)
.replace('{HEX_FILE}', '<Use {HEX} Instead!>');

this.previewCommand = this.previewCommand
.replace('{HEX_FILE}', '')
.replace(
'{HEX}',
this.$util.cutString(hexStr, this.previewContentMax),
);
'{HEX}',
this.$util.cutString(hexStr, this.previewContentMax),
)
.replace('{HEX_FILE}', '<Use {HEX} Instead!>');

this.exec();
}
},
Expand Down

0 comments on commit 007ed03

Please sign in to comment.