mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-07 12:06:56 +03:00
refactor: Update luci-app-podkop package
* Removed direct package manager calls * Removed commands related to optional luci package * Update external global_check call with version pass * Removed useless external calls in version check cases * Improved build process support: version will be automatically set at installation time from package metadata and will be readable from JS as constant
This commit is contained in:
@@ -4,6 +4,7 @@ export const STATUS_COLORS = {
|
|||||||
WARNING: '#ff9800',
|
WARNING: '#ff9800',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const PODKOP_LUCI_APP_VERSION = '__COMPILED_VERSION_VARIABLE__';
|
||||||
export const FAKEIP_CHECK_DOMAIN = 'fakeip.podkop.fyi';
|
export const FAKEIP_CHECK_DOMAIN = 'fakeip.podkop.fyi';
|
||||||
export const IP_CHECK_DOMAIN = 'ip.podkop.fyi';
|
export const IP_CHECK_DOMAIN = 'ip.podkop.fyi';
|
||||||
|
|
||||||
|
|||||||
@@ -19,4 +19,12 @@ LUCI_LANGUAGES:=en ru
|
|||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
# call BuildPackage - OpenWrt buildroot signature
|
define Package/$(PKG_NAME)/install
|
||||||
|
$(INSTALL_DIR) $(1)$(HTDOCS)
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/htdocs/* $(1)$(HTDOCS)/
|
||||||
|
$(INSTALL_DIR) $(1)/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/root/* $(1)/
|
||||||
|
sed -i -e 's/__COMPILED_VERSION_VARIABLE__/$(PKG_VERSION)/g' $(1)$(HTDOCS)/luci-static/resources/view/podkop/main.js || true
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||||
@@ -376,7 +376,7 @@ function showConfigModal(command, title) {
|
|||||||
let formattedOutput = '';
|
let formattedOutput = '';
|
||||||
|
|
||||||
if (command === 'global_check') {
|
if (command === 'global_check') {
|
||||||
safeExec('/usr/bin/podkop', [command], 'P0_PRIORITY', (res) => {
|
safeExec('/usr/bin/podkop', [command, `${main.PODKOP_LUCI_APP_VERSION}`], 'P0_PRIORITY', (res) => {
|
||||||
formattedOutput = formatDiagnosticOutput(res.stdout || _('No output'));
|
formattedOutput = formatDiagnosticOutput(res.stdout || _('No output'));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -918,19 +918,11 @@ async function updateDiagnostics() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
safeExec(
|
|
||||||
'/usr/bin/podkop',
|
|
||||||
['show_luci_version'],
|
|
||||||
'P2_PRIORITY',
|
|
||||||
(result) => {
|
|
||||||
updateTextElement(
|
updateTextElement(
|
||||||
'luci-version',
|
'luci-version',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
result.stdout ? result.stdout.trim() : _('Unknown'),
|
`${main.PODKOP_LUCI_APP_VERSION}`
|
||||||
),
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
safeExec(
|
safeExec(
|
||||||
'/usr/bin/podkop',
|
'/usr/bin/podkop',
|
||||||
|
|||||||
@@ -592,6 +592,7 @@ var STATUS_COLORS = {
|
|||||||
ERROR: "#f44336",
|
ERROR: "#f44336",
|
||||||
WARNING: "#ff9800"
|
WARNING: "#ff9800"
|
||||||
};
|
};
|
||||||
|
var PODKOP_LUCI_APP_VERSION = "__COMPILED_VERSION_VARIABLE__";
|
||||||
var FAKEIP_CHECK_DOMAIN = "fakeip.podkop.fyi";
|
var FAKEIP_CHECK_DOMAIN = "fakeip.podkop.fyi";
|
||||||
var IP_CHECK_DOMAIN = "ip.podkop.fyi";
|
var IP_CHECK_DOMAIN = "ip.podkop.fyi";
|
||||||
var REGIONAL_OPTIONS = [
|
var REGIONAL_OPTIONS = [
|
||||||
@@ -1913,6 +1914,7 @@ return baseclass.extend({
|
|||||||
FETCH_TIMEOUT,
|
FETCH_TIMEOUT,
|
||||||
IP_CHECK_DOMAIN,
|
IP_CHECK_DOMAIN,
|
||||||
REGIONAL_OPTIONS,
|
REGIONAL_OPTIONS,
|
||||||
|
PODKOP_LUCI_APP_VERSION,
|
||||||
STATUS_COLORS,
|
STATUS_COLORS,
|
||||||
TabService,
|
TabService,
|
||||||
TabServiceInstance,
|
TabServiceInstance,
|
||||||
|
|||||||
Reference in New Issue
Block a user