Files
OMS/app/desktop/view/appmgr/console.html
2026-01-04 19:08:31 +08:00

117 lines
3.0 KiB
HTML

<!--
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title><{$conf.installer.title}> -<{t}> 控制台<{/t}></title>
<style>
html,body{
overflow:hidden;
margin:0;
padding:0;
font-size:12px;
font-family:Verdana;
background:#333;
}
pre,input{
border:none;
width:100%;
padding:0;
margin:0;
background:#333;
color:#fff;
height:100%;
font-size:12px;
}
pre{overflow:hidden;overflow-y:auto;line-height:20px;}
</style>
<script src="<{$base_url}>/app/desktop/statics/js/moo.js" type="text/javascript"></script>
</head>
<body>
<div id="console_panel">
<pre>
</pre>
<form action="" target="console-frame" method="post" ><input type="text" value="" /><input type="hidden" id="cmd" name="cmd" ></form>
</div>
<script>
window.addEvent('domready',function(){
var _opener = this.opener;
if(!_opener)return;
var csol = _opener.frames['_TASK_IFRM_'];
var _textarea = $('console_panel').getElement('pre');
var _input = $('console_panel').getElement('input');
var _form = $('console_panel').getElement('form');
if(!$('console-frame'))new Element('iframe',{'id':'console-frame','name':'console-frame'}).setStyle('display','none').inject(document.body);
_form.addEvent('submit',function(e){
var command = _input.value;
if(!command){
e.stop();
}
$('cmd').value = command;
_textarea.set('text',_textarea.get('text')+'\n'+command);
_input.value = '';
});
if(!csol)return;
(function(){
var csolv;
if(!csol||!csol.document)return;
try{
csolv = $(csol.document.body).get('text');
}catch(e){
csolv = csol.document.body.innerText;
}
if(!csolv)return;
if(csolv.trim()!=""&&_textarea.retrieve('temp::text',"")==csolv)return;
_textarea.set('text',_textarea.get('text')+'\n'+csolv);
_textarea.store('temp::text',csolv);
if(_input.value.trim()!="")return;
_textarea.scrollTop = _textarea.scrollHeight - _textarea.offsetHeight;
}).periodical(200);
window.addEvent('resize',(function(){
var winY = window.getSize().y;
// $('console_panel').setStyle('height',winY);
_textarea.setStyle('height',winY*0.9);
_input.setStyle('height',winY*0.1).focus();
return arguments.callee;
})());
});
</script>
</body>
</html>