small-package/.github/diy/patches/luci-app-attendedsysupgrade...

155 lines
5.9 KiB
Diff

--- a/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
+++ b/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
@@ -100,7 +100,7 @@ return view.extend({
}
if (image.name != undefined) {
- var sysupgrade_url = `${this.data.url}/store/${response.bin_dir}/${image.name}`;
+ var sysupgrade_url = `${this.data.url}/store/${response.request_hash}/${image.name}`;
var keep = E('input', { type: 'checkbox' });
keep.checked = true;
@@ -284,15 +284,12 @@ return view.extend({
});
},
- handleCheck: function () {
+ handleCheck: function (force) {
var { url, revision } = this.data
var { version, target } = this.firmware
var candidates = [];
var response;
- var request_url = `${url}/api/overview`;
- if (version.endsWith('SNAPSHOT')) {
- request_url = `${url}/api/v1/revision/${version}/${target}`;
- }
+ var request_url = `${url}/api/v1/revision/${version}/${target}`;
ui.showModal(_('Searching...'), [
E('p', { 'class': 'spinning' },
@@ -311,40 +308,10 @@ return view.extend({
]);
return;
}
- if (version.endsWith('SNAPSHOT')) {
const remote_revision = response.json().revision;
- if (get_revision_count(revision) < get_revision_count(remote_revision)) {
+ if (revision < remote_revision || force == 1) {
candidates.push([version, remote_revision]);
}
- } else {
- const latest = response.json().latest;
-
- for (let remote_version of latest) {
- var remote_branch = get_branch(remote_version);
-
- // already latest version installed
- if (version == remote_version) {
- break;
- }
-
- // skip branch upgrades outside the advanced mode
- if (this.data.branch != remote_branch && this.data.advanced_mode == 0) {
- continue;
- }
-
- candidates.unshift([remote_version, null]);
-
- // don't offer branches older than the current
- if (this.data.branch == remote_branch) {
- break;
- }
- }
- }
-
- // allow to re-install running firmware in advanced mode
- if (this.data.advanced_mode == 1) {
- candidates.unshift([version, revision])
- }
if (candidates.length) {
var m, s, o;
@@ -353,7 +320,7 @@ return view.extend({
request: {
profile: this.firmware.profile,
version: candidates[0][0],
- packages: Object.keys(this.firmware.packages).sort(),
+ packages: Object.keys(this.firmware.packages).filter((value) => value.search("-zh-cn") == -1).sort(),
},
};
@@ -401,6 +368,9 @@ return view.extend({
E('p', _('The device runs the latest firmware version %s - %s').format(version, revision)),
E('div', { class: 'right' }, [
E('div', { class: 'btn', click: ui.hideModal }, _('Close')),
+ E('div', { class: 'btn cbi-button cbi-button-positive', click: ui.createHandlerFn(this, function () {
+ this.handleCheck(1)
+ }) }, _('Force Sysupgrade')),
]),
]);
}
@@ -429,6 +399,12 @@ return view.extend({
this.data.revision = response[1].release.revision;
this.data.efi = response[2];
+ this.firmware.partsize = response[1].release.distribution;
+ if (this.data.efi) {
+ this.firmware.efi = "efi";
+ } else {
+ this.firmware.efi = "not";
+ }
this.data.url = uci.get_first('attendedsysupgrade', 'server', 'url');
this.data.advanced_mode = uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0
@@ -438,6 +414,17 @@ return view.extend({
E('p', _('The attended sysupgrade service allows to easily upgrade vanilla and custom firmware images.')),
E('p', _('This is done by building a new firmware on demand via an online service.')),
E('p', _('Currently running: %s - %s').format(this.firmware.version, this.data.revision)),
+ E('p', [_('更多个性化定制请使用网页版: '),
+ E('a', {
+ 'class': '',
+ 'href': 'https://supes.top',
+ 'target': '_balank',
+ }, _('在线定制网页版'))]),
+ E('p', [_('非定制固件请在此更新: '),E('a', {
+ 'class': '',
+ 'href': '/cgi-bin/luci/admin/services/gpsysupgrade',
+ 'target': '_balank',
+ }, _('系统在线更新')),E('br')]),
E('button', {
'class': 'btn cbi-button cbi-button-positive important',
'click': ui.createHandlerFn(this, this.handleCheck)
--- a/luci-app-attendedsysupgrade/po/zh_Hans/attendedsysupgrade.po
+++ b/luci-app-attendedsysupgrade/po/zh_Hans/attendedsysupgrade.po
@@ -46,7 +46,10 @@ msgstr "高级模式"
#: applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js:437
#: applications/luci-app-attendedsysupgrade/root/usr/share/luci/menu.d/luci-app-attendedsysupgrade.json:3
msgid "Attended Sysupgrade"
-msgstr "值守式系统更新"
+msgstr "定制系统升级"
+
+msgid "Force Sysupgrade"
+msgstr "强制重刷"
#: applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/configuration.js:10
msgid "Attendedsysupgrade Configuration."
@@ -187,7 +190,7 @@ msgstr "请求固件镜像"
#: applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js:162
msgid "Request in build queue position %s"
-msgstr "构建队列位置 %s 中的请求"
+msgstr "排队中...当前位置 %s"
#: applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js:110
msgid "SHA256"
@@ -237,7 +240,7 @@ msgstr "目标"
msgid ""
"The attended sysupgrade service allows to easily upgrade vanilla and custom "
"firmware images."
-msgstr "值守式系统升级服务可让您轻松升级原版和自定义固件镜像。"
+msgstr "定制和更新适用于您设备的OpenWrt固件。"
#: applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js:401
msgid "The device runs the latest firmware version %s - %s"