2020-04-14 11:13:45 +00:00
|
|
|
import RestModel from "model/rest";
|
2020-03-29 19:24:44 +00:00
|
|
|
import Api from "../common/api";
|
2020-03-28 17:17:11 +00:00
|
|
|
|
2020-04-14 11:13:45 +00:00
|
|
|
class Account extends RestModel {
|
2020-03-28 17:17:11 +00:00
|
|
|
getDefaults() {
|
|
|
|
return {
|
|
|
|
ID: 0,
|
|
|
|
AccName: "",
|
|
|
|
AccOwner: "",
|
|
|
|
AccURL: "",
|
|
|
|
AccType: "",
|
|
|
|
AccKey: "",
|
|
|
|
AccUser: "",
|
|
|
|
AccPass: "",
|
|
|
|
AccError: "",
|
2020-04-04 15:19:34 +00:00
|
|
|
AccErrors: 0,
|
2020-03-29 19:24:44 +00:00
|
|
|
AccShare: true,
|
2020-03-28 17:17:11 +00:00
|
|
|
AccSync: false,
|
|
|
|
RetryLimit: 3,
|
2020-03-29 19:24:44 +00:00
|
|
|
SharePath: "/",
|
2020-04-03 16:08:49 +00:00
|
|
|
ShareSize: "",
|
2020-03-28 18:46:09 +00:00
|
|
|
ShareExpires: 0,
|
2020-03-29 19:24:44 +00:00
|
|
|
SyncPath: "/",
|
2020-04-04 15:19:34 +00:00
|
|
|
SyncStatus: "",
|
2020-03-28 17:17:11 +00:00
|
|
|
SyncInterval: 86400,
|
2020-04-04 15:19:34 +00:00
|
|
|
SyncDate: null,
|
2020-04-07 08:42:42 +00:00
|
|
|
SyncFilenames: true,
|
2020-03-28 17:17:11 +00:00
|
|
|
SyncUpload: false,
|
|
|
|
SyncDownload: true,
|
|
|
|
SyncRaw: true,
|
|
|
|
CreatedAt: "",
|
|
|
|
UpdatedAt: "",
|
|
|
|
DeletedAt: null,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
getEntityName() {
|
|
|
|
return this.AccName;
|
|
|
|
}
|
|
|
|
|
|
|
|
getId() {
|
|
|
|
return this.ID;
|
|
|
|
}
|
|
|
|
|
2020-04-02 16:17:07 +00:00
|
|
|
Dirs() {
|
|
|
|
return Api.get(this.getEntityResource() + "/dirs").then((response) => Promise.resolve(response.data));
|
2020-03-31 15:26:25 +00:00
|
|
|
}
|
|
|
|
|
2020-04-01 10:00:45 +00:00
|
|
|
Share(UUIDs, dest) {
|
2020-04-04 15:19:34 +00:00
|
|
|
const values = {Photos: UUIDs, Destination: dest};
|
2020-04-01 10:00:45 +00:00
|
|
|
|
|
|
|
return Api.post(this.getEntityResource() + "/share", values).then((response) => Promise.resolve(response.data));
|
|
|
|
}
|
|
|
|
|
2020-03-28 17:17:11 +00:00
|
|
|
static getCollectionResource() {
|
|
|
|
return "accounts";
|
|
|
|
}
|
|
|
|
|
|
|
|
static getModelName() {
|
|
|
|
return "Account";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Account;
|