-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEnhanced-vSphere-Client.user.js
50 lines (47 loc) · 2.03 KB
/
Enhanced-vSphere-Client.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// ==UserScript==
// @namespace https://openuserjs.org/users/Carsso
// @name Enhanced vSphere Client
// @version 0.2
// @description Enhance your vSphere Client - Supports vCenter 7.0.3
// @author Carsso
// @updateURL https://openuserjs.org/meta/Carsso/Enhanced_vSphere_Client.meta.js
// @downloadURL https://openuserjs.org/install/Carsso/Enhanced_vSphere_Client.user.js
// @homepageURL https://github.com/carsso/userscripts
// @include *://*/ui/*
// @grant GM_addStyle
// @license MIT
// ==/UserScript==
// ==OpenUserJS==
// @author Carsso
// ==/OpenUserJS==
(function () {
'use strict';
if (document.querySelector('main-app#main-app-div.main-container')) {
(new MutationObserver(check)).observe(document, { childList: true, subtree: true });
function check(changes, observer) {
if (document.querySelector('vsc-app-main-layout .vui-panel object-navigator-view .inventory-tree vsc-inventory-tree-view')) {
observer.disconnect();
console.log('Enhancing vSphere Client...');
var titleElem = document.querySelector('vsc-app-main-layout .branding .title[data-test-id="vsphere.core.controlcenter.domainView"]')
if (titleElem) {
titleElem.innerHTML = titleElem.innerHTML.replace(/vSphere Client/g, 'Enhanced vSphere Client');
}
GM_addStyle(`
vsc-inventory-tree-view clr-tabs.tab-content {
line-height: 1rem !important;
}
vsc-inventory-tree-view .clr-treenode-caret {
height: 1rem !important;
}
vsc-inventory-tree-view .cdk-tree-node {
line-height: 1rem !important;
}
vsc-inventory-tree-view .clr-treenode-caret {
flex: 0 0 0.8rem;
width: 0.8rem;
}
`);
}
}
}
})();