+
-
+
@@ -181,6 +181,7 @@
defalutLanguage: 'redis',
lineWrapping: false,
moblie: false,
+ panelReadOnly: true,
options: {
fontSize: 14,
contextmenu: true,
@@ -358,6 +359,8 @@
},
async requestStream(request, params, index) {
try {
+ const readOnly = this.panelReadOnly
+ this.options.readOnly = true
this.abortControllerAbort(index)
const queryString = this.buildQueryString(params);
let url = "/api/preview/text/stream"
@@ -386,6 +389,7 @@
throttledUpdateContent.cancel();
this.content = result;
this.setEditMap(index, this.content)
+ this.options.readOnly = readOnly
return;
}
result += decoder.decode(value, { stream: true });
@@ -648,11 +652,13 @@
checkReadOnly(fileUserId){
if(this.$store.state.user.token && this.$store.state.user.userId === fileUserId){
this.options.readOnly = false
+ this.panelReadOnly = false
}
if (!this.$pc) {
this.options.readOnly = true
+ this.panelReadOnly = false
}
- if(this.options.readOnly || this.moblie){
+ if(this.panelReadOnly || this.moblie){
this.$nextTick(()=> {
this.editorWidth += this.contentsWidth
this.contentsHide = true
-
+