ywana-core8 0.0.829 → 0.0.830
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/index.cjs +32 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +32 -35
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +32 -35
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/incubator/calendar.css +41 -0
- package/src/incubator/calendar.js +66 -0
- package/src/incubator/task.js +8 -28
package/dist/index.modern.js
CHANGED
@@ -5064,12 +5064,10 @@ var TaskContextProvider = function TaskContextProvider(props) {
|
|
5064
5064
|
}
|
5065
5065
|
};
|
5066
5066
|
|
5067
|
-
var tasks = function tasks(
|
5067
|
+
var tasks = function tasks(filters, likes) {
|
5068
5068
|
try {
|
5069
5069
|
return Promise.resolve(_catch$5(function () {
|
5070
|
-
|
5071
|
-
console.log("tasks", filters, filters3);
|
5072
|
-
return Promise.resolve(API.all(filters3, likes));
|
5070
|
+
return Promise.resolve(API.all(filters, likes));
|
5073
5071
|
}, function (error) {
|
5074
5072
|
console.log("tasks error", error);
|
5075
5073
|
}));
|
@@ -5090,14 +5088,6 @@ var TaskContextProvider = function TaskContextProvider(props) {
|
|
5090
5088
|
|
5091
5089
|
var _listeners = Object.assign({}, listeners);
|
5092
5090
|
|
5093
|
-
var _useState = useState({}),
|
5094
|
-
filters = _useState[0],
|
5095
|
-
setFilters = _useState[1];
|
5096
|
-
|
5097
|
-
useEffect(function () {
|
5098
|
-
console.log("TaskContext", filters);
|
5099
|
-
}, [filters]);
|
5100
|
-
|
5101
5091
|
function addListener(taskID, listener) {
|
5102
5092
|
_listeners[taskID] = listener;
|
5103
5093
|
}
|
@@ -5109,9 +5099,9 @@ var TaskContextProvider = function TaskContextProvider(props) {
|
|
5109
5099
|
useEffect(function () {
|
5110
5100
|
var interval = setInterval(function () {
|
5111
5101
|
try {
|
5112
|
-
|
5113
|
-
|
5114
|
-
|
5102
|
+
return Promise.resolve(API.all({
|
5103
|
+
state: TASK_STATES.RUNNING
|
5104
|
+
})).then(function (tasks) {
|
5115
5105
|
Object.keys(_listeners).forEach(function (taskID) {
|
5116
5106
|
var task = tasks.find(function (task) {
|
5117
5107
|
return task.id === taskID;
|
@@ -5138,13 +5128,23 @@ var TaskContextProvider = function TaskContextProvider(props) {
|
|
5138
5128
|
updateTask: updateTask,
|
5139
5129
|
removeTask: removeTask,
|
5140
5130
|
addListener: addListener,
|
5141
|
-
removeListener: removeListener
|
5142
|
-
setFilters: setFilters
|
5131
|
+
removeListener: removeListener
|
5143
5132
|
};
|
5144
5133
|
return /*#__PURE__*/React.createElement(TaskContext.Provider, {
|
5145
5134
|
value: value
|
5146
5135
|
}, children);
|
5147
5136
|
};
|
5137
|
+
/**
|
5138
|
+
* Task States
|
5139
|
+
*/
|
5140
|
+
|
5141
|
+
var TASK_STATES = {
|
5142
|
+
"CREATED": "CREATED",
|
5143
|
+
"RUNNING": "RUNNING",
|
5144
|
+
"COMPLETED": "COMPPLETED",
|
5145
|
+
"FAULTED": "FAULTED",
|
5146
|
+
"CANCELED": "CANCELED"
|
5147
|
+
};
|
5148
5148
|
/**
|
5149
5149
|
* TaskProgress
|
5150
5150
|
*/
|
@@ -5172,9 +5172,9 @@ var TaskProgress = function TaskProgress(props) {
|
|
5172
5172
|
autoreload = _props$autoreload === void 0 ? true : _props$autoreload,
|
5173
5173
|
onComplete = props.onComplete;
|
5174
5174
|
|
5175
|
-
var
|
5176
|
-
progress =
|
5177
|
-
setProgress =
|
5175
|
+
var _useState = useState(0),
|
5176
|
+
progress = _useState[0],
|
5177
|
+
setProgress = _useState[1];
|
5178
5178
|
|
5179
5179
|
useEffect(function () {
|
5180
5180
|
if (autoreload) {
|
@@ -5207,7 +5207,9 @@ var TaskMonitor = function TaskMonitor(props) {
|
|
5207
5207
|
|
5208
5208
|
var refresh = function refresh() {
|
5209
5209
|
try {
|
5210
|
-
|
5210
|
+
if (from) filters["from"] = from;
|
5211
|
+
console.log("refresh", filters);
|
5212
|
+
return Promise.resolve(context.tasks(filters)).then(function (tasks) {
|
5211
5213
|
setTasks(tasks);
|
5212
5214
|
});
|
5213
5215
|
} catch (e) {
|
@@ -5217,20 +5219,21 @@ var TaskMonitor = function TaskMonitor(props) {
|
|
5217
5219
|
|
5218
5220
|
var _props$title = props.title,
|
5219
5221
|
title = _props$title === void 0 ? "Task Monitor" : _props$title,
|
5222
|
+
_props$filters = props.filters,
|
5223
|
+
filters = _props$filters === void 0 ? {} : _props$filters,
|
5220
5224
|
editors = props.editors;
|
5221
5225
|
var context = useContext(TaskContext);
|
5222
5226
|
|
5223
|
-
var
|
5224
|
-
|
5225
|
-
tasks =
|
5226
|
-
setTasks =
|
5227
|
+
var _useState2 = useState([]),
|
5228
|
+
_useState2$ = _useState2[0],
|
5229
|
+
tasks = _useState2$ === void 0 ? [] : _useState2$,
|
5230
|
+
setTasks = _useState2[1];
|
5227
5231
|
|
5228
|
-
var
|
5229
|
-
from =
|
5230
|
-
setFrom =
|
5232
|
+
var _useState3 = useState(props.from),
|
5233
|
+
from = _useState3[0],
|
5234
|
+
setFrom = _useState3[1];
|
5231
5235
|
|
5232
5236
|
useEffect(function () {
|
5233
|
-
if (props.from) setFrom(props.from);
|
5234
5237
|
refresh();
|
5235
5238
|
var interval = setInterval(function () {
|
5236
5239
|
refresh();
|
@@ -5239,12 +5242,6 @@ var TaskMonitor = function TaskMonitor(props) {
|
|
5239
5242
|
clearInterval(interval);
|
5240
5243
|
};
|
5241
5244
|
}, []);
|
5242
|
-
useEffect(function () {
|
5243
|
-
console.log("from", from);
|
5244
|
-
if (from) context.setFilters({
|
5245
|
-
from: from
|
5246
|
-
});
|
5247
|
-
}, [from]);
|
5248
5245
|
|
5249
5246
|
function changeFrom(id, value) {
|
5250
5247
|
setFrom(value);
|