mirror of
https://github.com/amir20/dozzle.git
synced 2026-01-05 12:25:32 +01:00
Adds parcel and js files
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -10,3 +10,7 @@
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
dist
|
||||
node_modules
|
||||
.cache
|
||||
31
assets/components/App.vue
Normal file
31
assets/components/App.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template lang="html">
|
||||
<div id="app">
|
||||
<h1>Hello Parcel from Vue 📦 🚀</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "app"
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css">
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
|
||||
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
}
|
||||
#app {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
h1 {
|
||||
font-weight: 300;
|
||||
}
|
||||
</style>
|
||||
13
assets/index.html
Normal file
13
assets/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="/main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
7
assets/main.js
Normal file
7
assets/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import Vue from "vue";
|
||||
import App from "/components/App.vue";
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
render: h => h(App)
|
||||
});
|
||||
48
main.go
Normal file
48
main.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/gobuffalo/packr"
|
||||
)
|
||||
|
||||
var addr = flag.String("addr", "localhost:8080", "http service address")
|
||||
|
||||
var (
|
||||
box = packr.NewBox("./templates")
|
||||
cli *client.Client
|
||||
)
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
cli, err = client.NewClientWithOpts(client.FromEnv)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
// http.HandleFunc("/echo", echo)
|
||||
box := packr.NewBox("./dist")
|
||||
http.Handle("/", http.FileServer(box))
|
||||
|
||||
http.HandleFunc("/contains.json", listContainers)
|
||||
|
||||
log.Fatal(http.ListenAndServe(*addr, nil))
|
||||
|
||||
}
|
||||
|
||||
func listContainers(w http.ResponseWriter, r *http.Request) {
|
||||
containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
json.NewEncoder(w).Encode(containers)
|
||||
}
|
||||
8353
package-lock.json
generated
Normal file
8353
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
29
package.json
Normal file
29
package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "dozzle",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "parcel watch assets/index.html"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/amir20/dozzle.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/amir20/dozzle/issues"
|
||||
},
|
||||
"homepage": "https://github.com/amir20/dozzle#readme",
|
||||
"dependencies": {
|
||||
"vue": "^2.5.17",
|
||||
"vue-hot-reload-api": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/component-compiler-utils": "^2.3.0",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"parcel-bundler": "^1.10.3",
|
||||
"vue-template-compiler": "^2.5.17"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user