mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-07 12:06:56 +03:00
feat: migrate yacd url to dynamic
This commit is contained in:
4
fe-app-podkop/src/helpers/getBaseUrl.ts
Normal file
4
fe-app-podkop/src/helpers/getBaseUrl.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export function getBaseUrl(): string {
|
||||||
|
const { protocol, hostname } = window.location;
|
||||||
|
return `${protocol}//${hostname}`;
|
||||||
|
}
|
||||||
1
fe-app-podkop/src/helpers/index.ts
Normal file
1
fe-app-podkop/src/helpers/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './getBaseUrl';
|
||||||
@@ -3,3 +3,4 @@
|
|||||||
|
|
||||||
export * from './validators';
|
export * from './validators';
|
||||||
export * from './constants';
|
export * from './constants';
|
||||||
|
export * from './helpers';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
function createAdditionalSection(mainSection) {
|
function createAdditionalSection(mainSection) {
|
||||||
let o = mainSection.tab('additional', _('Additional Settings'));
|
let o = mainSection.tab('additional', _('Additional Settings'));
|
||||||
|
|
||||||
o = mainSection.taboption('additional', form.Flag, 'yacd', _('Yacd enable'), '<a href="http://openwrt.lan:9090/ui" target="_blank">openwrt.lan:9090/ui</a>');
|
o = mainSection.taboption('additional', form.Flag, 'yacd', _('Yacd enable'), `<a href="${main.getBaseUrl()}:9090/ui" target="_blank">${main.getBaseUrl()}:9090/ui</a>`);
|
||||||
o.default = '0';
|
o.default = '0';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
o.ucisection = 'main';
|
o.ucisection = 'main';
|
||||||
|
|||||||
@@ -189,6 +189,12 @@ var COMMAND_SCHEDULING = {
|
|||||||
P10_PRIORITY: 1900
|
P10_PRIORITY: 1900
|
||||||
// Lowest priority
|
// Lowest priority
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// src/helpers/getBaseUrl.ts
|
||||||
|
function getBaseUrl() {
|
||||||
|
const { protocol, hostname } = window.location;
|
||||||
|
return `${protocol}//${hostname}`;
|
||||||
|
}
|
||||||
return baseclass.extend({
|
return baseclass.extend({
|
||||||
ALLOWED_WITH_RUSSIA_INSIDE,
|
ALLOWED_WITH_RUSSIA_INSIDE,
|
||||||
BOOTSTRAP_DNS_SERVER_OPTIONS,
|
BOOTSTRAP_DNS_SERVER_OPTIONS,
|
||||||
@@ -207,6 +213,7 @@ return baseclass.extend({
|
|||||||
REGIONAL_OPTIONS,
|
REGIONAL_OPTIONS,
|
||||||
STATUS_COLORS,
|
STATUS_COLORS,
|
||||||
UPDATE_INTERVAL_OPTIONS,
|
UPDATE_INTERVAL_OPTIONS,
|
||||||
|
getBaseUrl,
|
||||||
validateDNS,
|
validateDNS,
|
||||||
validateDomain,
|
validateDomain,
|
||||||
validateIPV4,
|
validateIPV4,
|
||||||
|
|||||||
Reference in New Issue
Block a user