-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathOrganizationConfigurationInformation.vue
More file actions
194 lines (174 loc) · 5.43 KB
/
Copy pathOrganizationConfigurationInformation.vue
File metadata and controls
194 lines (174 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!-- Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS -->
<template>
<div class="organization-info">
<div class="card-header">
<ion-title class="card-header__title title-h3">
{{ $msTranslate('OrganizationPage.configuration.title') }}
</ion-title>
</div>
<div class="card-content">
<div class="info-list">
<!-- Workspace deletion delay -->
<div class="info-list-item">
<ion-label class="info-list-item__title body">
{{ $msTranslate('OrganizationPage.configuration.workspaceDeletionDelay') }}
</ion-label>
<div class="info-list-item__value cell-title info">
{{
$msTranslate(
orgInfo.workspaceDeletionDelay === 0
? 'WorkspacesPage.trashWorkspace.deletionDelay.immediate'
: formatWorkspaceDeletionDelay(orgInfo.workspaceDeletionDelay),
)
}}
</div>
</div>
<!-- Outsider profile -->
<div class="info-list-item">
<ion-label class="info-list-item__title body">
{{ $msTranslate('OrganizationPage.configuration.outsidersAllowed') }}
</ion-label>
<div
class="info-list-item__value cell-title"
:class="orgInfo.outsidersAllowed ? 'success' : 'warning'"
>
{{
orgInfo.outsidersAllowed
? $msTranslate('OrganizationPage.configuration.allowed')
: $msTranslate('OrganizationPage.configuration.forbidden')
}}
</div>
</div>
<!-- User limit -->
<div class="info-list-item">
<ion-text class="info-list-item__title body">
{{ $msTranslate('OrganizationPage.configuration.userLimit') }}
</ion-text>
<div
class="info-list-item__value cell-title"
:class="orgInfo.userLimit !== undefined ? 'warning' : 'success'"
>
{{ orgInfo.userLimit !== undefined ? orgInfo.userLimit : $msTranslate('OrganizationPage.configuration.unlimited') }}
</div>
</div>
<!-- Server addr -->
<div class="info-list-item server-address">
<ion-text class="info-list-item__title server-address__title body">
{{ $msTranslate('OrganizationPage.configuration.serverAddr') }}
</ion-text>
<div class="server-address-value">
<ion-text class="server-address-value__text body">
{{ orgInfo.organizationAddr }}
</ion-text>
<ms-feedback-button
fill="clear"
size="small"
id="copy-link-btn"
:callback="copyAddress"
:normal-state="{ icon: copy }"
/>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { formatWorkspaceDeletionDelay } from '@/components/workspaces/utils';
import { OrganizationInfo } from '@/parsec';
import { IonLabel, IonText, IonTitle } from '@ionic/vue';
import { copy } from 'ionicons/icons';
import { Clipboard, MsFeedbackButton } from 'megashark-lib';
const props = defineProps<{
orgInfo: OrganizationInfo;
}>();
async function copyAddress(): Promise<boolean | undefined> {
return await Clipboard.writeText(props.orgInfo.organizationAddr);
}
</script>
<style scoped lang="scss">
.organization-info {
display: flex;
flex-direction: column;
background: var(--parsec-color-light-secondary-white);
align-items: center;
gap: 1rem;
width: 100%;
max-width: 30rem;
border-radius: var(--parsec-radius-12);
height: fit-content;
box-shadow: var(--parsec-shadow-input);
padding: 1.5rem;
.card-header {
display: flex;
align-items: center;
width: 100%;
&__title {
color: var(--parsec-color-light-secondary-text);
}
}
.card-content {
display: flex;
flex-direction: column;
width: 100%;
gap: 1rem;
}
.info-list {
padding: 0;
display: flex;
flex-direction: column;
gap: 1rem;
&-item {
justify-content: space-between;
display: flex;
align-items: center;
gap: 1rem;
&__title {
color: var(--parsec-color-light-secondary-hard-grey);
}
&__value.cell-title {
padding: 0.125rem 0.5rem;
border-radius: var(--parsec-radius-32);
}
.success {
color: var(--parsec-color-light-success-700);
background: var(--parsec-color-light-success-50);
}
.warning {
color: var(--parsec-color-light-warning-700);
background: var(--parsec-color-light-warning-50);
}
.info {
color: var(--parsec-color-light-secondary-text);
background: var(--parsec-color-light-secondary-premiere);
}
}
}
.server-address {
display: flex;
flex-direction: column;
gap: 0.5rem;
align-items: start;
&-value {
color: var(--parsec-color-light-secondary-text);
background-color: var(--parsec-color-light-secondary-background);
border-radius: var(--parsec-radius-6);
padding: 0.5rem 1rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
overflow: hidden;
width: 100%;
&__text {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
&__copied {
color: var(--parsec-color-light-success-700);
}
}
}
}
</style>