aboutsummaryrefslogtreecommitdiff
path: root/editor/example.html
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-07-26 04:18:32 +0700
committerShulhan <ms@kilabit.info>2021-07-26 04:18:32 +0700
commitd22ecec866f9da676ed6a5b06a6089770ae1139d (patch)
tree14039a70115c3df8f723d84a99eea2e9b582dea4 /editor/example.html
parent1a49542d36fcc715b3839facee0ccac9952d5ecd (diff)
downloadpakakeh.ts-d22ecec866f9da676ed6a5b06a6089770ae1139d.tar.xz
all: implement editor
Diffstat (limited to 'editor/example.html')
-rw-r--r--editor/example.html104
1 files changed, 104 insertions, 0 deletions
diff --git a/editor/example.html b/editor/example.html
new file mode 100644
index 0000000..ac45e60
--- /dev/null
+++ b/editor/example.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title>WUI - editor</title>
+ <style>
+ [contenteditable] {
+ outline: 0px solid transparent;
+ }
+ .wui-editor {
+ background-color: cornsilk;
+ font-family: monospace;
+ width: 100%;
+ }
+ .wui-editor-line {
+ display: table;
+ }
+ .wui-line-number:hover {
+ background-color: lightsalmon;
+ }
+ .wui-line-number {
+ display: table-cell;
+ padding: 4px 1em 4px 4px;
+ text-align: right;
+ width: 3em;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ }
+ .wui-line-text {
+ display: table-cell;
+ padding: 4px;
+ border-color: lightblue;
+ border-width: 0px;
+ border-style: solid;
+ }
+ </style>
+ </head>
+ <body onload="main()">
+ <div id="editor"></div>
+
+ <script>
+ var exports = {}
+ </script>
+ <script src="editor.js"></script>
+ <script>
+ function main() {
+ let opts = {
+ id: "editor",
+ is_editable: true,
+ OpenFile: doOpenFile,
+ }
+
+ let editor = new Editor(opts)
+
+ editor.OpenFile("/test.aww")
+ }
+
+ function doOpenFile(path) {
+ let res = {
+ code: 200,
+ data: {
+ name: "Test",
+ path: path,
+ content: `mkdir -p \${HOME}/aur/stackdriver-collectd
+
+git -C \${HOME}/aur/stackdriver-collectd clone \
+ ssh://aur@aur.archlinux.org/stackdriver-collectd.git .
+
+sh -c "cd \${HOME}/aur/stackdriver-collectd; \
+ makepkg --force --install --noconfirm"
+pacman -Ql stackdriver-collectd
+
+sudo systemctl enable stackdriver-collectd
+
+#put! {{.BaseDir}}/_template/etc/collectd-influxdb.conf /opt/collectd/etc/collectd.conf
+
+sudo systemctl restart stackdriver-collectd
+sudo systemctl status stackdriver-collectd
+
+##---- Connect telegraf with collectd
+
+{{.Val "influxdb::dir"}}/bin/influx bucket create \
+ --name stackdriver_collectd \
+ --description "stackdriver collectd" \
+ --org {{.Val "influxdb::org"}} \
+ --token {{.Val "influxdb:telegraf:token"}} \
+ --retention "3d"
+
+#put: {{.BaseDir}}/_template/etc/telegraf/telegraf.d/stackdriver-collectd.conf \
+ {{.Val "influxdb::dir"}}/etc/telegraf/telegraf.d/stackdriver-collectd.conf
+
+sudo systemctl restart telegraf
+sudo systemctl status telegraf
+`,
+ },
+ }
+ return res
+ }
+ </script>
+ </body>
+</html>