InPanel 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inpanel/__init__.py +29 -0
- inpanel/acme.py +289 -0
- inpanel/aliyuncs.py +269 -0
- inpanel/app.py +514 -0
- inpanel/apt.py +223 -0
- inpanel/base.py +200 -0
- inpanel/config.py +139 -0
- inpanel/data/config.ini +29 -0
- inpanel/data/history +5 -0
- inpanel/data/runlogs.ini +12 -0
- inpanel/data/update_info.ini +4 -0
- inpanel/dnf.py +225 -0
- inpanel/lib/__init__.py +9 -0
- inpanel/lib/async_process.py +98 -0
- inpanel/lib/filelock.py +82 -0
- inpanel/lib/magic.py +233 -0
- inpanel/lib/pxssh.py +310 -0
- inpanel/lib/pyDes.py +867 -0
- inpanel/mod/__init__.py +0 -0
- inpanel/mod/apt.py +316 -0
- inpanel/mod/certificate.py +268 -0
- inpanel/mod/config.py +372 -0
- inpanel/mod/cron.py +315 -0
- inpanel/mod/disk.py +322 -0
- inpanel/mod/dnf.py +239 -0
- inpanel/mod/file.py +722 -0
- inpanel/mod/firewall.py +199 -0
- inpanel/mod/firewall_base.py +137 -0
- inpanel/mod/firewall_firewalld.py +170 -0
- inpanel/mod/firewall_iptables.py +176 -0
- inpanel/mod/firewall_macos.py +213 -0
- inpanel/mod/firewall_ufw.py +128 -0
- inpanel/mod/ftp.py +231 -0
- inpanel/mod/httpd.py +1205 -0
- inpanel/mod/lighttpd.py +26 -0
- inpanel/mod/login.py +98 -0
- inpanel/mod/mysql.py +577 -0
- inpanel/mod/named.py +26 -0
- inpanel/mod/nginx.py +2327 -0
- inpanel/mod/package.py +33 -0
- inpanel/mod/package_apt.py +62 -0
- inpanel/mod/package_base.py +77 -0
- inpanel/mod/package_dnf.py +62 -0
- inpanel/mod/package_map.py +366 -0
- inpanel/mod/package_yum.py +64 -0
- inpanel/mod/php.py +289 -0
- inpanel/mod/process.py +291 -0
- inpanel/mod/proftpd.py +26 -0
- inpanel/mod/pureftpd.py +26 -0
- inpanel/mod/query.py +108 -0
- inpanel/mod/server.py +1319 -0
- inpanel/mod/service.py +262 -0
- inpanel/mod/setting.py +228 -0
- inpanel/mod/shell.py +78 -0
- inpanel/mod/ssh.py +280 -0
- inpanel/mod/system.py +220 -0
- inpanel/mod/task.py +1337 -0
- inpanel/mod/ufw.py +14 -0
- inpanel/mod/user.py +306 -0
- inpanel/mod/vsftpd.py +67 -0
- inpanel/mod/yum.py +243 -0
- inpanel/plugins/__init__.py +10 -0
- inpanel/plugins/__pycache__/__init__.cpython-313.pyc +0 -0
- inpanel/plugins/acme/static/index.html +10 -0
- inpanel/plugins/acme/static/index.js +13 -0
- inpanel/plugins/shadowsocks-libev/__pycache__/info.cpython-313.pyc +0 -0
- inpanel/plugins/shadowsocks-libev/info.py +73 -0
- inpanel/plugins/shadowsocks-libev/static/index.html +70 -0
- inpanel/plugins/shadowsocks-libev/static/index.js +18 -0
- inpanel/public/css/global.css +138 -0
- inpanel/public/favicon.ico +0 -0
- inpanel/public/images/alipay.jpg +0 -0
- inpanel/public/images/loading.gif +0 -0
- inpanel/public/images/weixin.jpg +0 -0
- inpanel/public/index.html +94 -0
- inpanel/public/js/controllers/controllers.js +566 -0
- inpanel/public/js/controllers/database.js +590 -0
- inpanel/public/js/controllers/ecs.js +624 -0
- inpanel/public/js/controllers/file.js +940 -0
- inpanel/public/js/controllers/plugins.js +105 -0
- inpanel/public/js/controllers/service.js +1460 -0
- inpanel/public/js/controllers/site.js +1241 -0
- inpanel/public/js/controllers/utils.js +2319 -0
- inpanel/public/js/core.js +221 -0
- inpanel/public/js/directives.js +784 -0
- inpanel/public/js/filters.js +395 -0
- inpanel/public/js/services.js +257 -0
- inpanel/public/lib/angular/1.0.2/angular-resource.min.js +10 -0
- inpanel/public/lib/angular/1.0.2/angular.min.js +158 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.css +587 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.css.map +1 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.min.css +6 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.min.css.map +1 -0
- inpanel/public/lib/bootstrap/css/bootstrap.css +6757 -0
- inpanel/public/lib/bootstrap/css/bootstrap.css.map +1 -0
- inpanel/public/lib/bootstrap/css/bootstrap.min.css +6 -0
- inpanel/public/lib/bootstrap/css/bootstrap.min.css.map +1 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- inpanel/public/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- inpanel/public/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- inpanel/public/lib/bootstrap/js/bootstrap.js +2377 -0
- inpanel/public/lib/bootstrap/js/bootstrap.min.js +7 -0
- inpanel/public/lib/bootstrap/js/npm.js +13 -0
- inpanel/public/lib/codemirror/codemirror-compressed.js +1 -0
- inpanel/public/lib/codemirror/codemirror.css +173 -0
- inpanel/public/lib/jquery/jquery-1.12.4.min.js +5 -0
- inpanel/public/lib/md5/md5.js +379 -0
- inpanel/public/lib/md5/md5.min.js +1 -0
- inpanel/public/partials/database/index.html +172 -0
- inpanel/public/partials/database/mysql/dbedit.html +462 -0
- inpanel/public/partials/database/mysql/dbnew.html +348 -0
- inpanel/public/partials/database/mysql/useredit.html +310 -0
- inpanel/public/partials/database/mysql/usernew.html +97 -0
- inpanel/public/partials/directives/message.html +20 -0
- inpanel/public/partials/directives/navbar.html +25 -0
- inpanel/public/partials/directives/selector.html +57 -0
- inpanel/public/partials/directives/srvbase.html +72 -0
- inpanel/public/partials/directives/srvext.html +34 -0
- inpanel/public/partials/directives/srvfile.html +23 -0
- inpanel/public/partials/directives/srvinstall.html +34 -0
- inpanel/public/partials/directives/srvlog.html +23 -0
- inpanel/public/partials/directives/srvminiop.html +28 -0
- inpanel/public/partials/directives/srvuninstall.html +38 -0
- inpanel/public/partials/directives/srvupdate.html +30 -0
- inpanel/public/partials/ecs/account.html +156 -0
- inpanel/public/partials/ecs/ecs.html +198 -0
- inpanel/public/partials/ecs/index.html +40 -0
- inpanel/public/partials/ecs/setings.html +459 -0
- inpanel/public/partials/file/file.html +501 -0
- inpanel/public/partials/file/trash.html +95 -0
- inpanel/public/partials/ftp.html +36 -0
- inpanel/public/partials/log.html +83 -0
- inpanel/public/partials/login.html +79 -0
- inpanel/public/partials/logout.html +22 -0
- inpanel/public/partials/main.html +534 -0
- inpanel/public/partials/plugins/index.html +55 -0
- inpanel/public/partials/plugins/plugins.html +13 -0
- inpanel/public/partials/secure.html +13 -0
- inpanel/public/partials/service/apache.html +147 -0
- inpanel/public/partials/service/cron.html +71 -0
- inpanel/public/partials/service/index.html +293 -0
- inpanel/public/partials/service/iptables.html +40 -0
- inpanel/public/partials/service/lighttpd.html +63 -0
- inpanel/public/partials/service/mariadb.html +113 -0
- inpanel/public/partials/service/memcache.html +36 -0
- inpanel/public/partials/service/minio.html +44 -0
- inpanel/public/partials/service/mongodb.html +44 -0
- inpanel/public/partials/service/mysql.html +113 -0
- inpanel/public/partials/service/named.html +61 -0
- inpanel/public/partials/service/nginx.html +296 -0
- inpanel/public/partials/service/ntp.html +40 -0
- inpanel/public/partials/service/php.html +250 -0
- inpanel/public/partials/service/proftpd.html +59 -0
- inpanel/public/partials/service/pureftpd.html +59 -0
- inpanel/public/partials/service/redis.html +40 -0
- inpanel/public/partials/service/samba.html +58 -0
- inpanel/public/partials/service/sendmail.html +40 -0
- inpanel/public/partials/service/ssh.html +186 -0
- inpanel/public/partials/service/tomcat.html +65 -0
- inpanel/public/partials/service/vsftpd.html +195 -0
- inpanel/public/partials/setting.html +299 -0
- inpanel/public/partials/site/apache/site.html +277 -0
- inpanel/public/partials/site/index.html +344 -0
- inpanel/public/partials/site/nginx/site.html +558 -0
- inpanel/public/partials/sorry.html +19 -0
- inpanel/public/partials/storage/autofm.html +103 -0
- inpanel/public/partials/storage/backup.html +42 -0
- inpanel/public/partials/storage/index.html +360 -0
- inpanel/public/partials/storage/migrate.html +93 -0
- inpanel/public/partials/storage/movedata.html +98 -0
- inpanel/public/partials/storage/remote.html +77 -0
- inpanel/public/partials/utils/cron.html +486 -0
- inpanel/public/partials/utils/firewall.html +266 -0
- inpanel/public/partials/utils/index.html +193 -0
- inpanel/public/partials/utils/network.html +118 -0
- inpanel/public/partials/utils/process.html +239 -0
- inpanel/public/partials/utils/repository.html +373 -0
- inpanel/public/partials/utils/shell.html +28 -0
- inpanel/public/partials/utils/ssl.html +319 -0
- inpanel/public/partials/utils/time.html +109 -0
- inpanel/public/partials/utils/user.html +359 -0
- inpanel/public/robots.txt +2 -0
- inpanel/remote.py +109 -0
- inpanel/templates/file/preview.html +34 -0
- inpanel/templates/index.html +93 -0
- inpanel/utils.py +282 -0
- inpanel/web.py +1811 -0
- inpanel/yum.py +756 -0
- inpanel-1.2.1.dist-info/METADATA +399 -0
- inpanel-1.2.1.dist-info/RECORD +198 -0
- inpanel-1.2.1.dist-info/WHEEL +5 -0
- inpanel-1.2.1.dist-info/entry_points.txt +2 -0
- inpanel-1.2.1.dist-info/licenses/LICENSE +30 -0
- inpanel-1.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// var releasetime = '2020-12-03 23:00:00 GMT+0800';
|
|
2
|
+
var _v = new Date(releasetime).getTime() / 1000;
|
|
3
|
+
//if (1) _v += Math.random(); // ie test mode
|
|
4
|
+
var inpanel = angular.module('inpanel', ['inpanel.services', 'inpanel.directives', 'inpanel.filters']);
|
|
5
|
+
inpanel.config(['$routeProvider', function ($routeProvider) {
|
|
6
|
+
var _r = function (t, c, a) {
|
|
7
|
+
var r = {
|
|
8
|
+
templateUrl: template_path + '/partials/' + t + '.html?_v=' + _v,
|
|
9
|
+
controller: c,
|
|
10
|
+
reloadOnSearch: false
|
|
11
|
+
};
|
|
12
|
+
if (!a) r.resolve = Auth;
|
|
13
|
+
return r;
|
|
14
|
+
};
|
|
15
|
+
$routeProvider.
|
|
16
|
+
when('/login', _r('login', LoginCtrl, true)).
|
|
17
|
+
when('/', _r('main', MainCtrl)).
|
|
18
|
+
when('/service/nginx', _r('service/nginx', ServiceNginxCtrl)).
|
|
19
|
+
when('/service/apache', _r('service/apache', ServiceApacheCtrl)).
|
|
20
|
+
when('/service/lighttpd', _r('service/lighttpd', ServiceLighttpdCtrl)).
|
|
21
|
+
when('/service/tomcat', _r('service/tomcat', ServiceTomcatCtrl)).
|
|
22
|
+
when('/service/vsftpd', _r('service/vsftpd', ServiceVsftpdCtrl)).
|
|
23
|
+
when('/service/proftpd', _r('service/proftpd', ServiceProFTPDCtrl)).
|
|
24
|
+
when('/service/pureftpd', _r('service/pureftpd', ServicePureFTPdCtrl)).
|
|
25
|
+
when('/service/mysql', _r('service/mysql', ServiceMySQLCtrl)).
|
|
26
|
+
when('/service/mariadb', _r('service/mariadb', ServiceMariaDBCtrl)).
|
|
27
|
+
when('/service/redis', _r('service/redis', ServiceRedisCtrl)).
|
|
28
|
+
when('/service/memcache', _r('service/memcache', ServiceMemcacheCtrl)).
|
|
29
|
+
when('/service/mongodb', _r('service/mongodb', ServiceMongoDBCtrl)).
|
|
30
|
+
when('/service/minio', _r('service/minio', ServiceMinIOCtrl)).
|
|
31
|
+
when('/service/php', _r('service/php', ServicePHPCtrl)).
|
|
32
|
+
when('/service/sendmail', _r('service/sendmail', ServiceSendmailCtrl)).
|
|
33
|
+
when('/service/ssh', _r('service/ssh', ServiceSSHCtrl)).
|
|
34
|
+
when('/service/iptables', _r('service/iptables', ServiceIPTablesCtrl)).
|
|
35
|
+
when('/service/cron', _r('service/cron', ServiceCronCtrl)).
|
|
36
|
+
when('/service/ntp', _r('service/ntp', ServiceNTPCtrl)).
|
|
37
|
+
when('/service/named', _r('service/named', ServiceNamedCtrl)).
|
|
38
|
+
when('/service/samba', _r('service/samba', ServiceSambaCtrl)).
|
|
39
|
+
when('/service', _r('service/index', ServiceCtrl)).
|
|
40
|
+
when('/file', _r('file/file', FileCtrl)).
|
|
41
|
+
when('/file/go#(:path)', _r('file/file', FileCtrl)).
|
|
42
|
+
when('/file/trash', _r('file/trash', FileTrashCtrl)).
|
|
43
|
+
when('/site', _r('site/index', SiteCtrl)).
|
|
44
|
+
when('/site/nginx/:section', _r('site/nginx/site', SiteNginxCtrl)).
|
|
45
|
+
when('/site/apache/:section', _r('site/apache/site', SiteApacheCtrl)).
|
|
46
|
+
when('/database', _r('database/index', DatabaseCtrl)).
|
|
47
|
+
when('/database/mysql/db/new', _r('database/mysql/dbnew', DatabaseMySQLNewDBCtrl)).
|
|
48
|
+
when('/database/mysql/db/edit/:section', _r('database/mysql/dbedit', DatabaseMySQLEditDBCtrl)).
|
|
49
|
+
when('/database/mysql/user/new', _r('database/mysql/usernew', DatabaseMySQLNewUserCtrl)).
|
|
50
|
+
when('/database/mysql/user/edit/:section', _r('database/mysql/useredit', DatabaseMySQLEditUserCtrl)).
|
|
51
|
+
when('/ftp', _r('ftp', FtpCtrl)).
|
|
52
|
+
when('/utils', _r('utils/index', UtilsCtrl)).
|
|
53
|
+
when('/utils/user', _r('utils/user', UtilsUserCtrl)).
|
|
54
|
+
when('/utils/process', _r('utils/process', UtilsProcessCtrl)).
|
|
55
|
+
when('/utils/network', _r('utils/network', UtilsNetworkCtrl)).
|
|
56
|
+
when('/utils/time', _r('utils/time', UtilsTimeCtrl)).
|
|
57
|
+
when('/utils/cron', _r('utils/cron', UtilsCronCtrl)).
|
|
58
|
+
when('/utils/ssl', _r('utils/ssl', UtilsSSLCtrl)).
|
|
59
|
+
when('/utils/repository', _r('utils/repository', UtilsRepositoryCtrl)).
|
|
60
|
+
when('/utils/shell', _r('utils/shell', UtilsShellCtrl)).
|
|
61
|
+
when('/utils/firewall', _r('utils/firewall', UtilsFirewallCtrl)).
|
|
62
|
+
when('/storage', _r('storage/index', StorageCtrl)).
|
|
63
|
+
when('/storage/remote/:section', _r('storage/remote', StorageRemoteCtrl)).
|
|
64
|
+
when('/storage/autofm', _r('storage/autofm', StorageAutoFMCtrl)).
|
|
65
|
+
when('/storage/movedata', _r('storage/movedata', StorageMoveDataCtrl)).
|
|
66
|
+
when('/storage/backup', _r('storage/backup', BackupCtrl)).
|
|
67
|
+
when('/storage/migrate', _r('storage/migrate', UtilsMigrateCtrl)).
|
|
68
|
+
when('/ecs', _r('ecs/ecs', ECSCtrl)).
|
|
69
|
+
when('/ecs/index', _r('ecs/index', ECSIndexCtrl)).
|
|
70
|
+
when('/ecs/account', _r('ecs/account', ECSAccountCtrl)).
|
|
71
|
+
when('/ecs/:section', _r('ecs/setting', ECSSettingCtrl)).
|
|
72
|
+
when('/setting', _r('setting', SettingCtrl)).
|
|
73
|
+
when('/secure', _r('secure', SecureCtrl)).
|
|
74
|
+
when('/plugins', _r('plugins/index', PluginsHome)).
|
|
75
|
+
when('/plugins/:section', _r('plugins/plugins', PluginsCtrl)).
|
|
76
|
+
when('/log', _r('log', LogCtrl)).
|
|
77
|
+
when('/logout', _r('logout', LogoutCtrl)).
|
|
78
|
+
when('/sorry', _r('sorry', SorryCtrl)).
|
|
79
|
+
otherwise({
|
|
80
|
+
redirectTo: '/sorry'
|
|
81
|
+
});
|
|
82
|
+
}]);
|
|
83
|
+
inpanel.run(['$rootScope', '$location', 'Request', function ($rootScope, $location, Request) {
|
|
84
|
+
$rootScope.sec = function (sec) {
|
|
85
|
+
$location.search('s', sec)
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
$rootScope.virt = '?';
|
|
89
|
+
$rootScope.checkVirt = function (callback) {
|
|
90
|
+
if ($rootScope.virt != '?') return;
|
|
91
|
+
Request.get('/api/query/server.virt', function (data) {
|
|
92
|
+
$rootScope.virt = data['server.virt'];
|
|
93
|
+
if (callback) callback.call();
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// store some global data
|
|
98
|
+
$rootScope.$mysql = {
|
|
99
|
+
'password': '',
|
|
100
|
+
'password_validated': false
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
$rootScope.$ecs = {
|
|
104
|
+
'access_key_id': '',
|
|
105
|
+
'page_size': 10,
|
|
106
|
+
'page_number': 1
|
|
107
|
+
};
|
|
108
|
+
$rootScope.$proxyroot = location_path;
|
|
109
|
+
}]);
|
|
110
|
+
// inpanel.value('version', {
|
|
111
|
+
// 'version': '1.1.27',
|
|
112
|
+
// 'releasetime': releasetime,
|
|
113
|
+
// 'changelog': 'http://inpanel.org/changelog.html'
|
|
114
|
+
// });
|
|
115
|
+
|
|
116
|
+
var Auth = {
|
|
117
|
+
// auth should be done before enter the module
|
|
118
|
+
auth: function ($q, $location, Auth, Message) {
|
|
119
|
+
var deferred = $q.defer();
|
|
120
|
+
Message.setInfo('正在加载,请稍候...', true);
|
|
121
|
+
Auth.required(function (authed) {
|
|
122
|
+
Message.setInfo(false);
|
|
123
|
+
if (authed) deferred.resolve();
|
|
124
|
+
}, function (status) {
|
|
125
|
+
if (status == 403) {
|
|
126
|
+
Message.setError('身份认证失败,请<a href="#/login">重新登录</a>!');
|
|
127
|
+
$location.path('/login');
|
|
128
|
+
} else {
|
|
129
|
+
Message.setError('对不起,加载失败!(网络异常或服务器故障)');
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return deferred.promise;
|
|
133
|
+
},
|
|
134
|
+
// auth status would expired in 30 mins if no any client action
|
|
135
|
+
// we should active it every 5 mins if client is still active
|
|
136
|
+
auto_auth: function ($rootScope, $location, Auth, Timeout) {
|
|
137
|
+
if (!$rootScope._auth_check_inited) {
|
|
138
|
+
$rootScope._auth_check_inited = true;
|
|
139
|
+
// auto update auth if client active in the pass 5 mins
|
|
140
|
+
// and if no active in the pass 25 mins, a dialog will come out to confirm
|
|
141
|
+
var check_timeout = 300 * 1000;
|
|
142
|
+
var auth_timeout = 2500 * 1000;
|
|
143
|
+
var last_active = new Date().getTime();
|
|
144
|
+
|
|
145
|
+
$(document).mousemove(function () {
|
|
146
|
+
last_active = new Date().getTime();
|
|
147
|
+
});
|
|
148
|
+
$(document).keydown(function () {
|
|
149
|
+
last_active = new Date().getTime();
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
var active = (function () {
|
|
153
|
+
var stop_check = false;
|
|
154
|
+
var now = new Date().getTime();
|
|
155
|
+
if (now - last_active < check_timeout) {
|
|
156
|
+
Auth.required();
|
|
157
|
+
} else if (now - last_active > auth_timeout) {
|
|
158
|
+
// check if the cookie ready to expiring
|
|
159
|
+
stop_check = true;
|
|
160
|
+
Auth.getlastactive(function (lastactive) {
|
|
161
|
+
lastactive = parseInt(lastactive) * 1000;
|
|
162
|
+
if (now - lastactive > auth_timeout) {
|
|
163
|
+
// blink the title
|
|
164
|
+
var oldHtmlTitle = $rootScope.htmlTitle;
|
|
165
|
+
var blinks = ['登录超时', '!!!!!!!!'];
|
|
166
|
+
var blink_i = 0;
|
|
167
|
+
var stop_blink = false;
|
|
168
|
+
var toggletitle = function () {
|
|
169
|
+
if (!stop_blink) {
|
|
170
|
+
$rootScope.htmlTitle = blinks[(blink_i++) % 2];
|
|
171
|
+
Timeout(toggletitle, 1000, false, true, '_authtimeout_title');
|
|
172
|
+
} else {
|
|
173
|
+
$rootScope.htmlTitle = oldHtmlTitle;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
toggletitle();
|
|
177
|
+
$rootScope._authrenew = function () {
|
|
178
|
+
last_active = new Date().getTime();
|
|
179
|
+
stop_blink = true;
|
|
180
|
+
Auth.required();
|
|
181
|
+
Timeout(active, check_timeout, false, true, '_authtimeout');
|
|
182
|
+
};
|
|
183
|
+
$('#_authconfirm').modal();
|
|
184
|
+
} else {
|
|
185
|
+
last_active = lastactive;
|
|
186
|
+
Timeout(active, check_timeout, false, true, '_authtimeout');
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (!stop_check && $location.path() != '/')
|
|
191
|
+
Timeout(active, check_timeout, false, true, '_authtimeout');
|
|
192
|
+
});
|
|
193
|
+
Timeout(active, check_timeout, false, true, '_authtimeout');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
Auth.auth.$inject = ['$q', '$location', 'Auth', 'Message'];
|
|
198
|
+
Auth.auto_auth.$inject = ['$rootScope', '$location', 'Auth', 'Timeout'];
|
|
199
|
+
|
|
200
|
+
var getCookie = function (name) {
|
|
201
|
+
var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
|
|
202
|
+
return r ? r[1] : undefined;
|
|
203
|
+
};
|
|
204
|
+
var set_cookie = function (name, value) {
|
|
205
|
+
var Days = 30;
|
|
206
|
+
var exp = new Date();
|
|
207
|
+
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
|
|
208
|
+
document.cookie = name + '=' + encodeURIComponent(value) + ';expires=' + exp.toGMTString();
|
|
209
|
+
}
|
|
210
|
+
var get_cookie = function(name) {
|
|
211
|
+
var arr, reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
|
|
212
|
+
return (arr = document.cookie.match(reg)) ? decodeURIComponent(arr[2]) : null;
|
|
213
|
+
}
|
|
214
|
+
var del_cookie = function (name) {
|
|
215
|
+
var exp = new Date();
|
|
216
|
+
exp.setTime(exp.getTime() - 1);
|
|
217
|
+
var cval = get_cookie(name);
|
|
218
|
+
if (cval != null) {
|
|
219
|
+
document.cookie= name + "="+cval+";expires="+exp.toGMTString();
|
|
220
|
+
}
|
|
221
|
+
}
|