You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
3.5 KiB
Smarty

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{assign var=admin_title value='新增基础套餐'}
{assign var=admin_active value='shop'}
{include file='admin/static_header.tpl'}
<div class="py-3 d-flex align-items-xl-center flex-xl-row flex-column gap-3">
<div class="flex-grow-1">
<h1 class="fs-20 fw-semibold mb-1">新增基础套餐</h1>
<p class="text-muted mb-0">基础套餐只定义 CPU、内存、磁盘、带宽、账期和流量;保存后再为不同资源池添加独立的美元价格与库存。</p>
</div>
<div class="admin-config-actions flex-shrink-0">
<span id="shopFormStatus" class="admin-config-status" role="status" aria-live="polite">待保存</span>
<a class="btn btn-light" href="/admin/shop">返回套餐列表</a>
<button class="btn btn-primary" id="shopFormSubmit" type="submit" form="shopForm" {if !$admin_can_manage|default:false}disabled{/if}>保存并配置销售方案</button>
</div>
</div>
<form class="card" id="shopForm" data-method="POST" data-url="/admin/shop">
<div class="card-body">
<div class="row g-3">
<div class="col-12"><label class="form-label" for="name">套餐名称</label><input class="form-control" id="name" name="name" type="text" maxlength="128" required></div>
<div class="col-md-6 col-xl-3"><label class="form-label" for="cpu_cores">CPU 核数</label><input class="form-control" id="cpu_cores" name="cpu_cores" type="number" min="1" max="64" step="1" value="2" required></div>
<div class="col-md-6 col-xl-3"><label class="form-label" for="memory_gb">内存(GB)</label><input class="form-control" id="memory_gb" name="memory_gb" type="number" min="0.5" max="256" step="0.5" value="2" required></div>
<div class="col-md-6 col-xl-3"><label class="form-label" for="disk_gib">磁盘(GB)</label><input class="form-control" id="disk_gib" name="disk_gib" type="number" min="1" max="4096" step="1" value="20" required></div>
<div class="col-md-6 col-xl-3"><label class="form-label" for="bandwidth_mbps">带宽(Mbps)</label><input class="form-control" id="bandwidth_mbps" name="bandwidth_mbps" type="number" min="1" max="100000" step="1" value="100" required></div>
<div class="col-md-6"><label class="form-label" for="validity_days">每期天数</label><input class="form-control" id="validity_days" name="validity_days" type="number" min="1" max="3650" step="1" value="30" required><div class="form-text">购买或续费一次增加的服务天数。</div></div>
<div class="col-md-6"><label class="form-label" for="traffic_tb">每期流量额度(TB)</label><input class="form-control" id="traffic_tb" name="traffic_tb" type="number" min="0" max="1024" step="0.0009765625" value="1" required><div class="form-text">最小步进 1 GiB;填 0 表示不限流量。</div></div>
<div class="col-md-6"><label class="form-label" for="sort">排序</label><input class="form-control" id="sort" name="sort" type="number" min="-1000000" max="1000000" step="1" value="0" required></div>
<div class="col-md-6"><label class="form-label" for="status">套餐状态</label><select class="form-select" id="status" name="status"><option value="1" selected>启用</option><option value="0">停用</option></select><div class="form-text">用户只能购买已启用套餐下已上架的销售方案。</div></div>
</div>
</div>
</form>
<div class="admin-toast" id="shopFormToast"></div>
{include file='admin/shop/form_js.tpl'}
{include file='admin/static_footer.tpl'}