diff --git a/applications/luci-app-qiyougamebooster/Makefile b/applications/luci-app-qiyougamebooster/Makefile new file mode 100644 index 0000000000..0211eefd18 --- /dev/null +++ b/applications/luci-app-qiyougamebooster/Makefile @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: Apache-2.0 +# + +include $(TOPDIR)/rules.mk + +PKG_LICENSE:=Apache-2.0 + +LUCI_TITLE:=LuCI app for QiYou Game Booster +LUCI_DEPENDS:=+qiyougamebooster +LUCI_PKGARCH:=all + +PKG_MAINTAINER:=qiyouacc, Internet1235 + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js b/applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js new file mode 100644 index 0000000000..be1e631d9c --- /dev/null +++ b/applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; +'require form'; +'require poll'; +'require uci'; +'require view'; +'require fs'; + +function getStatus() { + var result + try { + result = fs.exec('/usr/bin/qiyougamebooster.sh', ['status']); + return result.then(function(status) { + return status.stdout.trim() + }) + } catch (e) { } + return result; +} + +function getVersion() { + var result + try { + result = fs.exec('/usr/bin/qiyougamebooster.sh', ['version']) + return result.then(function(version) { + return version.stdout.trim() || _('QiYou Game Booster'); + }).catch(function() { + return _('QiYou Game Booster'); + }); + } catch (e) { } + return Promise.resolve(_('QiYou Game Booster')); +} + +function renderStatus(status, version) { + var spanTemp = '%s: %s %s'; + var renderHTML; + if (status == 'NOT ENABLED' || status == 'NOT RUNNING' || status == 'NOT SUPPORTED') { + renderHTML = spanTemp.format('red', _('Status'), _(version), _(status)); + } else { + renderHTML = spanTemp.format('green', _('Status'), _(version), _(status)); + } + return renderHTML; +} + +return view.extend({ + load: function() { + return Promise.all([ + uci.load('qiyougamebooster') + ]); + }, + + render: function() { + let m, s, o; + + m = new form.Map('qiyougamebooster', _('QiYou Game Booster'), + _('Play console games online with less lag and more stability.') + '
' + + _('— now supporting PS, Switch, Xbox, PC, and mobile.')); + + s = m.section(form.TypedSection); + s.anonymous = true; + s.render = function () { + poll.add(function () { + return L.resolveDefault(getStatus()).then(function (status) { + return L.resolveDefault(getVersion()).then(function (version) { + var view = document.getElementById('service_status'); + view.innerHTML = renderStatus(status, version); + }); + }); + }); + + return E('div', { class: 'cbi-section', id: 'status_bar' }, [ + E('p', { id: 'service_status' }, _('Collecting data...')) + ]); + } + + s = m.section(form.NamedSection, 'config', 'qiyougamebooster'); + + o = s.option(form.Flag, 'enabled', _('Enable')); + o.default = o.disabled; + o.rmempty = false; + + s = m.section(form.TypedSection); + s.anonymous = true; + s.render = function () { + return E('div', {class: 'cbi-section'}, [ + E('p', [ + E('img', {src: '/qiyougamebooster/Tutorial.png', height: '350'}) + ]) + ]) + } + + + return m.render(); + } + +}); diff --git a/applications/luci-app-qiyougamebooster/po/templates/qiyougamebooster.pot b/applications/luci-app-qiyougamebooster/po/templates/qiyougamebooster.pot new file mode 100644 index 0000000000..d01d1f5858 --- /dev/null +++ b/applications/luci-app-qiyougamebooster/po/templates/qiyougamebooster.pot @@ -0,0 +1,52 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:26 +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:28 +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:53 +msgid "QiYou Game Booster" +msgstr "" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:54 +msgid "Play console games online with less lag and more stability." +msgstr "" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:55 +msgid "— now supporting PS, Switch, Xbox, PC, and mobile." +msgstr "" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:70 +msgid "Collecting data..." +msgstr "" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:76 +msgid "Enable" +msgstr "" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:38 +msgid "Status" +msgstr "" + +msgid "NOT ENABLED" +msgstr "" + +msgid "CLOSED" +msgstr "" + +msgid "BOOSTING" +msgstr "" + +msgid "RUNNING" +msgstr "" + +msgid "NOT SUPPORTED" +msgstr "" + +msgid "DOWNLOADING" +msgstr "" + +msgid "INSTALLING" +msgstr "" + +msgid "NOT RUNNING" +msgstr "" diff --git a/applications/luci-app-qiyougamebooster/po/zh_Hans/qiyougamebooster.po b/applications/luci-app-qiyougamebooster/po/zh_Hans/qiyougamebooster.po new file mode 100644 index 0000000000..1e5856f322 --- /dev/null +++ b/applications/luci-app-qiyougamebooster/po/zh_Hans/qiyougamebooster.po @@ -0,0 +1,52 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:26 +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:28 +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:53 +msgid "QiYou Game Booster" +msgstr "奇游联机宝" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:54 +msgid "Play console games online with less lag and more stability." +msgstr "加速主机游戏,实现满速下载、稳定联机、飞快匹配体验。" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:55 +msgid "— now supporting PS, Switch, Xbox, PC, and mobile." +msgstr "—— 现已支持 PS、Switch、Xbox、PC 与移动端。" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:70 +msgid "Collecting data..." +msgstr "正在收集数据中..." + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:76 +msgid "Enable" +msgstr "启用" + +#: applications/luci-app-qiyougamebooster/htdocs/luci-static/resources/view/qiyougamebooster.js:38 +msgid "Status" +msgstr "状态" + +msgid "NOT ENABLED" +msgstr "未启用" + +msgid "CLOSED" +msgstr "已关闭" + +msgid "BOOSTING" +msgstr "加速中" + +msgid "RUNNING" +msgstr "运行中" + +msgid "NOT SUPPORTED" +msgstr "不支持" + +msgid "DOWNLOADING" +msgstr "下载中" + +msgid "INSTALLING" +msgstr "安装中" + +msgid "NOT RUNNING" +msgstr "未运行" diff --git a/applications/luci-app-qiyougamebooster/root/usr/share/luci/menu.d/luci-app-qiyougamebooster.json b/applications/luci-app-qiyougamebooster/root/usr/share/luci/menu.d/luci-app-qiyougamebooster.json new file mode 100644 index 0000000000..0c161061a7 --- /dev/null +++ b/applications/luci-app-qiyougamebooster/root/usr/share/luci/menu.d/luci-app-qiyougamebooster.json @@ -0,0 +1,16 @@ +{ + "admin/services/qiyougamebooster": { + "title": "QiYou Game Booster", + "action": { + "type": "view", + "path": "qiyougamebooster" + }, + "depends": { + "acl": [ "luci-app-qiyougamebooster" ], + "fs": { + "/usr/bin/qiyougamebooster.sh": "executable" + }, + "uci": { "qiyougamebooster": true } + } + } +} diff --git a/applications/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json b/applications/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json new file mode 100644 index 0000000000..205ce66e32 --- /dev/null +++ b/applications/luci-app-qiyougamebooster/root/usr/share/rpcd/acl.d/luci-app-qiyougamebooster.json @@ -0,0 +1,14 @@ +{ + "luci-app-qiyougamebooster": { + "description": "Grant UCI access for luci-app-qiyougamebooster", + "read": { + "file": { + "/usr/bin/qiyougamebooster.sh": [ "exec" ] + }, + "uci": [ "qiyougamebooster" ] + }, + "write": { + "uci": [ "qiyougamebooster" ] + } + } +} diff --git a/applications/luci-app-qiyougamebooster/root/www/qiyougamebooster/Tutorial.png b/applications/luci-app-qiyougamebooster/root/www/qiyougamebooster/Tutorial.png new file mode 100644 index 0000000000..e98c8df9ae Binary files /dev/null and b/applications/luci-app-qiyougamebooster/root/www/qiyougamebooster/Tutorial.png differ