blob: 6ca35ed2f57dbd16cbcaa4ba00813a96a7755887 [file] [log] [blame]
/**
* Utility javascript functions used across the different Leasing pages.
*/
this.leasing = this.leasing || {};
// TODO(rmistry): Deduplicate this code with status-capacity.
this.leasing.alias = this.leasing.alias || (function() {
var ANDROID_ALIASES_AND_ARCH = {
"angler": ["Nexus 6p", "arm64"],
"athene": ["Moto G4", "arm"],
"bullhead": ["Nexus 5X", "arm64"],
"chorizo": ["Chromecast", "arm"],
"dragon": ["Pixel C", "arm64"],
"flo": ["Nexus 7 [2013]", "arm"],
"flounder": ["Nexus 9", "arm64"],
"foster": ["NVIDIA Shield", "arm64"],
"fugu": ["Nexus Player", "x86"],
"gce_x86": ["Android on GCE", "x86"],
"goyawifi": ["Galaxy Tab 3", "x86"],
"grouper": ["Nexus 7 [2012]", "arm"],
"hammerhead": ["Nexus 5", "arm"],
"herolte": ["Galaxy S7 [Global]", "arm64"],
"heroqlteatt": ["Galaxy S7 [AT&T]", "arm64"],
"j5xnlte": ["Galaxy J5", "arm"],
"m0": ["Galaxy S3", "arm"],
"mako": ["Nexus 4", "arm"],
"manta": ["Nexus 10", "arm"],
"marlin": ["Pixel XL", "arm64"],
"sailfish": ["Pixel", "arm64"],
"shamu": ["Nexus 6", "arm"],
"sprout": ["Android One", "arm"],
"taimen": ["Pixel2 XL", "arm64"],
"zerofltetmo": ["Galaxy S6", "arm64"],
};
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.android_arch = function(dt) {
return ANDROID_ALIASES_AND_ARCH[dt] ? ANDROID_ALIASES_AND_ARCH[dt][1]
: UNKNOWN;
};
alias.android = function(dt) {
return ANDROID_ALIASES_AND_ARCH[dt] ? ANDROID_ALIASES_AND_ARCH[dt][0]
: 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;
})();