Skip to content

Commit

Permalink
添加项目文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Nov 30, 2018
1 parent c0d7662 commit eb3906f
Show file tree
Hide file tree
Showing 786 changed files with 113,766 additions and 0 deletions.
944 changes: 944 additions & 0 deletions BTPanel.pyproj

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions BTPanel.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "BTPanel", "BTPanel.pyproj", "{971A9E98-428E-48CB-89F1-9042336AB2E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{971A9E98-428E-48CB-89F1-9042336AB2E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{971A9E98-428E-48CB-89F1-9042336AB2E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{971A9E98-428E-48CB-89F1-9042336AB2E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{971A9E98-428E-48CB-89F1-9042336AB2E1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0583A78D-D302-4B1D-A28C-677ED3263CE4}
EndGlobalSection
EndGlobal
774 changes: 774 additions & 0 deletions BTPanel/__init__.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions BTPanel/static/bootstrap-3.3.5/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions BTPanel/static/bootstrap-3.3.5/css/bootstrap.min.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions BTPanel/static/bootstrap-3.3.5/css/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">目标URL</span><input class="bt-input-text" type="text" name="toUrl" value="http://" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="请填写完整URL,例:http://www.test.com"></p>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">发送域名</span><input class="bt-input-text" type="text" name="toDomain" value="$host" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="发送到目标服务器的域名,例:www.test.com"></p>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">内容替换</span><input class="bt-input-text" type="text" name="sub1" value="" style="margin-left: 5px;width: 182px;height: 30px;margin-right:10px;" placeholder="被替换的文本,可留空"><input class="bt-input-text" type="text" name="sub2" value="" style="margin-left: 5px;width: 183px;height: 30px;margin-right:10px;" placeholder="替换为,可留空"></p>
<div class="label-input-group ptb10"><label style="font-weight:normal"><input type="checkbox" name="status" onclick="Proxy('w6.hao.com',1)">启用反向代理</label><label style="margin-left: 18px;"><input type="checkbox" name="status" onclick="OpenCache('w6.hao.com',1)">开启缓存</label></div>
<ul class="help-info-text c7 ptb10">
<li>目标Url必需是可以访问的,否则将直接502</li>
<li>默认本站点所有域名访问将被传递到目标服务器,请确保目标服务器已绑定域名</li>
<li>若您是被动代理,请在发送域名处填写上目标站点的域名</li>
<li>若您不需要内容替换功能,请直接留空</li>
<li>可通过purge清理指定URL的缓存,示例:http://test.com/purge/test.png</li>
</ul>
</div>
Binary file not shown.
288 changes: 288 additions & 0 deletions BTPanel/static/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions BTPanel/static/bootstrap-3.3.5/fonts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">目标URL</span><input class="bt-input-text" type="text" name="toUrl" value="http://" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="请填写完整URL,例:http://www.test.com"></p>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">发送域名</span><input class="bt-input-text" type="text" name="toDomain" value="$host" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="发送到目标服务器的域名,例:www.test.com"></p>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">内容替换</span><input class="bt-input-text" type="text" name="sub1" value="" style="margin-left: 5px;width: 182px;height: 30px;margin-right:10px;" placeholder="被替换的文本,可留空"><input class="bt-input-text" type="text" name="sub2" value="" style="margin-left: 5px;width: 183px;height: 30px;margin-right:10px;" placeholder="替换为,可留空"></p>
<div class="label-input-group ptb10"><label style="font-weight:normal"><input type="checkbox" name="status" onclick="Proxy('w6.hao.com',1)">启用反向代理</label><label style="margin-left: 18px;"><input type="checkbox" name="status" onclick="OpenCache('w6.hao.com',1)">开启缓存</label></div>
<ul class="help-info-text c7 ptb10">
<li>目标Url必需是可以访问的,否则将直接502</li>
<li>默认本站点所有域名访问将被传递到目标服务器,请确保目标服务器已绑定域名</li>
<li>若您是被动代理,请在发送域名处填写上目标站点的域名</li>
<li>若您不需要内容替换功能,请直接留空</li>
<li>可通过purge清理指定URL的缓存,示例:http://test.com/purge/test.png</li>
</ul>
</div>
13 changes: 13 additions & 0 deletions BTPanel/static/bootstrap-3.3.5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">目标URL</span><input class="bt-input-text" type="text" name="toUrl" value="http://" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="请填写完整URL,例:http://www.test.com"></p>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">发送域名</span><input class="bt-input-text" type="text" name="toDomain" value="$host" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="发送到目标服务器的域名,例:www.test.com"></p>
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">内容替换</span><input class="bt-input-text" type="text" name="sub1" value="" style="margin-left: 5px;width: 182px;height: 30px;margin-right:10px;" placeholder="被替换的文本,可留空"><input class="bt-input-text" type="text" name="sub2" value="" style="margin-left: 5px;width: 183px;height: 30px;margin-right:10px;" placeholder="替换为,可留空"></p>
<div class="label-input-group ptb10"><label style="font-weight:normal"><input type="checkbox" name="status" onclick="Proxy('w6.hao.com',1)">启用反向代理</label><label style="margin-left: 18px;"><input type="checkbox" name="status" onclick="OpenCache('w6.hao.com',1)">开启缓存</label></div>
<ul class="help-info-text c7 ptb10">
<li>目标Url必需是可以访问的,否则将直接502</li>
<li>默认本站点所有域名访问将被传递到目标服务器,请确保目标服务器已绑定域名</li>
<li>若您是被动代理,请在发送域名处填写上目标站点的域名</li>
<li>若您不需要内容替换功能,请直接留空</li>
<li>可通过purge清理指定URL的缓存,示例:http://test.com/purge/test.png</li>
</ul>
</div>
141 changes: 141 additions & 0 deletions BTPanel/static/build/addons/attach/attach.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* @license MIT
*
* Implements the attach method, that attaches the terminal to a WebSocket stream.
*/

(function (attach) {
if (typeof exports === 'object' && typeof module === 'object') {
/*
* CommonJS environment
*/
module.exports = attach(require('../../Terminal').Terminal);
} else if (typeof define == 'function') {
/*
* Require.js is available
*/
define(['../../xterm'], attach);
} else {
/*
* Plain browser environment
*/
attach(window.Terminal);
}
})(function (Terminal) {
'use strict';

var exports = {};

/**
* Attaches the given terminal to the given socket.
*
* @param {Terminal} term - The terminal to be attached to the given socket.
* @param {WebSocket} socket - The socket to attach the current terminal.
* @param {boolean} bidirectional - Whether the terminal should send data
* to the socket as well.
* @param {boolean} buffered - Whether the rendering of incoming data
* should happen instantly or at a maximum
* frequency of 1 rendering per 10ms.
*/
exports.attach = function (term, socket, bidirectional, buffered) {
bidirectional = (typeof bidirectional == 'undefined') ? true : bidirectional;
term.socket = socket;

term._flushBuffer = function () {
term.write(term._attachSocketBuffer);
term._attachSocketBuffer = null;
};

term._pushToBuffer = function (data) {
if (term._attachSocketBuffer) {
term._attachSocketBuffer += data;
} else {
term._attachSocketBuffer = data;
setTimeout(term._flushBuffer, 10);
}
};

var myTextDecoder;

term._getMessage = function (ev) {
var str;
if (typeof ev.data === "object") {
if (ev.data instanceof ArrayBuffer) {
if (!myTextDecoder) {
myTextDecoder = new TextDecoder();
}

str = myTextDecoder.decode( ev.data );
}
else {
throw "TODO: handle Blob?";
}
}

if (buffered) {
term._pushToBuffer(str || ev.data);
} else {
term.write(str || ev.data);
}
};

term._sendData = function (data) {
socket.send(data);
};

socket.addEventListener('message', term._getMessage);

if (bidirectional) {
term.on('data', term._sendData);
}

socket.addEventListener('close', term.detach.bind(term, socket));
socket.addEventListener('error', term.detach.bind(term, socket));
};

/**
* Detaches the given terminal from the given socket
*
* @param {Terminal} term - The terminal to be detached from the given socket.
* @param {WebSocket} socket - The socket from which to detach the current
* terminal.
*/
exports.detach = function (term, socket) {
term.off('data', term._sendData);

socket = (typeof socket == 'undefined') ? term.socket : socket;

if (socket) {
socket.removeEventListener('message', term._getMessage);
}

delete term.socket;
};

/**
* Attaches the current terminal to the given socket
*
* @param {WebSocket} socket - The socket to attach the current terminal.
* @param {boolean} bidirectional - Whether the terminal should send data
* to the socket as well.
* @param {boolean} buffered - Whether the rendering of incoming data
* should happen instantly or at a maximum
* frequency of 1 rendering per 10ms.
*/
Terminal.prototype.attach = function (socket, bidirectional, buffered) {
return exports.attach(this, socket, bidirectional, buffered);
};

/**
* Detaches the current terminal from the given socket.
*
* @param {WebSocket} socket - The socket from which to detach the current
* terminal.
*/
Terminal.prototype.detach = function (socket) {
return exports.detach(this, socket);
};

return exports;
});
93 changes: 93 additions & 0 deletions BTPanel/static/build/addons/attach/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="../../src/xterm.css" />
<link rel="stylesheet" href="../../demo/style.css" />
<script src="../../src/xterm.js"></script>
<script src="attach.js"></script>
<style>
body {
color: #111;
}

h1, h2 {
color: #444;
border-bottom: 1px solid #ddd;
text-align: left;
}

form {
margin-bottom: 32px;
}

input, button {
line-height: 22px;
font-size: 16px;
display: inline-block;
border-radius: 2px;
border: 1px solid #ccc;
}

input {
height: 22px;
padding-left: 4px;
padding-right: 4px;
}

button {
height: 28px;
background-color: #ccc;
cursor: pointer;
color: #333;
}

.container {
max-width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="container">

<h1>
xterm.js: socket attach
</h1>
<p>
Attach the terminal to a WebSocket terminal stream with ease. Perfect for attaching to your
Docker containers.
</p>
<h2>
Socket information
</h2>
<form id="socket-form">
<input id="socket-url"
type="text"
placeholder="Enter socket url (e.g. ws://mysock)"
autofocus />
<button>
Attach
</button>
</form>
<div id="terminal-container"></div>

</div>
<script>
var term = new Terminal(),
container = document.getElementById('terminal-container'),
socketUrl = document.getElementById('socket-url'),
socketForm = document.getElementById('socket-form');

socketForm.addEventListener('submit', function (ev) {
ev.preventDefault();
var url = socketUrl.value,
sock = new WebSocket(url);
sock.addEventListener('open', function () {
term.attach(sock);
});
});

term.open(container);
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions BTPanel/static/build/addons/attach/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "xterm.attach",
"main": "attach.js",
"private": true
}
81 changes: 81 additions & 0 deletions BTPanel/static/build/addons/fit/fit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* @license MIT
*
* Fit terminal columns and rows to the dimensions of its DOM element.
*
* ## Approach
*
* Rows: Truncate the division of the terminal parent element height by the
* terminal row height.
* Columns: Truncate the division of the terminal parent element width by the
* terminal character width (apply display: inline at the terminal
* row and truncate its width with the current number of columns).
*/

(function (fit) {
if (typeof exports === 'object' && typeof module === 'object') {
/*
* CommonJS environment
*/
module.exports = fit(require('../../Terminal').Terminal);
} else if (typeof define == 'function') {
/*
* Require.js is available
*/
define(['../../xterm'], fit);
} else {
/*
* Plain browser environment
*/
fit(window.Terminal);
}
})(function (Terminal) {
var exports = {};

exports.proposeGeometry = function (term) {
if (!term.element.parentElement) {
return null;
}
var parentElementStyle = window.getComputedStyle(term.element.parentElement);
var parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
var parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')) - 17);
var elementStyle = window.getComputedStyle(term.element);
var elementPaddingVer = parseInt(elementStyle.getPropertyValue('padding-top')) + parseInt(elementStyle.getPropertyValue('padding-bottom'));
var elementPaddingHor = parseInt(elementStyle.getPropertyValue('padding-right')) + parseInt(elementStyle.getPropertyValue('padding-left'));
var availableHeight = parentElementHeight - elementPaddingVer;
var availableWidth = parentElementWidth - elementPaddingHor;
var geometry = {
cols: Math.floor(availableWidth / term.charMeasure.width),
rows: Math.floor(availableHeight / Math.floor(term.charMeasure.height * term.getOption('lineHeight')))
};

return geometry;
};

exports.fit = function (term) {
// Wrap fit in a setTimeout as charMeasure needs time to get initialized
// after calling Terminal.open
setTimeout(function () {
var geometry = exports.proposeGeometry(term);

if (geometry) {
// Force a full render
if (term.rows !== geometry.rows || term.cols !== geometry.cols) {
term.renderer.clear();
term.resize(geometry.cols, geometry.rows);
}
}
}, 0);
};

Terminal.prototype.proposeGeometry = function () {
return exports.proposeGeometry(this);
};

Terminal.prototype.fit = function () {
return exports.fit(this);
};

return exports;
});
Loading

0 comments on commit eb3906f

Please sign in to comment.