mirror of
https://github.com/fluencelabs/cosmos-hackathon-frontend
synced 2025-03-15 01:30:51 +00:00
init
This commit is contained in:
parent
328d7b5fd3
commit
0d1db73074
28
index.html
Normal file
28
index.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Init</title>
|
||||||
|
<script src="bundle.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section class="container">
|
||||||
|
<div class="input-group border-primary mb-5">
|
||||||
|
<input type="text" class="form-control" placeholder="Node IP">
|
||||||
|
<input type="text" class="form-control" placeholder="Binary Source">
|
||||||
|
<button type="button" class="btn btn-outline-secondary">Start Check</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Last Checked
|
||||||
|
<div class="border-primary">
|
||||||
|
<div class="progress" style="height:60px">
|
||||||
|
<div class="progress-bar bg-white" role="progressbar" style="width: 25%; background-color: white;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
<div class="progress" style="height:60px">
|
||||||
|
<div class="progress-bar" role="progressbar" style="width: 100%; height: 100px" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</body>
|
||||||
|
</html>
|
24
index.js
Normal file
24
index.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
console.log("hello to1")
|
||||||
|
};
|
||||||
|
|
||||||
|
let socket = new WebSocket("ws://ip:port");
|
||||||
|
|
||||||
|
socket.onopen = function(e) {
|
||||||
|
console.log("Waaaa ebsocket was opened: " + JSON.stringify(e));
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
socket.onmessage = function(event) {
|
||||||
|
console.log("Message was received: " + JSON.stringify(event))
|
||||||
|
};
|
||||||
|
|
||||||
|
socket.onclose = function(event) {
|
||||||
|
console.log("Websocket was closed. Cause: " + JSON.stringify(event))
|
||||||
|
};
|
||||||
|
|
||||||
|
socket.onerror = function(error) {
|
||||||
|
console.log("Error: " + JSON.stringify(error))
|
||||||
|
};
|
6392
package-lock.json
generated
Normal file
6392
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
package.json
Normal file
31
package.json
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "init",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"start": "webpack-dev-server"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.html"
|
||||||
|
],
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "Apache 2.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"html-webpack-plugin": "^3.2.0",
|
||||||
|
"webpack": "^4.29.6",
|
||||||
|
"webpack-cli": "^3.3.0",
|
||||||
|
"webpack-dev-server": "^3.2.1",
|
||||||
|
"copy-webpack-plugin": "^4.6.0",
|
||||||
|
"css-loader": "^2.1.1",
|
||||||
|
"style-loader": "0.23.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"js-amino": "^1.0.0",
|
||||||
|
"bootstrap": "4.3.1",
|
||||||
|
"jquery": "^3.4.1",
|
||||||
|
"popper.js": "^1.15.0"
|
||||||
|
}
|
||||||
|
}
|
35
webpack.config.js
Normal file
35
webpack.config.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
// use index.js as entrypoint
|
||||||
|
entry: {
|
||||||
|
app: ['./index.js']
|
||||||
|
},
|
||||||
|
devServer: {
|
||||||
|
contentBase: './bundle',
|
||||||
|
hot: true
|
||||||
|
},
|
||||||
|
mode: "development",
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: ['style-loader', 'css-loader']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// build all code in `bundle.js` in `bundle` directory
|
||||||
|
output: {
|
||||||
|
filename: 'bundle.js',
|
||||||
|
path: path.resolve(__dirname, 'bundle')
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
// create `index.html` with imported `bundle.js`
|
||||||
|
new CopyWebpackPlugin([{
|
||||||
|
from: './*.html'
|
||||||
|
}]),
|
||||||
|
new webpack.HotModuleReplacementPlugin()
|
||||||
|
]
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user