* Hide password and token of instance view page.
This commit is contained in:
@@ -42,6 +42,7 @@ class account extends control
|
||||
|
||||
$this->view->title = $this->lang->account->common;
|
||||
$this->view->accountList = $accountList;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter,noempty,noclosed');
|
||||
$this->view->pager = $pager;
|
||||
$this->view->param = $param;
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
@@ -31,7 +31,7 @@ jsVar('sortLink', helper::createLink('account', 'browse', "browseType=$browseTyp
|
||||
|
||||
dtable
|
||||
(
|
||||
set::userMap($accountList),
|
||||
set::userMap($users),
|
||||
set::cols(array_values($config->account->dtable->fieldList)),
|
||||
set::data($tableData),
|
||||
set::sortLink(jsRaw('createSortLink')),
|
||||
|
||||
@@ -33,11 +33,36 @@ window.afterPageUpdate = function()
|
||||
if($('#statusTD').data('reload') === true || $('#memoryRate').data('load') == true)
|
||||
{
|
||||
reloadTimes++;
|
||||
fetchContent({url: $.createLink('instance', 'view', 'id=' + instanceID),
|
||||
selector: '#instanceInfoContainer',
|
||||
id: 'instanceInfoContainer',
|
||||
target: '#instanceInfoContainer',
|
||||
});
|
||||
fetchContent
|
||||
({
|
||||
url: $.createLink('instance', 'view', 'id=' + instanceID),
|
||||
selector: '#instanceInfoContainer',
|
||||
id: 'instanceInfoContainer',
|
||||
target: '#instanceInfoContainer',
|
||||
});
|
||||
}
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
$('.copy-btn').on('click', function()
|
||||
{
|
||||
var copyText = $(this).parent().find('input');
|
||||
copyText.show();
|
||||
copyText[0].select();
|
||||
document.execCommand("Copy");
|
||||
copyText.hide();
|
||||
|
||||
var that = this;
|
||||
$(that).tooltip
|
||||
({
|
||||
trigger: 'click',
|
||||
placement: 'bottom',
|
||||
title: copied,
|
||||
tipClass: 'success',
|
||||
show:true
|
||||
});
|
||||
setTimeout(function()
|
||||
{
|
||||
$(that).tooltip('hide');
|
||||
}, 2000)
|
||||
})
|
||||
@@ -57,6 +57,10 @@ $lang->instance->installAt = 'Creation time';
|
||||
$lang->instance->runDuration = 'Running';
|
||||
$lang->instance->defaultAccount = 'Default User';
|
||||
$lang->instance->defaultPassword = 'Default Password';
|
||||
$lang->instance->account = 'User';
|
||||
$lang->instance->password = 'Password';
|
||||
$lang->instance->token = 'Token';
|
||||
$lang->instance->copied = 'Copy successful';
|
||||
$lang->instance->operationLog = 'Operation Record';
|
||||
$lang->instance->installedService = 'Installed Service';
|
||||
$lang->instance->runningService = 'Running Service';
|
||||
|
||||
@@ -57,6 +57,10 @@ $lang->instance->installAt = 'Creation time';
|
||||
$lang->instance->runDuration = 'Running';
|
||||
$lang->instance->defaultAccount = 'Default User';
|
||||
$lang->instance->defaultPassword = 'Default Password';
|
||||
$lang->instance->account = 'User';
|
||||
$lang->instance->password = 'Password';
|
||||
$lang->instance->token = 'Token';
|
||||
$lang->instance->copied = 'Copy successful';
|
||||
$lang->instance->operationLog = 'Operation Record';
|
||||
$lang->instance->installedService = 'Installed Service';
|
||||
$lang->instance->runningService = 'Running Service';
|
||||
|
||||
@@ -57,6 +57,10 @@ $lang->instance->installAt = 'Creation time';
|
||||
$lang->instance->runDuration = 'Running';
|
||||
$lang->instance->defaultAccount = 'Default User';
|
||||
$lang->instance->defaultPassword = 'Default Password';
|
||||
$lang->instance->account = 'User';
|
||||
$lang->instance->password = 'Password';
|
||||
$lang->instance->token = 'Token';
|
||||
$lang->instance->copied = 'Copy successful';
|
||||
$lang->instance->operationLog = 'Operation Record';
|
||||
$lang->instance->installedService = 'Installed Service';
|
||||
$lang->instance->runningService = 'Running Service';
|
||||
|
||||
@@ -58,6 +58,10 @@ $lang->instance->installAt = '创建时间';
|
||||
$lang->instance->runDuration = '已运行';
|
||||
$lang->instance->defaultAccount = '默认用户';
|
||||
$lang->instance->defaultPassword = '默认密码';
|
||||
$lang->instance->account = '用户名';
|
||||
$lang->instance->password = '密码';
|
||||
$lang->instance->token = 'Token';
|
||||
$lang->instance->copied = '复制成功';
|
||||
$lang->instance->operationLog = '操作记录';
|
||||
$lang->instance->installedService = '已安装服务';
|
||||
$lang->instance->runningService = '运行中的服务';
|
||||
|
||||
@@ -13,12 +13,24 @@ declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('copied', $lang->instance->copied);
|
||||
jsVar('instanceID', $instance->id);
|
||||
|
||||
$cpuInfo = $this->instance->printCpuUsage($instance, $instanceMetric->cpu, 'array');
|
||||
$memoryInfo = $this->instance->printMemUsage($instance, $instanceMetric->memory, 'array');
|
||||
$actions = $this->loadModel('common')->buildOperateMenu($instance);
|
||||
|
||||
if($type !== 'store')
|
||||
{
|
||||
$defaultAccount = new stdclass();
|
||||
$defaultAccount->username = $instance->account;
|
||||
$defaultAccount->password = $instance->password;
|
||||
$defaultAccount->token = $instance->token;
|
||||
|
||||
$lang->instance->defaultAccount = $lang->instance->account;
|
||||
$lang->instance->defaultPassword = $lang->instance->password;
|
||||
}
|
||||
|
||||
$dbListWg = array();
|
||||
foreach($dbList as $db)
|
||||
{
|
||||
@@ -149,8 +161,9 @@ div
|
||||
h::th($lang->instance->installBy),
|
||||
h::th($lang->instance->installAt),
|
||||
$type !== 'store' ? null : h::th($lang->instance->runDuration),
|
||||
$defaultAccount ? h::th($lang->instance->defaultAccount) : null,
|
||||
$defaultAccount ? h::th($lang->instance->defaultPassword) : null,
|
||||
!empty($defaultAccount->username) ? h::th($lang->instance->defaultAccount) : null,
|
||||
!empty($defaultAccount->password) ? h::th($lang->instance->defaultPassword) : null,
|
||||
!empty($defaultAccount->token) ? h::th($lang->instance->token) : null,
|
||||
$type === 'store' ? null : h::th($lang->instance->browseProject),
|
||||
),
|
||||
h::tr
|
||||
@@ -170,8 +183,17 @@ div
|
||||
h::td(zget($users, $instance->createdBy, '')),
|
||||
h::td(substr($instance->createdAt, 0, 16)),
|
||||
$type !== 'store' ? null : h::td(common::printDuration($instance->runDuration)),
|
||||
$defaultAccount ? h::td($defaultAccount->username) : null,
|
||||
$defaultAccount ? h::td($defaultAccount->password) : null,
|
||||
!empty($defaultAccount->username) ? h::td($defaultAccount->username) : null,
|
||||
!empty($defaultAccount->password) ? h::td
|
||||
(
|
||||
input(set::type('text'), set::value($defaultAccount->password), set::name('password'), setStyle('display', 'none')),
|
||||
btn(set::class('copy-btn ghost'),set::icon('copy'))
|
||||
): null,
|
||||
!empty($defaultAccount->token) ? h::td
|
||||
(
|
||||
input(set::type('text'), set::value($defaultAccount->token), set::name('token'), setStyle('display', 'none')),
|
||||
btn(set::class('copy-btn ghost'),set::icon('copy'))
|
||||
): null,
|
||||
$type === 'store' ? null : h::td
|
||||
(
|
||||
btn
|
||||
|
||||
Reference in New Issue
Block a user