blob: 3658ed200826142cab5145a4eca3bfeb21739435 [file] [log] [blame]
/**
* Utility javascript functions used across the different Leasing pages.
*/
this.leasing = this.leasing || {};
// Updated from
// https://github.com/luci/luci-py/blob/master/appengine/swarming/ui2/modules/alias.js#L33
this.leasing.alias = this.leasing.alias || (function() {
var DEVICE_ALIASES = {
"TECNO-KB8": "Tecno Spark 3 Pro",
"angler": "Nexus 6p",
"athene": "Moto G4",
"blueline": "Pixel 3",
"bullhead": "Nexus 5X",
"chorizo": "Chromecast",
"crosshatch": "Pixel 3 XL",
"darcy": "NVIDIA Shield [2017]",
"dragon": "Pixel C",
"flo": "Nexus 7 [2013]",
"flounder": "Nexus 9",
"foster": "NVIDIA Shield [2015]",
"fugu": "Nexus Player",
"gce_x86": "Android on GCE",
"goyawifi": "Galaxy Tab 3",
"grouper": "Nexus 7 [2012]",
"hammerhead": "Nexus 5",
"herolte": "Galaxy S7 [Global]",
"heroqlteatt": "Galaxy S7 [AT&T]",
"iPad4,1": "iPad Air",
"iPad5,1": "iPad mini 4",
"iPad6,3": "iPad Pro [9.7 in]",
"iPhone7,2": "iPhone 6",
"iPhone9,1": "iPhone 7",
"iPhone10,1": "iPhone 8",
"j5xnlte": "Galaxy J5",
"m0": "Galaxy S3",
"mako": "Nexus 4",
"manta": "Nexus 10",
"marlin": "Pixel XL",
"sailfish": "Pixel",
"sargo": "Pixel 3a",
"shamu": "Nexus 6",
"sprout": "Android One",
"starlte": "Galaxy S9",
"taimen": "Pixel2 XL",
"universal7420": "Galaxy S6",
"walleye": "Pixel 2",
"zerofltetmo": "Galaxy S6",
};
var UNKNOWN = "unknown";
var GPU_ALIASES = {
"1002": "AMD",
"1002:6613": "AMD Radeon R7 240",
"1002:6646": "AMD Radeon R9 M280X",
"1002:6779": "AMD Radeon HD 6450/7450/8450",
"1002:679e": "AMD Radeon HD 7800",
"1002:6821": "AMD Radeon HD 8870M",
"1002:683d": "AMD Radeon HD 7770/8760",
"1002:9830": "AMD Radeon HD 8400",
"1002:9874": "AMD Carrizo",
"102b": "Matrox",
"102b:0522": "Matrox MGA G200e",
"102b:0532": "Matrox MGA G200eW",
"102b:0534": "Matrox G200eR2",
"10de": "NVIDIA",
"10de:08a4": "NVIDIA GeForce 320M",
"10de:08aa": "NVIDIA GeForce 320M",
"10de:0a65": "NVIDIA GeForce 210",
"10de:0fe9": "NVIDIA GeForce GT 750M Mac Edition",
"10de:0ffa": "NVIDIA Quadro K600",
"10de:104a": "NVIDIA GeForce GT 610",
"10de:11c0": "NVIDIA GeForce GTX 660",
"10de:1244": "NVIDIA GeForce GTX 550 Ti",
"10de:1401": "NVIDIA GeForce GTX 960",
"10de:1ba1": "NVIDIA GeForce GTX 1070",
"10de:1cb3": "NVIDIA Quadro P400",
"8086": "Intel",
"8086:0046": "Intel Ironlake HD Graphics",
"8086:0102": "Intel Sandy Bridge HD Graphics 2000",
"8086:0116": "Intel Sandy Bridge HD Graphics 3000",
"8086:0166": "Intel Ivy Bridge HD Graphics 4000",
"8086:0412": "Intel Haswell HD Graphics 4600",
"8086:041a": "Intel Haswell HD Graphics",
"8086:0a16": "Intel Haswell HD Graphics 4400",
"8086:0a26": "Intel Haswell HD Graphics 5000",
"8086:0a2e": "Intel Haswell Iris Graphics 5100",
"8086:0d26": "Intel Haswell Iris Pro Graphics 5200",
"8086:0f31": "Intel Bay Trail HD Graphics",
"8086:1616": "Intel Broadwell HD Graphics 5500",
"8086:161e": "Intel Broadwell HD Graphics 5300",
"8086:1626": "Intel Broadwell HD Graphics 6000",
"8086:162b": "Intel Broadwell Iris Graphics 6100",
"8086:1912": "Intel Skylake HD Graphics 530",
"8086:1926": "Intel Skylake Iris 540/550",
"8086:193b": "Intel Skylake Iris Pro 580",
"8086:22b1": "Intel Braswell HD Graphics",
"8086:591e": "Intel Kaby Lake HD Graphics 615",
"8086:5926": "Intel Kaby Lake Iris Plus Graphics 640",
}
var alias = {};
alias.device = function(dt) {
return DEVICE_ALIASES[dt] || UNKNOWN;
};
alias.gpu = function(gpu) {
if (!gpu || !gpu.split) {
return UNKNOWN;
}
gpu = gpu.split("-")[0];
return GPU_ALIASES[gpu] || UNKNOWN;
};
alias.getAKAStr = function(aka) {
return ' (' + aka + ')';
};
return alias;
})();