@nethserver/ns8-ui-lib 0.0.65 → 0.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethserver/ns8-ui-lib",
3
- "version": "0.0.65",
3
+ "version": "0.0.68",
4
4
  "description": "Vue.js library for NethServer 8 UI",
5
5
  "keywords": [
6
6
  "nethserver",
@@ -15,15 +15,11 @@
15
15
  ></cv-skeleton-text>
16
16
  </div>
17
17
  <template v-else-if="!backupsContainingInstance.length">
18
- <div class="row">
18
+ <div class="row no-backup">
19
19
  <!-- no backup -->
20
- <NsInlineNotification
21
- kind="warning"
22
- :title="noBackupMessage"
23
- :showCloseButton="false"
24
- :actionLabel="scheduleBackupLabel"
25
- @action="goToBackup"
26
- />
20
+ <span class="ns-warning">
21
+ {{ noBackupMessage }}
22
+ </span>
27
23
  </div>
28
24
  </template>
29
25
  <template v-else>
@@ -33,11 +29,8 @@
33
29
  :key="backup.id"
34
30
  class="backup"
35
31
  >
36
- <div class="row">
37
- <h5
38
- v-if="backupsContainingInstance.length > 1"
39
- class="title mg-top-sm"
40
- >
32
+ <div v-if="backupsContainingInstance.length > 1" class="row">
33
+ <h5 class="title">
41
34
  {{ backup.name }}
42
35
  </h5>
43
36
  </div>
@@ -83,12 +76,12 @@
83
76
  />
84
77
  </div>
85
78
  </div>
86
- <div class="table-wrapper">
79
+ <div
80
+ v-if="backupsContainingInstance.length > 1"
81
+ class="table-wrapper"
82
+ >
87
83
  <div class="table">
88
- <cv-accordion
89
- v-if="backupsContainingInstance.length > 1"
90
- ref="accordion"
91
- >
84
+ <cv-accordion ref="accordion">
92
85
  <cv-accordion-item :open="toggleAccordion[0]">
93
86
  <template slot="title">{{ showMoreLabel }}</template>
94
87
  <template slot="content">
@@ -140,10 +133,6 @@ export default {
140
133
  type: String,
141
134
  default: "No backup configured",
142
135
  },
143
- scheduleBackupLabel: {
144
- type: String,
145
- default: "Configure",
146
- },
147
136
  goToBackupLabel: {
148
137
  type: String,
149
138
  default: "Go to Backup",
@@ -292,6 +281,7 @@ export default {
292
281
  .title {
293
282
  margin-left: 0.25rem;
294
283
  margin-right: 0.25rem;
284
+ margin-bottom: 0.5rem;
295
285
  overflow: hidden;
296
286
  text-overflow: ellipsis;
297
287
  white-space: nowrap;
@@ -300,7 +290,7 @@ export default {
300
290
  .table-wrapper {
301
291
  display: flex;
302
292
  justify-content: center;
303
- margin-top: 0.5rem;
293
+ margin-bottom: 0.5rem;
304
294
  }
305
295
 
306
296
  .table {
@@ -329,6 +319,10 @@ export default {
329
319
  .backup-status-icon {
330
320
  margin-right: 0.25rem;
331
321
  }
322
+
323
+ .no-backup {
324
+ font-weight: bold;
325
+ }
332
326
  </style>
333
327
 
334
328
  <style lang="scss">
@@ -23,7 +23,19 @@
23
23
  </div>
24
24
  <template v-else>
25
25
  <div v-if="title" class="row">
26
- <h3 class="title">{{ title }}</h3>
26
+ <!-- title tooltip -->
27
+ <cv-tooltip
28
+ v-if="titleTooltip"
29
+ alignment="center"
30
+ direction="bottom"
31
+ :tip="titleTooltip"
32
+ >
33
+ <h3 class="title">
34
+ {{ title }}
35
+ </h3>
36
+ </cv-tooltip>
37
+ <!-- no title tooltip -->
38
+ <h3 v-else class="title">{{ title }}</h3>
27
39
  </div>
28
40
  <div v-if="description" class="row">
29
41
  <div class="description">{{ description }}</div>
@@ -52,6 +64,10 @@ export default {
52
64
  type: String,
53
65
  required: false,
54
66
  },
67
+ titleTooltip: {
68
+ type: String,
69
+ required: false,
70
+ },
55
71
  icon: {
56
72
  type: [String, Object],
57
73
  default: undefined,
@@ -105,6 +121,7 @@ export default {
105
121
  .title {
106
122
  margin-left: 0.25rem;
107
123
  margin-right: 0.25rem;
124
+ margin-bottom: 0.5rem;
108
125
  overflow: hidden;
109
126
  text-overflow: ellipsis;
110
127
  white-space: nowrap;
@@ -0,0 +1,136 @@
1
+ <template>
2
+ <NsInfoCard
3
+ :title="title"
4
+ :description="description"
5
+ :light="light"
6
+ :icon="Catalog32"
7
+ >
8
+ <template slot="content">
9
+ <NsButton kind="ghost" :icon="ArrowRight20" @click="goToLogs">
10
+ {{ buttonLabel }}
11
+ </NsButton>
12
+ </template>
13
+ </NsInfoCard>
14
+ </template>
15
+
16
+ <script>
17
+ import IconService from "../lib-mixins/icon.js";
18
+ import UtilService from "../lib-mixins/util.js";
19
+
20
+ export default {
21
+ name: "NsSystemLogsCard",
22
+ mixins: [UtilService, IconService],
23
+ props: {
24
+ title: {
25
+ type: String,
26
+ default: "Logs",
27
+ },
28
+ description: {
29
+ type: String,
30
+ default: "",
31
+ },
32
+ buttonLabel: {
33
+ type: String,
34
+ default: "Go to System logs",
35
+ },
36
+ router: {
37
+ type: Object,
38
+ default: null,
39
+ },
40
+ context: {
41
+ type: String,
42
+ default: "cluster",
43
+ validator: (val) => ["cluster", "node", "module"].includes(val),
44
+ },
45
+ nodeId: {
46
+ type: String,
47
+ default: "",
48
+ },
49
+ moduleId: {
50
+ type: String,
51
+ default: "",
52
+ },
53
+ searchQuery: {
54
+ type: String,
55
+ default: "",
56
+ },
57
+ maxLines: {
58
+ type: String,
59
+ default: "",
60
+ },
61
+ startDate: {
62
+ type: String,
63
+ default: "",
64
+ },
65
+ startTime: {
66
+ type: String,
67
+ default: "",
68
+ },
69
+ endDate: {
70
+ type: String,
71
+ default: "",
72
+ },
73
+ endTime: {
74
+ type: String,
75
+ default: "",
76
+ },
77
+ followLogs: Boolean,
78
+ light: Boolean,
79
+ },
80
+ computed: {
81
+ logsUrl() {
82
+ const queryParams = [];
83
+
84
+ if (this.context) {
85
+ queryParams.push(`context=${this.context}`);
86
+ }
87
+
88
+ if (this.context == "node" && this.nodeId) {
89
+ queryParams.push(`selectedNodeId=${this.nodeId}`);
90
+ }
91
+
92
+ if (this.context == "module" && this.moduleId) {
93
+ queryParams.push(`selectedAppId=${this.moduleId}`);
94
+ }
95
+
96
+ if (this.searchQuery) {
97
+ queryParams.push(`searchQuery=${this.searchQuery}`);
98
+ }
99
+
100
+ if (this.maxLines) {
101
+ queryParams.push(`maxLines=${this.maxLines}`);
102
+ }
103
+
104
+ if (this.startDate) {
105
+ queryParams.push(`startDate=${this.startDate}`);
106
+ }
107
+
108
+ if (this.startTime) {
109
+ queryParams.push(`startTime=${this.startTime}`);
110
+ }
111
+
112
+ if (this.endDate) {
113
+ queryParams.push(`endDate=${this.endDate}`);
114
+ }
115
+
116
+ if (this.endTime) {
117
+ queryParams.push(`endTime=${this.endTime}`);
118
+ }
119
+
120
+ if (this.followLogs) {
121
+ queryParams.push(`followLogs=${this.followLogs}`);
122
+ }
123
+ return "/system-logs?" + queryParams.join("&");
124
+ },
125
+ },
126
+ methods: {
127
+ goToLogs() {
128
+ if (this.router) {
129
+ this.router.push(this.logsUrl);
130
+ }
131
+ },
132
+ },
133
+ };
134
+ </script>
135
+
136
+ <style scoped lang="scss"></style>
@@ -87,6 +87,7 @@ export default {
87
87
  .service-name {
88
88
  margin-left: 0.25rem;
89
89
  margin-right: 0.25rem;
90
+ margin-bottom: 0.5rem;
90
91
  }
91
92
 
92
93
  .success-icon {