Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions applications/luci-app-uugamebooster/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: Apache-2.0
#

include $(TOPDIR)/rules.mk

PKG_LICENSE:=Apache-2.0

LUCI_TITLE:=LuCI support for UUgamebooster
LUCI_DEPENDS:=+uugamebooster
LUCI_PKGARCH:=all

include ../../luci.mk

# call BuildPackage - OpenWrt buildroot signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// SPDX-License-Identifier: Apache-2.0

'use strict';
'require form';
'require poll';
'require rpc';
'require uci';
'require view';

const callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: ['name'],
expect: { '': {} }
});

function getServiceStatus() {
return L.resolveDefault(callServiceList('uugamebooster'), {}).then(function (res) {
var isRunning = false;
try {
isRunning = res['uugamebooster']['instances']['uugamebooster']['running'];
} catch (e) { }
return isRunning;
});
}

function renderStatus(isRunning) {
var spanTemp = '<span style="color:%s"><strong>%s %s</strong></span>';
var renderHTML;
if (isRunning) {
renderHTML = spanTemp.format('green', _('UU GameAcc'), _('RUNNING'))
} else {
renderHTML = spanTemp.format('red', _('UU GameAcc'), _('NOT RUNNING'));
}

return renderHTML;
}

return view.extend({
load: function() {
return Promise.all([
uci.load('uugamebooster')
]);
},

render: function() {
let m, s, o;

m = new form.Map('uugamebooster', _('UU Game Accelerator'),
_('A Paid Game Acceleration service'));

s = m.section(form.TypedSection);
s.anonymous = true;
s.render = function () {
poll.add(function () {
return L.resolveDefault(getServiceStatus()).then(function (res) {
var view = document.getElementById('service_status');
view.innerHTML = renderStatus(res);
});
});

return E('div', { class: 'cbi-section', id: 'status_bar' }, [
E('p', { id: 'service_status' }, _('Collecting data...'))
]);
}

s = m.section(form.NamedSection, 'config', 'uugamebooster');

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: '/uugamebooster/uuios.png', height: '300'}),
E('img', {src: '/uugamebooster/uuandroid.png', height: '300'})
])
])
}

return m.render();
}

});
23 changes: 23 additions & 0 deletions applications/luci-app-uugamebooster/po/templates/uugamebooster.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:70
msgid "Enable"
msgstr ""

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:32
#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:34
msgid "UU GameAcc"
msgstr ""

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:50
msgid "UU Game Accelerator"
msgstr ""

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:51
msgid "A Paid Game Acceleration service"
msgstr ""

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:64
msgid "Collecting data..."
msgstr ""
23 changes: 23 additions & 0 deletions applications/luci-app-uugamebooster/po/zh_Hans/uugamebooster.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:70
msgid "Enable"
msgstr "启用"

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:32
#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:34
msgid "UU GameAcc"
msgstr "UU游戏加速器"

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:50
msgid "UU Game Accelerator"
msgstr "UU游戏加速器"

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:51
msgid "A Paid Game Acceleration service"
msgstr "一个付费主机游戏加速器 (开启服务后,使用手机APP绑定路由器并指定加速主机)"

#: applications/luci-app-uugamebooster/htdocs/luci-static/resources/view/uugamebooster.js:64
msgid "Collecting data..."
msgstr "正在收集数据中..."
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"admin/services/uugamebooster": {
"title": "UU GameAcc",
"action": {
"type": "view",
"path": "uugamebooster"
},
"depends": {
"acl": [ "luci-app-uugamebooster" ],
"uci": { "uugamebooster": true }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"luci-app-uugamebooster": {
"description": "Grant UCI access for luci-app-uugamebooster",
"read": {
"ubus": {
"service": [ "list" ]
},
"uci": [ "uugamebooster" ]
},
"write": {
"uci": [ "uugamebooster" ]
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading