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:
@@ -0,0 +1,14 @@
|
||||
var browserify = require('browserify');
|
||||
var tsify = require('tsify');
|
||||
var uglifyify = require('uglifyify');
|
||||
var fs = require('fs');
|
||||
var replace = require('stream-replace');
|
||||
|
||||
browserify()
|
||||
.add('minimal.ts')
|
||||
.plugin(tsify, { noImplicitAny: true })
|
||||
.transform(uglifyify, { global: true })
|
||||
.bundle()
|
||||
.on('error', function (error) { console.error(error.toString()); })
|
||||
.pipe(replace(/\.\.\/\.\.\/srcTS\//g, '')) // cleanup
|
||||
.pipe(fs.createWriteStream('minimal.js'));
|
||||
@@ -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
|
||||
*/
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Browserify 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 browserify. 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 Browserify. 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>
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
// This is one way of exposing init() to minimal.html. You could also use require, like the other projects do
|
||||
|
||||
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;
|
||||
|
||||
|
||||
// Attach to the window so you can manipulate in the console
|
||||
(window as any).myDiagram = myDiagram;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "minimalsourcebrowserify",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"browserify": "^16.5.2",
|
||||
"stream-replace": "^1.0.0",
|
||||
"tsify": "^5.0.0",
|
||||
"typescript": "^3.9.7",
|
||||
"uglifyify": "^5.0.2"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"author": "Northwoods Software"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
This demonstrates how to build a diagram with GoJS source, using Browserify.
|
||||
|
||||
Because Browserify 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 `Browserify` globally (`npm install --global browserify`). Run the script with:
|
||||
|
||||
```
|
||||
$ node browserify-run.js
|
||||
```
|
||||
|
||||
This creates `minimal.js`, which is referenced in `minimal.html`.
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"removeComments": true,
|
||||
"strict": true,
|
||||
"strictNullChecks": false // webpack --entry ..\minimalSource\minimal.js --output-filename all.js --display-error-details
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user