Update analytics calls in app.vue
This commit is contained in:
parent
b3ab9f22b9
commit
31a7a5c196
|
@ -101,6 +101,7 @@ THE SOFTWARE.
|
||||||
:name="confContents[0]"
|
:name="confContents[0]"
|
||||||
:conf="confContents[1]"
|
:conf="confContents[1]"
|
||||||
:half="Object.keys(confFilesOutput).length > 1 && !splitColumn"
|
:half="Object.keys(confFilesOutput).length > 1 && !splitColumn"
|
||||||
|
@copied="codeCopiedEvent(confContents[3])"
|
||||||
></component>
|
></component>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -148,8 +149,8 @@ THE SOFTWARE.
|
||||||
Global,
|
Global,
|
||||||
Setup,
|
Setup,
|
||||||
NginxPrism,
|
NginxPrism,
|
||||||
'YamlPrism': () => import('./prism/yaml'),
|
YamlPrism: () => import('./prism/yaml'),
|
||||||
'DockerPrism': () => import('./prism/docker'),
|
DockerPrism: () => import('./prism/docker'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -170,7 +171,7 @@ THE SOFTWARE.
|
||||||
splitColumn: false,
|
splitColumn: false,
|
||||||
confWatcherWaiting: false,
|
confWatcherWaiting: false,
|
||||||
confFilesPrevious: {},
|
confFilesPrevious: {},
|
||||||
confFilesOutput: {},
|
confFilesOutput: [],
|
||||||
languageLoading: false,
|
languageLoading: false,
|
||||||
languagePrevious: defaultPack,
|
languagePrevious: defaultPack,
|
||||||
interactiveEvents: false,
|
interactiveEvents: false,
|
||||||
|
@ -326,7 +327,7 @@ THE SOFTWARE.
|
||||||
const diffConf = diff(newConf, oldConf, {
|
const diffConf = diff(newConf, oldConf, {
|
||||||
highlightFunction: value => `<mark>${value}</mark>`,
|
highlightFunction: value => `<mark>${value}</mark>`,
|
||||||
});
|
});
|
||||||
this.$data.confFilesOutput = Object.values(diffConf).map(({ name, content }) => {
|
this.$data.confFilesOutput = Object.entries(diffConf).map(([ file, { name, content } ]) => {
|
||||||
const diffName = name.filter(x => !x.removed).map(x => x.value).join('');
|
const diffName = name.filter(x => !x.removed).map(x => x.value).join('');
|
||||||
const confName = `${escape(this.$data.global.nginx.nginxConfigDirectory.computed)}/${diffName}`;
|
const confName = `${escape(this.$data.global.nginx.nginxConfigDirectory.computed)}/${diffName}`;
|
||||||
const diffContent = content.filter(x => !x.removed).map(x => x.value).join('');
|
const diffContent = content.filter(x => !x.removed).map(x => x.value).join('');
|
||||||
|
@ -335,6 +336,7 @@ THE SOFTWARE.
|
||||||
confName,
|
confName,
|
||||||
diffContent,
|
diffContent,
|
||||||
`${sha2_256(confName)}-${sha2_256(diffContent)}`,
|
`${sha2_256(confName)}-${sha2_256(diffContent)}`,
|
||||||
|
file,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -346,6 +348,7 @@ THE SOFTWARE.
|
||||||
confName,
|
confName,
|
||||||
content,
|
content,
|
||||||
`${sha2_256(confName)}-${sha2_256(content)}`,
|
`${sha2_256(confName)}-${sha2_256(content)}`,
|
||||||
|
name,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -388,6 +391,13 @@ THE SOFTWARE.
|
||||||
value: count,
|
value: count,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
codeCopiedEvent(file) {
|
||||||
|
analytics({
|
||||||
|
category: 'Config files',
|
||||||
|
action: 'Code snippet copied',
|
||||||
|
label: file,
|
||||||
|
});
|
||||||
|
},
|
||||||
getPrismComponent(confName) {
|
getPrismComponent(confName) {
|
||||||
switch (confName) {
|
switch (confName) {
|
||||||
case '/etc/nginx/Dockerfile':
|
case '/etc/nginx/Dockerfile':
|
||||||
|
|
Loading…
Reference in New Issue