// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "fmt" "time" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/util" "github.com/Unknwon/com" "github.com/go-xorm/xorm" ) //NoticeType describes the notice type type NoticeType int const ( //NoticeRepository type NoticeRepository NoticeType = iota + 1 ) // Notice represents a system notice for admin. type Notice struct { ID int64 `xorm:"pk autoincr"` Type NoticeType Description string `xorm:"TEXT"` Created time.Time `xorm:"-"` CreatedUnix int64 `xorm:"INDEX"` } // BeforeInsert is invoked from XORM before inserting an object of this type. func (n *Notice) BeforeInsert() { n.CreatedUnix = time.Now().Unix() } // AfterSet is invoked from XORM after setting the value of a field of this object. func (n *Notice) AfterSet(colName string, _ xorm.Cell) { switch colName { case "created_unix": n.Created = time.Unix(n.CreatedUnix, 0).Local() } } // TrStr returns a translation format string. func (n *Notice) TrStr() string { return "admin.notices.type_" + com.ToStr(n.Type) } // CreateNotice creates new system notice. func CreateNotice(tp NoticeType, desc string) error { return createNotice(x, tp, desc) } func createNotice(e Engine, tp NoticeType, desc string) error { n := &Notice{ Type: tp, Description: desc, } _, err := e.Insert(n) return err } // CreateRepositoryNotice creates new system notice with type NoticeRepository. func CreateRepositoryNotice(desc string) error { return createNotice(x, NoticeRepository, desc) } // RemoveAllWithNotice removes all directories in given path and // creates a system notice when error occurs. func RemoveAllWithNotice(title, path string) { removeAllWithNotice(x, title, path) } func removeAllWithNotice(e Engine, title, path string) { if err := util.RemoveAll(path); err != nil { desc := fmt.Sprintf("%s [%s]: %v", title, path, err) log.Warn(desc) if err = createNotice(e, NoticeRepository, desc); err != nil { log.Error(4, "CreateRepositoryNotice: %v", err) } } } // CountNotices returns number of notices. func CountNotices() int64 { count, _ := x.Count(new(Notice)) return count } // Notices returns notices in given page. func Notices(page, pageSize int) ([]*Notice, error) { notices := make([]*Notice, 0, pageSize) return notices, x. Limit(pageSize, (page-1)*pageSize). Desc("id"). Find(¬ices) } // DeleteNotice deletes a system notice by given ID. func DeleteNotice(id int64) error { _, err := x.Id(id).Delete(new(Notice)) return err } // DeleteNotices deletes all notices with ID from start to end (inclusive). func DeleteNotices(start, end int64) error { sess := x.Where("id >= ?", start) if end > 0 { sess.And("id <= ?", end) } _, err := sess.Delete(new(Notice)) return err } // DeleteNoticesByIDs deletes notices by given IDs. func DeleteNoticesByIDs(ids []int64) error { if len(ids) == 0 { return nil } _, err := x. In("id", ids). Delete(new(Notice)) return err } lue='artonge/chore/update_nc_cypress_beta.11'>artonge/chore/update_nc_cypress_beta.11 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.modules.js
blob: dc319e397802345a89530112c8bbf6b15ec101b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
 * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>
 *
 * @author John Molakvoæ <skjnldsv@protonmail.com>
 *
 * @license AGPL-3.0-or-later
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */
const path = require('path')

module.exports = {
	comments: {
		'comments-app': path.join(__dirname, 'apps/comments/src', 'comments-app.js'),
		'comments-tab': path.join(__dirname, 'apps/comments/src', 'comments-tab.js'),
		init: path.join(__dirname, 'apps/comments/src', 'init.ts'),
	},
	core: {
		files_client: path.join(__dirname, 'core/src', 'files/client.js'),
		files_fileinfo: path.join(__dirname, 'core/src', 'files/fileinfo.js'),
		install: path.join(__dirname, 'core/src', 'install.js'),
		login: path.join(__dirname, 'core/src', 'login.js'),
		main: path.join(__dirname, 'core/src', 'main.js'),
		maintenance: path.join(__dirname, 'core/src', 'maintenance.js'),
		profile: path.join(__dirname, 'core/src', 'profile.ts'),
		recommendedapps: path.join(__dirname, 'core/src', 'recommendedapps.js'),
		systemtags: path.resolve(__dirname, 'core/src', 'systemtags/merged-systemtags.js'),
		'unified-search': path.join(__dirname, 'core/src', 'unified-search.js'),
		'legacy-unified-search': path.join(__dirname, 'core/src', 'legacy-unified-search.js'),
		'unsupported-browser': path.join(__dirname, 'core/src', 'unsupported-browser.js'),
		'unsupported-browser-redirect': path.join(__dirname, 'core/src', 'unsupported-browser-redirect.js'),
	},
	dashboard: {
		main: path.join(__dirname, 'apps/dashboard/src', 'main.js'),
	},
	dav: {
		'settings-admin-caldav': path.join(__dirname, 'apps/dav/src', 'settings.js'),
		'settings-personal-availability': path.join(__dirname, 'apps/dav/src', 'settings-personal-availability.js'),
	},
	files: {
		sidebar: path.join(__dirname, 'apps/files/src', 'sidebar.js'),
		main: path.join(__dirname, 'apps/files/src', 'main.ts'),
		init: path.join(__dirname, 'apps/files/src', 'init.ts'),
		'personal-settings': path.join(__dirname, 'apps/files/src', 'main-personal-settings.js'),
		'reference-files': path.join(__dirname, 'apps/files/src', 'reference-files.js'),
	},
	files_external: {
		init: path.join(__dirname, 'apps/files_external/src', 'init.ts'),
	},
	files_reminders: {
		init: path.join(__dirname, 'apps/files_reminders/src', 'init.ts'),
	},
	files_sharing: {
		additionalScripts: path.join(__dirname, 'apps/files_sharing/src', 'additionalScripts.js'),
		collaboration: path.join(__dirname, 'apps/files_sharing/src', 'collaborationresourceshandler.js'),
		files_sharing_tab: path.join(__dirname, 'apps/files_sharing/src', 'files_sharing_tab.js'),
		init: path.join(__dirname, 'apps/files_sharing/src', 'init.ts'),
		main: path.join(__dirname, 'apps/files_sharing/src', 'main.ts'),
		'personal-settings': path.join(__dirname, 'apps/files_sharing/src', 'personal-settings.js'),
	},
	files_trashbin: {
		main: path.join(__dirname, 'apps/files_trashbin/src', 'main.ts'),
	},
	files_versions: {
		files_versions: path.join(__dirname, 'apps/files_versions/src', 'files_versions_tab.js'),
	},
	oauth2: {
		oauth2: path.join(__dirname, 'apps/oauth2/src', 'main.js'),
	},
	federatedfilesharing: {
		'vue-settings-admin': path.join(__dirname, 'apps/federatedfilesharing/src', 'main-admin.js'),
		'vue-settings-personal': path.join(__dirname, 'apps/federatedfilesharing/src', 'main-personal.js'),
	},
	settings: {
		apps: path.join(__dirname, 'apps/settings/src', 'apps.js'),
		'legacy-admin': path.join(__dirname, 'apps/settings/src', 'admin.js'),
		'vue-settings-admin-basic-settings': path.join(__dirname, 'apps/settings/src', 'main-admin-basic-settings.js'),
		'vue-settings-admin-ai': path.join(__dirname, 'apps/settings/src', 'main-admin-ai.js'),
		'vue-settings-admin-delegation': path.join(__dirname, 'apps/settings/src', 'main-admin-delegation.js'),
		'vue-settings-admin-security': path.join(__dirname, 'apps/settings/src', 'main-admin-security.js'),
		'vue-settings-admin-sharing': path.join(__dirname, 'apps/settings/src', 'admin-settings-sharing.ts'),
		'vue-settings-apps-users-management': path.join(__dirname, 'apps/settings/src', 'main-apps-users-management.js'),
		'vue-settings-nextcloud-pdf': path.join(__dirname, 'apps/settings/src', 'main-nextcloud-pdf.js'),
		'vue-settings-personal-info': path.join(__dirname, 'apps/settings/src', 'main-personal-info.js'),
		'vue-settings-personal-password': path.join(__dirname, 'apps/settings/src', 'main-personal-password.js'),
		'vue-settings-personal-security': path.join(__dirname, 'apps/settings/src', 'main-personal-security.js'),
		'vue-settings-personal-webauthn': path.join(__dirname, 'apps/settings/src', 'main-personal-webauth.js'),
	},
	sharebymail: {
		'vue-settings-admin-sharebymail': path.join(__dirname, 'apps/sharebymail/src', 'main-admin.js'),
	},
	systemtags: {
		init: path.join(__dirname, 'apps/systemtags/src', 'init.ts'),
		admin: path.join(__dirname, 'apps/systemtags/src', 'admin.ts'),
	},
	theming: {
		'personal-theming': path.join(__dirname, 'apps/theming/src', 'personal-settings.js'),
		'admin-theming': path.join(__dirname, 'apps/theming/src', 'admin-settings.js'),
	},
	twofactor_backupcodes: {
		settings: path.join(__dirname, 'apps/twofactor_backupcodes/src', 'settings.js'),
	},
	updatenotification: {
		updatenotification: path.join(__dirname, 'apps/updatenotification/src', 'init.js'),
	},
	user_status: {
		menu: path.join(__dirname, 'apps/user_status/src', 'menu.js'),
	},
	weather_status: {
		'weather-status': path.join(__dirname, 'apps/weather_status/src', 'weather-status.js'),
	},
	workflowengine: {
		workflowengine: path.join(__dirname, 'apps/workflowengine/src', 'workflowengine.js'),
	},
}