Skip to content

Commit

Permalink
Merge pull request Anankke#2412 from SSPanel-UIM/dev
Browse files Browse the repository at this point in the history
Dev 20240403
  • Loading branch information
AutisticShark committed Apr 3, 2024
2 parents ed93a72 + e284317 commit 4dc80dc
Show file tree
Hide file tree
Showing 16 changed files with 293 additions and 201 deletions.
4 changes: 4 additions & 0 deletions app/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@
// 设置中心
$group->get('/setting/billing', App\Controllers\Admin\Setting\BillingController::class . ':index');
$group->post('/setting/billing', App\Controllers\Admin\Setting\BillingController::class . ':save');
$group->post(
'/setting/billing/set_stripe_webhook',
App\Controllers\Admin\Setting\BillingController::class . ':setStripeWebhook'
);
$group->get('/setting/captcha', App\Controllers\Admin\Setting\CaptchaController::class . ':index');
$group->post('/setting/captcha', App\Controllers\Admin\Setting\CaptchaController::class . ':save');
$group->get('/setting/cron', App\Controllers\Admin\Setting\CronController::class . ':index');
Expand Down
52 changes: 26 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 15 additions & 24 deletions config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,31 @@
"mark": "当面付自定义回调地址"
},
{
"item": "stripe_currency",
"value": "USD",
"class": "billing",
"is_public": 0,
"type": "string",
"default": "USD",
"mark": "货币代码"
},
{
"item": "stripe_sk",
"value": "stripe_sk",
"item": "stripe_api_key",
"value": "",
"class": "billing",
"is_public": 0,
"type": "string",
"default": "",
"mark": "stripe_sk"
"mark": "Stripe API Key"
},
{
"item": "stripe_pk",
"value": "stripe_pk",
"item": "stripe_endpoint_secret",
"value": "",
"class": "billing",
"is_public": 0,
"type": "string",
"default": "",
"mark": "stripe_pk"
"mark": "Stripe Endpoint Secret"
},
{
"item": "stripe_webhook_key",
"value": "stripe_webhook_key",
"item": "stripe_currency",
"value": "USD",
"class": "billing",
"is_public": 0,
"type": "string",
"default": "",
"mark": "web_hook密钥"
"default": "USD",
"mark": "Stripe Currency"
},
{
"item": "stripe_min_recharge",
Expand All @@ -96,7 +87,7 @@
"is_public": 1,
"type": "int",
"default": "10",
"mark": "最低充值限额"
"mark": "Stripe minimum recharge amount"
},
{
"item": "stripe_max_recharge",
Expand All @@ -105,7 +96,7 @@
"is_public": 1,
"type": "int",
"default": "1000",
"mark": "最高充值限额"
"mark": "Stripe maximum recharge amount"
},
{
"item": "stripe_card",
Expand All @@ -114,7 +105,7 @@
"is_public": 0,
"type": "bool",
"default": "0",
"mark": "银行卡支付"
"mark": "Stripe Card Payment"
},
{
"item": "stripe_alipay",
Expand All @@ -123,7 +114,7 @@
"is_public": 0,
"type": "bool",
"default": "0",
"mark": "支付宝支付"
"mark": "Stripe Alipay Payment"
},
{
"item": "stripe_wechat",
Expand All @@ -132,7 +123,7 @@
"is_public": 0,
"type": "bool",
"default": "0",
"mark": "微信支付"
"mark": "Stripe WeChat Payment"
},
{
"item": "epay_url",
Expand Down
33 changes: 17 additions & 16 deletions resources/views/tabler/admin/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,23 @@
</div>
<!-- js -->
<script>
$("#switch_theme_mode").click(function () {
$.ajax({
type: "POST",
url: "/user/switch_theme_mode",
dataType: "json",
success: function (data) {
if (data.ret === 1) {
$('#success-message').text(data.msg);
$('#success-dialog').modal('show');
window.setTimeout("location.reload()", {$config['jump_delay']});
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
let successDialog = new bootstrap.Modal(document.getElementById('success-dialog'));
let failDialog = new bootstrap.Modal(document.getElementById('fail-dialog'));
htmx.on("htmx:afterRequest", function(evt) {
if (evt.detail.xhr.getResponseHeader('HX-Refresh') === 'true' ||
evt.detail.xhr.getResponseHeader('HX-Trigger'))
{
return;
}
if (res.ret === 1) {
document.getElementById("success-message").innerHTML = res.msg;
successDialog.show();
} else {
document.getElementById("fail-message").innerHTML = res.msg;
failDialog.show();
}
});
$("#success-confirm").click(function () {
Expand Down
9 changes: 7 additions & 2 deletions resources/views/tabler/admin/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<script src="//{$config['jsdelivr_url']}/npm/qrcode_js@latest/qrcode.min.js"></script>
<script src="//{$config['jsdelivr_url']}/npm/clipboard@latest/dist/clipboard.min.js"></script>
<script src="//{$config['jsdelivr_url']}/npm/jquery/dist/jquery.min.js"></script>
<script src="//{$config['jsdelivr_url']}/npm/htmx.org@latest/dist/htmx.min.js"></script>
<style>
.home-subtitle {
font-size: 14px;
Expand Down Expand Up @@ -53,9 +54,13 @@
</a>
<div class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
{if $user->is_dark_mode}
<a id="switch_theme_mode" class="dropdown-item">浅色模式</a>
<a class="dropdown-item" hx-post="/user/switch_theme_mode" hx-swap="none">
浅色模式
</a>
{else}
<a id="switch_theme_mode" class="dropdown-item">深色模式</a>
<a class="dropdown-item" hx-post="/user/switch_theme_mode" hx-swap="none">
深色模式
</a>
{/if}
<a href="/user/logout" class="dropdown-item">登出</a>
</div>
Expand Down
Loading

0 comments on commit 4dc80dc

Please sign in to comment.