fix ui
This commit is contained in:
parent
41924fbd8b
commit
67c9c41a24
5
Makefile
5
Makefile
|
@ -29,7 +29,10 @@ run: $(BINARY)
|
|||
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(DOCS_ASSET)
|
||||
go build "sour.is/x/paste/cmd/paste"
|
||||
|
||||
build-ui: $(ROUTE_ASSET) $(DOCS_ASSET)
|
||||
|
||||
clean-ui:
|
||||
rm -rf $(ROUTE_ASSET) $(DOCS_ASSET)
|
||||
build-ui: clean-ui $(ROUTE_ASSET) $(DOCS_ASSET)
|
||||
$(ROUTE_ASSET):
|
||||
cd assets; \
|
||||
rm -rf build ../public; \
|
||||
|
|
183
assets/package-lock.json
generated
183
assets/package-lock.json
generated
|
@ -1402,25 +1402,6 @@
|
|||
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz",
|
||||
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw=="
|
||||
},
|
||||
"@popperjs/core": {
|
||||
"version": "2.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.4.4.tgz",
|
||||
"integrity": "sha512-1oO6+dN5kdIA3sKPZhRGJTfGVP4SWV6KqlMOwry4J3HfyD68sl/3KmG7DeYUzvN+RbhXDnv/D8vNNB8168tAMg=="
|
||||
},
|
||||
"@restart/context": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz",
|
||||
"integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q=="
|
||||
},
|
||||
"@restart/hooks": {
|
||||
"version": "0.3.25",
|
||||
"resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.25.tgz",
|
||||
"integrity": "sha512-m2v3N5pxTsIiSH74/sb1yW8D9RxkJidGW+5Mfwn/lHb2QzhZNlaU1su7abSyT9EGf0xS/0waLjrf7/XxQHUk7w==",
|
||||
"requires": {
|
||||
"lodash": "^4.17.15",
|
||||
"lodash-es": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"@svgr/babel-plugin-add-jsx-attribute": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz",
|
||||
|
@ -1567,11 +1548,6 @@
|
|||
"@babel/types": "^7.3.0"
|
||||
}
|
||||
},
|
||||
"@types/classnames": {
|
||||
"version": "2.2.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.2.10.tgz",
|
||||
"integrity": "sha512-1UzDldn9GfYYEsWWnn/P4wkTlkZDH7lDb0wBMGbtIQc9zXEQq7FlKBdZUn6OBqD8sKZZ2RQO2mAjGpXiDGoRmQ=="
|
||||
},
|
||||
"@types/color-name": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
|
||||
|
@ -1591,11 +1567,6 @@
|
|||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/invariant": {
|
||||
"version": "2.2.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.33.tgz",
|
||||
"integrity": "sha512-/jUNmS8d4bCKdqslfxW6dg/9Gksfzxz67IYfqApHn+HvHlMVXwYv2zpTDnS/yaK9BB0i0GlBTaYci0EFE62Hmw=="
|
||||
},
|
||||
"@types/istanbul-lib-coverage": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
|
||||
|
@ -1638,43 +1609,16 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
|
||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
|
||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
||||
},
|
||||
"@types/q": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz",
|
||||
"integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug=="
|
||||
},
|
||||
"@types/react": {
|
||||
"version": "16.9.46",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.46.tgz",
|
||||
"integrity": "sha512-dbHzO3aAq1lB3jRQuNpuZ/mnu+CdD3H0WVaaBQA8LTT3S33xhVBUj232T8M3tAhSWJs/D/UqORYUlJNl/8VQZg==",
|
||||
"requires": {
|
||||
"@types/prop-types": "*",
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"@types/react-transition-group": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.0.tgz",
|
||||
"integrity": "sha512-/QfLHGpu+2fQOqQaXh8MG9q03bFENooTb/it4jr5kKaZlDQfWvjqWZg48AwzPVMBHlRuTRAY7hRHCEOXz5kV6w==",
|
||||
"requires": {
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"@types/stack-utils": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz",
|
||||
"integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw=="
|
||||
},
|
||||
"@types/warning": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz",
|
||||
"integrity": "sha1-DSUBJorY+ZYrdA04fEZU9fjiPlI="
|
||||
},
|
||||
"@types/yargs": {
|
||||
"version": "13.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.10.tgz",
|
||||
|
@ -2878,6 +2822,20 @@
|
|||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.2.tgz",
|
||||
"integrity": "sha512-vlGn0bcySYl/iV+BGA544JkkZP5LB3jsmkeKLFQakCOwCM3AOk7VkldBz4jrzSe+Z0Ezn99NVXa1o45cQY4R6A=="
|
||||
},
|
||||
"bootstrap-4-react": {
|
||||
"version": "0.0.59",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-4-react/-/bootstrap-4-react-0.0.59.tgz",
|
||||
"integrity": "sha512-j3a618tWHl/ajYQi6zn0LdVfksRH+gyQ4RwIanTPin6xkHkgYfk+47ZlHFSwyiO9zVFn4xznoGjTwWA0AIlJkA==",
|
||||
"requires": {
|
||||
"bootstrap-4-required": "0.0.1",
|
||||
"fsts": "0.0.44"
|
||||
}
|
||||
},
|
||||
"bootstrap-4-required": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-4-required/-/bootstrap-4-required-0.0.1.tgz",
|
||||
"integrity": "sha512-4S6Trn9pRVSR756GRYr3hy2cZL3Vc0tw0/H9E+mbNeOR+4tn6CeRgcLx0YqZmL2XlabtEV73+XAesmwkgTDKvQ=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
|
@ -3337,11 +3295,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"classnames": {
|
||||
"version": "2.2.6",
|
||||
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
|
||||
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
|
||||
},
|
||||
"clean-css": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
|
||||
|
@ -4056,11 +4009,6 @@
|
|||
"cssom": "0.3.x"
|
||||
}
|
||||
},
|
||||
"csstype": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.2.tgz",
|
||||
"integrity": "sha512-ofovWglpqoqbfLNOTBNZLSbMuGrblAf1efvvArGKOZMBrIoJeu5UsAipQolkijtyQx5MtAzT/J9IHj/CEY1mJw=="
|
||||
},
|
||||
"cyclist": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz",
|
||||
|
@ -4377,15 +4325,6 @@
|
|||
"utila": "~0.4"
|
||||
}
|
||||
},
|
||||
"dom-helpers": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.0.tgz",
|
||||
"integrity": "sha512-Ru5o9+V8CpunKnz5LGgWXkmrH/20cGKwcHwS4m73zIvs54CN9epEmT/HLqFJW3kXpakAFkEdzgy1hzlJe3E4OQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.8.7",
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"dom-serializer": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
|
||||
|
@ -5884,6 +5823,11 @@
|
|||
"integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
|
||||
"optional": true
|
||||
},
|
||||
"fsts": {
|
||||
"version": "0.0.44",
|
||||
"resolved": "https://registry.npmjs.org/fsts/-/fsts-0.0.44.tgz",
|
||||
"integrity": "sha512-0U4qvbzOE+3s2711DdszIyaAnZ3M0dbFAhnkez/ITy31MwzDI2lepGSkVeFOyx6jqWvwaSZr01RP4hdM4I8wxQ=="
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
|
@ -7864,11 +7808,6 @@
|
|||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
||||
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
|
||||
},
|
||||
"lodash-es": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz",
|
||||
"integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ=="
|
||||
},
|
||||
"lodash._reinterpolate": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz",
|
||||
|
@ -10161,15 +10100,6 @@
|
|||
"react-is": "^16.8.1"
|
||||
}
|
||||
},
|
||||
"prop-types-extra": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz",
|
||||
"integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==",
|
||||
"requires": {
|
||||
"react-is": "^16.3.2",
|
||||
"warning": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"proxy-addr": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
||||
|
@ -10354,31 +10284,6 @@
|
|||
"whatwg-fetch": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"react-bootstrap": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.3.0.tgz",
|
||||
"integrity": "sha512-GYj0c6FO9mx7DaO8Xyz2zs0IcQ6CGCtM3O6/feIoCaG4N8B0+l4eqL7stlMcLpqO4d8NG2PoMO/AbUOD+MO7mg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.2",
|
||||
"@restart/context": "^2.1.4",
|
||||
"@restart/hooks": "^0.3.21",
|
||||
"@types/classnames": "^2.2.10",
|
||||
"@types/invariant": "^2.2.33",
|
||||
"@types/prop-types": "^15.7.3",
|
||||
"@types/react": "^16.9.35",
|
||||
"@types/react-transition-group": "^4.4.0",
|
||||
"@types/warning": "^3.0.0",
|
||||
"classnames": "^2.2.6",
|
||||
"dom-helpers": "^5.1.2",
|
||||
"invariant": "^2.2.4",
|
||||
"prop-types": "^15.7.2",
|
||||
"prop-types-extra": "^1.1.0",
|
||||
"react-overlays": "^4.1.0",
|
||||
"react-transition-group": "^4.4.1",
|
||||
"uncontrollable": "^7.0.0",
|
||||
"warning": "^4.0.3"
|
||||
}
|
||||
},
|
||||
"react-dev-utils": {
|
||||
"version": "10.2.1",
|
||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz",
|
||||
|
@ -10609,11 +10514,6 @@
|
|||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"react-lifecycles-compat": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
|
||||
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
|
||||
},
|
||||
"react-markdown": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-4.3.1.tgz",
|
||||
|
@ -10629,21 +10529,6 @@
|
|||
"xtend": "^4.0.1"
|
||||
}
|
||||
},
|
||||
"react-overlays": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-4.1.0.tgz",
|
||||
"integrity": "sha512-vdRpnKe0ckWOOD9uWdqykLUPHLPndIiUV7XfEKsi5008xiyHCfL8bxsx4LbMrfnxW1LzRthLyfy50XYRFNQqqw==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.5",
|
||||
"@popperjs/core": "^2.0.0",
|
||||
"@restart/hooks": "^0.3.12",
|
||||
"@types/warning": "^3.0.0",
|
||||
"dom-helpers": "^5.1.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"uncontrollable": "^7.0.0",
|
||||
"warning": "^4.0.3"
|
||||
}
|
||||
},
|
||||
"react-router": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
|
||||
|
@ -10750,17 +10635,6 @@
|
|||
"workbox-webpack-plugin": "4.3.1"
|
||||
}
|
||||
},
|
||||
"react-transition-group": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz",
|
||||
"integrity": "sha512-Djqr7OQ2aPUiYurhPalTrVy9ddmFCCzwhqQmtN+J3+3DzLO209Fdr70QrN8Z3DsglWql6iY1lDWAfpFiBtuKGw==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"dom-helpers": "^5.0.1",
|
||||
"loose-envify": "^1.4.0",
|
||||
"prop-types": "^15.6.2"
|
||||
}
|
||||
},
|
||||
"read-pkg": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
|
||||
|
@ -12692,17 +12566,6 @@
|
|||
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
||||
},
|
||||
"uncontrollable": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.1.1.tgz",
|
||||
"integrity": "sha512-EcPYhot3uWTS3w00R32R2+vS8Vr53tttrvMj/yA1uYRhf8hbTG2GyugGqWDY0qIskxn0uTTojVd6wPYW9ZEf8Q==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.6.3",
|
||||
"@types/react": "^16.9.11",
|
||||
"invariant": "^2.2.4",
|
||||
"react-lifecycles-compat": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"unherit": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz",
|
||||
|
@ -13076,14 +12939,6 @@
|
|||
"makeerror": "1.0.x"
|
||||
}
|
||||
},
|
||||
"warning": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
|
||||
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "1.7.4",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz",
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
"private": true,
|
||||
"dependencies": {
|
||||
"bootstrap": "^4.5.2",
|
||||
"bootstrap-4-react": "0.0.59",
|
||||
"crypto-js": "^4.0.0",
|
||||
"react": "^16.9.0",
|
||||
"react-bootstrap": "^1.3.0",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-highlight": "^0.12.0",
|
||||
"react-markdown": "^4.3.1",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import React, { Component } from 'react';
|
||||
import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.css';
|
||||
import './paste/Framework.css';
|
||||
|
||||
import Paste from './paste/Paste';
|
||||
|
@ -21,7 +20,7 @@ class App extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
req('/app-info').get()
|
||||
req('https://paste.dn42.us/app-info').get()
|
||||
.then((response) => {
|
||||
if (response.ok) return response.text().catch(()=>"");
|
||||
else return "Unknown API"; })
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
body,html {color: #c8c8c8; background-color: #272b30; }
|
||||
body,html {color: #c8c8c8 !important; background-color: #272b30 !important; }
|
||||
header + section { padding-top: 52px; padding-bottom: 2.1em }
|
||||
footer { background-color: #3e444c; position:fixed; bottom:0; width: 100%; height: 2em; border-top: 1px solid #bbb; padding: 4px }
|
||||
footer span.left { float: left; }
|
||||
footer span.right { float: right; }
|
||||
|
||||
pre {background-color: #c8c8c8; color: black}
|
||||
.breadcrumb label { color: black; }
|
||||
|
||||
.sidebar .list-group {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from "react";
|
||||
import { Form, Button, Alert } from "react-bootstrap";
|
||||
import { Form, Button, Alert } from "bootstrap-4-react";
|
||||
|
||||
import "./paste.css";
|
||||
|
||||
|
@ -185,7 +185,7 @@ class Paste extends Component {
|
|||
this.setState(function(state, props) {
|
||||
return {entropy: state.entropy + s.length};
|
||||
} );
|
||||
Math.seedrandom(s, {entropy: true});
|
||||
seedrandom(s, {entropy: true});
|
||||
};
|
||||
|
||||
onChange(event) {
|
||||
|
@ -319,24 +319,21 @@ function PasteCreate({error, onSubmit, onChange, syntax, syntaxItems, expire, ex
|
|||
</Alert> : ""}
|
||||
|
||||
<Form name='paste' onSubmit={onSubmit}>
|
||||
<div className="form form-inline">
|
||||
<ol className='breadcrumb'>
|
||||
<li>
|
||||
<label>Syntax</label>
|
||||
<select className='form-control input-sm' name="syntax" onChange={onChange} value={syntax}>
|
||||
{syntaxItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)}
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>Expires</label>
|
||||
<select className='form-control input-sm' name="expire" onChange={onChange} value={expire}>
|
||||
{expireItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)}
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><input type='checkbox' name="burn" onChange={onChange} value={burn}/> Burn on Read</label>
|
||||
</li>
|
||||
</ol>
|
||||
<div className="form-inline">
|
||||
<label className="my-1 mr-2" for="syntax">Syntax</label>
|
||||
<select className='custom-select my-1 mr-sm-2' id="syntax" name="syntax" onChange={onChange} value={syntax}>
|
||||
{syntaxItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)}
|
||||
</select>
|
||||
|
||||
<label className="my-1 mr-2" for="expire">Expires</label>
|
||||
<select className='custom-select my-1 mr-sm-2' id="expire" name="expire" onChange={onChange} value={expire}>
|
||||
{expireItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)}
|
||||
</select>
|
||||
|
||||
<div className="custom-control custom-checkbox my-1 mr-sm-2">
|
||||
<input className="custom-control-input" type='checkbox' id="burn-on-read" name="burn" onChange={onChange} value={burn}/>
|
||||
<label className="custom-control-label" for="burn-on-read">Burn on Read</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<textarea required className='form-control' rows='20' name="plain" onChange={onChange} value={plain}></textarea>
|
||||
|
@ -346,7 +343,6 @@ function PasteCreate({error, onSubmit, onChange, syntax, syntaxItems, expire, ex
|
|||
</Form>
|
||||
|
||||
<p>Create pastes from the command line! <a href='./paste.sh' download>paste.sh</a></p>
|
||||
|
||||
<pre>{`$ echo /etc/passwd | ./paste.sh
|
||||
|
||||
env options:
|
||||
|
@ -366,11 +362,11 @@ function PasteView({hash, decryptKey, expires, gzip, cipher, plain, syntax, onNe
|
|||
<section className="container">
|
||||
<div className="input-group">
|
||||
<span className="input-group-btn">
|
||||
<a className="btn btn-default" type="button" onClick={onNew}>New</a>
|
||||
<button className="btn btn-default" type="button" onClick={onNew}>New</button>
|
||||
</span>
|
||||
<input type='text' readOnly className='form-control' value={`${window.location.origin}/paste/#/${hash}!${decryptKey}`} onClick={(e) => e.target.select()}/>
|
||||
<span className="input-group-btn">
|
||||
<a className="btn btn-default" type="button" onClick={onCopy}>Copy</a>
|
||||
<button className="btn btn-default" type="button" onClick={onCopy}>Copy</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
35
cmd/paste/cors.go
Normal file
35
cmd/paste/cors.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"sour.is/x/toolbox/httpsrv"
|
||||
"sour.is/x/toolbox/ident"
|
||||
)
|
||||
|
||||
func init() {
|
||||
httpsrv.NewMiddleware("cors", doCORS).
|
||||
Register(httpsrv.EventPreAuth)
|
||||
}
|
||||
|
||||
func doCORS(_ string, w httpsrv.ResponseWriter, r *http.Request, _ ident.Ident) bool {
|
||||
origin := r.Header.Get("origin")
|
||||
headers := r.Header.Get("access-control-request-headers")
|
||||
|
||||
if origin != "" {
|
||||
w.Header().Add("access-control-allow-origin", origin)
|
||||
}
|
||||
|
||||
w.Header().Add("access-control-allow-methods", "GET, POST, PUT, DELETE, OPTIONS")
|
||||
w.Header().Add("access-control-allow-credentials", "true")
|
||||
w.Header().Add("access-control-max-age", "3600")
|
||||
if headers != "" {
|
||||
w.Header().Add("access-control-allow-headers", headers)
|
||||
}
|
||||
|
||||
if r.Method == "OPTIONS" {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
|
@ -254,7 +254,7 @@ func publicSwaggerJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "public/swagger.json", size: 4895, mode: os.FileMode(0644), modTime: time.Unix(1597685436, 0)}
|
||||
info := bindataFileInfo{name: "public/swagger.json", size: 4895, mode: os.FileMode(0644), modTime: time.Unix(1598654963, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xcc, 0xe, 0x5f, 0xc1, 0xe9, 0xd6, 0xa9, 0x46, 0x93, 0xde, 0x3d, 0x71, 0x10, 0x7f, 0xa9, 0x1e, 0x98, 0x11, 0x70, 0xc6, 0xcf, 0x1c, 0xa, 0x57, 0x84, 0xfc, 0x3c, 0xf7, 0x28, 0x3, 0x67}}
|
||||
return a, nil
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user