add Safe Update pro feature

This commit is contained in:
sepehr 2024-07-13 10:39:16 +03:30
parent 9786895628
commit 22e101c9fe
2 changed files with 6 additions and 17 deletions

View file

@ -185,15 +185,13 @@
setting for any change to prevent/fix the configuration.</c-form-feedback>
</c-form-check>
<c-form-check [switch]="true" sizing="xl">
<c-form-check *ngIf="ispro" [switch]="true" sizing="xl">
<input cFormCheckInput [(ngModel)]="sysconfigs['safe_install']['value']" type="checkbox" />
<label cFormCheckLabel>Safe Update</label>
<c-form-feedback style="display: block;color: #979797;margin-top: 0;" [valid]="true">
<c-form-feedback style="display: block;color: #979797;margin-top: 0;" [valid]="true"><code style="padding: 0!important;">PRO</code>
* Download and install reqired firmware before installing the target firmware . for example it will install
latest 7.12 then upgrade to newer version >7.13</c-form-feedback>
</c-form-check>
<button cButton color="primary" (click)="saveSysSetting()">Save</button>
</c-card-body>

View file

@ -22,19 +22,6 @@ import {
import { ToasterComponent } from "@coreui/angular";
import { AppToastComponent } from "../toast-simple/toast.component";
import { TimeZones } from "./timezones-data";
interface IUser {
name: string;
state: string;
registered: string;
country: string;
usage: number;
period: string;
payment: string;
activity: string;
avatar: string;
status: string;
color: string;
}
@Component({
templateUrl: "settings.component.html",
@ -44,6 +31,7 @@ interface IUser {
export class SettingsComponent implements OnInit {
public uid: number;
public uname: string;
public ispro:boolean=false;
public filterText: string;
public filters: any = {};
public firms: any = {};
@ -63,6 +51,7 @@ export class SettingsComponent implements OnInit {
this.data_provider.getSessionInfo().then((res) => {
_self.uid = res.uid;
_self.uname = res.name;
_self.ispro = res.ISPRO;
const userId = _self.uid;
if (res.role != "admin") {
@ -222,6 +211,8 @@ export class SettingsComponent implements OnInit {
].filter((x: any) => x.match(/^6\./g));
_self.firmwaretoinstall = res.firmwaretoinstall;
_self.firmwaretoinstallv6 = res.firmwaretoinstallv6;
_self.updateBehavior = res.updateBehavior;
});
}