helm-viewer 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Document</title>
8
+
9
+ <script src="https://cdn.tailwindcss.com"></script>
10
+ <script>
11
+ tailwind.config = {
12
+ theme: {
13
+ extend: {
14
+ colors: {
15
+ clifford: '#da373d',
16
+ }
17
+ }
18
+ }
19
+ }
20
+ </script>
21
+ <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
22
+ </head>
23
+ <body>
24
+ <div id="app" class="flex h-screen">
25
+ <div
26
+ class="w-2/5 xl:w-1/5 bg-blue-50 h-screen overflow-scroll"
27
+ >
28
+ <div class="p-2">
29
+ <h1 class="italic text-2xl xl:text-4xl font-thin ml-4 mb-8">>> Computed files</h1>
30
+
31
+ <div
32
+ v-if="data.templated"
33
+ v-for="template of Object.keys(data.templated)"
34
+ class="mb-2"
35
+ >
36
+ <p class="text-xl xl:text-3xl font-thin">
37
+ {{ template }}
38
+ </p>
39
+
40
+ <div
41
+ class="ml-6 mt-2"
42
+ v-for="file of Object.keys(data.templated[template])"
43
+ @click="displayTemplatedFile(template, file)"
44
+ >
45
+ {{ file }}
46
+ </div>
47
+ </div>
48
+ </div>
49
+
50
+ <div
51
+ v-if="data.sources"
52
+ class="bg-green-100"
53
+ >
54
+ <h1 class="italic text-4xl font-thin ml-4 mb-8">>> Sources</h1>
55
+ <div class="mb-1" v-for="file of Object.keys(data.sources).filter(n => n !== 'templates')">
56
+ <p
57
+ class="text-xl ml-8 font-thin"
58
+ @click="displaySourceFile(file)"
59
+ >
60
+ {{ file }}
61
+ </p>
62
+ </div>
63
+
64
+ <p v-if="data.sources['templates']" class="text-xl ml-8 font-thin">templates</p>
65
+
66
+ <div
67
+ v-if="data.sources['templates']"
68
+ v-for="file of Object.keys(data.sources['templates'])"
69
+ class="mb-1 ml-6"
70
+ >
71
+ <p
72
+ class="text-xl ml-8 font-thin"
73
+ @click="displaySourceFile(file, true)"
74
+ >
75
+ {{ file }}
76
+ </p>
77
+ </div>
78
+ </div>
79
+ </div>
80
+
81
+ <div id="container" class="w-4/5">
82
+ </div>
83
+ </div>
84
+
85
+ <script src="assets/global-data.js"></script>
86
+ <script>
87
+ const { createApp, ref } = Vue
88
+ createApp({
89
+ data() {
90
+ return {
91
+ templateFile: undefined,
92
+ fileName: undefined,
93
+ source: undefined,
94
+ isSourceTemplate: false,
95
+ }
96
+ },
97
+ setup() {
98
+ const message = ref('Hello vue!')
99
+ return {
100
+ message,
101
+ data: DATA,
102
+ }
103
+ },
104
+ methods: {
105
+ displayTemplatedFile(templateFile, fileName) {
106
+ document.getElementById('container').innerHTML = ""
107
+ require(["vs/editor/editor.main"], () => {
108
+ monaco.editor.create(document.getElementById('container'), {
109
+ value: this.data["templated"][templateFile][fileName],
110
+ language: 'yaml',
111
+ theme: 'vs-dark',
112
+ });
113
+ });
114
+ },
115
+ displaySourceFile(fileName, isTemplate = false) {
116
+ this.source = "source"
117
+ this.fileName = fileName
118
+ this.isSourceTemplate = isTemplate
119
+
120
+ if (isTemplate) {
121
+ document.getElementById('container').innerHTML = ""
122
+ require(["vs/editor/editor.main"], () => {
123
+ monaco.editor.create(document.getElementById('container'), {
124
+ value: this.data["sources"]["templates"][fileName],
125
+ language: 'yaml',
126
+ theme: 'vs-dark',
127
+ });
128
+ });
129
+ } else {
130
+ document.getElementById('container').innerHTML = ""
131
+ require(["vs/editor/editor.main"], () => {
132
+ monaco.editor.create(document.getElementById('container'), {
133
+ value: this.data["sources"][fileName],
134
+ language: 'yaml',
135
+ theme: 'vs-dark',
136
+ });
137
+ });
138
+ }
139
+ }
140
+ }
141
+ }).mount('#app')
142
+ </script>
143
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.26.1/min/vs/loader.min.js"></script>
144
+ <script>
145
+ // require is provided by loader.min.js.
146
+ require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.26.1/min/vs' }});
147
+
148
+ </script>
149
+ </body>
150
+ </html>