You will download a language pack template that you can translate:
`,
success: function () {
$('.download-btn').click(function () {
_this.$request('downloadLanguage').then(function (res) {
if (res.path) {
window.open(`/download?filename=${res.path}`);
}
});
});
},
});
});
};
PanelConfig.prototype.setDeveloperView = function (event) {
var _this = this;
this.$open({
title: 'Turn on developer mode',
area: ['460px', '340px'],
btn: [lan.public.submit, lan.public.cancel],
content: {
data: { agreement: false },
template: function () {
return (0, snabbdom_1.jsx)(
'div',
{ class: this.$class('bt-form pd25') },
this.$warningTitle('Risk ordinary users do not open!'),
this.$ul({ className: 'explainDescribeList pd15' }, [
['For development use only;', 'red'],
['Please do not enable it in production environment;'],
['It may take up a lot of memory after opening;'],
]),
this.$learnMore({ title: 'I understand and am willing to take the risk, confirm to open', model: 'agreement', id: 'checkDevelopers' })
);
},
},
yes: function (config) {
return __awaiter(_this, void 0, void 0, function () {
var close, vm, status;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
(close = config.close), (vm = config.vm);
if (!vm.agreement) return [2, this.$tips({ msg: 'Please tick to understand the risk options', el: '#checkDevelopers' })];
return [4, this.$request('setDebug')];
case 1:
status = _a.sent().status;
if (status) {
close();
this.$refreshBrowser();
}
return [2];
}
});
});
},
cancel: function () {
_this.changeReverseCheckbox(event);
},
btn2: function () {
_this.changeReverseCheckbox(event);
},
}).catch(function (err) {});
};
PanelConfig.prototype.setPanelApiView = function (checked) {
return __awaiter(this, void 0, void 0, function () {
var that, $checked, rdata, error_1;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
that = this;
$checked = $('input[name="api"]');
return [4, this.$request('getToken')];
case 1:
rdata = _a.sent();
_a.label = 2;
case 2:
_a.trys.push([2, 4, , 5]);
return [
4,
this.$open({
area: '522px',
title: lan.config.set_api,
content: {
data: {
api: typeof checked === 'undefined' ? rdata.open : checked,
panelTokenValue: rdata.token,
apiLimitAddr: rdata.limit_addr,
},
template: function () {
var lineWidth = '125px',
helpHref = 'https://www.aapanel.com/forum/d/482-api-interface-tutorial';
return (0, snabbdom_1.jsx)(
'div',
{ class: this.$class('bt-form'), style: this.$style('padding: 15px 25px;') },
this.$line({ title: lan.config.api, width: lineWidth }, this.$switch({ model: 'api', change: this.setPanelApi.bind(this) })),
this.$line(
{ title: lan.config.int_sk, width: lineWidth },
this.$box(
this.$input({ model: 'panelTokenValue', disabled: true, style: { width: '310px' } }),
this.$button({ size: 'xs', click: this.resetInterface.bind(this), style: 'margin-left: -56px;', title: lan.config.reset })
)
),
this.$line(
{
title: (0, snabbdom_1.jsx)('span', null, lan.config.ip_white_list, (0, snabbdom_1.jsx)('br', null), '(', lan.config.one_per_line, ')'),
width: lineWidth,
style: 'overflow: initial;height:20px;line-height:20px;',
},
this.$textarea({ model: 'apiLimitAddr', style: 'width: 310px;height:80px;line-height: 20px;padding: 5px 8px;' })
),
this.$line({ title: '', width: lineWidth }, this.$button({ size: 'sm', click: this.savePanelApiIp.bind(this), title: lan.config.save })),
this.$ul({ style: { marginLeft: '16px' } }, [
[lan.config.help1],
[lan.config.help2],
[(0, snabbdom_1.jsx)('span', null, lan.config.help3, ': ', this.$link({ title: helpHref, href: helpHref }))],
])
);
},
methods: {
setPanelApi: function () {
return __awaiter(this, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
return [4, that.$request('setToken', { t_type: 2 })];
case 1:
res = _a.sent();
if (res.status) {
$checked.prop('checked', this.api);
} else {
this.api = !this.api;
}
return [2];
}
});
});
},
resetInterface: function () {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
that
.$confirm({
title: 'Reset key',
msg: 'Are you sure you want to reset your current key?