public async Task <IActionResult> UpdateComponent(ComponentJson comp, string module) { MiniEditorManager editorMgr = new MiniEditorManager(); var res = await editorMgr.AddUpdateComponent(comp, GetUsername, module, GetSiteID); return(new ObjectResult(res)); }
public PageHome(ComponentJson owner) : base(owner) { new Html(this) { TextHtml = "<h1>Web Application Framework</h1>" }; }
public PageAdminStorage(ComponentJson owner) : base(owner) { var content = new Div(this) { CssClass = "content" }; new Html(content) { TextHtml = "<h1>Storage</h1>" }; }
protected override async Task ProcessAsync() { AlertError.ComponentRemove(); if (Button.IsClick) { var loginUserSession = Grid.RowSelect; var loginUserRoleAppList = (await Data.Query <LoginUserRoleApp>().Where(item => item.LoginUserName == loginUserSession.Name && item.LoginUserRoleIsActive == true).QueryExecuteAsync()); if (!loginUserRoleAppList.Any()) { // Username does not exist this.AlertError = new Alert(this.ComponentOwner <AppJson>(), "Username or password wrong!", AlertEnum.Error); } else { var pageMain = this.ComponentOwner <PageMain>(); string password = loginUserSession.PasswordHash; // User entered password string passwordHash = loginUserRoleAppList.First().LoginUserPasswordHash; // In db stored hash string passwordSalt = loginUserRoleAppList.First().LoginUserPasswordSalt; // In db stored salt if (passwordHash != null && !UtilFramework.PasswordIsValid(password, passwordHash, passwordSalt)) { // Password wrong this.AlertError = new Alert(this.ComponentOwner <AppJson>(), "Username or password wrong!", AlertEnum.Error); } else { if (!loginUserRoleAppList.First().LoginUserIsActive) { // User not active this.AlertError = new Alert(this.ComponentOwner <AppJson>(), "User not (yet) active.", AlertEnum.Warning); } else { // Login successful pageMain.LoginUserRoleAppList = loginUserRoleAppList; foreach (var item in pageMain.LoginUserRoleAppList) { item.LoginUserPasswordHash = null; // Remoe from session item.LoginUserPasswordSalt = null; // Remove from session } var loginUserId = pageMain.LoginUserRoleAppList.First().LoginUserId; await pageMain.GridNavigate.LoadAsync(); this.ComponentOwner <AppJson>().Navigate("/"); // Navigate to home after login } } } // Render grid ConfigDeveloper (coffee icon) if user is a developer. await Grid.LoadAsync(); } }
public PageAdminLoginUser(ComponentJson owner) : base(owner) { new Html(this) { TextHtml = "<h1>User</h1>" }; GridLoginUser = new GridAdminLoginUser(this); new Html(this) { TextHtml = "<h2>Role</h1>" }; GridLoginUserRole = new GridAdminLoginUserRole(this); }
public PageAdminNavigate(ComponentJson owner) : base(owner) { new Html(this) { TextHtml = "<h1>Navigate</h1>" }; GridNavigate = new GridAdminNavigate(this); new Html(this) { TextHtml = "<h2>Role</h1>" }; GridNavigateRole = new GridAdminNavigateRole(this); }
public PageContent(ComponentJson owner, Content contentRow) : base(owner) { // Content new Html(this) { TextHtml = contentRow.TextHtml, IsNoSanatize = true, IsNoSanatizeScript = "if (typeof Prism != 'undefined') { Prism.highlightAll(); }" }; // IsNoSanatize because of html id for named anchor. // Title, Description this.ComponentOwner <AppJson>().Title = contentRow.TitleLong; this.ComponentOwner <AppJson>().Description = contentRow.Description; NavigatePath = contentRow.NavigatePath; }
public PageLoginSignIn(ComponentJson owner) : base(owner) { new Html(this) { TextHtml = "<h1>User Sign In</h1>" }; Grid = new GridSignIn(this); Button = new Button(this) { TextHtml = "Login", CssClass = "button is-primary" }; }
public PageLoginSignUp(ComponentJson owner) : base(owner) { new Html(this) { TextHtml = "<h1>User Sign Up</h1>" }; new Html(this) { TextHtml = "<p>After sign up you'll receive an email with confirmation link to click and finish registration.</p><div></div>" }; Grid = new GridLoginUserSignUp(this); Button = new Button(this) { TextHtml = "Sign Up", CssClass = "button is-primary" }; }
public PageNotFound(ComponentJson owner) : base(owner) { var content = new Div(this) { CssClass = "content" }; new Html(content) { TextHtml = "<h1>Page not Found</h1>" }; string text = "<article class=\"message is-warning\"><div class=\"message-body\">The requested URL was not found on this server.</div></article>"; new Html(content) { TextHtml = text }; }
public PageAdminContent(ComponentJson owner) : base(owner) { new Html(this) { TextHtml = "<h1>Content Page</h1>" }; GridContent = new GridContent(this); GridContentMd = new GridContentMd(this); ButtonPublish = new Button(this) { TextHtml = "Update Navigation", CssClass = "button is-primary" }; var content = new Div(this) { CssClass = "content" }; Html = new Html(content) { IsNoSanatize = true, IsNoSanatizeScript = "if (typeof Prism != 'undefined') { Prism.highlightAll(); }" }; // IsNoSanatize because of html id for named anchor. }
public PageLoginSignOut(ComponentJson owner) : base(owner) { }
public BootstrapContainer(ComponentJson owner) : base(owner) { CssClass = "container"; }
public BootstrapNavbar(ComponentJson owner) : base(owner, nameof(BootstrapNavbar)) { }
public BootstrapRow(ComponentJson owner) : base(owner) { CssClass = "row"; }
public GridFeedback(ComponentJson owner) : base(owner) { FeedbackList = new List <Feedback>(); FeedbackList.Add(new Feedback()); }
public GridContentMd(ComponentJson owner) : base(owner) { }
public GridLanguage(ComponentJson owner) : base(owner) { }
public PageConfigGrid(ComponentJson owner, string tableNameCSharp, string fieldNameCSharp) : base(owner) { TableNameCSharp = tableNameCSharp; FieldNameCSharp = fieldNameCSharp; }
public GridConfigGrid(ComponentJson owner) : base(owner) { }
public MyGrid(ComponentJson owner) : base(owner, nameof(MyGrid)) { }
public GridLoginUserSignUp(ComponentJson owner) : base(owner) { LoginUserList.Add(new LoginUser()); }
public GridAdminLoginUserRole(ComponentJson owner) : base(owner) { }
public GridNavigate(ComponentJson owner) : base(owner) { }
public PageMain(ComponentJson owner) : base(owner) { BulmaNavbar = new BulmaNavbar(this) { BrandTextHtml = "<b>WorkplaceX</b>.org" }; // Hero new Custom01(this); // Columns var columns = new DivContainer(this) { CssClass = "columns" }; var column0 = new Div(columns) { CssClass = "column is-one-fifth has-background-white-ter" }; var column1 = new Div(columns) { CssClass = "column" }; var column2 = new Div(columns) { CssClass = "column is-one-fifth" }; // Container // var container = new DivContainer(column1) { CssClass = "container" }; Content = new Div(column1) { CssClass = "content content-bulma-framework" }; // Content = column1; GridNavigate = new GridNavigate(this) { IsHide = true }; GridLanguage = new GridLanguage(this) { IsHide = true }; // Footer Footer = new Custom02(this); BulmaNavbar.GridAdd(GridLanguage, isNavbarEnd: true, isSelectMode: true); BulmaNavbar.GridAdd(GridNavigate); new BulmaNavbarMenu(column0) { Grid = GridNavigate }; // Preserve login user if (this.ComponentOwner <AppMain>().IsNavigateReload <AppMain>(out var appJsonPrevious)) { LoginUserRoleAppList = appJsonPrevious.PageMain.LoginUserRoleAppList; } }
public GridAdminNavigateRole(ComponentJson owner) : base(owner) { }
/// <summary> /// Constructor. /// </summary> public BulmaNavbar(ComponentJson owner) : base(owner, nameof(BulmaNavbar)) { }
public BingMap(ComponentJson owner) : base(owner, nameof(BingMap)) { }
public MyComponent(ComponentJson owner) : base(owner, nameof(MyComponent)) { }
/// <summary> /// Constructor. /// </summary> public GridStorage(ComponentJson owner) : base(owner) { }