Skip to content

Commit

Permalink
* Improve instance view page.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjianhua committed Nov 22, 2022
1 parent 3558e69 commit 16a5a97
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
18 changes: 18 additions & 0 deletions frontend/module/instance/js/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,24 @@ $(function()

$('#customBtn').on('click', function(event)
{
var errors = '';
$("#customForm").find("input[type=text]").each(function(index, item)
{
if($(item).val().trim().length == 0)
{
errors += $(item).attr('placeholder') + instanceNotices.required + '<br/>';
}
});
if(errors.length > 0)
{
bootbox.alert(
{
title: instanceNotices.error,
message: errors,
});
return;
}

bootbox.confirm(instanceNotices.confirmCustom, function(result)
{
if(!result) return;
Expand Down
2 changes: 2 additions & 0 deletions frontend/module/instance/lang/zh-cn.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
$lang->instance->notices = array();
$lang->instance->notices['success'] = '成功';
$lang->instance->notices['fail'] = '失败';
$lang->instance->notices['error'] = '错误';
$lang->instance->notices['confirmStart'] = '确定启动该应用吗?';
$lang->instance->notices['confirmStop'] = '确定关闭该应用吗?';
$lang->instance->notices['confirmUninstall'] = '确定卸载该应用吗?';
Expand Down Expand Up @@ -247,6 +248,7 @@
$lang->instance->notices['enableSMTPSuccess'] = '启用SMTP成功';
$lang->instance->notices['disableSMTPSuccess'] = '禁用SMTP成功';
$lang->instance->notices['confirmCustom'] = '修改自定义配置后请手动重启服务以使配置生效。';
$lang->instance->notices['required'] = '不能为空';

$lang->instance->nameChangeTo = ' %s 修改为 %s 。';
$lang->instance->versionChangeTo = ' %s 升级为 %s 。';
Expand Down
10 changes: 5 additions & 5 deletions frontend/module/instance/view/advance.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
<tr>
<?php $LDAPInstalled = $this->system->hasSystemLDAP();?>
<?php $enableLDAP = $instance->ldapSnippetName ? 'true' : '' ;?>
<td class='w-100px'><?php echo html::checkbox('enableLDAP', array('true' => $lang->instance->enableLDAP), $enableLDAP, ($LDAPInstalled ? '' : 'disabled'));?></td>
<td class='w-120px'><?php echo html::checkbox('enableLDAP', array('true' => $lang->instance->enableLDAP), $enableLDAP, ($LDAPInstalled ? '' : 'disabled'));?></td>
<td colspan='2'>
<?php if(!$LDAPInstalled):?>
<?php echo $lang->instance->systemLDAPInactive;?>
<?php echo html::a(helper::createLink('system', 'installLDAP'), $lang->instance->toSystemLDAP, '', "class='btn btn-link'");?>
<?php echo html::a(helper::createLink('system', 'installLDAP'), $lang->instance->toSystemLDAP, '', "class='btn btn-default'");?>
<?php endif?>
</td>
<td></td>
Expand All @@ -71,11 +71,11 @@
<tr>
<?php $SMTPInstalled = $this->system->isSMTPEnabled();?>
<?php $enableSMTP = $instance->smtpSnippetName ? 'true' : '' ;?>
<td class='w-100px'><?php echo html::checkbox('enableSMTP', array('true' => $lang->instance->enableSMTP), $enableSMTP, ($SMTPInstalled ? '' : 'disabled'));?></td>
<td class='w-120px'><?php echo html::checkbox('enableSMTP', array('true' => $lang->instance->enableSMTP), $enableSMTP, ($SMTPInstalled ? '' : 'disabled'));?></td>
<td colspan='2'>
<?php if(!$SMTPInstalled):?>
<?php echo $lang->instance->systemSMTPInactive;?>
<?php echo html::a(helper::createLink('system', 'installSMTP'), $lang->instance->toSystemSMTP, '', "class='btn btn-link'");?>
<?php echo html::a(helper::createLink('system', 'installSMTP'), $lang->instance->toSystemSMTP, '', "class='btn btn-default'");?>
<?php endif?>
</td>
<td></td>
Expand Down Expand Up @@ -103,7 +103,7 @@
<tr>
<th><?php echo $item->label;?></th>
<td>
<?php echo html::input($item->name, $item->default, "class='form-control'");?>
<?php echo html::input($item->name, $item->default, "class='form-control' placeholder='{$item->label}'");?>
</td>
<td></td>
<td></td>
Expand Down

0 comments on commit 16a5a97

Please sign in to comment.