mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
chore: Update getpats function to include patch information and fix product version selection logic
This commit is contained in:
parent
8d24023401
commit
e845414652
@ -38,6 +38,7 @@
|
|||||||
var repo = "RROrg/rr"
|
var repo = "RROrg/rr"
|
||||||
|
|
||||||
var _models = {};
|
var _models = {};
|
||||||
|
var _pats = {};
|
||||||
var _addons = {};
|
var _addons = {};
|
||||||
var _modules = {};
|
var _modules = {};
|
||||||
|
|
||||||
@ -58,16 +59,19 @@
|
|||||||
function init() {
|
function init() {
|
||||||
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/models.json", function (result) {
|
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/models.json", function (result) {
|
||||||
_models = JSON.parse(result);
|
_models = JSON.parse(result);
|
||||||
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/addons.json", function (result) {
|
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/pats.json", function (result) {
|
||||||
_addons = JSON.parse(result);
|
_pats = JSON.parse(result);
|
||||||
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/modules.json", function (result) {
|
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/addons.json", function (result) {
|
||||||
_modules = JSON.parse(result);
|
_addons = JSON.parse(result);
|
||||||
$("#model").on("change", changeModel);
|
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/modules.json", function (result) {
|
||||||
$("#version").on("change", changeVersion);
|
_modules = JSON.parse(result);
|
||||||
$("#language").on("change", changeVersion);
|
$("#model").on("change", changeModel);
|
||||||
$("#kernel").on("change", chanageKernel);
|
$("#version").on("change", changeVersion);
|
||||||
$('#addons').val("acpid,mountloader,powersched,reboottoloader");
|
$("#language").on("change", changeVersion);
|
||||||
setModels();
|
$("#kernel").on("change", chanageKernel);
|
||||||
|
$('#addons').val("acpid,mountloader,powersched,reboottoloader");
|
||||||
|
setModels();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -88,11 +92,9 @@
|
|||||||
function changeModel() {
|
function changeModel() {
|
||||||
model = $("#model").val();
|
model = $("#model").val();
|
||||||
var versions = [];
|
var versions = [];
|
||||||
for (var P in _models) {
|
if (model in _pats) {
|
||||||
if (_models[P]["models"].includes(model)) {
|
versions = Object.keys(_pats[model]);
|
||||||
versions = Object.keys(_models[P]["productvers"]).reverse();
|
versions.sort((a, b) => b.localeCompare(a));
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$("#version")[0].options.length = 0;
|
$("#version")[0].options.length = 0;
|
||||||
for (var i = 0; i < versions.length; i++) {
|
for (var i = 0; i < versions.length; i++) {
|
||||||
@ -138,7 +140,7 @@
|
|||||||
|
|
||||||
function createModulesBtn() {
|
function createModulesBtn() {
|
||||||
var model = $("#model").val();
|
var model = $("#model").val();
|
||||||
var version = $("#version").val();
|
var version = $("#version").val().split(".").slice(0, 2).join(".");
|
||||||
var platform = "";
|
var platform = "";
|
||||||
for (var P in _models) {
|
for (var P in _models) {
|
||||||
if (_models[P]["models"].includes(model)) {
|
if (_models[P]["models"].includes(model)) {
|
||||||
@ -164,7 +166,7 @@
|
|||||||
|
|
||||||
function chanageKernel() {
|
function chanageKernel() {
|
||||||
var model = $("#model").val();
|
var model = $("#model").val();
|
||||||
var version = $("#version").val();
|
var version = $("#version").val().split(".").slice(0, 2).join(".");
|
||||||
var kernel = $("#kernel").val();
|
var kernel = $("#kernel").val();
|
||||||
if (model == "SA6400" && version == "7.2") {
|
if (model == "SA6400" && version == "7.2") {
|
||||||
$("#kernel_item").show();
|
$("#kernel_item").show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user