mirror of https://gitee.com/apiumc/Gateway.git
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.
214 lines
7.8 KiB
HTML
214 lines
7.8 KiB
HTML
<!doctype html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>ITME Web SSH</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
|
|
<link href="/css/weui.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/base.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/icon.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/umc.ui.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/umc.css" rel="stylesheet" type="text/css" />
|
|
|
|
<script src="/js/umc.js" type="text/javascript"></script>
|
|
|
|
<style>
|
|
.app-main {
|
|
height: 100vh;
|
|
}
|
|
|
|
#app .main-container {
|
|
margin: 0px !important;
|
|
}
|
|
|
|
.el-link iframe {
|
|
height: 100vh;
|
|
}
|
|
|
|
div[ui=WebSSH] #terminal::before {
|
|
content: attr(data-msg);
|
|
text-align: center;
|
|
top: 45%;
|
|
top: 40%;
|
|
position: absolute;
|
|
width: 100%;
|
|
}
|
|
div[ui=WebSSH] #terminal{
|
|
min-height: 100vh;
|
|
position: relative;
|
|
}
|
|
</style>
|
|
<script src="/js/umc.date.js"></script>
|
|
<script src="/js/umc.page.js"></script>
|
|
<script src="/js/umc.paging.js"></script>
|
|
<script>(function ($) {
|
|
|
|
$.Src = '/UMC.UI/';
|
|
$.SPA = '/';
|
|
window.apiumc = function (p) {
|
|
$('div[ui].ui').on('UI.' + p.type, p, p.value);
|
|
}
|
|
var callFn = {};
|
|
var callJ = 0;
|
|
UMC.UI.Bridge = function (v, fn) {
|
|
var key = 'd' + callJ;
|
|
callFn[key] = fn;
|
|
callJ++;
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'umc',
|
|
value: v,
|
|
key: key
|
|
}), "*");
|
|
|
|
}
|
|
$.UI.Off('Prompt').On("Prompt", function (e, p) {
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'msg',
|
|
value: p.Text
|
|
}), "*");
|
|
});
|
|
$(function () {
|
|
var app = $('section.app-main');
|
|
UMC(document.body).on('UI.Key.Url', function (e, v) {
|
|
location.href = v;
|
|
}).on('UI.Key.Markdown', function (e, v) {
|
|
var m = v || v.submit;
|
|
var send = m.send;
|
|
delete m.send;
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'open',
|
|
value: { max: true, src: '/Desktop/Markdown?' + $.query($.extend(m, send)) }
|
|
}), "*");
|
|
|
|
}).on('UI.Key.Nav', function (e, v) {
|
|
switch (v) {
|
|
case 'Doc':
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'open',
|
|
value: { max: true, src: '/Docs?itme/webssh' }
|
|
}), "*");
|
|
break;
|
|
case "WebSSH":
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'open',
|
|
value: { max: true, src: '/WebSSH' }
|
|
}), "*");
|
|
break;
|
|
}
|
|
});
|
|
$.UI.On('UI.Push', function (e, xhr) {
|
|
|
|
var last = app.children('div.ui').cls('ui', 0);
|
|
if (last.on('backstage') !== false)
|
|
last.remove();
|
|
if (xhr.root.cls('ui', 1).parent()[0] != app[0]) {
|
|
xhr.root.appendTo(app);
|
|
}
|
|
xhr.root.on('active');
|
|
|
|
var v = {
|
|
title: xhr.title,
|
|
menu: xhr.menu || []
|
|
}
|
|
if (xhr.search) {
|
|
v.search = true;
|
|
}
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'page',
|
|
value: v
|
|
}), "*");
|
|
|
|
});
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'nav',
|
|
value: [{
|
|
click: {
|
|
'key': 'Nav',
|
|
'send': 'WebSSH'
|
|
}, text: '我的设备'
|
|
}, {
|
|
click: {
|
|
'key': 'Nav',
|
|
'send': 'Doc'
|
|
}, text: '帮助文档'
|
|
}]
|
|
}), "*");
|
|
|
|
|
|
$(window).on('message', function (e) {
|
|
var data = {};
|
|
try {
|
|
data = JSON.parse(e.data);
|
|
} catch (c) {
|
|
return;
|
|
}
|
|
switch (data.type) {
|
|
case 'searchValue':
|
|
app.children('div[ui].ui').on('searchValue', data.data)
|
|
break;
|
|
case 'search':
|
|
var root = app.children('div[ui].ui');
|
|
root.on('search', data.data) !== false ?
|
|
root.find('.pagination-container')
|
|
.on('search', data.data) : 0;
|
|
break;
|
|
case 'event':
|
|
app.children('div[ui].ui').last().on('event', data.data);
|
|
break;
|
|
case 'config':
|
|
$.UI.Config(data.data);
|
|
break;
|
|
case 'click':
|
|
$.Click(data.data);
|
|
break;
|
|
case 'umc':
|
|
var fn = callFn[data.key] || $.UI.Ready;
|
|
delete callFn[data.key];
|
|
fn(data.data);
|
|
break;
|
|
}
|
|
}).on('search', function (e, t) {
|
|
if (Array.isArray(t)) {
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'search',
|
|
value: t
|
|
}), "*");
|
|
}
|
|
}).on('menu', function (e, t) {
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'menu',
|
|
value: t
|
|
}), "*");
|
|
}).on('title', function (e, t) {
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'title',
|
|
value: t
|
|
}), "*");
|
|
}).on('fullscreenchange,webkitfullscreenchange,mozfullscreenchange', function () {
|
|
$(document.body).cls('umc-fullscreen', document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen);
|
|
});
|
|
window.top.postMessage(JSON.stringify({
|
|
type: 'config',
|
|
value: {}
|
|
}), "*");
|
|
|
|
|
|
$.page('WebSSH', 'Web SSH', false);
|
|
UMC.shift('main', 'WebSSH');
|
|
$(window).on('popstate');
|
|
});
|
|
|
|
})(UMC);</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
<div class="main-container">
|
|
<section class="app-main">
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |