glib-web 2.6.5 → 2.6.7
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/LICENSE +0 -0
- package/action.js +7 -10
- package/actions/auth/restart.js +0 -0
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/actions/http/get.js +27 -12
- package/components/_message.vue +0 -0
- package/components/datetime.vue +0 -0
- package/components/fab.vue +0 -0
- package/components/fields/country/countries.js +0 -0
- package/components/fields/country/field.vue +0 -0
- package/components/fields/country/regions.js +0 -0
- package/components/fields/datetime.vue +0 -0
- package/components/fields/dynamicSelect.vue +0 -0
- package/components/fields/richText.vue +1 -1
- package/components/fields/timeZone.vue +0 -0
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- package/components/mixins/table/export.js +0 -0
- package/components/mixins/table/import.js +0 -0
- package/components/p.vue +0 -0
- package/keys.js +0 -0
- package/nav/drawerButton.vue +0 -0
- package/package.json +1 -1
- package/settings.json.example +0 -0
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/unsupported.vue +0 -0
- package/utils/dom.js +0 -0
- package/utils/http.js +12 -4
- package/utils/settings.js +0 -0
- package/utils/storage.js +0 -0
- package/utils/url.js +0 -0
package/LICENSE
CHANGED
|
File without changes
|
package/action.js
CHANGED
|
@@ -132,9 +132,9 @@ export default class Action {
|
|
|
132
132
|
const name = spec.action;
|
|
133
133
|
if (TypeUtils.isString(name)) {
|
|
134
134
|
if (name.startsWith("component/")) {
|
|
135
|
-
this.executeLocal(name, spec, component);
|
|
135
|
+
return this.executeLocal(name, spec, component);
|
|
136
136
|
} else {
|
|
137
|
-
this.executeGlobal(name, spec, component, params);
|
|
137
|
+
return this.executeGlobal(name, spec, component, params);
|
|
138
138
|
}
|
|
139
139
|
} else {
|
|
140
140
|
console.warn(`Invalid action: "${name}"`);
|
|
@@ -151,7 +151,7 @@ export default class Action {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
static executeGlobal(name, spec, component, params) {
|
|
154
|
-
this._executeInternal(name, spec, component, params, actions);
|
|
154
|
+
return this._executeInternal(name, spec, component, params, actions);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
static _executeInternal(name, spec, component, params, registry) {
|
|
@@ -163,13 +163,10 @@ export default class Action {
|
|
|
163
163
|
if (!logDisabled) {
|
|
164
164
|
console.debug(`Executing "${actionName}"`);
|
|
165
165
|
}
|
|
166
|
-
action.execute(spec, component, params);
|
|
166
|
+
return action.execute(spec, component, params);
|
|
167
167
|
} catch (e) {
|
|
168
|
-
GLib.settings.errorHandler(
|
|
169
|
-
|
|
170
|
-
`Failed executing command "${actionName}". Error: ${e.message}`
|
|
171
|
-
)
|
|
172
|
-
);
|
|
168
|
+
GLib.settings.errorHandler(e);
|
|
169
|
+
return null;
|
|
173
170
|
}
|
|
174
171
|
}
|
|
175
172
|
|
|
@@ -195,7 +192,7 @@ export default class Action {
|
|
|
195
192
|
}
|
|
196
193
|
|
|
197
194
|
static executeCustom(name, spec, component, params) {
|
|
198
|
-
this._executeInternal(name, spec, component, params, customActions);
|
|
195
|
+
return this._executeInternal(name, spec, component, params, customActions);
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
198
|
|
package/actions/auth/restart.js
CHANGED
|
File without changes
|
package/actions/dialogs/oauth.js
CHANGED
|
File without changes
|
|
File without changes
|
package/actions/http/get.js
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
export default class {
|
|
2
|
-
execute(
|
|
2
|
+
execute(spec, component) {
|
|
3
|
+
return new Promise(resolve => {
|
|
4
|
+
GLib.http.execute(
|
|
5
|
+
spec,
|
|
6
|
+
"GET",
|
|
7
|
+
component,
|
|
8
|
+
(page, response) => {
|
|
9
|
+
this.handleSuccess(page, spec, component);
|
|
10
|
+
resolve({ page: page, response: response });
|
|
11
|
+
},
|
|
12
|
+
(error, response) => {
|
|
13
|
+
resolve({ error: error, response: response });
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
handleSuccess(page, spec, component) {
|
|
3
20
|
const currentUrl = window.location.href;
|
|
4
21
|
|
|
5
|
-
|
|
6
|
-
Utils.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
22
|
+
Utils.type.ifString(spec.historyUrl, historyUrl => {
|
|
23
|
+
const cleanUrl = Utils.url.htmlUrl(historyUrl);
|
|
24
|
+
if (cleanUrl !== currentUrl) {
|
|
25
|
+
const data = Object.assign({}, window.vueApp.page, {
|
|
26
|
+
replayGetResponse: page.onResponse
|
|
27
|
+
});
|
|
12
28
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
GLib.action.handleResponse(page, controller);
|
|
29
|
+
Utils.history.pushPage(data, cleanUrl);
|
|
30
|
+
}
|
|
17
31
|
});
|
|
32
|
+
GLib.action.handleResponse(page, component);
|
|
18
33
|
}
|
|
19
34
|
}
|
package/components/_message.vue
CHANGED
|
File without changes
|
package/components/datetime.vue
CHANGED
|
File without changes
|
package/components/fab.vue
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -177,7 +177,7 @@ export default {
|
|
|
177
177
|
data: () => ({
|
|
178
178
|
customToolbar: [
|
|
179
179
|
["bold", "italic", "strike"],
|
|
180
|
-
[{ header: 1
|
|
180
|
+
[{ header: [false, 1, 2, 3, 4, 5] }],
|
|
181
181
|
[{ list: "ordered" }, { list: "bullet" }],
|
|
182
182
|
["image", "link"],
|
|
183
183
|
],
|
|
File without changes
|
package/components/hr.vue
CHANGED
|
File without changes
|
package/components/html.vue
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/p.vue
CHANGED
|
File without changes
|
package/keys.js
CHANGED
|
File without changes
|
package/nav/drawerButton.vue
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/settings.json.example
CHANGED
|
File without changes
|
package/styles/test.sass
CHANGED
|
File without changes
|
package/styles/test.scss
CHANGED
|
File without changes
|
|
File without changes
|
package/utils/dom.js
CHANGED
|
File without changes
|
package/utils/http.js
CHANGED
|
@@ -149,7 +149,7 @@ export default class {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
static execute(properties, methodName, component, jsonHandler) {
|
|
152
|
+
static execute(properties, methodName, component, jsonHandler, errorHandler) {
|
|
153
153
|
this.startIndicator(component);
|
|
154
154
|
|
|
155
155
|
// `fetch()` only supports uppercase
|
|
@@ -185,12 +185,12 @@ export default class {
|
|
|
185
185
|
.then(res => {
|
|
186
186
|
vm.stopIndicator(component);
|
|
187
187
|
|
|
188
|
+
response = res;
|
|
188
189
|
if (res.status >= 500) {
|
|
189
190
|
throw "Server error";
|
|
190
191
|
} else if (res.status >= 400) {
|
|
191
192
|
throw "Not accessible";
|
|
192
193
|
} else {
|
|
193
|
-
response = res;
|
|
194
194
|
return res.json();
|
|
195
195
|
}
|
|
196
196
|
})
|
|
@@ -200,9 +200,17 @@ export default class {
|
|
|
200
200
|
})
|
|
201
201
|
.catch(error => {
|
|
202
202
|
vm.stopIndicator(component);
|
|
203
|
+
|
|
203
204
|
if (!request.canceled) {
|
|
204
|
-
|
|
205
|
-
|
|
205
|
+
const message = error.toString();
|
|
206
|
+
|
|
207
|
+
console.error("Error:", message);
|
|
208
|
+
|
|
209
|
+
if (errorHandler) {
|
|
210
|
+
errorHandler(error, response);
|
|
211
|
+
} else {
|
|
212
|
+
Utils.launch.snackbar.error(message, component);
|
|
213
|
+
}
|
|
206
214
|
} else {
|
|
207
215
|
console.info("Canceled");
|
|
208
216
|
}
|
package/utils/settings.js
CHANGED
|
File without changes
|
package/utils/storage.js
CHANGED
|
File without changes
|
package/utils/url.js
CHANGED
|
File without changes
|