mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Support mounted file icon (#7496)
This commit is contained in:
@@ -76,7 +76,7 @@ export class HdfsProvider implements vscode.TreeDataProvider<TreeNode>, ITreeCha
|
||||
}
|
||||
|
||||
export abstract class HdfsFileSourceNode extends TreeNode {
|
||||
constructor(protected context: TreeDataContext, protected _path: string, public readonly fileSource: IFileSource) {
|
||||
constructor(protected context: TreeDataContext, protected _path: string, public readonly fileSource: IFileSource, protected mountStatus?: MountStatus) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -88,6 +88,11 @@ export abstract class HdfsFileSourceNode extends TreeNode {
|
||||
return this.getDisplayName();
|
||||
}
|
||||
|
||||
|
||||
protected isMounted(): boolean {
|
||||
return this.mountStatus === MountStatus.Mount || this.mountStatus === MountStatus.Mount_Child;
|
||||
}
|
||||
|
||||
getDisplayName(): string {
|
||||
return fspath.basename(this._path);
|
||||
}
|
||||
@@ -104,8 +109,8 @@ export abstract class HdfsFileSourceNode extends TreeNode {
|
||||
export class FolderNode extends HdfsFileSourceNode {
|
||||
private children: TreeNode[];
|
||||
protected _nodeType: string;
|
||||
constructor(context: TreeDataContext, path: string, fileSource: IFileSource, nodeType?: string, private mountStatus?: MountStatus) {
|
||||
super(context, path, fileSource);
|
||||
constructor(context: TreeDataContext, path: string, fileSource: IFileSource, nodeType?: string, mountStatus?: MountStatus) {
|
||||
super(context, path, fileSource, mountStatus);
|
||||
this._nodeType = nodeType ? nodeType : Constants.MssqlClusterItems.Folder;
|
||||
}
|
||||
|
||||
@@ -179,10 +184,6 @@ export class FolderNode extends HdfsFileSourceNode {
|
||||
return nodeInfo;
|
||||
}
|
||||
|
||||
private isMounted(): boolean {
|
||||
return this.mountStatus === MountStatus.Mount || this.mountStatus === MountStatus.Mount_Child;
|
||||
}
|
||||
|
||||
private getSubType(): string | undefined {
|
||||
if (this.mountStatus === MountStatus.Mount) {
|
||||
return Constants.MssqlClusterItemsSubType.Mount;
|
||||
@@ -269,8 +270,8 @@ export class ConnectionNode extends FolderNode {
|
||||
|
||||
export class FileNode extends HdfsFileSourceNode implements IFileNode {
|
||||
|
||||
constructor(context: TreeDataContext, path: string, fileSource: IFileSource, private mountStatus?: MountStatus) {
|
||||
super(context, path, fileSource);
|
||||
constructor(context: TreeDataContext, path: string, fileSource: IFileSource, mountStatus?: MountStatus) {
|
||||
super(context, path, fileSource, mountStatus);
|
||||
}
|
||||
|
||||
public onChildRemoved(): void {
|
||||
@@ -303,7 +304,7 @@ export class FileNode extends HdfsFileSourceNode implements IFileNode {
|
||||
nodeStatus: undefined,
|
||||
nodeType: Constants.MssqlClusterItems.File,
|
||||
nodeSubType: this.getSubType(),
|
||||
iconType: 'FileGroupFile'
|
||||
iconType: this.isMounted() ? 'FileGroupFile_mounted' : 'FileGroupFile'
|
||||
};
|
||||
return nodeInfo;
|
||||
}
|
||||
|
||||
11
src/sql/media/objectTypes/FileGroupFile_mounted.svg
Normal file
11
src/sql/media/objectTypes/FileGroupFile_mounted.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="15.996" height="16" viewBox="0 0 15.996 16">
|
||||
<title>FileGroupFile_mounted_V2</title>
|
||||
<path d="M15.984,16h-16V0h16Z" fill="#f6f6f6" fill-opacity="0"/>
|
||||
<path d="M14.985,0V15h-14V0Z" fill="#f6f6f6"/>
|
||||
<path d="M1.986,1V2h1V3h-1V4h1V5h-1V6h1V7h-1V8h1V9h-1v1h1v1h-1v1h1v1h-1v1h12V1Zm11,12h-9V2h9Zm-2-9V6h-5V4Z" fill="#424242"/>
|
||||
<path d="M4,2V12.987h8.991V2Zm6.993,3v1h-5V4h5Z" fill="#f0eff1"/>
|
||||
<path d="M7.2,15.961a2.559,2.559,0,0,1-.263-.013H4.139L3.9,15.332a4.765,4.765,0,0,0-.436-.823l-.044-.066-.039-.077a1.8,1.8,0,0,1,.081-1.723,1.376,1.376,0,0,1,1.143-.657,1.241,1.241,0,0,1,.684.2l.081.058a4.7,4.7,0,0,1,.72.718h.3L4.836,9.973h2.3a2.641,2.641,0,0,1,2.85,2.415V12.4a2.593,2.593,0,0,1-.007.506,2.793,2.793,0,0,1-2.514,3.042C7.378,15.957,7.287,15.961,7.2,15.961Z" fill="#f0eff1"/>
|
||||
<path d="M7.138,10.978H6.471l.518,1c.379,0,1,0,1,1,0,.379,0,1-.777,1H5.573a3.719,3.719,0,0,0-.827-.937c-.288-.189-.747.289-.458.927a5.667,5.667,0,0,1,.528,1H6.989a1.8,1.8,0,0,0,2-1.57,1.769,1.769,0,0,0,0-.424C8.982,11.477,8.255,10.978,7.138,10.978Z" fill="#424242"/>
|
||||
<path d="M2.906,15.961A2.664,2.664,0,0,1,.012,13.548h0a2.576,2.576,0,0,1,0-.512A2.793,2.793,0,0,1,2.526,9.99a2.75,2.75,0,0,1,.529,0h2.83l.253.62a4.821,4.821,0,0,0,.435.822l.044.066.034.075A1.793,1.793,0,0,1,6.57,13.3a1.376,1.376,0,0,1-1.146.653,1.249,1.249,0,0,1-.684-.2l-.081-.058a4.593,4.593,0,0,1-.715-.72H3.6l1.615,2.994Z" fill="#f0eff1"/>
|
||||
<path d="M2.905,14.965h.638l-.538-1c-.369,0-1,0-1-1,0-.369,0-1,.777-1H4.458a3.714,3.714,0,0,0,.827.936c.288.19.747-.289.458-.926a5.671,5.671,0,0,1-.528-1H3.005A1.8,1.8,0,0,0,1.01,12.553a1.727,1.727,0,0,0,0,.431C1.01,14.467,1.776,14.965,2.905,14.965Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -171,6 +171,12 @@
|
||||
background: url("FileGroupFile.svg") center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .icon.filegroupfile_mounted,
|
||||
.vs-dark .icon.filegroupfile_mounted,
|
||||
.hc-black .icon.filegroupfile_mounted {
|
||||
background: url("FileGroupFile_mounted.svg") center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .icon.folder,
|
||||
.vs-dark .icon.folder,
|
||||
.hc-black .icon.folder {
|
||||
|
||||
Reference in New Issue
Block a user