feat: 后端全量更新 - 含所有本次需求

- Contract.php: 返回合约账户余额(balance_contract)
- My.php: 地址管理增加BTC/ETH
- AppContract.php: 一键平仓(closeall)
- AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2)
- site.php: 手续费减半(0.018→0.009)
- agent_permission_setup.sql: 代理权限SQL
- crypto_news_crawler.py: 新闻自动采集脚本
This commit is contained in:
li
2026-03-30 20:16:32 +08:00
commit 1b24994e74
6721 changed files with 1308571 additions and 0 deletions
+219
View File
@@ -0,0 +1,219 @@
/*
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
*/
/*
* Removable modules are commented out in this file with "!!" in the comment.
* This index demonstrates building a minimal library from source. There is a maximal example in the same directory.
*/
/* tslint:disable:ordered-imports */
import { EnumValue } from '../../srcTS/enumValue';
import { Map, Set, List } from '../../srcTS/collections';
import { Point } from '../../srcTS/point';
import { Size } from '../../srcTS/size';
import { Rect } from '../../srcTS/rect';
import { Margin } from '../../srcTS/margin';
import { Spot } from '../../srcTS/spot';
import { PathSegment, PathFigure, Geometry } from '../../srcTS/geometry';
import { DiagramEvent, InputEvent } from '../../srcTS/inputEvent';
import { ChangedEvent } from '../../srcTS/changedEvent';
import { Binding, Model } from '../../srcTS/model';
import { UndoManager, Transaction } from '../../srcTS/undoManager';
import { Tool } from '../../srcTS/tool';
import { ToolManager } from '../../srcTS/toolManager';
import { AnimationManager } from '../../srcTS/animationManager';
import { Layer } from '../../srcTS/layer';
import { Diagram } from '../../srcTS/diagram';
import { Brush } from '../../srcTS/brush';
import { GraphObject } from '../../srcTS/graphObject';
import { Panel } from '../../srcTS/panel';
import { RowColumnDefinition } from '../../srcTS/rowColumnDefinition';
import { Shape } from '../../srcTS/shape';
import { TextBlock, TextBlockMetrics } from '../../srcTS/textBlock';
import { Picture } from '../../srcTS/picture';
import { Adornment, Part } from '../../srcTS/parts';
import { Node } from '../../srcTS/parts';
import { Link } from '../../srcTS/parts';
import { Group, Placeholder } from '../../srcTS/parts';
import { LayoutEdge, LayoutVertex, LayoutNetwork, Layout } from '../../srcTS/layout';
// Already imported in Panel
// import { PanelLayoutPosition } from '../../srcTS/panelLayoutPosition';
// import { PanelLayoutVertical } from '../../srcTS/panelLayoutVertical';
// import { PanelLayoutAuto } from '../../srcTS/panelLayoutAuto';
// import { PanelLayoutLink } from '../../srcTS/panelLayoutLink';
// import { PanelLayoutGrid } from '../../srcTS/panelLayoutGrid';
/* !!
import { root } from '../../srcTS/root';
import { CommandHandler } from '../../srcTS/commandHandler';
import { DraggingTool } from '../../srcTS/draggingTool';
import { RelinkingTool, LinkingTool, LinkingBaseTool } from '../../srcTS/linkingTools';
import { LinkReshapingTool } from '../../srcTS/linkReshapingTool';
import { ResizingTool } from '../../srcTS/resizingTool';
import { RotatingTool } from '../../srcTS/rotatingTool';
import { PanningTool, DragSelectingTool, ClickCreatingTool, ActionTool, ClickSelectingTool } from '../../srcTS/selectingTools';
import { TextEditingTool } from '../../srcTS/textEditingTool';
import { ContextMenuTool } from '../../srcTS/contextMenuTool';
import { GridLayout } from '../../srcTS/gridLayout';
import { CircularEdge, CircularVertex, CircularNetwork, CircularLayout } from '../../srcTS/circularLayout';
import { ForceDirectedEdge, ForceDirectedVertex, ForceDirectedNetwork, ForceDirectedLayout } from '../../srcTS/forceDirectedLayout';
import { LayeredDigraphEdge, LayeredDigraphVertex, LayeredDigraphNetwork, LayeredDigraphLayout } from '../../srcTS/layeredDigraphLayout';
import { TreeEdge, TreeVertex, TreeNetwork, TreeLayout } from '../../srcTS/treeLayout';
import { SVGSurface } from '../../srcTS/svgContext';
import { PanelLayoutPosition } from '../../srcTS/panelLayoutPosition';
import { PanelLayoutHorizontal } from '../../srcTS/panelLayoutHorizontal';
import { PanelLayoutVertical } from '../../srcTS/panelLayoutVertical';
import { PanelLayoutSpot } from '../../srcTS/panelLayoutSpot';
import { PanelLayoutAuto } from '../../srcTS/panelLayoutAuto';
import { PanelLayoutTable, PanelLayoutTableRow, PanelLayoutTableColumn } from '../../srcTS/panelLayoutTable';
import { PanelLayoutViewbox } from '../../srcTS/panelLayoutViewbox';
import { PanelLayoutLink } from '../../srcTS/panelLayoutLink';
import { PanelLayoutGrid } from '../../srcTS/panelLayoutGrid';
import { PanelLayoutGraduated } from '../../srcTS/panelLayoutGraduated';
*/
/* !!
ToolManager.prototype.initializeStandardTools = function(this: ToolManager): void {
// For each of these lists, the tools need to be assigned in a specific order,
// so that they are added to the list in the correct order.
// mouse-down tools:
this.replaceStandardTool('Action', new ActionTool(), this.mouseDownTools);
this.replaceStandardTool('Relinking', new RelinkingTool(), this.mouseDownTools);
this.replaceStandardTool('LinkReshaping', new LinkReshapingTool(), this.mouseDownTools);
this.replaceStandardTool('Resizing', new ResizingTool(), this.mouseDownTools);
this.replaceStandardTool('Rotating', new RotatingTool(), this.mouseDownTools);
// mouse-move tools:
this.replaceStandardTool('Linking', new LinkingTool(), this.mouseMoveTools);
this.replaceStandardTool('Dragging', new DraggingTool(), this.mouseMoveTools);
this.replaceStandardTool('DragSelecting', new DragSelectingTool(), this.mouseMoveTools);
this.replaceStandardTool('Panning', new PanningTool(), this.mouseMoveTools);
// mouse-up tools:
this.replaceStandardTool('ContextMenu', new ContextMenuTool(), this.mouseUpTools);
this.replaceStandardTool('TextEditing', new TextEditingTool(), this.mouseUpTools);
this.replaceStandardTool('ClickCreating', new ClickCreatingTool(), this.mouseUpTools);
this.replaceStandardTool('ClickSelecting', new ClickSelectingTool(), this.mouseUpTools);
};
Diagram.prototype.initializeStandardRenderers = function(this: Diagram): void {
this.addRenderer('SVG', new SVGSurface(this, root.document));
};
Panel.addPanelLayout('Position', new PanelLayoutPosition());
Panel.addPanelLayout('Horizontal', new PanelLayoutHorizontal());
Panel.addPanelLayout('Vertical', new PanelLayoutVertical());
Panel.addPanelLayout('Spot', new PanelLayoutSpot());
Panel.addPanelLayout('Auto', new PanelLayoutAuto());
Panel.addPanelLayout('Table', new PanelLayoutTable());
Panel.addPanelLayout('Viewbox', new PanelLayoutViewbox());
Panel.addPanelLayout('TableRow', new PanelLayoutTableRow());
Panel.addPanelLayout('TableColumn', new PanelLayoutTableColumn());
Panel.addPanelLayout('Link', new PanelLayoutLink());
Panel.addPanelLayout('Grid', new PanelLayoutGrid());
Panel.addPanelLayout('Graduated', new PanelLayoutGraduated());
*/
export const go = {
get licenseKey() {
return Diagram.licenseKey;
},
set licenseKey (licx) {
Diagram.licenseKey = licx;
},
get version() {
return Diagram.version;
},
'Group': Group,
'EnumValue': EnumValue,
'List': List,
'Set': Set,
'Map': Map,
'Point': Point,
'Size': Size,
'Rect': Rect,
'Margin': Margin,
'Spot': Spot,
'Geometry': Geometry,
'PathFigure': PathFigure,
'PathSegment': PathSegment,
'InputEvent': InputEvent,
'DiagramEvent': DiagramEvent,
'ChangedEvent': ChangedEvent,
'Model': Model,
'Binding': Binding,
'Transaction': Transaction,
'UndoManager': UndoManager,
'Tool': Tool,
'ToolManager': ToolManager,
'AnimationManager': AnimationManager,
'Layer': Layer,
'Diagram': Diagram,
'Brush': Brush,
'GraphObject': GraphObject,
'Panel': Panel,
'RowColumnDefinition': RowColumnDefinition,
'Shape': Shape,
'TextBlock': TextBlock,
'TextBlockMetrics': TextBlockMetrics,
'Picture': Picture,
'Part': Part,
'Adornment': Adornment,
'Node': Node,
'Link': Link,
'Placeholder': Placeholder,
'Layout': Layout,
'LayoutNetwork': LayoutNetwork,
'LayoutVertex': LayoutVertex,
'LayoutEdge': LayoutEdge
/* !!
'DraggingTool': DraggingTool,
'DraggingInfo': DraggingInfo,
'LinkingBaseTool': LinkingBaseTool,
'LinkingTool': LinkingTool,
'RelinkingTool': RelinkingTool,
'LinkReshapingTool': LinkReshapingTool,
'ResizingTool': ResizingTool,
'RotatingTool': RotatingTool,
'ClickSelectingTool': ClickSelectingTool,
'ActionTool': ActionTool,
'ClickCreatingTool': ClickCreatingTool,
'HTMLInfo': HTMLInfo,
'ContextMenuTool': ContextMenuTool,
'DragSelectingTool': DragSelectingTool,
'PanningTool': PanningTool,
'TextEditingTool': TextEditingTool,
'GraphLinksModel': GraphLinksModel,
'TreeModel': TreeModel,
'CommandHandler': CommandHandler,
'Palette': Palette,
'Overview': Overview,
'GridLayout': GridLayout,
'CircularLayout': CircularLayout,
'CircularNetwork': CircularNetwork,
'CircularVertex': CircularVertex,
'CircularEdge': CircularEdge,
'ForceDirectedLayout': ForceDirectedLayout,
'ForceDirectedNetwork': ForceDirectedNetwork,
'ForceDirectedVertex': ForceDirectedVertex,
'ForceDirectedEdge': ForceDirectedEdge,
'LayeredDigraphLayout': LayeredDigraphLayout,
'LayeredDigraphNetwork': LayeredDigraphNetwork,
'LayeredDigraphVertex': LayeredDigraphVertex,
'LayeredDigraphEdge': LayeredDigraphEdge,
'TreeLayout': TreeLayout,
'TreeNetwork': TreeNetwork,
'TreeVertex': TreeVertex,
'TreeEdge': TreeEdge
*/
};
+47
View File
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webpack Minimal GoJS Sample</title>
<meta name="description" content="An almost minimal diagram using a very simple node template and the default link template." />
<!-- Copyright 1998-2020 by Northwoods Software Corporation. -->
<meta charset="UTF-8">
<script src="minimal.js"></script>
<script>
window.onload = function() {
// window.init() was created in minimal.js, which was built from minimal.ts with webpack. See readme for details.
init();
}
</script>
</head>
<body>
<div id="sample">
<!-- The DIV for the Diagram needs an explicit size or else we won't see anything.
This also adds a border to help see the edges of the viewport. -->
<div id="myDiagramDiv" style="border: solid 1px black; width:400px; height:400px"></div>
<p>
This sample uses a JavaScript file that is built with Webpack. If you do not see a diagram, you may need to build first.
See the <a href="./readme.md">readme.md in this directory</a> for details.
</p>
<p>
This minimal sample contains as few GoJS modules as possible when building from the source.
As a result, there is almost no interactivity possible, as no tools or the CommandHandler exist.
There are also no Layouts (except the base Layout), Overviews, or Palettes.
</p>
<p>
If you look at the <a href="./minimal-index.ts">minimal-index.ts</a> you will see what is dis-included.
</p>
<p>
For an example of building GoJS from source with all modules, see the <a href="../maximalSource/maximal.html">Maximal project</a> adjacent to this directory.
</p>
</div>
</body>
</html>
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
*/
/*
The code in this file is typical of a "minimal" sample, except it uses Model instead of GraphLinksModel.
The code which dis-includes unused modules can be found in minimal-index.ts
*/
import { go } from './minimal-index';
window.init = function() {
const $ = go.GraphObject.make; // for conciseness in defining templates
const myDiagram = $(go.Diagram, 'myDiagramDiv', // create a Diagram for the DIV HTML element
{
'undoManager.isEnabled': true // enable undo & redo
});
// define a simple Node template
myDiagram.nodeTemplate =
$(go.Node, 'Auto', // the Shape will go around the TextBlock
{ rotatable: true },
$(go.Shape, 'RoundedRectangle', { strokeWidth: 0 },
// Shape.fill is bound to Node.data.color
new go.Binding('fill', 'color')),
$(go.TextBlock,
{ margin: 8 }, // some room around the text
// TextBlock.text is bound to Node.data.key
new go.Binding('text', 'key'))
);
// but use the default Link template, by not setting Diagram.linkTemplate
myDiagram.model = new go.Model(
[
{ key: 'Alpha', color: 'lightblue' },
{ key: 'Beta', color: 'orange' },
{ key: 'Gamma', color: 'lightgreen' },
{ key: 'Delta', color: 'pink' }
]);
// Attach to the window so you can manipulate in the console
(window as any).myDiagram = myDiagram;
};
+14
View File
@@ -0,0 +1,14 @@
{
"name": "minimalsource",
"version": "0.0.0",
"private": true,
"dependencies": {
"ts-loader": "^8.0.2",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-closure-compiler": "^2.1.6"
},
"devDependencies": {},
"author": "Northwoods Software"
}
+23
View File
@@ -0,0 +1,23 @@
This demonstrates how to build a diagram with GoJS source, using webpack.
Because Webpack is able to shake out all functionality not used, this Diagram is truly minimal, and the compiled JS contains no layouts, no GoJS Tools for interactivity, no TreeModel or GraphLinksModel, no SVG rendering capability,
There are many related projects in this directory:
* **minimalSource**, for an example of building GoJS while excluding as many modules as possible. This project uses webpack's tree shaking to remove unused modules.
* **maximalSource**, for an example of building GoJS while including every module.
* **minimalSourceBrowserify**, for another minimal example of building GoJS with Browserify. Also does not use `require`.
With npm, install the dependencies:
```
$ npm install
```
You may also need to install `webpack` globally. Run script with:
```
$ webpack
```
This creates `minimal.js`, which is referenced in `minimal.html`.
+9
View File
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"removeComments": true,
"strict": true,
"strictNullChecks": false
}
}
@@ -0,0 +1,31 @@
const path = require('path');
const ClosureCompilerPlugin = require('webpack-closure-compiler');
module.exports = {
mode: 'production',
entry: path.resolve(__dirname, './minimal.ts'),
output: {
path: path.resolve(__dirname, './'),
library: 'minimal.js',
libraryTarget: 'umd',
filename: 'minimal.js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
// files with `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: 'ts-loader' }
]
},
stats: 'errors-only',
plugins: [
new ClosureCompilerPlugin({
compiler: {
language_out: 'ECMASCRIPT5',
process_common_js_modules: true,
}
})
]
}