From 2e15a67375e10a279cbc92a4d90c5f7f6ab90ec9 Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Thu, 10 May 2018 15:51:47 +0200 Subject: [PATCH] Add icons to the "SSH File Systems" view and improve some code flow --- resources/Icons.psd | Bin 0 -> 198678 bytes resources/config/Active.png | Bin 0 -> 867 bytes resources/config/Connecting.png | Bin 0 -> 868 bytes resources/config/Deleted.png | Bin 0 -> 1108 bytes resources/config/Error.png | Bin 0 -> 869 bytes resources/config/Idle.png | Bin 0 -> 869 bytes src/extension.ts | 2 +- src/manager.ts | 45 ++++++++++++++++++-------------- 8 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 resources/Icons.psd create mode 100644 resources/config/Active.png create mode 100644 resources/config/Connecting.png create mode 100644 resources/config/Deleted.png create mode 100644 resources/config/Error.png create mode 100644 resources/config/Idle.png diff --git a/resources/Icons.psd b/resources/Icons.psd new file mode 100644 index 0000000000000000000000000000000000000000..52083ef01365b1bdbff3209827128c519fb6840d GIT binary patch literal 198678 zcmeI53w%^XmhkI#9t09V2(Q^)W+S2kGvon+zyLyc2o4|u;yiTLkTfAfr@QHH0_}YJ ziL1caoM)SgpyAJw@X zOlwg5Jl#LKZk?)Ax9-2rJ?Gq;?#qPSg^QWSVUc^vu!cSVcUVSI!IWY5jGLc5-#f#(qG-+o zKIh^G7A(nsU}gTqf?>B!?KOGrq_xG~VrL*PV{Ng^?Vq%E%CNiw&obvE*hX>Iunf^9 zuyV?<>DZ9*z4;3>W_WzgjB%OcN9X5^oseA z&ZO*#ld^L%^w+SdytV4q}Wm)9KIm6?p?i9(M+go43rfIxuC}Fx-*((vPdy zYwpPH&lJa)neQpiTASz1%E`>miltPLZ|Zng`&?pb1^HP{m$TUE4){SYC#D`Coj>1H zjk&wx;+UHLz^oED0-Z=qP5+Xh*O|4*>G!Pm%Pz!FJs0GT<2ReM%+{6F7T}JkDQ#yTYc%J~ zynu5mXigZNJ#KVP_L7`&ld`iXjT`^1>@l#R3?h4W7-K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Active.png b/resources/config/Active.png new file mode 100644 index 0000000000000000000000000000000000000000..8435735bd05d003ad994ac537b74f5e7cb33c91d GIT binary patch literal 867 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=3?wxlRx~p(FnVW(M3hAM`dB6B=jtV<?;Zqle1Gx6p~WYGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&% zT$P<{nWAKG$7NGt1vDTxwIorYA~z?m*s8)-32d$vkPQ;nS5g2gDap1~as*kZ5aAo3 z;GAESs$i;TrkiYNY@uLosb^?vX<=ldqhMrUXr^yqsc&eaYhY+)U}!BPbD zzk=sFD`42Mq&xaLGB9lH=l+w(3gj~u2e~^jtUD+363D3w@Ck7R(hUCx426pqJq0>I zvn0qbn4#cI;Z>eLZ&-fjzg?xP{z>m*anS|8m7i6w{r2I17o+y;?8n%EbJ2k-nsX=5 z0&4p1>EamTas2JH<6_MU0>I$4_w(heH1^>OH)vttvM}bW5#11t~r{lt2NY?{t1~fDM(0Eb)m?j zMFL(QLqzgdZ%Rtm?u&mVe)CHH(=P7KkD?ZZtXp!+Unk;-+O@h9mv&U_-nB5q^|y<> z6Z7@Ld3yrtLg&QR{=8VfcXQA0P@74=c3$XqzvMC9EO?=(_0o@7eUHDENgrP=DL21Y b_6Kv_+zmP2^&1j^LBQbY>gTe~DWM4fMd>yD literal 0 HcmV?d00001 diff --git a/resources/config/Connecting.png b/resources/config/Connecting.png new file mode 100644 index 0000000000000000000000000000000000000000..42788a53a2c2199bab8064a80590fefeced8d24f GIT binary patch literal 868 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=3?wxlRx~p(FnVW(M3hAM`dB6B=jtV<?;Zqle1Gx6p~WYGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&% zT$P<{nWAKG$7NGt1vDTxwIorYA~z?m*s8)-32d$vkPQ;nS5g2gDap1~as*kZ5aAo3 z;GAESs$i;TrkiYNY@uLosb^?vX<=ldqhMrUXr^yqsc&eaYhY+)U}!BPbD zzk=sFD`42Mq&xaLGB9lH=l+w(3gj~u2e~^jtUD+363D3w@Ck7R(%+}Z4itJF%Xbmz z0?m>jzhH(xX9}76U~crS1tSA}SfvX7n`kbNy+)ClR+`iCoFCuS`;Ub8p?KSa9_A zik@X`%%zK0Oyzg`Q+d~D!+|u}C1$OsY;_NKDQYf^<#bhMXW6;Hpht+~lr;Lo+aCmO4@#bai$UY}I3`_SC^5mw#4&;CqUTUh8F zkJ>Mems|S2Uu*r8y!z(VVEMnh7oW0tcSd>T^wxVelia@ju@OC2(=WCDphcYj^1?lA ePycWJ$ZV%qyCG+}{R2=GGI+ZBxvX?;Zqle1Gx6p~WYGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&% zT$P<{nWAKG$7NGt1vDTxwIorYA~z?m*s8)-32d$vkPQ;nS5g2gDap1~as*kZ5aAo3 z;GAESs$i;TrkiYNY@uLosb^?vX<=ldqhMrUXr^yqsc&eaYhY+)U}!BPbD zzk=sFD`42Mq&xaLGB9lH=l+w(3gj~u2e~^jtUD+363Dp`;1l8sq#6DX45|cMoiED3 z_=kbxJpvE#+_D++Bp3oi7|PffVyzf#>lths81ls!R5ml% zG%}R4GPve3l(92tu3(6>WGE0}h_hhOT*<)vlOficVbY=`Eui_DB|(0{3tt;!s@ALNjmri9r?-{dA!EpM&>6<^x-kAANUghP&-&3au@7%HK zSTUz%rFWeNf7v>bE6#EbCSoslh;+KTx@cZV)ChPad{te2X?`yMv%GYp%;fL&f_8ToyXK#AXfAg|l z+~PXll`|ei-@lj2@N8aw?W8LOGw%KQ!7cN=?_k^f%4L6o_T2b!%1+mO_S2Jbu{nEw zoZJ2{ZT423TfQH?R_$)wRiT=Ab;~EyfNNRiYr|RBUk~G6AFlfI$ITz?wajyRwq<+D R#m)yMRZmwxmvv4FO#sWdmn8rI literal 0 HcmV?d00001 diff --git a/resources/config/Error.png b/resources/config/Error.png new file mode 100644 index 0000000000000000000000000000000000000000..8188bbf15bf9566191b534bcf3cadd159120b07c GIT binary patch literal 869 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=3?wxlRx~p(FnVW(M3hAM`dB6B=jtV<?;Zqle1Gx6p~WYGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&% zT$P<{nWAKG$7NGt1vDTxwIorYA~z?m*s8)-32d$vkPQ;nS5g2gDap1~as*kZ5aAo3 z;GAESs$i;TrkiYNY@uLosb^?vX<=ldqhMrUXr^yqsc&eaYhY+)U}!BPbD zzk=sFD`42Mq&xaLGB9lH=l+w(3gj~u2e~^jtUD+363D3w@Ck7R(*Fkz{oX%oC(s3& zB|(0{3|HTt`BT92hUI5rzIw6l1wXxupH>yE{QN8Co!W2yv#Qs8K1K%y#GYGWv8re? zP}5IO7sn8f<8PfT^qF>U;3zzn$Z$Ssa^bQCjq?f@?{1p5>u}F)MghLwdl7C8Lb|1H zam|fZ*ROOn30kd-W)r)yqWR9U4~hP&5fhnJH)uCzg*XHlu%-L%XeXJ_l+m_$Zs;$i`$s5k^8xF zQU3(C(nacGr}}j_t+tl?`+M>^i??T$SITm&tyK9cbM$HSj*i8bD|~-{+;#iwV^iIK d^Lr(KFhtvJ$oYPUy%QJ+44$rjF6*2UngG+oJ~jXV literal 0 HcmV?d00001 diff --git a/resources/config/Idle.png b/resources/config/Idle.png new file mode 100644 index 0000000000000000000000000000000000000000..1537ee99c24aa88360dda4f7585ca3081fce3595 GIT binary patch literal 869 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=3?wxlRx~p(FnVW(M3hAM`dB6B=jtV<?;Zqle1Gx6p~WYGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&% zT$P<{nWAKG$7NGt1vDTxwIorYA~z?m*s8)-32d$vkPQ;nS5g2gDap1~as*kZ5aAo3 z;GAESs$i;TrkiYNY@uLosb^?vX<=ldqhMrUXr^yqsc&eaYhY+)U}!BPbD zzk=sFD`42Mq&xaLGB9lH=l+w(3gj~u2e~^jtUD+363D3w@Ck7R(rX3|v{yum16`n5 z666=m@bgUJpQ}7?SPJsr7W-Ye_^D`>x}NUJ&+mTo`^5Y@t9DKGW8k^i=oJAvhj-`z zHU0E-aSZV|{&w1Ju_grp*T4{$vns~km)}kQ`CtCb@qo7OuP^G-*0UNHusMm{@PME#Gd|id9D2CIER1mhi}ut& zu>}h?M7Mr&?6zMU&BXR&N%NT{8w&kdB?OgKO|%#0-%b>oM|ui?bk$;3n|a@AI>oidpwoz@z&REAH7yT d-TaZ=PH^dloDC0?tAK&P;OXk;vd$@?2>@M|W)lDa literal 0 HcmV?d00001 diff --git a/src/extension.ts b/src/extension.ts index 15c20c8..d334b59 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -45,7 +45,7 @@ export function activate(context: vscode.ExtensionContext) { registerCommand('sshfs.disconnect', (name?: string) => pickAndClick(manager.commandDisconnect, name, true)); registerCommand('sshfs.reconnect', (name?: string) => pickAndClick(manager.commandReconnect, name, true)); registerCommand('sshfs.configure', (name?: string) => pickAndClick(manager.commandConfigure, name)); - registerCommand('sshfs.delete', (name?: string) => pickAndClick(manager.commandConfigDelete, name)); + registerCommand('sshfs.delete', (name?: string) => pickAndClick(manager.commandDelete, name)); vscode.window.createTreeView('sshfs-configs', { treeDataProvider: manager }); } diff --git a/src/manager.ts b/src/manager.ts index 339064a..1c67f8c 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -26,11 +26,15 @@ export interface FileSystemConfig extends ConnectConfig { function createTreeItem(manager: Manager, name: string): vscode.TreeItem { const config = manager.getConfig(name); const folders = vscode.workspace.workspaceFolders || []; - const active = folders.some(f => f.uri.scheme === 'ssh' && f.uri.authority === name); + const isConnected = folders.some(f => f.uri.scheme === 'ssh' && f.uri.authority === name); + const isActive = manager.getActive().some(f => f.name === name); + let status = isActive ? (config ? 'Active' : 'Deleted') : 'Idle'; + if (isConnected && !isActive) status = 'Connecting'; return { label: config && config.label || name, - contextValue: active ? 'active' : 'inactive', - tooltip: config ? (active ? 'Active' : 'Inactive') : 'Active but deleted', + contextValue: isConnected ? 'active' : 'inactive', + tooltip: status === 'Deleted' ? 'Active but deleted' : status, + iconPath: manager.context.asAbsolutePath(`resources/config/${status}.png`), }; } @@ -41,17 +45,24 @@ function createConfigFs(manager: Manager): SSHFileSystem { stat: (uri: vscode.Uri) => ({ type: vscode.FileType.File, ctime: 0, mtime: 0, size: 0 } as vscode.FileStat), readFile: async (uri: vscode.Uri) => { const name = uri.path.substring(1, uri.path.length - 12); - const config = manager.getConfig(name); + let config = manager.getConfig(name); + let activeButDeleted = false; + if (!config) { + config = config || manager.getActive().find(c => c.name === name); + activeButDeleted = true; + } let str; if (config) { str = JSON.stringify({ ...config, name: undefined }, undefined, 4); - str = `// If you haven't already, associate .jsonc files with "JSON with Comments (jsonc)"\n${str}`; + let prefix = `// If you haven't already, associate .jsonc files with "JSON with Comments (jsonc)\n`; + if (activeButDeleted) prefix += '// This configuration is deleted, but still active!\n'; + str = `${prefix}${str}`; } else { str = await toPromise(cb => readFile(path.resolve(__dirname, '../resources/defaultConfig.jsonc'), 'utf-8', cb)); } return new Uint8Array(new Buffer(str)); }, - writeFile: (uri: vscode.Uri, content: Uint8Array) => { + writeFile: async (uri: vscode.Uri, content: Uint8Array) => { const name = uri.path.substring(1, uri.path.length - 12); const errors: ParseError[] = []; const config = parseJsonc(new Buffer(content).toString(), errors); @@ -60,7 +71,7 @@ function createConfigFs(manager: Manager): SSHFileSystem { return; } config.name = name; - const loc = manager.updateConfig(name, config); + const loc = await manager.updateConfig(name, config); let dialog: Thenable; if (loc === vscode.ConfigurationTarget.Global) { dialog = vscode.window.showInformationMessage(`Config for '${name}' saved globally`, 'Connect', 'Okay'); @@ -71,7 +82,7 @@ function createConfigFs(manager: Manager): SSHFileSystem { } else { throw new Error(`This isn't supposed to happen! Config location was '${loc}' somehow`); } - dialog.then(o => o === 'Connect' && manager.commandReconnect(name)); + dialog.then(response => response === 'Connect' && manager.commandReconnect(name)); }, } as any; } @@ -86,7 +97,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid protected onDidChangeTreeDataEmitter = new vscode.EventEmitter(); protected skippedConfigNames: string[] = []; // private memento: vscode.Memento = this.context.globalState; - constructor(protected readonly context: vscode.ExtensionContext) { + constructor(public readonly context: vscode.ExtensionContext) { this.onDidChangeFile = this.onDidChangeFileEmitter.event; this.onDidChangeTreeData = this.onDidChangeTreeDataEmitter.event; const folderAdded = async (folder) => { @@ -121,12 +132,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid } public async registerFileSystem(name: string, config?: FileSystemConfig) { if (name === '') return; - // this.memento.update(`fs.config.${name}`, config); this.updateConfig(name, config); - // const configs: string[] = this.memento.get('fs.configs',[]); - // if (configs.indexOf(name) === -1) configs.push(name); - // this.memento.update('fs.configs', configs); - this.onDidChangeTreeDataEmitter.fire(); } public async createFileSystem(name: string, config?: FileSystemConfig): Promise { if (name === '') return this.configFileSystem; @@ -140,7 +146,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid if (!config) { throw new Error(`A SSH filesystem with the name '${name}' doesn't exist`); } - this.registerFileSystem(name, config); + this.registerFileSystem(name, { ...config }); if (config.putty) { let nameOnly = true; if (config.putty === true) { @@ -204,6 +210,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid this.fileSystems.push(fs); delete this.creatingFileSystems[name]; vscode.commands.executeCommand('workbench.files.action.refreshFilesExplorer'); + this.onDidChangeTreeDataEmitter.fire(); return resolve(fs); }); }); @@ -323,7 +330,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid public async commandConfigure(name: string) { vscode.window.showTextDocument(vscode.Uri.parse(`ssh:///${name}.sshfs.jsonc`), { preview: false }); } - public commandConfigDelete(name: string) { + public commandDelete(name: string) { this.commandDisconnect(name); this.updateConfig(name); } @@ -374,19 +381,19 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid return vscode.ConfigurationTarget.Global; } } - public updateConfig(name: string, config?: FileSystemConfig) { + public async updateConfig(name: string, config?: FileSystemConfig) { const conf = vscode.workspace.getConfiguration('sshfs'); const inspect = conf.inspect('configs')!; // const contains = (v?: FileSystemConfig[]) => v && v.find(c => c.name === name); const patch = (v: FileSystemConfig[]) => { const con = v.findIndex(c => c.name === name); - if (!config) return v.filter(c => c.name !== name); + if (!config) return v.filter(c => c.name.toLowerCase() !== name); v[con === -1 ? v.length : con] = config; return v; }; const loc = this.getConfigLocation(name); const array = [[], inspect.globalValue, inspect.workspaceValue, inspect.workspaceFolderValue][loc]; - conf.update('configs', patch(array || []), loc || vscode.ConfigurationTarget.Global); + await conf.update('configs', patch(array || []), loc || vscode.ConfigurationTarget.Global); this.onDidChangeTreeDataEmitter.fire(); return loc; }