-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from rancher/opni
Adding resizable drawer and kibana linking
- Loading branch information
Showing
15 changed files
with
280 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script> | ||
export default { | ||
props: { | ||
row: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
collapseClass() { | ||
return this.open ? 'icon-chevron-down' : 'icon-chevron-right'; | ||
}, | ||
key() { | ||
return 'open'; | ||
}, | ||
open() { | ||
return this.row[this.key]; | ||
}, | ||
}, | ||
methods: { | ||
toggle() { | ||
this.$set(this.row, this.key, !this.open); | ||
}, | ||
} | ||
}; | ||
</script> | ||
|
||
<template> | ||
<span class="icon" :class="collapseClass" @click="toggle"></span> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.icon { | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script> | ||
const UTC_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'; | ||
export default { | ||
props: { | ||
value: { | ||
type: String, | ||
required: true | ||
}, | ||
row: { | ||
type: Object, | ||
required: true, | ||
}, | ||
options: { | ||
type: [Object, String], | ||
required: true, | ||
} | ||
}, | ||
computed: { | ||
query() { | ||
switch (this.options.type) { | ||
case 'pod': | ||
return `_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${ this.from }',to:'${ this.to }'))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,key:kubernetes.pod_name,negate:!f,params:(query:${ this.value }),type:phrase),query:(match_phrase:(kubernetes.pod_name:${ this.value })))),interval:auto,query:(language:kuery,query:''),sort:!())`; | ||
case 'control-plane': | ||
return `_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${ this.from }',to:'${ this.to }'))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,key:is_control_plane_log,negate:!f,params:(query:!t),type:phrase),query:(match_phrase:(is_control_plane_log:!t))),('$state':(store:appState),meta:(alias:!n,disabled:!f,key:kubernetes_component,negate:!f,params:(query:${ this.value }),type:phrase),query:(match_phrase:(kubernetes_component:${ this.value })))),interval:auto,query:(language:kuery,query:''),sort:!())`; | ||
case 'namespace': | ||
return `_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${ this.from }',to:'${ this.to }'))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,key:kubernetes.namespace_name,negate:!f,params:(query:${ this.value }),type:phrase),query:(match_phrase:(kubernetes.namespace_name:${ this.value })))),interval:auto,query:(language:kuery,query:''),sort:!())`; | ||
case 'workload': | ||
return `_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${ this.from }',to:'${ this.to }'))&_a=(columns:!(_source),filters:!(),interval:auto,query:(language:kuery,query:"${ this.value }"),sort:!())`; | ||
default: | ||
return ''; | ||
} | ||
}, | ||
from() { | ||
return this.options.fromTo.from.utc().format(UTC_FORMAT); | ||
}, | ||
to() { | ||
return this.options.fromTo.to.utc().format(UTC_FORMAT); | ||
}, | ||
url() { | ||
const hostname = window.location.hostname; | ||
return `http://${ hostname }:5601/app/discover#/?${ this.query }`; | ||
} | ||
}, | ||
methods: { | ||
toggle() { | ||
this.$set(this.row, this.key, !this.open); | ||
}, | ||
} | ||
}; | ||
</script> | ||
|
||
<template> | ||
<a :href="url" rel="nofollow noopener noreferrer" target="_blank">{{ value }}</a> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.icon { | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import day from 'dayjs'; | ||
import utc from 'dayjs/plugin/utc'; | ||
|
||
day.extend(utc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.