diff --git a/web/src/store/index.js b/web/src/store/index.js index 536a1f4..48a4722 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -2,7 +2,7 @@ import { io } from 'socket.io-client' import { defineStore, acceptHMRUpdate } from 'pinia' import $api from '@/api' import config from '@/config' -// import ping from '@/utils/ping' +import { isHttps } from '@/utils' const { defaultClientPort } = config @@ -34,9 +34,12 @@ const useStore = defineStore({ ], terminalConfig: { ...{ - fontSize: 14, - themeName: localStorage.getItem('themeName') || 'Afterglow', - background: localStorage.getItem('terminalBackground') || '' + fontSize: 16, + themeName: 'Afterglow', + background: '', + quickCopy: isHttps(), + quickPaste: isHttps(), + autoExecuteScript: false }, ...(localStorage.getItem('terminalConfig') ? JSON.parse(localStorage.getItem('terminalConfig')) : {}) } diff --git a/web/src/utils/index.js b/web/src/utils/index.js index 713e216..f77bf7c 100644 --- a/web/src/utils/index.js +++ b/web/src/utils/index.js @@ -56,10 +56,10 @@ export const sortString = (arr = []) => { let c1 = '' let c2 = '' let temp = a.length > b.length ? b : a - for(let i = 0; i < temp.length; i++) { + for (let i = 0; i < temp.length; i++) { c1 = a[i].toLowerCase() c2 = b[i].toLowerCase() - if(c1 !== c2) break + if (c1 !== c2) break } return c1.charCodeAt() - c2.charCodeAt() }) @@ -83,10 +83,10 @@ export const sortDirTree = (tree = []) => { let c1 = '' let c2 = '' let temp = aName.length > bName.length ? bName : aName - for(let i = 0; i < temp.length; i++) { + for (let i = 0; i < temp.length; i++) { c1 = aName[i].toLowerCase() c2 = bName[i].toLowerCase() - if(c1 !== c2) break + if (c1 !== c2) break } return c1.charCodeAt() - c2.charCodeAt() }) @@ -128,3 +128,7 @@ export const exportFile = (data, filename, mimeType = 'application/json') =>{ document.body.removeChild(link) window.URL.revokeObjectURL(url) } + +export const isHttps = () => { + return window.location.protocol === 'https:' +} diff --git a/web/src/views/setting/index.vue b/web/src/views/setting/index.vue index 19cbfb4..a059d26 100644 --- a/web/src/views/setting/index.vue +++ b/web/src/views/setting/index.vue @@ -4,20 +4,13 @@ - - - diff --git a/web/src/views/terminal/components/terminal-setting.vue b/web/src/views/terminal/components/terminal-setting.vue index 91e8b62..a60a69e 100644 --- a/web/src/views/terminal/components/terminal-setting.vue +++ b/web/src/views/terminal/components/terminal-setting.vue @@ -3,59 +3,120 @@ v-model="visible" width="600px" top="120px" - title="终端设置" + title="本地设置" :append-to-body="false" :close-on-click-modal="false" > - - - - - - - - -
- -
-
- - - -
+ + + + + + + + + + + + +
    +
  • + + + +
  • +
  • + +
  • +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + +