2019-09-09 17:00:25 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="header">
|
|
|
|
<div class="header__content-holder">
|
2019-09-19 12:43:57 +01:00
|
|
|
<div class="header__content-holder__logo-area">
|
2019-10-25 10:53:35 +01:00
|
|
|
<StorjIcon
|
|
|
|
class="header__content-holder__icon"
|
|
|
|
alt="storj icon"
|
|
|
|
/>
|
2019-09-19 12:43:57 +01:00
|
|
|
<div class="header__content-holder__logo-area__refresh-button" @click="onRefresh">
|
2019-10-25 10:53:35 +01:00
|
|
|
<RefreshIcon alt="refresh image"/>
|
2019-09-19 12:43:57 +01:00
|
|
|
</div>
|
2019-09-09 17:00:25 +01:00
|
|
|
</div>
|
2019-09-19 12:43:57 +01:00
|
|
|
<div class="header__content-holder__node-id-container">
|
|
|
|
<b class="header__content-holder__node-id-container__title">Node ID:</b>
|
|
|
|
<p class="header__content-holder__node-id-container__id">{{this.nodeId}}</p>
|
2019-09-09 17:00:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
|
2019-10-25 10:53:35 +01:00
|
|
|
import RefreshIcon from '@/../static/images/refresh.svg';
|
|
|
|
import StorjIcon from '@/../static/images/storjIcon.svg';
|
|
|
|
|
2019-09-09 17:00:25 +01:00
|
|
|
import { NODE_ACTIONS } from '@/app/store/modules/node';
|
|
|
|
|
|
|
|
const {
|
|
|
|
GET_NODE_INFO,
|
|
|
|
SELECT_SATELLITE,
|
|
|
|
} = NODE_ACTIONS;
|
|
|
|
|
2019-10-25 10:53:35 +01:00
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
StorjIcon,
|
|
|
|
RefreshIcon,
|
|
|
|
},
|
|
|
|
})
|
2019-09-09 17:00:25 +01:00
|
|
|
export default class SNOHeader extends Vue {
|
|
|
|
public async onRefresh(): Promise<void> {
|
|
|
|
const selectedSatellite = this.$store.state.node.selectedSatellite.id;
|
2019-09-13 17:06:04 +01:00
|
|
|
|
|
|
|
try {
|
|
|
|
await this.$store.dispatch(GET_NODE_INFO);
|
|
|
|
await this.$store.dispatch(SELECT_SATELLITE, selectedSatellite);
|
|
|
|
} catch (error) {
|
|
|
|
console.error(`${error.message} satellite data.`);
|
|
|
|
}
|
2019-09-09 17:00:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public get nodeId(): string {
|
|
|
|
return this.$store.state.node.info.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2019-10-11 17:28:47 +01:00
|
|
|
<style scoped lang="scss">
|
2019-09-09 17:00:25 +01:00
|
|
|
.header {
|
|
|
|
width: 100%;
|
|
|
|
height: 89px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2019-10-28 13:19:57 +00:00
|
|
|
background-color: #fff;
|
2019-09-09 17:00:25 +01:00
|
|
|
|
|
|
|
&__content-holder {
|
|
|
|
width: 822px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
|
2019-09-19 12:43:57 +01:00
|
|
|
&__logo-area {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-09-09 17:00:25 +01:00
|
|
|
|
2019-09-19 12:43:57 +01:00
|
|
|
&__refresh-button {
|
|
|
|
margin-left: 25px;
|
|
|
|
max-height: 42px;
|
2019-10-02 11:26:50 +01:00
|
|
|
cursor: pointer;
|
2019-09-09 17:00:25 +01:00
|
|
|
|
2019-10-02 11:26:50 +01:00
|
|
|
&:hover {
|
2019-09-09 17:00:25 +01:00
|
|
|
|
2019-10-02 11:26:50 +01:00
|
|
|
.refresh-button-svg-rect {
|
2019-10-28 13:19:57 +00:00
|
|
|
fill: #133e9c;
|
2019-09-19 12:43:57 +01:00
|
|
|
}
|
|
|
|
|
2019-10-02 11:26:50 +01:00
|
|
|
.refresh-button-svg-path {
|
2019-10-28 13:19:57 +00:00
|
|
|
fill: #fff;
|
2019-09-19 12:43:57 +01:00
|
|
|
}
|
2019-09-09 17:00:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-19 12:43:57 +01:00
|
|
|
&__node-id-container {
|
2019-10-28 13:19:57 +00:00
|
|
|
color: #535f77;
|
2019-09-09 17:00:25 +01:00
|
|
|
height: 44px;
|
|
|
|
padding: 0 14px 0 14px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-10-28 13:19:57 +00:00
|
|
|
border: 1px solid #e8e8e8;
|
2019-09-09 17:00:25 +01:00
|
|
|
border-radius: 12px;
|
2019-09-19 12:43:57 +01:00
|
|
|
font-size: 14px;
|
2019-09-09 17:00:25 +01:00
|
|
|
|
2019-09-19 12:43:57 +01:00
|
|
|
&__title {
|
|
|
|
min-width: 55px;
|
|
|
|
margin-right: 5px;
|
2019-11-05 15:53:37 +00:00
|
|
|
user-select: none;
|
2019-09-19 12:43:57 +01:00
|
|
|
}
|
2019-09-09 17:00:25 +01:00
|
|
|
|
2019-09-19 12:43:57 +01:00
|
|
|
&__id {
|
|
|
|
font-size: 11px;
|
2019-09-09 17:00:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|