|
114 | 114 | </table> |
115 | 115 | </div> |
116 | 116 |
|
| 117 | + <div class="card" v-if="iCan('any','sgstreams',$route.params.namespace)"> |
| 118 | + <table class="fullWidth"> |
| 119 | + <thead> |
| 120 | + <th class="crdName"> |
| 121 | + <template v-if="iCan('list', 'sgstreams', $route.params.namespace)"> |
| 122 | + <router-link :to="'/' + $route.params.namespace + '/sgstreams/'" title="Stream Overview"> |
| 123 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g><path d="M16.3 18.8h-4.5c-1 0-1.9-.4-2.6-1.1l-7.6-7.6c-.5-.5-.5-1.3 0-1.8s1.3-.5 1.8 0l7.6 7.6c.2.2.5.3.8.3h2.7l-12-12c-.5-.5-.7-1.3-.4-1.9S3 1.2 3.7 1.2h4.5c1 0 1.9.4 2.6 1.1l7.6 7.6c.5.5.5 1.3 0 1.8s-1.3.5-1.8 0L9 4.1c-.2-.2-.5-.3-.8-.3H5.5l12 12c.5.5.7 1.2.4 1.9s-.9 1.1-1.6 1.1M4.5 18.8c-.3 0-.6-.1-.9-.4l-2-2c-.5-.5-.5-1.3 0-1.8s1.3-.5 1.8 0l2 2c.5.5.5 1.3 0 1.8s-.6.4-.9.4M17 4.8c-1 0-1.8-.8-1.8-1.8S16 1.2 17 1.2s1.8.8 1.8 1.8S18 4.8 17 4.8" class="cls-1"/></g></svg> |
| 124 | + <span>SGStream <i class="length">{{ sgstreams.length }}</i></span> |
| 125 | + </router-link> |
| 126 | + </template> |
| 127 | + <template v-else> |
| 128 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g><path d="M16.3 18.8h-4.5c-1 0-1.9-.4-2.6-1.1l-7.6-7.6c-.5-.5-.5-1.3 0-1.8s1.3-.5 1.8 0l7.6 7.6c.2.2.5.3.8.3h2.7l-12-12c-.5-.5-.7-1.3-.4-1.9S3 1.2 3.7 1.2h4.5c1 0 1.9.4 2.6 1.1l7.6 7.6c.5.5.5 1.3 0 1.8s-1.3.5-1.8 0L9 4.1c-.2-.2-.5-.3-.8-.3H5.5l12 12c.5.5.7 1.2.4 1.9s-.9 1.1-1.6 1.1M4.5 18.8c-.3 0-.6-.1-.9-.4l-2-2c-.5-.5-.5-1.3 0-1.8s1.3-.5 1.8 0l2 2c.5.5.5 1.3 0 1.8s-.6.4-.9.4M17 4.8c-1 0-1.8-.8-1.8-1.8S16 1.2 17 1.2s1.8.8 1.8 1.8S18 4.8 17 4.8" class="cls-1"/></g></svg> |
| 129 | + <span>SGStream <i class="length">{{ sgstreams.length }}</i></span> |
| 130 | + </template> |
| 131 | + </th> |
| 132 | + <th class="icon invisible"> |
| 133 | + <router-link |
| 134 | + :to="'/' + $route.params.namespace + '/sgstreams/new'" |
| 135 | + title="Create Stream" |
| 136 | + v-if="iCan('create', 'sgstreams', $route.params.namespace)" |
| 137 | + > |
| 138 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" width="16px"><g fill="#36A8FF"><path d="M7.5 15C3.4 15 0 11.6 0 7.5S3.4 0 7.5 0 15 3.4 15 7.5 11.6 15 7.5 15zm0-13.4c-3.3 0-5.9 2.7-5.9 5.9s2.7 5.9 5.9 5.9 5.9-2.7 5.9-5.9-2.6-5.9-5.9-5.9z"/><path class="prefix__st0" d="M10.7 6.9H8.2V4.5H6.8v2.4H4.3v1.4h2.5v2.5h1.4V8.3h2.5z"/></g></svg> |
| 139 | + </router-link> |
| 140 | + </th> |
| 141 | + </thead> |
| 142 | + <tbody> |
| 143 | + <template v-if="!sgstreams.length"> |
| 144 | + <tr class="no-results"> |
| 145 | + <td colspan="999" v-if="iCan('create', 'sgstreams', $route.params.namespace)"> |
| 146 | + No streams have been found, would you like to <router-link :to="'/' + $route.params.namespace + '/sgstreams/new'" title="Create Stream">create a new one?</router-link> |
| 147 | + </td> |
| 148 | + <td v-else colspan="2"> |
| 149 | + No streams have been found. You don't have enough permissions to create a new one. |
| 150 | + </td> |
| 151 | + </tr> |
| 152 | + </template> |
| 153 | + <template v-else> |
| 154 | + <template v-for="stream in sgstreams"> |
| 155 | + <tr> |
| 156 | + <td class="hasTooltip"> |
| 157 | + <span> |
| 158 | + <router-link :to="'/' + $route.params.namespace + '/sgstream/' + stream.name" title="Stream Status"> |
| 159 | + {{ stream.name }} |
| 160 | + </router-link> |
| 161 | + </span> |
| 162 | + </td> |
| 163 | + <td class="icon invisible"> |
| 164 | + <router-link :to="'/' + $route.params.namespace + '/sgstream/' + stream.name" title="Stream Status" target="_blank"></router-link> |
| 165 | + </td> |
| 166 | + </tr> |
| 167 | + </template> |
| 168 | + </template> |
| 169 | + </tbody> |
| 170 | + </table> |
| 171 | + </div> |
| 172 | + |
117 | 173 | <div class="card" v-if="iCan('any', 'sginstanceprofiles', $route.params.namespace)"> |
118 | 174 | <table class="fullWidth"> |
119 | 175 | <thead> |
@@ -598,43 +654,69 @@ export default { |
598 | 654 |
|
599 | 655 | computed: { |
600 | 656 | clusters () { |
601 | | - return store.state.sgclusters.filter(cluster => (cluster.data.metadata.namespace == this.$route.params.namespace)) |
| 657 | + return (store.state.sgclusters !== null) |
| 658 | + ? store.state.sgclusters.filter(cluster => (cluster.data.metadata.namespace == this.$route.params.namespace)) |
| 659 | + : [] |
602 | 660 | }, |
603 | 661 |
|
604 | 662 | sgshardedclusters () { |
605 | | - return store.state.sgshardedclusters.filter(cluster => (cluster.data.metadata.namespace == this.$route.params.namespace)) |
| 663 | + return (store.state.sgshardedclusters !== null) |
| 664 | + ? store.state.sgshardedclusters.filter(cluster => (cluster.data.metadata.namespace == this.$route.params.namespace)) |
| 665 | + : [] |
| 666 | + }, |
| 667 | +
|
| 668 | + sgstreams () { |
| 669 | + return (store.state.sgstreams !== null) |
| 670 | + ? store.state.sgstreams.filter(stream => (stream.data.metadata.namespace == this.$route.params.namespace)) |
| 671 | + : [] |
606 | 672 | }, |
607 | 673 |
|
608 | 674 | profiles () { |
609 | | - return store.state.sginstanceprofiles.filter(profile => (profile.data.metadata.namespace == this.$route.params.namespace)) |
| 675 | + return (store.state.sginstanceprofiles !== null) |
| 676 | + ? store.state.sginstanceprofiles.filter(profile => (profile.data.metadata.namespace == this.$route.params.namespace)) |
| 677 | + : [] |
610 | 678 | }, |
611 | 679 |
|
612 | 680 | pgconfigs () { |
613 | | - return store.state.sgpgconfigs.filter(pgconfig => (pgconfig.data.metadata.namespace == this.$route.params.namespace)) |
| 681 | + return (store.state.sgpgconfigs !== null) |
| 682 | + ? store.state.sgpgconfigs.filter(pgconfig => (pgconfig.data.metadata.namespace == this.$route.params.namespace)) |
| 683 | + : [] |
614 | 684 | }, |
615 | 685 |
|
616 | 686 | poolconfigs () { |
617 | | - return store.state.sgpoolconfigs.filter(poolconfig => (poolconfig.data.metadata.namespace == this.$route.params.namespace)) |
| 687 | + return (store.state.sgpoolconfigs !== null) |
| 688 | + ? store.state.sgpoolconfigs.filter(poolconfig => (poolconfig.data.metadata.namespace == this.$route.params.namespace)) |
| 689 | + : [] |
618 | 690 | }, |
619 | 691 |
|
620 | 692 | objectstorages () { |
621 | | - return store.state.sgobjectstorages.filter(config => (config.data.metadata.namespace == this.$route.params.namespace)) |
| 693 | + return (store.state.sgobjectstorages !== null) |
| 694 | + ? store.state.sgobjectstorages.filter(config => (config.data.metadata.namespace == this.$route.params.namespace)) |
| 695 | + : [] |
622 | 696 | }, |
623 | 697 |
|
624 | 698 | sgscripts () { |
625 | | - return store.state.sgscripts.filter(config => (config.data.metadata.namespace == this.$route.params.namespace)) |
| 699 | + return (store.state.sgscripts !== null) |
| 700 | + ? store.state.sgscripts.filter(config => (config.data.metadata.namespace == this.$route.params.namespace)) |
| 701 | + : [] |
626 | 702 | }, |
627 | 703 |
|
628 | 704 | logsservers () { |
629 | | - return store.state.sgdistributedlogs.filter(logserver => (logserver.data.metadata.namespace == this.$route.params.namespace)) |
| 705 | + return (store.state.sgdistributedlogs !== null) |
| 706 | + ? store.state.sgdistributedlogs.filter(logserver => (logserver.data.metadata.namespace == this.$route.params.namespace)) |
| 707 | + : [] |
630 | 708 | }, |
631 | 709 |
|
632 | 710 | backups () { |
633 | | - return store.state.sgbackups.filter(backup => (backup.data.metadata.namespace == this.$route.params.namespace)) |
| 711 | + return (store.state.sgbackups !== null) |
| 712 | + ? store.state.sgbackups.filter(backup => (backup.data.metadata.namespace == this.$route.params.namespace)) |
| 713 | + : [] |
634 | 714 | }, |
635 | 715 |
|
636 | 716 | dbops () { |
637 | | - return store.state.sgdbops.filter(op => (op.data.metadata.namespace == this.$route.params.namespace)) |
| 717 | + return (store.state.sgdbops !== null) |
| 718 | + ? store.state.sgdbops.filter(op => (op.data.metadata.namespace == this.$route.params.namespace)) |
| 719 | + : [] |
638 | 720 | }, |
639 | 721 |
|
640 | 722 | tooltips () { |
|
0 commit comments