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
+225
View File
@@ -0,0 +1,225 @@
/*
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
*/
/*
* This index demonstrates building a maximal library from source.
* There is a minimal 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 { GraphLinksModel } from '../../srcTS/graphLinksModel';
import { TreeModel } from '../../srcTS/treeModel';
import { UndoManager, Transaction } from '../../srcTS/undoManager';
import { CommandHandler } from '../../srcTS/commandHandler';
import { Tool } from '../../srcTS/tool';
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 { ToolManager } from '../../srcTS/toolManager';
import { Animation, AnimationManager, AnimationTrigger } from '../../srcTS/animationManager';
import { Layer } from '../../srcTS/layer';
import { Diagram, DraggingInfo } from '../../srcTS/diagram';
import { Palette } from '../../srcTS/palette';
import { Overview } from '../../srcTS/overview';
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';
import { GridLayout } from '../../srcTS/gridLayout';
import { GraphLinksPartManager } from '../../srcTS/graphLinksPartManager';
import { TreePartManager } from '../../srcTS/treePartManager';
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 { HTMLInfo } from '../../srcTS/htmlInfo';
import { ContextMenuTool } from '../../srcTS/contextMenuTool';
import { PanelLayout } from '../../srcTS/panelLayout';
import { PanelLayoutHorizontal } from '../../srcTS/panelLayoutHorizontal';
import { PanelLayoutSpot } from '../../srcTS/panelLayoutSpot';
import { PanelLayoutTable, PanelLayoutTableRow, PanelLayoutTableColumn } from '../../srcTS/panelLayoutTable';
import { PanelLayoutViewbox } from '../../srcTS/panelLayoutViewbox';
import { PanelLayoutGraduated } from '../../srcTS/panelLayoutGraduated';
import { PanelLayoutGrid } from '../../srcTS/panelLayoutGrid';
// 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';
/**
* @suppress {duplicate}
* @this {ToolManager}
*/
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('Rotating', new RotatingTool(), this.mouseDownTools);
this.replaceStandardTool('Resizing', new ResizingTool(), 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);
};
// By default, these are added to the library in index.ts. When building from source, you must add them manually.
Panel.definePanelLayout('Horizontal', new PanelLayoutHorizontal());
Panel.definePanelLayout('Spot', new PanelLayoutSpot());
Panel.definePanelLayout('Table', new PanelLayoutTable());
Panel.definePanelLayout('Viewbox', new PanelLayoutViewbox());
Panel.definePanelLayout('TableRow', new PanelLayoutTableRow());
Panel.definePanelLayout('TableColumn', new PanelLayoutTableColumn());
Panel.definePanelLayout('Graduated', new PanelLayoutGraduated());
Panel.definePanelLayout('Grid', new PanelLayoutGrid());
// These PanelLayouts are essential to GoJs and are added in panel.ts, so we don't add them here:
// Panel.definePanelLayout('Position', new PanelLayoutPosition());
// Panel.definePanelLayout('Vertical', new PanelLayoutVertical());
// Panel.definePanelLayout('Auto', new PanelLayoutAuto());
// Panel.definePanelLayout('Link', new PanelLayoutLink());
// Add PartManagers for model subclasses.
Diagram.addPartManager(GraphLinksModel.type, GraphLinksPartManager);
Diagram.addPartManager(TreeModel.type, TreePartManager);
/**
* @hidden @internal
*/
export const go = {
get licenseKey() {
return Diagram.licenseKey;
},
set licenseKey (licx) {
Diagram.licenseKey = licx;
},
get version() {
return Diagram.version;
},
'Group': Group,
// 'Util': Util, // could add back for debug
'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,
'GraphLinksModel': GraphLinksModel,
'TreeModel': TreeModel,
'Binding': Binding,
'Transaction': Transaction,
'UndoManager': UndoManager,
'CommandHandler': CommandHandler,
'Tool': Tool,
'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,
'ToolManager': ToolManager,
'Animation': Animation,
'AnimationManager': AnimationManager,
'AnimationTrigger': AnimationTrigger,
'Layer': Layer,
'Diagram': Diagram,
'Palette': Palette,
'Overview': Overview,
'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,
'GridLayout': GridLayout,
'PanelLayout': PanelLayout,
'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
};
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webpack Maximal GoJS Sample</title>
<meta name="description" content="An almost maximal diagram using a every GoJS class." />
<!-- Copyright 1998-2020 by Northwoods Software Corporation. -->
<meta charset="UTF-8">
<script src="maximal.js"></script>
<script>
window.onload = function() {
// window.init() was created in maximal.js, which was built from maximal.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 maximal sample builds from source with all GoJS modules.
As a result, the build JavaScript is large, but all functionality is present.
</p>
<p>
The <a href="./maximal-index.ts">maximal-index.ts</a> displays how to include every GoJS module into a build.
</p>
<p>
For an example of building GoJS from source with as few modules as possible,
see the <a href="../minimalSource/minimal.html">Minimal project</a> adjacent to this directory.
</p>
</div>
</body>
</html>
+53
View File
@@ -0,0 +1,53 @@
/*
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
*/
/*
The code in this file is typical of a "minimal" sample.
The code which includes all modules can be found in maximal-index.ts
*/
import { go } from './maximal-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'))
);
myDiagram.model = new go.GraphLinksModel(
[
{ key: 'Alpha', color: 'lightblue' },
{ key: 'Beta', color: 'orange' },
{ key: 'Gamma', color: 'lightgreen' },
{ key: 'Delta', color: 'pink' }
],
[
{ from: 'Alpha', to: 'Beta' },
{ from: 'Alpha', to: 'Gamma' },
{ from: 'Beta', to: 'Beta' },
{ from: 'Gamma', to: 'Delta' },
{ from: 'Delta', to: 'Alpha' }
]);
// Attach to the window so you can manipulate in the console
window.myDiagram = myDiagram;
};
+14
View File
@@ -0,0 +1,14 @@
{
"name": "maximalsource",
"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 `maximal.js`, which is referenced in `maximal.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, './maximal.ts'),
output: {
path: path.resolve(__dirname, './'),
library: 'maximal.js',
libraryTarget: 'umd',
filename: 'maximal.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,
}
})
]
}