forked from bigbluebutton/greenlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement dashboard setting for defining inactivity duration leading …
…to user ban
- Loading branch information
1 parent
b4e507c
commit 5763f42
Showing
7 changed files
with
111 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
app/javascript/components/admin/site_settings/SettingsRowNumberInput.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. | ||
// | ||
// Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below). | ||
// | ||
// This program is free software; you can redistribute it and/or modify it under the | ||
// terms of the GNU Lesser General Public License as published by the Free Software | ||
// Foundation; either version 3.0 of the License, or (at your option) any later | ||
// version. | ||
// | ||
// Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY | ||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
// PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License along | ||
// with Greenlight; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Stack } from 'react-bootstrap'; | ||
import useUpdateSiteSetting from '../../../hooks/mutations/admin/site_settings/useUpdateSiteSetting'; | ||
|
||
export default function SettingsRow({ | ||
name, title, description, value, | ||
}) { | ||
const updateSiteSetting = useUpdateSiteSetting(name); | ||
|
||
return ( | ||
<Stack direction="horizontal"> | ||
<Stack className='pe-2'> | ||
<strong> {title} </strong> | ||
{description} | ||
</Stack> | ||
<div className=""> | ||
<input | ||
className="room-limit fs-5" | ||
type="number" | ||
min='0' | ||
value={value} | ||
onChange={(event) => { | ||
updateSiteSetting.mutate({ value: event.target.value }); | ||
}} | ||
/> | ||
</div> | ||
</Stack> | ||
); | ||
} | ||
|
||
SettingsRow.defaultProps = { | ||
value: '', | ||
}; | ||
|
||
SettingsRow.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
title: PropTypes.string.isRequired, | ||
value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]), | ||
description: PropTypes.node.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
db/data/20240613166290_add_automated_user_ban_time_site_setting.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. | ||
# | ||
# Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below). | ||
# | ||
# This program is free software; you can redistribute it and/or modify it under the | ||
# terms of the GNU Lesser General Public License as published by the Free Software | ||
# Foundation; either version 3.0 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License along | ||
# with Greenlight; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
# frozen_string_literal: true | ||
|
||
class AddAutomatedUserBanTimeSiteSetting < ActiveRecord::Migration[7.1] | ||
def up | ||
setting = Setting.create!(name: 'AutomatedUserBanTime') | ||
values = [{ provider: 'greenlight', setting_id: setting.id, value: '0' }] | ||
SiteSetting.create! values | ||
end | ||
|
||
def down | ||
raise ActiveRecord::IrreversibleMigration | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters