mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Differentiated server icons by server type: box, big data cluster, cloud... (#5241)
This commit is contained in:
@@ -418,6 +418,22 @@
|
|||||||
"connectionProvider": {
|
"connectionProvider": {
|
||||||
"providerId": "MSSQL",
|
"providerId": "MSSQL",
|
||||||
"displayName": "%mssql.provider.displayName%",
|
"displayName": "%mssql.provider.displayName%",
|
||||||
|
"iconPath": [
|
||||||
|
{
|
||||||
|
"id": "mssql:cloud",
|
||||||
|
"path": {
|
||||||
|
"light": "resources/light/azureDB.svg",
|
||||||
|
"dark": "resources/dark/azureDB_inverse.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mssql:cluster",
|
||||||
|
"path": {
|
||||||
|
"light": "resources/light/sql_bigdata_cluster.svg",
|
||||||
|
"dark": "resources/dark/sql_bigdata_cluster_inverse.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"connectionOptions": [
|
"connectionOptions": [
|
||||||
{
|
{
|
||||||
"specialValueType": "connectionName",
|
"specialValueType": "connectionName",
|
||||||
|
|||||||
45
extensions/mssql/resources/dark/azureDB_inverse.svg
Normal file
45
extensions/mssql/resources/dark/azureDB_inverse.svg
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
id="Layer_1"
|
||||||
|
data-name="Layer 1"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
version="1.1">
|
||||||
|
<metadata
|
||||||
|
id="metadata16">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>azureDB</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<style
|
||||||
|
id="style2">.cls-1{fill:#212121;}</style>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title6">azureDB</title>
|
||||||
|
<g
|
||||||
|
style="fill:#ffffff"
|
||||||
|
id="iconFg"
|
||||||
|
transform="translate(-0.005)">
|
||||||
|
<path
|
||||||
|
style="fill:#ffffff"
|
||||||
|
d="m 3.92,7.11 v 1 h 2 v 3 h -3 v -1 h 2 v -1 h -2 v -3 h 3 v 1 z m 6.59,5.31 -1.34,-1.34 H 6.9 v -5 h 3 v 4.26 l 1.35,1.34 z M 7.89,10.09 h 1 v -3 h -1 z m 4,0 v -4 h -1 v 5 h 2 v -1 z"
|
||||||
|
id="path8" />
|
||||||
|
</g>
|
||||||
|
<path
|
||||||
|
class="cls-1"
|
||||||
|
d="m 7.995,0 c -2.4,0 -6.43,0.49 -6.54,2.16 V 13.7 c 0,1.78 4.11,2.3 6.54,2.3 2.43,0 6.55,-0.48 6.55,-2.26 V 2.16 C 14.425,0.49 10.395,0 7.995,0 Z m 5.44,13.7 c -0.14,0.4 -2.18,1.16 -5.45,1.16 -3.27,0 -5.32,-0.77 -5.43,-1.16 V 3.53 a 14.47,14.47 0 0 0 5.44,0.88 14.51,14.51 0 0 0 5.45,-0.88 z m 0,-11.48 c -0.17,0.38 -2.19,1.09 -5.44,1.09 -3.25,0 -5.2,-0.69 -5.43,-1.08 0.22,-0.39 2.21,-1.09 5.43,-1.09 3.22,0 5.27,0.72 5.45,1.06 v 0 z"
|
||||||
|
id="path11"
|
||||||
|
style="fill:#ffffff" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
data-name="Layer 1"
|
||||||
|
id="Layer_1">
|
||||||
|
<metadata
|
||||||
|
id="metadata17">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>sql_bigdata_cluster</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<style
|
||||||
|
id="style2">.cls-1{fill:#212121;}.cls-2{fill:#231f20;}</style>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title6">sql_bigdata_cluster</title>
|
||||||
|
<path
|
||||||
|
style="fill:#ffffff;stroke-width:1.00282443"
|
||||||
|
id="path8"
|
||||||
|
d="M 7.995,0 C 5.605,0 1.575,0.45254557 1.465,2.1319925 V 13.737272 C 1.465,15.517285 5.575,16 7.995,16 c 2.42,0 6.54,-0.482715 6.54,-2.262728 V 2.1319925 C 14.435,0.45254557 10.405,0 7.995,0 Z m 5.45,13.737272 c -0.14,0.392206 -2.18,1.166562 -5.45,1.166562 -3.27,0 -5.32,-0.784412 -5.43,-1.166562 V 3.5097423 a 14.67,14.752986 0 0 0 5.43,0.8749214 14.71,14.793212 0 0 0 5.45,-0.8749214 z m 0,-11.5549967 c -0.17,0.3922062 -2.19,1.1062225 -5.45,1.1062225 -3.26,0 -5.2,-0.6939032 -5.43,-1.0861094 0.23,-0.4022627 2.22,-1.1062225 5.43,-1.1062225 3.21,0 5.27,0.7240729 5.45,1.0659963 v 0 z"
|
||||||
|
class="cls-1" />
|
||||||
|
<polygon
|
||||||
|
style="fill:#ffffff"
|
||||||
|
transform="translate(0.075)"
|
||||||
|
id="polygon10"
|
||||||
|
points="13.57,2.35 13.58,2.36 13.57,2.37 "
|
||||||
|
class="cls-2" />
|
||||||
|
<path
|
||||||
|
style="fill:#ffffff"
|
||||||
|
id="path12"
|
||||||
|
d="m 9.6501562,5.2372858 c -0.1362374,0 -0.2728654,0.026375 -0.4003906,0.082031 -0.123585,0.050567 -0.2358691,0.1260731 -0.3300781,0.2207031 -0.094256,0.096634 -0.1724299,0.2082024 -0.2304688,0.3300781 -0.062701,0.1283175 -0.099426,0.2676857 -0.109375,0.4101562 -0.00186,0.1267925 0.022265,0.2517914 0.070312,0.3691407 0.045212,0.1164344 0.1088696,0.2248797 0.1894531,0.3203125 L 8.2107031,7.9384577 C 8.011051,7.8519995 7.7980699,7.8002026 7.5798437,7.7997858 7.2852043,7.7997877 7.0158159,7.8890317 6.7790625,8.0283014 L 6.3435156,7.4677545 C 6.4851678,7.2819801 6.5620085,7.0548883 6.5622656,6.8212702 6.5623837,6.2311827 6.0839937,5.7527927 5.4939062,5.7529108 4.9038187,5.7527927 4.4254288,6.2311827 4.4255469,6.8212702 4.4254288,7.4113576 4.9038188,7.8897476 5.4939062,7.8896295 5.646983,7.8892233 5.7981841,7.8559185 5.9372656,7.7919733 l 0.4628906,0.5351562 c -0.2593431,0.2844532 -0.4218723,0.6589599 -0.421875,1.0742188 1.1e-6,0.1550931 0.029186,0.301527 0.070312,0.4433594 L 5.2692969,10.19041 C 5.0668671,9.9352433 4.7590727,9.7863779 4.4333593,9.7861139 3.8432718,9.7859958 3.3648819,10.264386 3.365,10.854473 c -1.179e-4,0.590087 0.478272,1.068477 1.0683593,1.068359 0.5900874,1.18e-4 1.0684773,-0.478272 1.0683594,-1.068359 -2.425e-4,-0.05958 -0.00547,-0.119029 -0.015625,-0.177734 l 0.7675782,-0.376953 c 0.2881162,0.42403 0.7748778,0.703124 1.3261718,0.703124 0.087028,-9e-5 0.1739047,-0.0073 0.2597656,-0.02148 l 0.2011719,0.597656 c -0.2806104,0.199117 -0.4474678,0.523359 -0.4472656,0.869137 -8.57e-5,0.586839 0.4721644,1.062587 1.0546875,1.0625 0.5825231,8.7e-5 1.054773,-0.475661 1.054687,-1.0625 8.6e-5,-0.586839 -0.4721639,-1.062587 -1.054687,-1.0625 -0.043779,5.16e-4 -0.087483,0.0038 -0.1308594,0.0098 L 8.3220312,10.819317 C 8.6909643,10.625493 8.9698168,10.295494 9.099375,9.8993953 l 0.5449219,0.089844 h 0.00195 c 0.05025,0.5310507 0.4958731,0.9369327 1.0292971,0.9374997 0.571737,8.6e-5 1.035243,-0.46342 1.035156,-1.0351567 C 11.710786,9.3198482 11.247281,8.8563402 10.675544,8.8564264 10.264465,8.85697 9.8926723,9.100743 9.7282783,9.4775202 L 9.1814062,9.3798639 C 9.1740509,8.9410593 8.9869509,8.524497 8.6638281,8.2275202 L 9.3103125,7.2607233 c 0.1095989,0.036162 0.2244742,0.051906 0.3398437,0.048828 0.1376991,0.0043 0.2729851,-0.023148 0.3984378,-0.080078 0.126162,-0.045588 0.239468,-0.119827 0.330078,-0.21875 0.09823,-0.093286 0.176943,-0.2056351 0.230469,-0.3300781 0.05137,-0.1271794 0.07858,-0.2632358 0.08008,-0.4003907 -4.88e-4,-0.140498 -0.02772,-0.2797842 -0.08008,-0.4101562 C 10.551096,5.7482226 10.472932,5.6366542 10.378672,5.5400202 10.284463,5.44539 10.172179,5.369883 10.048594,5.3193171 9.9210683,5.2636605 9.7863933,5.2372858 9.6501562,5.2372858 Z m -0.00195,0.4746094 C 9.9659223,5.7112473 10.223947,5.9683972 10.224378,6.2861139 10.225028,6.6045936 9.9666863,6.8629356 9.6482062,6.8622858 9.3304864,6.8618548 9.0733369,6.6038302 9.0739843,6.2861139 9.0744163,5.9691601 9.3312493,5.7123255 9.6482031,5.7118952 Z m -4.1543,0.4941406 C 5.8337444,6.2059063 6.1092701,6.481432 6.1091406,6.8212702 6.1092701,7.1611084 5.8337444,7.4366342 5.4939062,7.4365045 5.1540681,7.436634 4.8785424,7.1611083 4.8786719,6.8212702 4.8785424,6.481432 5.154068,6.2059063 5.4939062,6.2060358 Z M 7.5817969,8.3700983 A 1.0403689,1.0403689 0 0 1 8.6228125,9.4111139 1.0403689,1.0403689 0 0 1 7.5817969,10.450176 1.0403689,1.0403689 0 0 1 6.5427343,9.4111139 1.0403689,1.0403689 0 0 1 7.5817969,8.3700983 Z m 3.0585941,0.9277344 h 0.002 c 0.01432,-5.13e-4 0.02865,-5.13e-4 0.04297,0 0.331066,2.151e-4 0.599395,0.2685422 0.59961,0.5996096 -2.16e-4,0.3310657 -0.268544,0.5993937 -0.59961,0.5996087 -0.331828,8.64e-4 -0.601347,-0.26778 -0.601562,-0.5996087 -7.66e-4,-0.3150021 0.242463,-0.5768467 0.556641,-0.5996096 z M 4.4216406,10.260723 c 0.3398381,-1.3e-4 0.6153637,0.275396 0.6152344,0.615234 1.299e-4,0.339838 -0.2753959,0.615365 -0.6152344,0.615235 -0.3398385,1.3e-4 -0.6153643,-0.275397 -0.6152344,-0.615235 -1.293e-4,-0.339838 0.2753963,-0.615364 0.6152344,-0.615234 z m 4.2382813,1.589844 c 0.3452152,-8.4e-5 0.6250885,0.272792 0.625,0.609375 8.81e-5,0.336583 -0.2797848,0.609459 -0.625,0.609375 -0.3452157,8.4e-5 -0.6250889,-0.272792 -0.625,-0.609375 -8.86e-5,-0.336583 0.2797844,-0.609459 0.625,-0.609375 z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.9 KiB |
43
extensions/mssql/resources/light/azureDB.svg
Normal file
43
extensions/mssql/resources/light/azureDB.svg
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
id="Layer_1"
|
||||||
|
data-name="Layer 1"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
version="1.1">
|
||||||
|
<metadata
|
||||||
|
id="metadata16">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>azureDB</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<style
|
||||||
|
id="style2">.cls-1{fill:#212121;}</style>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title6">azureDB</title>
|
||||||
|
<g
|
||||||
|
id="iconFg"
|
||||||
|
transform="translate(-0.005)">
|
||||||
|
<path
|
||||||
|
d="m 3.92,7.11 v 1 h 2 v 3 h -3 v -1 h 2 v -1 h -2 v -3 h 3 v 1 z m 6.59,5.31 -1.34,-1.34 H 6.9 v -5 h 3 v 4.26 l 1.35,1.34 z M 7.89,10.09 h 1 v -3 h -1 z m 4,0 v -4 h -1 v 5 h 2 v -1 z"
|
||||||
|
id="path8" />
|
||||||
|
</g>
|
||||||
|
<path
|
||||||
|
class="cls-1"
|
||||||
|
d="m 7.995,0 c -2.4,0 -6.43,0.49 -6.54,2.16 V 13.7 c 0,1.78 4.11,2.3 6.54,2.3 2.43,0 6.55,-0.48 6.55,-2.26 V 2.16 C 14.425,0.49 10.395,0 7.995,0 Z m 5.44,13.7 c -0.14,0.4 -2.18,1.16 -5.45,1.16 -3.27,0 -5.32,-0.77 -5.43,-1.16 V 3.53 a 14.47,14.47 0 0 0 5.44,0.88 14.51,14.51 0 0 0 5.45,-0.88 z m 0,-11.48 c -0.17,0.38 -2.19,1.09 -5.44,1.09 -3.25,0 -5.2,-0.69 -5.43,-1.08 0.22,-0.39 2.21,-1.09 5.43,-1.09 3.22,0 5.27,0.72 5.45,1.06 v 0 z"
|
||||||
|
id="path11"
|
||||||
|
style="fill:#212121" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.6 KiB |
45
extensions/mssql/resources/light/sql_bigdata_cluster.svg
Normal file
45
extensions/mssql/resources/light/sql_bigdata_cluster.svg
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
data-name="Layer 1"
|
||||||
|
id="Layer_1">
|
||||||
|
<metadata
|
||||||
|
id="metadata17">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>sql_bigdata_cluster</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<style
|
||||||
|
id="style2">.cls-1{fill:#212121;}.cls-2{fill:#231f20;}</style>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title6">sql_bigdata_cluster</title>
|
||||||
|
<path
|
||||||
|
style="fill:#212121;stroke-width:1.00282443"
|
||||||
|
id="path8"
|
||||||
|
d="M 7.995,0 C 5.605,0 1.575,0.45254557 1.465,2.1319925 V 13.737272 C 1.465,15.517285 5.575,16 7.995,16 c 2.42,0 6.54,-0.482715 6.54,-2.262728 V 2.1319925 C 14.435,0.45254557 10.405,0 7.995,0 Z m 5.45,13.737272 c -0.14,0.392206 -2.18,1.166562 -5.45,1.166562 -3.27,0 -5.32,-0.784412 -5.43,-1.166562 V 3.5097423 a 14.67,14.752986 0 0 0 5.43,0.8749214 14.71,14.793212 0 0 0 5.45,-0.8749214 z m 0,-11.5549967 c -0.17,0.3922062 -2.19,1.1062225 -5.45,1.1062225 -3.26,0 -5.2,-0.6939032 -5.43,-1.0861094 0.23,-0.4022627 2.22,-1.1062225 5.43,-1.1062225 3.21,0 5.27,0.7240729 5.45,1.0659963 v 0 z"
|
||||||
|
class="cls-1" />
|
||||||
|
<polygon
|
||||||
|
style="fill:#231f20"
|
||||||
|
transform="translate(0.075)"
|
||||||
|
id="polygon10"
|
||||||
|
points="13.57,2.35 13.58,2.36 13.57,2.37 "
|
||||||
|
class="cls-2" />
|
||||||
|
<path
|
||||||
|
id="path12"
|
||||||
|
d="m 9.6501562,5.2372858 c -0.1362374,0 -0.2728654,0.026375 -0.4003906,0.082031 -0.123585,0.050567 -0.2358691,0.1260731 -0.3300781,0.2207031 -0.094256,0.096634 -0.1724299,0.2082024 -0.2304688,0.3300781 -0.062701,0.1283175 -0.099426,0.2676857 -0.109375,0.4101562 -0.00186,0.1267925 0.022265,0.2517914 0.070312,0.3691407 0.045212,0.1164344 0.1088696,0.2248797 0.1894531,0.3203125 L 8.2107031,7.9384577 C 8.011051,7.8519995 7.7980699,7.8002026 7.5798437,7.7997858 7.2852043,7.7997877 7.0158159,7.8890317 6.7790625,8.0283014 L 6.3435156,7.4677545 C 6.4851678,7.2819801 6.5620085,7.0548883 6.5622656,6.8212702 6.5623837,6.2311827 6.0839937,5.7527927 5.4939062,5.7529108 4.9038187,5.7527927 4.4254288,6.2311827 4.4255469,6.8212702 4.4254288,7.4113576 4.9038188,7.8897476 5.4939062,7.8896295 5.646983,7.8892233 5.7981841,7.8559185 5.9372656,7.7919733 l 0.4628906,0.5351562 c -0.2593431,0.2844532 -0.4218723,0.6589599 -0.421875,1.0742188 1.1e-6,0.1550931 0.029186,0.301527 0.070312,0.4433594 L 5.2692969,10.19041 C 5.0668671,9.9352433 4.7590727,9.7863779 4.4333593,9.7861139 3.8432718,9.7859958 3.3648819,10.264386 3.365,10.854473 c -1.179e-4,0.590087 0.478272,1.068477 1.0683593,1.068359 0.5900874,1.18e-4 1.0684773,-0.478272 1.0683594,-1.068359 -2.425e-4,-0.05958 -0.00547,-0.119029 -0.015625,-0.177734 l 0.7675782,-0.376953 c 0.2881162,0.42403 0.7748778,0.703124 1.3261718,0.703124 0.087028,-9e-5 0.1739047,-0.0073 0.2597656,-0.02148 l 0.2011719,0.597656 c -0.2806104,0.199117 -0.4474678,0.523359 -0.4472656,0.869137 -8.57e-5,0.586839 0.4721644,1.062587 1.0546875,1.0625 0.5825231,8.7e-5 1.054773,-0.475661 1.054687,-1.0625 8.6e-5,-0.586839 -0.4721639,-1.062587 -1.054687,-1.0625 -0.043779,5.16e-4 -0.087483,0.0038 -0.1308594,0.0098 L 8.3220312,10.819317 C 8.6909643,10.625493 8.9698168,10.295494 9.099375,9.8993953 l 0.5449219,0.089844 h 0.00195 c 0.05025,0.5310507 0.4958731,0.9369327 1.0292971,0.9374997 0.571737,8.6e-5 1.035243,-0.46342 1.035156,-1.0351567 C 11.710786,9.3198482 11.247281,8.8563402 10.675544,8.8564264 10.264465,8.85697 9.8926723,9.100743 9.7282783,9.4775202 L 9.1814062,9.3798639 C 9.1740509,8.9410593 8.9869509,8.524497 8.6638281,8.2275202 L 9.3103125,7.2607233 c 0.1095989,0.036162 0.2244742,0.051906 0.3398437,0.048828 0.1376991,0.0043 0.2729851,-0.023148 0.3984378,-0.080078 0.126162,-0.045588 0.239468,-0.119827 0.330078,-0.21875 0.09823,-0.093286 0.176943,-0.2056351 0.230469,-0.3300781 0.05137,-0.1271794 0.07858,-0.2632358 0.08008,-0.4003907 -4.88e-4,-0.140498 -0.02772,-0.2797842 -0.08008,-0.4101562 C 10.551096,5.7482226 10.472932,5.6366542 10.378672,5.5400202 10.284463,5.44539 10.172179,5.369883 10.048594,5.3193171 9.9210683,5.2636605 9.7863933,5.2372858 9.6501562,5.2372858 Z m -0.00195,0.4746094 C 9.9659223,5.7112473 10.223947,5.9683972 10.224378,6.2861139 10.225028,6.6045936 9.9666863,6.8629356 9.6482062,6.8622858 9.3304864,6.8618548 9.0733369,6.6038302 9.0739843,6.2861139 9.0744163,5.9691601 9.3312493,5.7123255 9.6482031,5.7118952 Z m -4.1543,0.4941406 C 5.8337444,6.2059063 6.1092701,6.481432 6.1091406,6.8212702 6.1092701,7.1611084 5.8337444,7.4366342 5.4939062,7.4365045 5.1540681,7.436634 4.8785424,7.1611083 4.8786719,6.8212702 4.8785424,6.481432 5.154068,6.2059063 5.4939062,6.2060358 Z M 7.5817969,8.3700983 A 1.0403689,1.0403689 0 0 1 8.6228125,9.4111139 1.0403689,1.0403689 0 0 1 7.5817969,10.450176 1.0403689,1.0403689 0 0 1 6.5427343,9.4111139 1.0403689,1.0403689 0 0 1 7.5817969,8.3700983 Z m 3.0585941,0.9277344 h 0.002 c 0.01432,-5.13e-4 0.02865,-5.13e-4 0.04297,0 0.331066,2.151e-4 0.599395,0.2685422 0.59961,0.5996096 -2.16e-4,0.3310657 -0.268544,0.5993937 -0.59961,0.5996087 -0.331828,8.64e-4 -0.601347,-0.26778 -0.601562,-0.5996087 -7.66e-4,-0.3150021 0.242463,-0.5768467 0.556641,-0.5996096 z M 4.4216406,10.260723 c 0.3398381,-1.3e-4 0.6153637,0.275396 0.6152344,0.615234 1.299e-4,0.339838 -0.2753959,0.615365 -0.6152344,0.615235 -0.3398385,1.3e-4 -0.6153643,-0.275397 -0.6152344,-0.615235 -1.293e-4,-0.339838 0.2753963,-0.615364 0.6152344,-0.615234 z m 4.2382813,1.589844 c 0.3452152,-8.4e-5 0.6250885,0.272792 0.625,0.609375 8.81e-5,0.336583 -0.2797848,0.609459 -0.625,0.609375 -0.3452157,8.4e-5 -0.6250889,-0.272792 -0.625,-0.609375 -8.86e-5,-0.336583 0.2797844,-0.609459 0.625,-0.609375 z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.9 KiB |
28
extensions/mssql/src/iconProvider.ts
Normal file
28
extensions/mssql/src/iconProvider.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as azdata from 'azdata';
|
||||||
|
import * as constants from './constants';
|
||||||
|
|
||||||
|
const cloudIcon = 'mssql:cloud';
|
||||||
|
const clusterIcon = 'mssql:cluster';
|
||||||
|
|
||||||
|
export class MssqlIconProvider implements azdata.IconProvider {
|
||||||
|
public readonly providerId: string = constants.sqlProviderName;
|
||||||
|
public handle: number;
|
||||||
|
getConnectionIconId(connection: azdata.IConnectionProfile, serverInfo: azdata.ServerInfo): Thenable<string> {
|
||||||
|
let iconName: string = undefined;
|
||||||
|
if (connection.providerName === 'MSSQL') {
|
||||||
|
if (serverInfo.isCloud) {
|
||||||
|
iconName = cloudIcon;
|
||||||
|
} else if (serverInfo.options['isBigDataCluster']) {
|
||||||
|
iconName = clusterIcon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.resolve(iconName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ import { OpenSparkYarnHistoryTask } from './sparkFeature/historyTask';
|
|||||||
import { MssqlObjectExplorerNodeProvider, mssqlOutputChannel } from './objectExplorerNodeProvider/objectExplorerNodeProvider';
|
import { MssqlObjectExplorerNodeProvider, mssqlOutputChannel } from './objectExplorerNodeProvider/objectExplorerNodeProvider';
|
||||||
import { CmsService } from './cms/cmsService';
|
import { CmsService } from './cms/cmsService';
|
||||||
import { registerSearchServerCommand } from './objectExplorerNodeProvider/command';
|
import { registerSearchServerCommand } from './objectExplorerNodeProvider/command';
|
||||||
|
import { MssqlIconProvider } from './iconProvider';
|
||||||
|
|
||||||
const baseConfig = require('./config.json');
|
const baseConfig = require('./config.json');
|
||||||
const outputChannel = vscode.window.createOutputChannel(Constants.serviceName);
|
const outputChannel = vscode.window.createOutputChannel(Constants.serviceName);
|
||||||
@@ -110,7 +111,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<MssqlE
|
|||||||
|
|
||||||
let nodeProvider = new MssqlObjectExplorerNodeProvider(prompter, appContext);
|
let nodeProvider = new MssqlObjectExplorerNodeProvider(prompter, appContext);
|
||||||
azdata.dataprotocol.registerObjectExplorerNodeProvider(nodeProvider);
|
azdata.dataprotocol.registerObjectExplorerNodeProvider(nodeProvider);
|
||||||
|
let iconProvider = new MssqlIconProvider();
|
||||||
|
azdata.dataprotocol.registerIconProvider(iconProvider);
|
||||||
cmsService = new CmsService(appContext, languageClient);
|
cmsService = new CmsService(appContext, languageClient);
|
||||||
|
|
||||||
activateSparkFeatures(appContext);
|
activateSparkFeatures(appContext);
|
||||||
|
|||||||
7
src/sql/azdata.proposed.d.ts
vendored
7
src/sql/azdata.proposed.d.ts
vendored
@@ -26,6 +26,8 @@ declare module 'azdata' {
|
|||||||
|
|
||||||
export function registerObjectExplorerNodeProvider(provider: ObjectExplorerNodeProvider): vscode.Disposable;
|
export function registerObjectExplorerNodeProvider(provider: ObjectExplorerNodeProvider): vscode.Disposable;
|
||||||
|
|
||||||
|
export function registerIconProvider(provider: IconProvider): vscode.Disposable;
|
||||||
|
|
||||||
export function registerTaskServicesProvider(provider: TaskServicesProvider): vscode.Disposable;
|
export function registerTaskServicesProvider(provider: TaskServicesProvider): vscode.Disposable;
|
||||||
|
|
||||||
export function registerFileBrowserProvider(provider: FileBrowserProvider): vscode.Disposable;
|
export function registerFileBrowserProvider(provider: FileBrowserProvider): vscode.Disposable;
|
||||||
@@ -1228,6 +1230,10 @@ declare module 'azdata' {
|
|||||||
handleSessionClose(closeSessionInfo: ObjectExplorerCloseSessionInfo): void;
|
handleSessionClose(closeSessionInfo: ObjectExplorerCloseSessionInfo): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IconProvider extends DataProvider {
|
||||||
|
getConnectionIconId(connection: IConnectionProfile, serverInfo: ServerInfo): Thenable<string>;
|
||||||
|
}
|
||||||
|
|
||||||
// Admin Services interfaces -----------------------------------------------------------------------
|
// Admin Services interfaces -----------------------------------------------------------------------
|
||||||
export interface DatabaseInfo {
|
export interface DatabaseInfo {
|
||||||
options: {};
|
options: {};
|
||||||
@@ -3963,6 +3969,7 @@ declare module 'azdata' {
|
|||||||
DacFxServicesProvider = 'DacFxServicesProvider',
|
DacFxServicesProvider = 'DacFxServicesProvider',
|
||||||
SchemaCompareServicesProvider = 'SchemaCompareServicesProvider',
|
SchemaCompareServicesProvider = 'SchemaCompareServicesProvider',
|
||||||
ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider',
|
ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider',
|
||||||
|
IconProvider = 'IconProvider'
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace dataprotocol {
|
export namespace dataprotocol {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
|
|||||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||||
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||||
import { IServerGroupDialogCallbacks } from 'sql/platform/serverGroup/common/serverGroupController';
|
import { IServerGroupDialogCallbacks } from 'sql/platform/serverGroup/common/serverGroupController';
|
||||||
|
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
|
||||||
|
|
||||||
export const VIEWLET_ID = 'workbench.view.connections';
|
export const VIEWLET_ID = 'workbench.view.connections';
|
||||||
|
|
||||||
@@ -182,6 +183,8 @@ export interface IConnectionManagementService {
|
|||||||
*/
|
*/
|
||||||
registerProvider(providerId: string, provider: azdata.ConnectionProvider): void;
|
registerProvider(providerId: string, provider: azdata.ConnectionProvider): void;
|
||||||
|
|
||||||
|
registerIconProvider(providerId: string, provider: azdata.IconProvider): void;
|
||||||
|
|
||||||
editGroup(group: ConnectionProfileGroup): Promise<void>;
|
editGroup(group: ConnectionProfileGroup): Promise<void>;
|
||||||
|
|
||||||
getConnectionProfile(fileUri: string): IConnectionProfile;
|
getConnectionProfile(fileUri: string): IConnectionProfile;
|
||||||
@@ -273,6 +276,10 @@ export interface IConnectionManagementService {
|
|||||||
* Get connection profile by id
|
* Get connection profile by id
|
||||||
*/
|
*/
|
||||||
getConnectionProfileById(profileId: string): IConnectionProfile;
|
getConnectionProfileById(profileId: string): IConnectionProfile;
|
||||||
|
|
||||||
|
getProviderProperties(providerName: string): ConnectionProviderProperties;
|
||||||
|
|
||||||
|
getConnectionIconId(connectionId: string): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum RunQueryOnConnectionMode {
|
export enum RunQueryOnConnectionMode {
|
||||||
|
|||||||
@@ -52,12 +52,15 @@ import { IConnectionDialogService } from 'sql/workbench/services/connection/comm
|
|||||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
|
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
|
||||||
|
|
||||||
_serviceBrand: any;
|
_serviceBrand: any;
|
||||||
|
|
||||||
private _providers = new Map<string, { onReady: Thenable<azdata.ConnectionProvider>, properties: ConnectionProviderProperties }>();
|
private _providers = new Map<string, { onReady: Thenable<azdata.ConnectionProvider>, properties: ConnectionProviderProperties }>();
|
||||||
|
private _iconProviders = new Map<string, azdata.IconProvider>();
|
||||||
|
private _connectionIconIdCache = new Map<string, string>();
|
||||||
|
|
||||||
private _uriToProvider: { [uri: string]: string; } = Object.create(null);
|
private _uriToProvider: { [uri: string]: string; } = Object.create(null);
|
||||||
|
|
||||||
@@ -176,6 +179,10 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
(this._providers.get(providerId).onReady as Deferred<azdata.ConnectionProvider>).resolve(provider);
|
(this._providers.get(providerId).onReady as Deferred<azdata.ConnectionProvider>).resolve(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public registerIconProvider(providerId: string, iconProvider: azdata.IconProvider): void {
|
||||||
|
this._iconProviders.set(providerId, iconProvider);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the connection dialog
|
* Opens the connection dialog
|
||||||
* @param params Include the uri, type of connection
|
* @param params Include the uri, type of connection
|
||||||
@@ -543,10 +550,27 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
if (options.showDashboard) {
|
if (options.showDashboard) {
|
||||||
this.showDashboardForConnectionManagementInfo(connectionManagementInfo.connectionProfile);
|
this.showDashboardForConnectionManagementInfo(connectionManagementInfo.connectionProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let connectionProfile = connectionManagementInfo.connectionProfile;
|
||||||
this._onConnect.fire(<IConnectionParams>{
|
this._onConnect.fire(<IConnectionParams>{
|
||||||
connectionUri: uri,
|
connectionUri: uri,
|
||||||
connectionProfile: connectionManagementInfo.connectionProfile
|
connectionProfile: connectionProfile
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let iconProvider = this._iconProviders.get(connectionManagementInfo.providerId);
|
||||||
|
if (iconProvider) {
|
||||||
|
let serverInfo: azdata.ServerInfo = this.getServerInfo(connectionProfile.id);
|
||||||
|
let profile: interfaces.IConnectionProfile = connectionProfile.toIConnectionProfile();
|
||||||
|
iconProvider.getConnectionIconId(profile, serverInfo).then(iconId => {
|
||||||
|
if (iconId) {
|
||||||
|
this._connectionIconIdCache.set(connectionProfile.id, iconId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public getConnectionIconId(connectionId: string): string {
|
||||||
|
return this._connectionIconIdCache.get(connectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public showDashboard(connection: IConnectionProfile): Thenable<boolean> {
|
public showDashboard(connection: IConnectionProfile): Thenable<boolean> {
|
||||||
@@ -1392,4 +1416,9 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
}
|
}
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getProviderProperties(providerName: string): ConnectionProviderProperties {
|
||||||
|
let connectionProvider = this._providers.get(providerName);
|
||||||
|
return connectionProvider && connectionProvider.properties;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
src/sql/sqlops.proposed.d.ts
vendored
3
src/sql/sqlops.proposed.d.ts
vendored
@@ -1598,7 +1598,8 @@ declare module 'sqlops' {
|
|||||||
CapabilitiesProvider = 'CapabilitiesProvider',
|
CapabilitiesProvider = 'CapabilitiesProvider',
|
||||||
DacFxServicesProvider = 'DacFxServicesProvider',
|
DacFxServicesProvider = 'DacFxServicesProvider',
|
||||||
SchemaCompareServicesProvider = 'SchemaCompareServicesProvider',
|
SchemaCompareServicesProvider = 'SchemaCompareServicesProvider',
|
||||||
ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider'
|
ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider',
|
||||||
|
IconProvider = 'IconProvider'
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace dataprotocol {
|
export namespace dataprotocol {
|
||||||
|
|||||||
@@ -292,7 +292,8 @@ export enum DataProviderType {
|
|||||||
CapabilitiesProvider = 'CapabilitiesProvider',
|
CapabilitiesProvider = 'CapabilitiesProvider',
|
||||||
DacFxServicesProvider = 'DacFxServicesProvider',
|
DacFxServicesProvider = 'DacFxServicesProvider',
|
||||||
SchemaCompareServicesProvider = 'SchemaCompareServicesProvider',
|
SchemaCompareServicesProvider = 'SchemaCompareServicesProvider',
|
||||||
ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider'
|
ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider',
|
||||||
|
IconProvider = 'IconProvider'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DeclarativeDataType {
|
export enum DeclarativeDataType {
|
||||||
|
|||||||
@@ -136,6 +136,12 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
|||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$registerIconProvider(provider: azdata.IconProvider): vscode.Disposable {
|
||||||
|
let rt = this.registerProvider(provider, DataProviderType.IconProvider);
|
||||||
|
this._proxy.$registerIconProvider(provider.providerId, provider.handle);
|
||||||
|
return rt;
|
||||||
|
}
|
||||||
|
|
||||||
$registerProfilerProvider(provider: azdata.ProfilerProvider): vscode.Disposable {
|
$registerProfilerProvider(provider: azdata.ProfilerProvider): vscode.Disposable {
|
||||||
let rt = this.registerProvider(provider, DataProviderType.ProfilerProvider);
|
let rt = this.registerProvider(provider, DataProviderType.ProfilerProvider);
|
||||||
this._proxy.$registerProfilerProvider(provider.providerId, provider.handle);
|
this._proxy.$registerProfilerProvider(provider.providerId, provider.handle);
|
||||||
@@ -330,6 +336,10 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
|||||||
this._proxy.$onEditSessionReady(handle, ownerUri, success, message);
|
this._proxy.$onEditSessionReady(handle, ownerUri, success, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public $getConnectionIconId(handle: number, connection: azdata.IConnectionProfile, serverInfo: azdata.ServerInfo): Thenable<string> {
|
||||||
|
return this._resolveProvider<azdata.IconProvider>(handle).getConnectionIconId(connection, serverInfo);
|
||||||
|
}
|
||||||
|
|
||||||
// Metadata handlers
|
// Metadata handlers
|
||||||
public $getMetadata(handle: number, connectionUri: string): Thenable<azdata.ProviderMetadata> {
|
public $getMetadata(handle: number, connectionUri: string): Thenable<azdata.ProviderMetadata> {
|
||||||
return this._resolveProvider<azdata.MetadataProvider>(handle).getMetadata(connectionUri);
|
return this._resolveProvider<azdata.MetadataProvider>(handle).getMetadata(connectionUri);
|
||||||
|
|||||||
@@ -278,6 +278,16 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public $registerIconProvider(providerId: string, handle: number): Promise<any> {
|
||||||
|
const self = this;
|
||||||
|
this._connectionManagementService.registerIconProvider(providerId, <azdata.IconProvider>{
|
||||||
|
getConnectionIconId(connection: azdata.IConnectionProfile, serverInfo: azdata.ServerInfo): Thenable<string> {
|
||||||
|
return self._proxy.$getConnectionIconId(handle, connection, serverInfo);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
public $registerTaskServicesProvider(providerId: string, handle: number): Promise<any> {
|
public $registerTaskServicesProvider(providerId: string, handle: number): Promise<any> {
|
||||||
const self = this;
|
const self = this;
|
||||||
this._taskService.registerProvider(providerId, <azdata.TaskServicesProvider>{
|
this._taskService.registerProvider(providerId, <azdata.TaskServicesProvider>{
|
||||||
|
|||||||
@@ -269,6 +269,10 @@ export function createApiFactory(
|
|||||||
return extHostDataProvider.$registerObjectExplorerNodeProvider(provider);
|
return extHostDataProvider.$registerObjectExplorerNodeProvider(provider);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let registerIconProvider = (provider: azdata.IconProvider): vscode.Disposable => {
|
||||||
|
return extHostDataProvider.$registerIconProvider(provider);
|
||||||
|
};
|
||||||
|
|
||||||
let registerTaskServicesProvider = (provider: azdata.TaskServicesProvider): vscode.Disposable => {
|
let registerTaskServicesProvider = (provider: azdata.TaskServicesProvider): vscode.Disposable => {
|
||||||
provider.registerOnTaskCreated((response: azdata.TaskInfo) => {
|
provider.registerOnTaskCreated((response: azdata.TaskInfo) => {
|
||||||
extHostDataProvider.$onTaskCreated(provider.handle, response);
|
extHostDataProvider.$onTaskCreated(provider.handle, response);
|
||||||
@@ -365,6 +369,7 @@ export function createApiFactory(
|
|||||||
registerMetadataProvider,
|
registerMetadataProvider,
|
||||||
registerObjectExplorerProvider,
|
registerObjectExplorerProvider,
|
||||||
registerObjectExplorerNodeProvider,
|
registerObjectExplorerNodeProvider,
|
||||||
|
registerIconProvider,
|
||||||
registerProfilerProvider,
|
registerProfilerProvider,
|
||||||
registerRestoreProvider,
|
registerRestoreProvider,
|
||||||
registerScriptingProvider,
|
registerScriptingProvider,
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ export abstract class ExtHostDataProtocolShape {
|
|||||||
|
|
||||||
$getServerCapabilities(handle: number, client: azdata.DataProtocolClientCapabilities): Thenable<azdata.DataProtocolServerCapabilities> { throw ni(); }
|
$getServerCapabilities(handle: number, client: azdata.DataProtocolClientCapabilities): Thenable<azdata.DataProtocolServerCapabilities> { throw ni(); }
|
||||||
|
|
||||||
|
$getConnectionIconId(handle: number, connection: azdata.IConnectionProfile, serverInfo: azdata.ServerInfo): Thenable<string> { throw ni(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata service methods
|
* Metadata service methods
|
||||||
*
|
*
|
||||||
@@ -541,6 +543,7 @@ export interface MainThreadDataProtocolShape extends IDisposable {
|
|||||||
$registerProfilerProvider(providerId: string, handle: number): Promise<any>;
|
$registerProfilerProvider(providerId: string, handle: number): Promise<any>;
|
||||||
$registerObjectExplorerProvider(providerId: string, handle: number): Promise<any>;
|
$registerObjectExplorerProvider(providerId: string, handle: number): Promise<any>;
|
||||||
$registerObjectExplorerNodeProvider(providerId: string, supportedProviderId: string, group: string, handle: number): Promise<any>;
|
$registerObjectExplorerNodeProvider(providerId: string, supportedProviderId: string, group: string, handle: number): Promise<any>;
|
||||||
|
$registerIconProvider(providerId: string, handle: number): Promise<any>;
|
||||||
$registerMetadataProvider(providerId: string, handle: number): Promise<any>;
|
$registerMetadataProvider(providerId: string, handle: number): Promise<any>;
|
||||||
$registerTaskServicesProvider(providerId: string, handle: number): Promise<any>;
|
$registerTaskServicesProvider(providerId: string, handle: number): Promise<any>;
|
||||||
$registerFileBrowserProvider(providerId: string, handle: number): Promise<any>;
|
$registerFileBrowserProvider(providerId: string, handle: number): Promise<any>;
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import { Event, Emitter } from 'vs/base/common/event';
|
|||||||
import { deepClone } from 'vs/base/common/objects';
|
import { deepClone } from 'vs/base/common/objects';
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
import * as path from 'path';
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
export interface ConnectionProviderProperties {
|
export interface ConnectionProviderProperties {
|
||||||
providerId: string;
|
providerId: string;
|
||||||
@@ -66,6 +68,47 @@ const ConnectionProviderContrib: IJSONSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
description: localize('schema.displayName', "Display Name for the provider")
|
description: localize('schema.displayName', "Display Name for the provider")
|
||||||
},
|
},
|
||||||
|
iconPath: {
|
||||||
|
description: localize('schema.iconPath', 'Icon path for the server type'),
|
||||||
|
oneOf: [
|
||||||
|
{
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
id: {
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
path: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
light: {
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
type: 'string',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
light: {
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
type: 'string',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
connectionOptions: {
|
connectionOptions: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
description: localize('schema.connectionOptions', "Options for connection"),
|
description: localize('schema.connectionOptions', "Options for connection"),
|
||||||
@@ -123,6 +166,7 @@ ExtensionsRegistry.registerExtensionPoint<ConnectionProviderProperties | Connect
|
|||||||
|
|
||||||
for (let extension of extensions) {
|
for (let extension of extensions) {
|
||||||
const { value } = extension;
|
const { value } = extension;
|
||||||
|
resolveIconPath(extension);
|
||||||
if (Array.isArray<ConnectionProviderProperties>(value)) {
|
if (Array.isArray<ConnectionProviderProperties>(value)) {
|
||||||
for (let command of value) {
|
for (let command of value) {
|
||||||
handleCommand(command, extension);
|
handleCommand(command, extension);
|
||||||
@@ -132,3 +176,39 @@ ExtensionsRegistry.registerExtensionPoint<ConnectionProviderProperties | Connect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function resolveIconPath(extension: IExtensionPointUser<any>): void {
|
||||||
|
if (!extension || !extension.value) { return undefined; }
|
||||||
|
|
||||||
|
let toAbsolutePath = (iconPath: any, baseDir: string) => {
|
||||||
|
if (!iconPath || !baseDir) { return; }
|
||||||
|
if (Array.isArray(iconPath)) {
|
||||||
|
for (let e of iconPath) {
|
||||||
|
e.path = {
|
||||||
|
light: URI.file(path.join(baseDir, e.path.light)),
|
||||||
|
dark: URI.file(path.join(baseDir, e.path.dark))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else if (typeof iconPath === 'string') {
|
||||||
|
iconPath = {
|
||||||
|
light: URI.file(path.join(baseDir, iconPath)),
|
||||||
|
dark: URI.file(path.join(baseDir, iconPath))
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
iconPath = {
|
||||||
|
light: URI.file(path.join(baseDir, iconPath.light)),
|
||||||
|
dark: URI.file(path.join(baseDir, iconPath.dark))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let baseDir = extension.description.extensionLocation.fsPath;
|
||||||
|
let properties: ConnectionProviderProperties = extension.value;
|
||||||
|
if (Array.isArray<ConnectionProviderProperties>(properties)) {
|
||||||
|
for (let p of properties) {
|
||||||
|
toAbsolutePath(p['iconPath'], baseDir);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
toAbsolutePath(properties['iconPath'], baseDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,25 +10,35 @@ export class ServerInfoContextKey implements IContextKey<ServerInfo> {
|
|||||||
|
|
||||||
static ServerInfo = new RawContextKey<ServerInfo>('serverInfo', undefined);
|
static ServerInfo = new RawContextKey<ServerInfo>('serverInfo', undefined);
|
||||||
static ServerMajorVersion = new RawContextKey<string>('serverMajorVersion', undefined);
|
static ServerMajorVersion = new RawContextKey<string>('serverMajorVersion', undefined);
|
||||||
|
static IsCloud = new RawContextKey<boolean>('isCloud', undefined);
|
||||||
|
static IsBigDataCluster = new RawContextKey<boolean>('isBigDataCluster', undefined);
|
||||||
|
|
||||||
private _serverInfo: IContextKey<ServerInfo>;
|
private _serverInfo: IContextKey<ServerInfo>;
|
||||||
private _serverMajorVersion: IContextKey<string>;
|
private _serverMajorVersion: IContextKey<string>;
|
||||||
|
private _isCloud: IContextKey<boolean>;
|
||||||
|
private _isBigDataCluster: IContextKey<boolean>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IContextKeyService contextKeyService: IContextKeyService
|
@IContextKeyService contextKeyService: IContextKeyService
|
||||||
) {
|
) {
|
||||||
this._serverInfo = ServerInfoContextKey.ServerInfo.bindTo(contextKeyService);
|
this._serverInfo = ServerInfoContextKey.ServerInfo.bindTo(contextKeyService);
|
||||||
this._serverMajorVersion = ServerInfoContextKey.ServerMajorVersion.bindTo(contextKeyService);
|
this._serverMajorVersion = ServerInfoContextKey.ServerMajorVersion.bindTo(contextKeyService);
|
||||||
|
this._isCloud = ServerInfoContextKey.IsCloud.bindTo(contextKeyService);
|
||||||
|
this._isBigDataCluster = ServerInfoContextKey.IsBigDataCluster.bindTo(contextKeyService);
|
||||||
}
|
}
|
||||||
|
|
||||||
set(value: ServerInfo) {
|
set(value: ServerInfo) {
|
||||||
this._serverInfo.set(value);
|
this._serverInfo.set(value);
|
||||||
let majorVersion = value && value.serverMajorVersion;
|
let majorVersion = value && value.serverMajorVersion;
|
||||||
this._serverMajorVersion.set(majorVersion && `${majorVersion}`);
|
this._serverMajorVersion.set(majorVersion && `${majorVersion}`);
|
||||||
|
this._isCloud.set(value && value.isCloud);
|
||||||
|
this._isBigDataCluster.set(value && value.options && value.options['isBigDataCluster']);
|
||||||
}
|
}
|
||||||
|
|
||||||
reset(): void {
|
reset(): void {
|
||||||
this._serverMajorVersion.reset();
|
this._serverMajorVersion.reset();
|
||||||
|
this._isCloud.reset();
|
||||||
|
this._isBigDataCluster.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): ServerInfo {
|
public get(): ServerInfo {
|
||||||
|
|||||||
@@ -98,22 +98,13 @@ margin-bottom: 2px;
|
|||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page.connected {
|
.monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page {
|
||||||
background: url('connected_active_server.svg') center center no-repeat;
|
background: url('default_server.svg') center center no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vs-dark .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page.connected,
|
.vs-dark .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page,
|
||||||
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page.connected{
|
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page{
|
||||||
background: url('connected_active_server_inverse.svg') center center no-repeat;
|
background: url('default_server_inverse.svg') center center no-repeat;
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page.disconnected {
|
|
||||||
background: url('disconnected_server.svg') center center no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vs-dark .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page.disconnected,
|
|
||||||
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content > .connection-tile > .icon.server-page.disconnected{
|
|
||||||
background: url('disconnected_server_inverse.svg') center center no-repeat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loading for OE node */
|
/* loading for OE node */
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
data-name="Layer 1"
|
||||||
|
id="Layer_1">
|
||||||
|
<metadata
|
||||||
|
id="metadata15">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>server_16x16</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<style
|
||||||
|
id="style2">.cls-1{fill:#212121;}.cls-2{fill:#231f20;}</style>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title6">server_16x16</title>
|
||||||
|
<path
|
||||||
|
style="fill:#212121"
|
||||||
|
id="path8"
|
||||||
|
d="m 2.735,0 v 16 h 10.53 V 0 Z m 1,1 h 8.53 v 9 h -8.53 z m 8.53,14 h -8.53 v -4 h 8.53 z"
|
||||||
|
class="cls-1" />
|
||||||
|
<path
|
||||||
|
style="fill:#231f20"
|
||||||
|
id="path10"
|
||||||
|
d="M 7.125,4.23 H 4.675 V 1.77 h 2.45 z m -2,-0.5 h 1.5 V 2.27 h -1.45 z"
|
||||||
|
class="cls-2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
data-name="Layer 1"
|
||||||
|
id="Layer_1">
|
||||||
|
<metadata
|
||||||
|
id="metadata15">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>server_16x16</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<style
|
||||||
|
id="style2">.cls-1{fill:#212121;}.cls-2{fill:#231f20;}</style>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title6">server_16x16</title>
|
||||||
|
<path
|
||||||
|
style="fill:#ffffff"
|
||||||
|
id="path8"
|
||||||
|
d="m 2.735,0 v 16 h 10.53 V 0 Z m 1,1 h 8.53 v 9 h -8.53 z m 8.53,14 h -8.53 v -4 h 8.53 z"
|
||||||
|
class="cls-1" />
|
||||||
|
<path
|
||||||
|
style="fill:#ffffff"
|
||||||
|
id="path10"
|
||||||
|
d="M 7.125,4.23 H 4.675 V 1.77 h 2.45 z m -2,-0.5 h 1.5 V 2.27 h -1.45 z"
|
||||||
|
class="cls-2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
137
src/sql/workbench/parts/objectExplorer/browser/iconRenderer.ts
Normal file
137
src/sql/workbench/parts/objectExplorer/browser/iconRenderer.ts
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import { createCSSRule } from 'vs/base/browser/dom';
|
||||||
|
import { hash } from 'vs/base/common/hash';
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
|
class IconRenderer {
|
||||||
|
private iconRegistered: Set<string> = new Set<string>();
|
||||||
|
|
||||||
|
public registerIcon(path: URI | IconPath): string {
|
||||||
|
if (!path) { return undefined; }
|
||||||
|
let iconPath: IconPath = this.toIconPath(path);
|
||||||
|
let iconUid: string = this.getIconUid(iconPath);
|
||||||
|
if (!this.iconRegistered.has(iconUid)) {
|
||||||
|
createCSSRule(`.icon#${iconUid}`, `background: url("${iconPath.light.toString()}") center center no-repeat`);
|
||||||
|
createCSSRule(`.vs-dark .icon#${iconUid}, .hc-black .icon#${iconUid}`, `background: url("${iconPath.dark.toString()}") center center no-repeat`);
|
||||||
|
this.iconRegistered.add(iconUid);
|
||||||
|
}
|
||||||
|
return iconUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getIconUid(path: URI | IconPath): string {
|
||||||
|
if (!path) { return undefined; }
|
||||||
|
let iconPath: IconPath = this.toIconPath(path);
|
||||||
|
return `icon${hash(iconPath.light.toString() + iconPath.dark.toString())}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
private toIconPath(path: URI | IconPath): IconPath {
|
||||||
|
if (path['light']) {
|
||||||
|
return path as IconPath;
|
||||||
|
} else {
|
||||||
|
let singlePath = path as URI;
|
||||||
|
return { light: singlePath, dark: singlePath };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public putIcon(element: HTMLElement, path: URI | IconPath): void {
|
||||||
|
if (!element || !path) { return undefined; }
|
||||||
|
let iconUid: string = this.registerIcon(path);
|
||||||
|
element.id = iconUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeIcon(element: HTMLElement): void {
|
||||||
|
if (!element) { return undefined; }
|
||||||
|
element.id = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const iconRenderer: IconRenderer = new IconRenderer();
|
||||||
|
|
||||||
|
class BadgeRenderer {
|
||||||
|
public readonly serverConnected: string = 'serverConnected';
|
||||||
|
public readonly serverDisconnected: string = 'serverDisconnected';
|
||||||
|
public readonly newTag: string = 'newTag';
|
||||||
|
|
||||||
|
private badgeCreated: Set<string> = new Set<string>();
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.createBadge(this.serverConnected, this.getConnectionStatusBadge(true));
|
||||||
|
this.createBadge(this.serverDisconnected, this.getConnectionStatusBadge(false));
|
||||||
|
this.createBadge(this.newTag, this.getNewTagBadge());
|
||||||
|
}
|
||||||
|
|
||||||
|
private getConnectionStatusBadge(isConnected: boolean) {
|
||||||
|
let circleColor: string = isConnected ? 'rgba(59, 180, 74, 100%)' : 'rgba(208, 46, 0, 100%)';
|
||||||
|
let bgColor: string = isConnected ? 'rgba(59, 180, 74, 100%)' : 'rgba(255, 255, 255, 80%)';
|
||||||
|
return `position: absolute;
|
||||||
|
height: 0.25rem;
|
||||||
|
width: 0.25rem;
|
||||||
|
top: 14px;
|
||||||
|
left: 19px;
|
||||||
|
border: 0.12rem solid ${circleColor};
|
||||||
|
border-radius: 100%;
|
||||||
|
background: ${bgColor};
|
||||||
|
content:"";
|
||||||
|
font-size: 100%;
|
||||||
|
line-height: 100%;
|
||||||
|
color:white;
|
||||||
|
text-align:center;
|
||||||
|
vertical-align:middle;`
|
||||||
|
.replace(/\t/g, ' ').replace(/\r?\n/g, ' ').replace(/ +/g, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
private getNewTagBadge(): string {
|
||||||
|
return `position: absolute;
|
||||||
|
height: 0.4rem;
|
||||||
|
width: 0.4rem;
|
||||||
|
top: 3px;
|
||||||
|
left: 5px;
|
||||||
|
border: 1px solid green;
|
||||||
|
border-radius: 15%;
|
||||||
|
background: green;
|
||||||
|
content:"N";
|
||||||
|
font-size: 0.3rem;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 0.4rem;
|
||||||
|
color: white;
|
||||||
|
text-align:center;
|
||||||
|
vertical-align:middle;`
|
||||||
|
.replace(/\t/g, ' ').replace(/\r?\n/g, ' ').replace(/ +/g, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
private createBadge(badgeClass: string, badge: string): void {
|
||||||
|
if (!this.badgeCreated.has(badgeClass)) {
|
||||||
|
createCSSRule(`.${badgeClass}:after`, badge);
|
||||||
|
this.badgeCreated.add(badgeClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public addBadge(element: HTMLElement, badgeClass: string): void {
|
||||||
|
element.innerHTML = (element.innerHTML || '') +
|
||||||
|
`<div class="${badgeClass}" style="width: 0px; height: 0px;"><div>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeBadge(element: HTMLElement, badgeClass: string): void {
|
||||||
|
let children: HTMLCollection = element.children;
|
||||||
|
let current = children[0];
|
||||||
|
while (current) {
|
||||||
|
let next = current.nextElementSibling;
|
||||||
|
if (current.classList.contains(badgeClass)) {
|
||||||
|
current.remove();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
current = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const badgeRenderer: BadgeRenderer = new BadgeRenderer();
|
||||||
|
|
||||||
|
interface IconPath {
|
||||||
|
light: URI;
|
||||||
|
dark: URI;
|
||||||
|
}
|
||||||
@@ -14,6 +14,9 @@ import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree';
|
|||||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||||
import { TreeNode } from 'sql/workbench/parts/objectExplorer/common/treeNode';
|
import { TreeNode } from 'sql/workbench/parts/objectExplorer/common/treeNode';
|
||||||
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||||
|
import { badgeRenderer, iconRenderer } from 'sql/workbench/parts/objectExplorer/browser/iconRenderer';
|
||||||
|
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
export interface IConnectionTemplateData {
|
export interface IConnectionTemplateData {
|
||||||
root: HTMLElement;
|
root: HTMLElement;
|
||||||
@@ -56,7 +59,8 @@ export class ServerTreeRenderer implements IRenderer {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
isCompact: boolean,
|
isCompact: boolean,
|
||||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||||
|
@IContextKeyService private _contextKeyService: IContextKeyService
|
||||||
) {
|
) {
|
||||||
// isCompact defaults to false unless explicitly set by instantiation call.
|
// isCompact defaults to false unless explicitly set by instantiation call.
|
||||||
if (isCompact) {
|
if (isCompact) {
|
||||||
@@ -152,19 +156,70 @@ export class ServerTreeRenderer implements IRenderer {
|
|||||||
let iconLowerCaseName = iconName.toLocaleLowerCase();
|
let iconLowerCaseName = iconName.toLocaleLowerCase();
|
||||||
templateData.icon.classList.add(iconLowerCaseName);
|
templateData.icon.classList.add(iconLowerCaseName);
|
||||||
|
|
||||||
|
if (treeNode.iconPath) {
|
||||||
|
iconRenderer.putIcon(templateData.icon, treeNode.iconPath);
|
||||||
|
}
|
||||||
|
|
||||||
templateData.label.textContent = treeNode.label;
|
templateData.label.textContent = treeNode.label;
|
||||||
templateData.root.title = treeNode.label;
|
templateData.root.title = treeNode.label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getIconPath(connection: ConnectionProfile): IconPath {
|
||||||
|
if (!connection) { return undefined; }
|
||||||
|
|
||||||
|
if (connection['iconPath']) {
|
||||||
|
return connection['iconPath'];
|
||||||
|
}
|
||||||
|
|
||||||
|
let iconId = this._connectionManagementService.getConnectionIconId(connection.id);
|
||||||
|
if (!iconId) { return undefined; }
|
||||||
|
|
||||||
|
let providerProperties = this._connectionManagementService.getProviderProperties(connection.providerName);
|
||||||
|
if (!providerProperties) { return undefined; }
|
||||||
|
|
||||||
|
let iconPath: IconPath = undefined;
|
||||||
|
let pathConfig: URI | IconPath | { id: string, path: IconPath }[] = providerProperties['iconPath'];
|
||||||
|
if (Array.isArray(pathConfig)) {
|
||||||
|
for (const e of pathConfig) {
|
||||||
|
if (!e.id || e.id === iconId) {
|
||||||
|
iconPath = e.path;
|
||||||
|
connection['iconPath'] = iconPath;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (pathConfig['light']) {
|
||||||
|
iconPath = pathConfig as IconPath;
|
||||||
|
connection['iconPath'] = iconPath;
|
||||||
|
} else {
|
||||||
|
let singlePath = pathConfig as URI;
|
||||||
|
iconPath = { light: singlePath, dark: singlePath };
|
||||||
|
connection['iconPath'] = iconPath;
|
||||||
|
}
|
||||||
|
return iconPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
private renderServerIcon(element: HTMLElement, iconPath: IconPath, isConnected: boolean): void {
|
||||||
|
if (!element) { return; }
|
||||||
|
if (iconPath) {
|
||||||
|
iconRenderer.putIcon(element, iconPath);
|
||||||
|
}
|
||||||
|
let badgeToRemove: string = isConnected ? badgeRenderer.serverDisconnected : badgeRenderer.serverConnected;
|
||||||
|
let badgeToAdd: string = isConnected ? badgeRenderer.serverConnected : badgeRenderer.serverDisconnected;
|
||||||
|
badgeRenderer.removeBadge(element, badgeToRemove);
|
||||||
|
badgeRenderer.addBadge(element, badgeToAdd);
|
||||||
|
}
|
||||||
|
|
||||||
private renderConnection(connection: ConnectionProfile, templateData: IConnectionTemplateData): void {
|
private renderConnection(connection: ConnectionProfile, templateData: IConnectionTemplateData): void {
|
||||||
if (!this._isCompact) {
|
if (!this._isCompact) {
|
||||||
|
let iconPath: IconPath = this.getIconPath(connection);
|
||||||
if (this._connectionManagementService.isConnected(undefined, connection)) {
|
if (this._connectionManagementService.isConnected(undefined, connection)) {
|
||||||
templateData.icon.classList.remove('disconnected');
|
templateData.icon.classList.remove('disconnected');
|
||||||
templateData.icon.classList.add('connected');
|
templateData.icon.classList.add('connected');
|
||||||
|
this.renderServerIcon(templateData.icon, iconPath, true);
|
||||||
} else {
|
} else {
|
||||||
templateData.icon.classList.remove('connected');
|
templateData.icon.classList.remove('connected');
|
||||||
templateData.icon.classList.add('disconnected');
|
templateData.icon.classList.add('disconnected');
|
||||||
|
this.renderServerIcon(templateData.icon, iconPath, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,3 +272,7 @@ export class ServerTreeRenderer implements IRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IconPath {
|
||||||
|
light: URI;
|
||||||
|
dark: URI;
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { NodeType, SqlThemeIcon } from 'sql/workbench/parts/objectExplorer/commo
|
|||||||
import * as azdata from 'sqlops';
|
import * as azdata from 'sqlops';
|
||||||
|
|
||||||
import * as UUID from 'vs/base/common/uuid';
|
import * as UUID from 'vs/base/common/uuid';
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
export enum TreeItemCollapsibleState {
|
export enum TreeItemCollapsibleState {
|
||||||
None = 0,
|
None = 0,
|
||||||
@@ -91,6 +92,8 @@ export class TreeNode {
|
|||||||
|
|
||||||
public iconType: string | SqlThemeIcon;
|
public iconType: string | SqlThemeIcon;
|
||||||
|
|
||||||
|
public iconPath: URI | { light: URI, dark: URI };
|
||||||
|
|
||||||
constructor(nodeTypeId: string, label: string, isAlwaysLeaf: boolean, nodePath: string,
|
constructor(nodeTypeId: string, label: string, isAlwaysLeaf: boolean, nodePath: string,
|
||||||
nodeSubType: string, nodeStatus: string, parent: TreeNode, metadata: azdata.ObjectMetadata,
|
nodeSubType: string, nodeStatus: string, parent: TreeNode, metadata: azdata.ObjectMetadata,
|
||||||
iconType: string | SqlThemeIcon,
|
iconType: string | SqlThemeIcon,
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
|
|||||||
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
|
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||||
|
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
|
||||||
|
|
||||||
// Test stubs for commonly used objects
|
// Test stubs for commonly used objects
|
||||||
|
|
||||||
@@ -35,6 +37,10 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerIconProvider(providerId: string, provider: azdata.IconProvider): void {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
showConnectionDialog(params?: INewConnectionParams, model?: IConnectionProfile, connectionResult?: IConnectionResult): Promise<void> {
|
showConnectionDialog(params?: INewConnectionParams, model?: IConnectionProfile, connectionResult?: IConnectionResult): Promise<void> {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -273,4 +279,12 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
|||||||
getConnectionProfileById(profileId: string): IConnectionProfile {
|
getConnectionProfileById(profileId: string): IConnectionProfile {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getProviderProperties(providerName: string): ConnectionProviderProperties {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
getConnectionIconId(connectionId: string): string {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user