@hostlink/nuxt-light 1.21.10 → 1.21.12

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.21.10",
4
+ "version": "1.21.12",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -268,7 +268,7 @@ watch(menuWidth, () => {
268
268
  })
269
269
 
270
270
  const c1 = computed(() => {
271
- return light.getColorValue(light.color)
271
+ return light.getColorValue()
272
272
  })
273
273
 
274
274
  if (route.fullPath == "/" && my.default_page) {
@@ -401,13 +401,10 @@ const onLogout = async () => {
401
401
  @mouseover="isMouseOnDrawer = true">
402
402
  <!-- drawer content -->
403
403
  <q-scroll-area class="fit">
404
-
405
- <div class="q-mx-sm">
404
+ <div class="q-mx-xs q-mt-xs">
406
405
  <l-fav-menu :value="myFavorites" :dense="style.dense" v-if="myFavoritesCount > 0" />
407
406
  <l-menu :value="menus" :dense="style.dense" />
408
-
409
407
  </div>
410
-
411
408
  </q-scroll-area>
412
409
  </q-drawer>
413
410
 
@@ -448,13 +445,8 @@ const onLogout = async () => {
448
445
  </template>
449
446
  </router-view -->
450
447
  <NuxtLoadingIndicator />
451
-
452
448
  <NuxtPage />
453
-
454
-
455
449
  </q-page-container>
456
-
457
-
458
450
  <q-footer bordered v-if="style.footer">
459
451
  <q-item>
460
452
  <q-item-section>
@@ -656,7 +656,7 @@ selectedNodePath.value = drives[0].index.toString();
656
656
  <q-list padding class="text-grey-8">
657
657
  <q-item>
658
658
  <q-item-section>
659
- <q-btn icon="add" outline rounded :color="light.color" :label="$t('New')" :disable="!selectedNodePath">
659
+ <l-btn icon="add" label="New" :disable="!selectedNodePath">
660
660
  <q-menu>
661
661
  <q-list>
662
662
  <q-item clickable v-close-popup @click="onNewFolder" v-if="permission.includes('fs.folder.create')">
@@ -675,7 +675,7 @@ selectedNodePath.value = drives[0].index.toString();
675
675
  </q-item>
676
676
  </q-list>
677
677
  </q-menu>
678
- </q-btn>
678
+ </l-btn>
679
679
  </q-item-section>
680
680
  </q-item>
681
681
 
@@ -747,7 +747,7 @@ selectedNodePath.value = drives[0].index.toString();
747
747
 
748
748
  <template v-if="grid">
749
749
  <q-table :title="$t('Folders')" flat grid :columns="columns" :rows="folders" hide-pagination
750
- :pagination="{ rowsPerPage: 0 }">
750
+ :pagination="{ rowsPerPage: 0 }" color="$light.color">
751
751
  <template v-slot:item="props">
752
752
  <div class="q-pa-xs col-xs-12 col-sm-6 col-md-4" @click="onDblclickRow(null, props.row, null)">
753
753
  <q-card flat bordered>
@@ -768,7 +768,7 @@ selectedNodePath.value = drives[0].index.toString();
768
768
  </q-table>
769
769
 
770
770
  <q-table :title="$t('Files')" flat grid :columns="columns" :rows="files" hide-pagination
771
- :pagination="{ rowsPerPage: 0 }">
771
+ :pagination="{ rowsPerPage: 0 }" :color="$light.color">
772
772
 
773
773
  <template v-slot:item="props">
774
774
  <div class="q-pa-xs col-xs-12 col-sm-6 col-md-4" @click="onClickRow(null, props.row, null)">
@@ -798,7 +798,8 @@ selectedNodePath.value = drives[0].index.toString();
798
798
 
799
799
  <q-table flat :columns="columns" :rows="items" @row-dblclick="onDblclickRow" @row-click="onClickRow"
800
800
  :pagination="pagination" row-key="path" selection="multiple" v-model:selected="selected" dense
801
- :loading="loading" :loading-label="$t('Loading...')" :no-data-label="$t('No data available')">
801
+ :loading="loading" :loading-label="$t('Loading...')" :no-data-label="$t('No data available')"
802
+ :color="$light.color">
802
803
  <template #body-cell-icon="props">
803
804
  <q-td auto-width>
804
805
  <q-icon name="sym_o_folder" v-if="props.value == 'folder'" size="sm" />
@@ -118,7 +118,7 @@ const localShowPassword = computed(() => {
118
118
  });
119
119
 
120
120
  const onClickTc2Sc = () => {
121
- modelValue.value = tc2sc(modelValue.value);
121
+ modelValue.value = tc2sc(modelValue.value ?? "");
122
122
  }
123
123
 
124
124
  </script>
@@ -135,12 +135,10 @@ const onClickTc2Sc = () => {
135
135
  </q-menu>
136
136
  </q-btn>
137
137
  </template>
138
-
139
138
  <template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
140
139
  <slot :name="name" v-bind="props ?? {}"></slot>
141
140
  </template>
142
141
 
143
-
144
142
  <template v-if="localShowPassword" v-slot:append>
145
143
  <q-icon name="sym_o_visibility" class="cursor-pointer" :color="showPassword ? 'primary' : 'grey-5'"
146
144
  @click="isShowPassword = false" v-if="isShowPassword" />
@@ -56,8 +56,8 @@ const hasChildLink = () => {
56
56
  <q-list class="menu-list" :dense="dense">
57
57
  <template v-for="menu in value">
58
58
 
59
- <q-expansion-item :default-opened="hasLink(menu)" :label="$t(menu.label)" :icon="menu.icon" :dense="dense" v-if="isShowExpansionItem(menu)"
60
- :group="group">
59
+ <q-expansion-item :default-opened="hasLink(menu)" :label="$t(menu.label)" :icon="menu.icon" :dense="dense"
60
+ v-if="isShowExpansionItem(menu)" :group="group">
61
61
  <l-menu class="q-pl-md" :value="menu.children" :dense="dense"></l-menu>
62
62
  </q-expansion-item>
63
63
 
@@ -69,9 +69,7 @@ const hasChildLink = () => {
69
69
  <q-item-section avatar>
70
70
  <q-icon :name="menu.icon" />
71
71
  </q-item-section>
72
- <q-item-section>
73
- <q-item-label v-text="$t(menu.label)"></q-item-label>
74
- </q-item-section>
72
+ <q-item-section>{{ $t(menu.label) }}</q-item-section>
75
73
  </q-item>
76
74
  </template>
77
75
 
@@ -558,7 +558,7 @@ const onAdd = () => {
558
558
  </template>
559
559
 
560
560
  <q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onLocalRequest" :columns="columns"
561
- v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
561
+ v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected" :color="$light.color">
562
562
 
563
563
  <template #header="props">
564
564
  <q-tr :props="props">
@@ -31,7 +31,6 @@ const COLOR_CODE = {
31
31
  warning: "#ff9f43",
32
32
  dark: "#4b4b4b"
33
33
  };
34
- let styles = {};
35
34
  const light = reactive({
36
35
  styles: {
37
36
  table: {
@@ -46,8 +45,8 @@ const light = reactive({
46
45
  square: false
47
46
  },
48
47
  button: {
49
- outline: true,
50
- rounded: true,
48
+ outline: false,
49
+ rounded: false,
51
50
  unelevated: false,
52
51
  dense: false
53
52
  },
@@ -56,7 +55,7 @@ const light = reactive({
56
55
  outlined: true,
57
56
  standout: false,
58
57
  rounded: false,
59
- dense: true,
58
+ dense: false,
60
59
  square: false,
61
60
  stackLabel: true
62
61
  }
@@ -189,7 +188,7 @@ const light = reactive({
189
188
  name,
190
189
  value
191
190
  });
192
- styles[name] = value;
191
+ light.styles[name] = value;
193
192
  },
194
193
  setCurrentRoute(to) {
195
194
  currentRoute = to;
@@ -202,22 +201,18 @@ const light = reactive({
202
201
  const keyname = parts[1];
203
202
  return parseInt(currentRoute.params[keyname]);
204
203
  },
205
- init(styles2) {
206
- light.color = styles2.color || "primary";
207
- light.theme = styles2.theme || "semi-dark";
208
- styles2.input = { ...light.styles.input, ...styles2.input || {} };
209
- styles2.card = { ...light.styles.card, ...styles2.card || {} };
210
- styles2.button = { ...light.styles.button, ...styles2.button || {} };
211
- styles2.table = { ...light.styles.table, ...styles2.table || {} };
212
- light.styles = styles2;
204
+ init(styles) {
205
+ light.color = styles.color || "primary";
206
+ light.theme = styles.theme || "semi-dark";
207
+ light.styles.input = { ...light.styles.input, ...styles.input || {} };
208
+ light.styles.card = { ...light.styles.card, ...styles.card || {} };
209
+ light.styles.button = { ...light.styles.button, ...styles.button || {} };
210
+ light.styles.table = { ...light.styles.table, ...styles.table || {} };
213
211
  watch(() => light.theme, async () => {
214
212
  await light.setStyle("theme", light.theme);
215
213
  });
216
214
  watch(() => light.color, async () => {
217
- await m("updateMyStyle", {
218
- name: "color",
219
- value: light.color
220
- });
215
+ await light.setStyle("color", light.color);
221
216
  });
222
217
  },
223
218
  isGranted(right) {
@@ -18,13 +18,30 @@ const dialog = ref(false)
18
18
  const value = ref({})
19
19
 
20
20
  const onSubmit = async (data) => {
21
- //save data
22
- await m("addFileSystem", {
23
- data: data
24
- })
21
+ loading.value = true
22
+
23
+ try {
24
+ if (data.uuid) {
25
+ await m("lightFSupdate", {
26
+ data: data
27
+ })
28
+ } else {
29
+ //save data
30
+ await m("lightFSadd", {
31
+ data: data
32
+ })
33
+ }
34
+ dialog.value = false
35
+ refresh()
36
+
37
+ } catch (e) {
38
+ $q.notify({
39
+ type: 'negative',
40
+ message: e.message
41
+ })
42
+ }
25
43
 
26
- dialog.value = false
27
- refresh()
44
+ loading.value = false
28
45
  }
29
46
 
30
47
  const onRemove = async (selected) => {
@@ -36,11 +53,9 @@ const onRemove = async (selected) => {
36
53
  ok: 'Yes',
37
54
  cancel: 'No'
38
55
  }).onOk(async () => {
39
-
40
-
41
56
  for (let row of selected) {
42
- await m("deleteFileSystem", {
43
- name: row.name
57
+ await m("lightFSdelete", {
58
+ uuid: row.uuid
44
59
  })
45
60
  }
46
61
  selected.value = []
@@ -52,6 +67,15 @@ const onRemove = async (selected) => {
52
67
 
53
68
  const columns = [
54
69
  {
70
+ name: "action"
71
+ },
72
+ /* {
73
+ name: 'uuid',
74
+ required: true,
75
+ label: 'UUID',
76
+ field: row => row.uuid,
77
+ },
78
+ */ {
55
79
  name: 'name',
56
80
  required: true,
57
81
  label: 'Name',
@@ -74,8 +98,9 @@ const columns = [
74
98
  align: 'left',
75
99
  }
76
100
  ]
77
-
78
101
  const selected = ref([])
102
+
103
+ const loading = ref(false)
79
104
  </script>
80
105
  <template>
81
106
 
@@ -85,69 +110,76 @@ const selected = ref([])
85
110
  <q-card style="width: 500px;">
86
111
 
87
112
  <q-toolbar>
88
- <q-toolbar-title>{{ $t('Add File System') }}</q-toolbar-title>
113
+ <q-toolbar-title v-if="value.uuid">{{ $t('Edit File System') }}</q-toolbar-title>
114
+ <q-toolbar-title v-else>{{ $t('Add File System') }}</q-toolbar-title>
89
115
  <q-space></q-space>
90
116
  <q-btn flat round dense icon="sym_o_close" v-close-popup></q-btn>
91
117
  </q-toolbar>
92
118
 
93
- <FormKit type="l-form" :value="value" @submit="onSubmit" #default="{ value }">
94
- <FormKit type="l-input" label="Name" name="name" validation="required"></FormKit>
95
- <FormKit type="l-select" label="Type" name="type" validation="required" :options="[
119
+ <form-kit type="l-form" :value="value" @submit="onSubmit" #default="{ value }">
120
+ <form-kit type="l-input" label="Name" name="name" validation="required"></form-kit>
121
+ <form-kit type="l-select" label="Type" name="type" validation="required" :options="[
96
122
  { label: 'Local', value: 'local', disable: !app.driveTypes.includes('local') },
97
123
  { label: 'S3', value: 's3', disable: !app.driveTypes.includes('s3') },
98
124
  { label: 'HostLink storage', value: 'hostlink', disable: !app.driveTypes.includes('hostlink') },
99
125
  { label: 'Aliyun OSS', value: 'aliyun-oss', disable: !app.driveTypes.includes('aliyun-oss') },
100
- ]"></FormKit>
126
+ ]"></form-kit>
101
127
 
102
- <FormKit type="group" name="data">
103
- <FormKit type="l-input" label="Url" name="url"
128
+ <form-kit type="group" name="data">
129
+ <form-kit type="l-input" label="Url" name="url"
104
130
  hint="URL is used to generate the full URL of the file.">
105
- </FormKit>
131
+ </form-kit>
106
132
 
107
133
  <template v-if="value.type == 'local'">
108
- <FormKit type="l-input" label="Location" name="location" validation="required"
109
- hint="Location is the path to the directory where the files are stored."></FormKit>
134
+ <form-kit type="l-input" label="Location" name="location" validation="required"
135
+ hint="Location is the path to the directory where the files are stored."></form-kit>
110
136
  </template>
111
137
 
112
138
  <template v-if="value.type == 's3'">
113
- <FormKit type="l-input" label="Bucket" name="bucket" validation="required"></FormKit>
114
- <FormKit type="l-input" label="Access Key" name="accessKey" validation="required"></FormKit>
115
- <FormKit type="l-input" label="Secret Key" name="secretKey" validation="required"></FormKit>
116
- <FormKit type="l-input" label="Region" name="region" validation="required"></FormKit>
117
- <FormKit type="l-input" label="Endpoint" name="endpoint" validation="required"></FormKit>
118
- <FormKit type="l-input" label="Prefix" name="prefix"></FormKit>
119
- <FormKit type="l-select" label="Visibility" name="visibility" validation="required"
139
+ <form-kit type="l-input" label="Bucket" name="bucket" validation="required"></form-kit>
140
+ <form-kit type="l-input" label="Access Key" name="accessKey"
141
+ validation="required"></form-kit>
142
+ <form-kit type="l-input" label="Secret Key" name="secretKey"
143
+ validation="required"></form-kit>
144
+ <form-kit type="l-input" label="Region" name="region" validation="required"></form-kit>
145
+ <form-kit type="l-input" label="Endpoint" name="endpoint" validation="required"></form-kit>
146
+ <form-kit type="l-input" label="Prefix" name="prefix"></form-kit>
147
+ <form-kit type="l-select" label="Visibility" name="visibility" validation="required"
120
148
  :options="[
121
149
  { label: 'Public', value: 'public' },
122
150
  { label: 'Private', value: 'private' }
123
- ]"></FormKit>
151
+ ]"></form-kit>
124
152
  </template>
125
153
 
126
154
  <template v-if="value.type == 'hostlink'">
127
- <FormKit type="l-input" label="Endpoint" name="endpoint" validation="required"></FormKit>
128
- <FormKit type="l-input" label="Token" name="token" validation="required"></FormKit>
155
+ <form-kit type="l-input" label="Endpoint" name="endpoint" validation="required"></form-kit>
156
+ <form-kit type="l-input" label="Token" name="token" validation="required"></form-kit>
129
157
  </template>
130
158
 
131
159
  <template v-if="value.type == 'aliyun-oss'">
132
- <FormKit type="l-input" label="Access Key" name="access_key_id" validation="required">
133
- </FormKit>
134
- <FormKit type="l-input" label="Secret Key" name="access_key_secret" validation="required">
135
- </FormKit>
136
- <FormKit type="l-input" label="Endpoint" name="endpoint" validation="required"></FormKit>
137
- <FormKit type="l-input" label="Bucket" name="bucket" validation="required"></FormKit>
138
- <FormKit type="l-input" label="Prefix" name="prefix"></FormKit>
160
+ <form-kit type="l-input" label="Access Key" name="access_key_id" validation="required">
161
+ </form-kit>
162
+ <form-kit type="l-input" label="Secret Key" name="access_key_secret" validation="required">
163
+ </form-kit>
164
+ <form-kit type="l-input" label="Endpoint" name="endpoint" validation="required"></form-kit>
165
+ <form-kit type="l-input" label="Bucket" name="bucket" validation="required"></form-kit>
166
+ <form-kit type="l-input" label="Prefix" name="prefix"></form-kit>
139
167
  </template>
140
- </FormKit>
168
+ </form-kit>
141
169
 
142
- </FormKit>
170
+ </form-kit>
143
171
 
144
172
  </q-card>
145
173
  </q-dialog>
146
174
 
147
175
  <q-table :rows="items" :columns="columns" selection="multiple" flat bordered dense separator="cell"
148
- v-model:selected="selected" row-key="name">
176
+ v-model:selected="selected" row-key="uuid" :loading="loading" :color="$light.color">
149
177
  <template #top-left>
150
- <q-btn icon="sym_o_add" @click="dialog = true" flat round dense>
178
+ <q-btn icon="sym_o_add" @click="value = {
179
+ data: {
180
+ url: '',
181
+ }
182
+ }; dialog = true" flat round dense>
151
183
  <q-tooltip>Add File System</q-tooltip>
152
184
  </q-btn>
153
185
  <q-btn icon="sym_o_delete" @click="onRemove(selected)" flat round dense :disable="selected.length == 0">
@@ -161,6 +193,14 @@ const selected = ref([])
161
193
  </q-td>
162
194
  </template>
163
195
 
196
+ <template #body-cell-action="props">
197
+ <q-td auto-width>
198
+ <q-btn icon="sym_o_edit" @click="value = props.row; dialog = true" flat round dense>
199
+ <q-tooltip>Edit</q-tooltip>
200
+ </q-btn>
201
+ </q-td>
202
+ </template>
203
+
164
204
  </q-table>
165
205
  </l-page>
166
206
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.21.10",
3
+ "version": "1.21.12",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",